Ubuntu Operating System Related Skills
System Backup, Restore, and Clone
- ucloner: Backup/restore/clone your Ubuntu, and make Live-Ubuntu.
File Management
- krusader: Twin panel file management for your desktop. Similar to TotalCommander for Windows.
FileSystem
-
Support filesystem type 'exfat'
You need to install ExFat support in Ubuntu. You can do that by simply running the following commands: sudo apt-add-repository ppa:relan/exfat sudo apt-get update sudo apt-get install fuse-exfat
Software
-
How to install Adobe Reader on Ubuntu 12.04
sudo apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" sudo apt-get update sudo apt-get install acroread
-
Install Request Ticket on Ubuntu 12.04
sudo apt-get install request-tracker3.8 rt3.8*
Redmine
-
Intall Bitnami-Redmine-2.0.3-1
./bitnami-redmine-2.0.3-1-linux-x64-installer.run
-
Recover Bitnami-Redmine from 1.2.0.0 to 2.0.3-1
1. cp old backed attachments to ~/redmine-2.0.3-1/apps/redmine/htdocs/files/ 2. replace new password by backed passwd of ~/redmine-2.0.3-1/apps/redmine/htdocs/config/database.yml 3. start mysql: ~/redmine-2.0.3-1$ ./mysql/bin/mysql -u root -p 4. delete database: drop database bitnami_redmine; 5. create database: create database bitnami_redmine; 6. grant all privileges: grant all privileges on bitnami_redmine.* to 'bitnami'@'localhost' identified by 'BITNAMI_USER_PASSWORD'; 7. flush privileges: flush privileges; 8. exit mysql: exit; 9. import database: ~/redmine-2.0.3-1$ ./mysql/bin/mysql -u root -p bitnami_redmine < redmine_backup.sql 10. cd ~/redmine-2.0.3-1/apps/redmine/htdocs 11. ../../../ruby/bin/rake db:migrate RAILS_ENV=production 12. ../../../ruby/bin/rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production 13. ../../../ruby/bin/rake db:migrate_plugins RAILS_ENV=production 14. ./ctlscript.sh start
LibreOffice
- Impress Presentation Templates: IBM's repository Modern Impress Templates LibreOffice Templates Center
Request Ticket
-
Install Request Ticket on Ubuntu 12.04
sudo apt-get install request-tracker3.8 rt3.8*
Bitnami Serials Software
- concrete5 最好的开源CMS系统,可以用于创建网站
- Redmine 项目管理系统
- Tracks 个人GTD系统
- ownCloud 私有云
- Pootle 在线翻译管理系统
- LimeSurvey 在线投票系统
- Gitorious 私人Github
Linux Skills
-
How to link Windows Shared Directory from Linux?
sudo mount -t cifs -o username=yourname,passwd='yourpasswd' //ipaddcrss/shareddir /mnt/samba
Useful Commands Collection
-
Modify dir can read, write, and excute only by owner
chmod -R 700 dirpath
-
Stat shell running time
date_start=`date|awk -F"[ :]" '{print $4*3600 + $5*60 +$6}' your shells date_end=`date|awk -F"[ :]" '{print $4*3600 + $5*60 +$6}'` time=`expr "$date_end" - "$date_start"` echo "the whole process takes $time seconds"
-
Multi-thread downloading
lftp -c 'pget -n 10 your-file-path'
-
Check and kill port
netstat -anp netstat -anp | grep 9312 tcp 0 0 0.0.0.0:9312 0.0.0.0:* LISTEN 11902/searchd kill -9 11902
-
Transfer Dos File into Linux Format. Dos File has 0d0a problem, should be replaced into 0a
tr -d '\r' < all.en.txt > all.en.txt.dos2unix
-
count word frequency
filename=$1 tr " \011" "\012\012" < $filename |sort |uniq -c|sort -nr
【转】强大的shell-计算文件中单词出现次数并按次数排序 当亲身使用了shell,方能体会其强大。之前我发表过一篇关于统计文件中单词出现次数,并按次数排序的c++程序,这可是当时微软和百度的笔试题目。而用shell实现该功能却只需要一句:tr " \011" "\012\012" < $filename |tr -dc "[a-z][A-Z]\012" |sort |uniq -c|sort -nr 下面是源程序: #!/bin/sh set -x echo "enter the filename " read filename tr " \011" "\012\012" < $filename |tr -dc "[a-z][A-Z]\012" |sort |uniq -c|sort -nr set +x 在这里用到了tr,sort,uniq三个过滤器以及管道,流重定向。 tr " \011" "\012\012" < $filename 读入文件filename,并将空格和tab(\011)转换为回车(\012) tr -dc "[a-z][A-Z]\012" 删除文件中非字母以及回车的其他字符(-c按条件取反,-d删除) sort 对单词排序 uniq –c 统计单词出现的次数(-c输出重复次数) sort –nr对单词出现的次数排序(-r逆序,-n按照数值比较排序)
-
fast scan clockwise combine book
for((i=1706;i<=1780;i++)); do wget http://address/img0$i.pdf; done for((i=1688;i<=1780;i++)); do pdftk img0$i.pdf cat 1E output convert/img0$i-2.pdf; done pdftk *.pdf cat output combined.pdf
-
delete comments of all c++ files in specific folder
#!/bin/bash #delcomment.sh function: this shell script delete the comment in c/c++ source file function del_comment_file() { #delete the comment line begin with '//comment' sed -i "/^[ \t]*\/\//d" $file #delete the commnet line end with '//comment' sed -i "s/\/\/[^\"]*//" $file #delete the comment only occupied one line '/* commnet */' sed -i "s/\/\*.*\*\///" $file #delete the comment that occupied many lines '/*comment # *comment # # */ sed -i "/^[ \t]*\/\*/,/.*\*\//d" $file } function del_comment() { for file in `ls `; do case $file in *.c) del_comment_file ;; *.cpp) del_comment_file ;; *.h) del_comment_file ;; *) if [ -d $file ]; then cd $file del_comment cd .. fi ;; esac done } DIR=$1 if [ ! -e $DIR ]; then echo "The file or directory does not exist." exit 1; fi if [ -f $DIR ]; then file=`basename $DIR` if [[ `echo $DIR | grep /` == $DIR ]]; then cd `echo $DIR | sed -e "s/$file//"` del_comment_file else del_comment_file fi exit 0; fi if [ -d $DIR ]; then cd $DIR del_comment exit 0; fi
Last modified: 五 1 17 12:41:19 2014