This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| protected:member:data [2016/08/22 05:55] – [Blast] dirty | protected:member:data [2016/09/21 09:32] (current) – removed dirty | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| - | ====== Linux server ====== | ||
| - | *增加使用者建議使用 adduser較useradd為佳 會自動設定目錄 密碼 以及shell(自動複製.bashrc) | ||
| - | *vi /etc/passwd 改使用者剛進去的位置, | ||
| - | *在/ | ||
| - | *刪除使用者建議使用 deluser 或 userdel -r 可依並刪除目錄 | ||
| - | *將A使用者加入B Group: gpasswd -a A B | ||
| - | *新增使用者並設定UID GID (為了符合mount 硬碟內資料的權限) | ||
| - | < | ||
| - | *新增apt source list | ||
| - | < | ||
| - | *至[[https:// | ||
| - | | ||
| - | < | ||
| - | deb-src http:// | ||
| - | 貼上至sources.list最末行,即完成增加更新主機列表的動作 | ||
| - | |||
| - | *改sudo權限的使用者 | ||
| - | < | ||
| - | ======NIS+NFS====== | ||
| - | [[https:// | ||
| - | [[https:// | ||
| - | [[http:// | ||
| - | [[private: | ||
| - | =====client===== | ||
| - | *HDD / 30G swap 8G /local_home remain\\ | ||
| - | 使用者名稱mbi 密碼\\ | ||
| - | -再編輯resolv.conf (應該不用, | ||
| - | *(9.04)更新語言包 (左上角那邊找一下)\\ | ||
| - | *更新套件 (進入終端機案crtl+alt+f1), | ||
| - | *設定網路 \\ | ||
| - | **更新ubnuntu** | ||
| - | -先隨便連一個網路\\ | ||
| - | -apt-get update\\ | ||
| - | -apt-get upgrade\\ | ||
| - | -重新設定網路, | ||
| - | *ip = 192.168.1.2(01+1)(後面的電腦 如果是merry01)\\ | ||
| - | *mask = 255.255.255.0\\ | ||
| - | *gateway = 192.168.1.1\\ | ||
| - | *dns = 140.116.72.14\\ | ||
| - | -連到接到merry的區網\\ | ||
| - | *安裝NIS\\ | ||
| - | -apt-get install portmap nis --> fail 一次裝好protmap(nis nfs的協定) nis\\ | ||
| - | -sudo vi / | ||
| - | -ypserver merry(不知要步要 ㄏ) | ||
| - | -sudo domainname merry | ||
| - | -sudo make -C /var/yp | ||
| - | -sudo service portmap restart | ||
| - | -sudo / | ||
| - | -重開機, 可以先確定一下vi順不順 | ||
| - | -clinet 端 (設在後面的電腦)\\ | ||
| - | **以下步驟要確定vi很順,不然會無法重開機且失敗機率很高。如果真的不順就重開機或重灌吧。** | ||
| - | -sudo vi /etc/passwd 加上+:::::: | ||
| - | -sudo vi /etc/group 加上+::: | ||
| - | -sudo vi /etc/shadow 加上+:::::::: | ||
| - | -sudo vi / | ||
| - | *passwd: | ||
| - | *group: | ||
| - | *shadow: | ||
| - | *hosts: | ||
| - | -在/ | ||
| - | -/ | ||
| - | -/ | ||
| - | -ypwhich | ||
| - | -sudo aptitude install openssh-server(裝這個才可以ssh) | ||
| - | -server 端 (設在merry, | ||
| - | vi / | ||
| - | (加入)host 192.168.1.x (client ip)\\ | ||
| - | -make -C /var/yp (如果今天有新增使用者, | ||
| - | *安裝NFS (又跑回client端了!!)\\ | ||
| - | apt-get install nfs-common\\ | ||
| - | mount -t nfs 192.168.1.1:/ | ||
| - | *自動掛載/ | ||
| - | sudo apt-get install autofs (如此一來重開機才可以看到home)\\ | ||
| - | vi / | ||
| - | 最下面加 \\ | ||
| - | / | ||
| - | vi / | ||
| - | * 192.168.1.1:/ | ||
| - | *clone 到其他台 | ||
| - | -改host名字\\ | ||
| - | -vi / | ||
| - | -vi / | ||
| - | 127.0.1.1 | ||
| - | -vi / | ||
| - | 重開 設定網路 (把IP 改成正確的)\\ | ||
| - | -mount -t nfs 192.168.1.1:/ | ||
| - | *開機帳號因為沒有nfs的空間所以無法登入\\ | ||
| - | -vi / | ||
| - | -banner /home..... \\ | ||
| - | *ubuntu 沒有chkconfig \\ | ||
| - | apt-get install sysv-rc-conf\\ | ||
| - | |||
| - | ====== Apache2 ====== | ||
| - | ===== 更改www-data使用者 ===== | ||
| - | 先建立一新使用者www-user, | ||
| - | < | ||
| - | export APACHE_RUN_USER=www-user | ||
| - | export APACHE_RUN_GROUP=www-user | ||
| - | </ | ||
| - | ===== Apache2 基本操作 ===== | ||
| - | 啟動Apache server | ||
| - | < | ||
| - | 停止Apache server | ||
| - | < | ||
| - | 重啟動Apache server | ||
| - | < | ||
| - | ===== 使系統上所有使用者都擁有自己的個人網頁 ===== | ||
| - | < | ||
| - | cd / | ||
| - | ln -s ../ | ||
| - | ln -s ../ | ||
| - | </ | ||
| - | ===== 禁止瀏覽目錄 ===== | ||
| - | < | ||
| - | 將原指令 | ||
| - | < | ||
| - | < | ||
| - | Options Indexes FollowSymLinks MultiViews | ||
| - | </ | ||
| - | 改成 | ||
| - | < | ||
| - | < | ||
| - | Options -Indexes FollowSymLinks MultiViews | ||
| - | </ | ||
| - | 以及 | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | </ | ||
| - | 改成 | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | </ | ||
| - | ===== 限制瀏覽 ===== | ||
| - | 在想要保護的目錄下, | ||
| - | < | ||
| - | AuthName "Hi, there." | ||
| - | AuthUserFile [passwd path]/ | ||
| - | AuthType Basic | ||
| - | require valid-user | ||
| - | </ | ||
| - | 創建具瀏覽權限的名單 .passwd | ||
| - | < | ||
| - | htpasswd -c [passwd path]/ | ||
| - | htpasswd [passed path]/ | ||
| - | </ | ||
| - | ===== 使位於/ | ||
| - | 修改userdir.conf | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | 再增加以下區段 | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | </ | ||
| - | 重開apache即可 | ||
| - | < | ||
| - | ===== Ubuntu 10.04LST PHP bug ===== | ||
| - | 修改/ | ||
| - | 將以下部分以# | ||
| - | < | ||
| - | #< | ||
| - | # < | ||
| - | # php_admin_value engine On | ||
| - | # </ | ||
| - | #</ | ||
| - | </ | ||
| - | ===== 自動轉向do ===== | ||
| - | 新增/ | ||
| - | < | ||
| - | SetHandler cgi-script | ||
| - | </ | ||
| - | |||
| - | Alias /bp/ "/ | ||
| - | < | ||
| - | Options Indexes | ||
| - | <Limit GET POST> | ||
| - | Allow from all | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | 在/ | ||
| - | < | ||
| - | |||
| - | |||
| - | ====== CPAN ====== | ||
| - | execute cpan | ||
| - | < | ||
| - | sudo cpan | ||
| - | </ | ||
| - | install perl module (ex. JSON) | ||
| - | < | ||
| - | cpan> install JSON | ||
| - | </ | ||
| - | type "o conf" and list all configur | ||
| - | < | ||
| - | cpan> o conf | ||
| - | </ | ||
| - | reset configuration of CPAN (You cna select " | ||
| - | < | ||
| - | cpan> o conf init | ||
| - | </ | ||
| - | write config in config file (don't need config again next time) | ||
| - | < | ||
| - | cpan> o conf commit | ||
| - | </ | ||
| - | ====== Reset mirror site of CPAN ====== | ||
| - | [[http:// | ||
| - | < | ||
| - | cpan> o conf urllist shift | ||
| - | cpan> o conf urllist push http:// | ||
| - | cpan> o conf urllist | ||
| - | cpan> o conf commit | ||
| - | </ | ||
| - | [[http:// | ||
| - | [[http:// | ||
| - | ====== install GD module ====== | ||
| - | < | ||
| - | |||
| - | ====== Setting vim template ====== | ||
| - | - create a template (ex. ~/ | ||
| - | - edit .vimrc & add one line:\\ autocmd BufNewFile *.pl 0r ~\.vim_template/ | ||
| - | |||
| - | ====== Vim Regular Expressions ====== | ||
| - | [[http:// | ||
| - | [[http:// | ||
| - | |||
| - | ====== shell script ====== | ||
| - | [[shell script]] | ||
| - | |||
| - | ====== Study ====== | ||
| - | [[Protein Activity]] | ||
| - | ===== CD-HIT ===== | ||
| - | < | ||
| - | ===== PISCES ===== | ||
| - | 建議先cp 至欲使用之目錄\\ | ||
| - | 更改捷徑 將bin/ | ||
| - | < | ||
| - | 若出現 mv ...錯誤訊息 不管他 | ||
| - | |||
| - | ====== Linux C ====== | ||
| - | [[Linux C]] | ||
| - | |||
| - | ====== Perl ====== | ||
| - | *[[http:// | ||
| - | < | ||
| - | left terms and list operators (leftward) | ||
| - | left -> | ||
| - | nonassoc | ||
| - | right ** | ||
| - | right ! ~ \ and unary + and - | ||
| - | left =~ !~ | ||
| - | left * / % x | ||
| - | left + - . | ||
| - | left << >> | ||
| - | nonassoc | ||
| - | nonassoc | ||
| - | nonassoc | ||
| - | left & | ||
| - | left | ^ | ||
| - | left && | ||
| - | left || | ||
| - | nonassoc | ||
| - | right ?: | ||
| - | right = += -= *= etc. | ||
| - | left , => | ||
| - | nonassoc | ||
| - | right not | ||
| - | left and | ||
| - | left or xor | ||
| - | </ | ||
| - | ====== 未整理 ====== | ||
| - | cut -d ':' | ||
| - | sed '/ | ||
| - | my @sortbox =sort {$a->[0] < | ||
| - | splice 要從array索引值大的開始刪\\ | ||
| - | shell:read (讀取輸入)+ 變數 使用:$變數\\ | ||
| - | sed -n ' | ||
| - | awk -f : 以:為分隔\\ | ||
| - | : | ||
| - | *merry的更新及cron.daily | ||
| - | sudo apt-get update\\ | ||
| - | sudo apt-get -y dist-upgrade (如果上面尚未更新完全, | ||
| - | 至[[http:// | ||
| - | *[[http:// | ||
| - | sudo apt-get install openssh-server\\ | ||
| - | ====== Ubuntu ====== | ||
| - | *[[http:// | ||
| - | *指令: | ||