User Tools

Site Tools


protected:member:data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
protected:member:data [2016/08/22 05:55] – [Blast] dirtyprotected:member:data [2016/09/21 09:32] (current) – removed dirty
Line 1: Line 1:
  
- 
-====== Linux server ====== 
-  *增加使用者建議使用 adduser較useradd為佳 會自動設定目錄 密碼 以及shell(自動複製.bashrc) 
-  *vi /etc/passwd 改使用者剛進去的位置, ex:課堂上的使用者xx 把/home/xx 改成 /home/mlb/xx , 再把home底下的xx資料夾mv 到mlb底下 
-  *在/home改權限, 讓其他使用者無法在妳的資料夾ls : chmod 711 xx 
-  *刪除使用者建議使用 deluser 或 userdel -r 可依並刪除目錄 
-  *將A使用者加入B Group: gpasswd -a A B 
-  *新增使用者並設定UID GID (為了符合mount 硬碟內資料的權限) 
-<code>sudo adduser --uid 1011 --gid 1000 --home /homeL/guy --shell /bin/bash</code> 
-  *新增apt source list 
-<code>sudo vi /etc/apt/sources.list</code> 
-  *至[[https://launchpad.net/ubuntu/+mirror/free.nchc.org.tw-archive|NCHC]]網頁中間部分選擇ubuntu版本 
-   複製(ex.) 
-<code>deb http://free.nchc.org.tw/ubuntu/ lucid main  
-deb-src http://free.nchc.org.tw/ubuntu/ lucid main </code> 
-貼上至sources.list最末行,即完成增加更新主機列表的動作 
- 
-  *改sudo權限的使用者 
-<code>sudo vi /etc/sudoers</code> 
-======NIS+NFS====== 
-[[https://help.ubuntu.com/community/SettingUpNISHowTo|SettingUpNISHowTo]]\\ 
-[[https://help.ubuntu.com/community/SettingUpNFSHowTo|SettingUpNFSHowTo]]\\ 
-[[http://ljhuang.pixnet.net/blog/category/1362152/3|中文參考-隨手亂記]]\\ 
-[[private:zzhowzz:note:NIS|NIS]] 
-=====client===== 
-  *HDD / 30G swap 8G /local_home remain\\ 
-使用者名稱mbi 密碼\\ 
--再編輯resolv.conf (應該不用,如果是從終端機就要再這邊設定)\\ 
-  *(9.04)更新語言包 (左上角那邊找一下)\\ 
-  *更新套件 (進入終端機案crtl+alt+f1),ctrl+alt+f7可以切換回圖形介面\\ 
-  *設定網路 \\ 
-**更新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 /etc/yp.confg 改ypserver 192.168.1.1 
-  -ypserver merry(不知要步要 ㄏ) 
-  -sudo domainname merry 
-  -sudo make -C /var/yp 
-  -sudo service portmap restart 
-  -sudo /etc/init.d/nis restart (不成功也沒差) 
-  -重開機, 可以先確定一下vi順不順 
--clinet 端 (設在後面的電腦)\\ 
-**以下步驟要確定vi很順,不然會無法重開機且失敗機率很高。如果真的不順就重開機或重灌吧。** 
-  -sudo vi /etc/passwd 加上+:::::: (指令'rpcinfo -p [hosts]':rpc 為協定,這個可以看rpc協定打開的port) (sudo vi,通常都是加在檔案的最下面)\\ 
-  -sudo vi /etc/group 加上+:::\\ 
-  -sudo vi /etc/shadow 加上+::::::::   \\ 
-  -sudo vi /etc/nsswitch.conf (sudo vi)\\ 
-    *passwd:  compat nis\\ 
-    *group:   compat nis\\ 
-    *shadow:  compat nis\\ 
-    *hosts:   (....略) nis\\ 
-  -在/etc/resolv.conf設nameserver(就是設定dns:140.116.72.14)  \\ 
-  -/etc/init.d/portmap restart\\ 
-  -/etc/init.d/nis restart(如果成功很快就OK)\\ 
-  -ypwhich  (測試nis是否成功,成功就會出現merry,rpcinfo -p 應該會有ypbind)\\ 
-  -sudo aptitude install openssh-server(裝這個才可以ssh) 
--server 端  (設在merry,基本上應該已經設好了,除非電腦真的太多了,才有可能要新增) \\ 
-  vi /etc/ypserv.securenets\\ 
-  (加入)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:/home /home \\ 
-  *自動掛載/home目錄\\ 
-sudo apt-get install autofs (如此一來重開機才可以看到home)\\ 
-vi /etc/auto.master \\ 
-最下面加 \\ 
-/home /etc/auto.home   (home 代表home目錄)\\ 
-vi /etc/auto.home     \\ 
-* 192.168.1.1:/home/&  (新增此行)\\ 
-  *clone 到其他台   (如果是複製硬碟之後才要改以下的東西)\\ 
-  -改host名字\\ 
-  -vi /etc/hostname\\ 
-  -vi /etc/hosts\\ 
-      127.0.1.1  [hosts]\\ 
-  -vi /etc/udev/rules.d/70-persistent-net.rules 將PCI device底下的都刪除\\ 
-  重開 設定網路 (把IP 改成正確的)\\ 
-  -mount -t nfs 192.168.1.1:/home /home\\ 
-  *開機帳號因為沒有nfs的空間所以無法登入\\ 
-  -vi /etc/auto.master\\ 
-  -banner /home..... \\ 
-  *ubuntu 沒有chkconfig \\ 
-apt-get install sysv-rc-conf\\ 
- 
-====== Apache2 ====== 
-===== 更改www-data使用者 ===== 
-先建立一新使用者www-user, 更改/etc/apache2/envvars, 改成 
-<code> 
-export APACHE_RUN_USER=www-user 
-export APACHE_RUN_GROUP=www-user 
-</code>再重開apache2即可 
-===== Apache2 基本操作 ===== 
-啟動Apache server 
-<code>sudo /etc/init.d/apache2 start</code> 
-停止Apache server 
-<code>sudo /etc/init.d/apache2 stop</code> 
-重啟動Apache server 
-<code>sudo /etc/init.d/apache2 restart</code> 
-===== 使系統上所有使用者都擁有自己的個人網頁 ===== 
-<code> 
-cd /etc/apache2/mod-enabled/ 
-ln -s ../mods-available/userdir.conf userdir.conf 
-ln -s ../mods-available/userdir.load userdir.load 
-</code> 
-===== 禁止瀏覽目錄 ===== 
-<code>sudo vim /etc/apache2/sites-avaiable/default</code> 
-將原指令 
-<code> 
-<Directory /var/www> 
-Options Indexes FollowSymLinks MultiViews 
-</code> 
-改成 
-<code> 
-<Directory /var/www> 
-Options -Indexes FollowSymLinks MultiViews 
-</code> 
-以及 
-<code>sudo vim /etc/apache2/mods-available/userdir.conf</code> 
-<code> 
-<Directory /home/*/public_html> 
-AllowOverride FileInfo AuthConfig Limit 
-</Directory> 
-改成 
-<Directory /home/*/public_html> 
-AllowOverride FileInfo AuthConfig Limit 
-AddHandler cgi-script .cgi .pl .php 
-Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI 
-</Directory> 
-</code> 
-===== 限制瀏覽 ===== 
-在想要保護的目錄下, 寫一個.htaccess檔, 內容為 
-<code> 
-AuthName "Hi, there." 
-AuthUserFile [passwd path]/.passwd 
-AuthType Basic 
-require valid-user 
-</code> 
-創建具瀏覽權限的名單 .passwd 
-<code> 
-htpasswd -c [passwd path]/.passwd username (第一次建立.passwd) 
-htpasswd [passed path]/.passwd username (新增其它具有權限瀏覽的user) 
-</code> 
-===== 使位於/home/xx/目錄下使用者可執行CGI ===== 
-修改userdir.conf 
-<code>sudo vim /etc/apache2/mods-available/userdir.conf</code> 
-<code> 
-<Directory /home/*/public_html> 
-AllowOverride FileInfo AuthConfig Limit 
-AddHandler cgi-script .cgi .pl .php 
-Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI 
-</Directory> 
-再增加以下區段 
-<Directory /home/xx/*/public_html> 
-AllowOverride FileInfo AuthConfig Limit 
-AddHandler cgi-script .cgi .pl .php 
-Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI 
-</Directory> 
-</code> 
-重開apache即可 
-<code>sudo /etc/init.d/apache2 restart</code> 
-===== Ubuntu 10.04LST PHP bug ===== 
-修改/etc/apache2/mods-available/php5.conf 
-將以下部分以#號標記 
-<code> 
-#<IfModule mod_userdir.c> 
-#    <Directory /home/*/public_html> 
-#        php_admin_value engine On 
-#    </Directory> 
-#</IfModule> 
-</code> 
-===== 自動轉向do ===== 
-新增/etc/apache2/sites-available/serv 
-<code><Files ~ "^do$"> 
-        SetHandler cgi-script 
-</Files> 
- 
-Alias /bp/ "/home/dirty/wrk/BP2010/" 
-<DirectoryMatch ~ "^/home/dirty/wrk/"> 
-        Options Indexes 
-        <Limit GET POST> 
-                Allow from all 
-        </Limit> 
-</DirectoryMatch> 
-</code> 
-在/etc/apache2/sites-enable/ 
-<code>ln -s /etc/apache2/sites-available/serv .</code> 
- 
- 
-====== CPAN ====== 
-execute cpan  
-<code> 
-sudo cpan 
-</code> 
-install perl module (ex. JSON) 
-<code> 
-cpan> install JSON 
-</code> 
-type "o conf" and list all configur 
-<code> 
-cpan> o conf 
-</code> 
-reset configuration of CPAN (You cna select "no" and configure manually) 
-<code> 
-cpan> o conf init  
-</code> 
-write config in config file (don't need config again next time) 
-<code> 
-cpan> o conf commit 
-</code> 
-====== Reset mirror site of CPAN ====== 
-[[http://www.cpan.org/SITES.html|search mirror site]] 
-<code> 
-cpan> o conf urllist shift 
-cpan> o conf urllist push http://ftp.cse.yzu.edu.tw/pub/CPAN/ 
-cpan> o conf urllist 
-cpan> o conf commit 
-</code> 
-[[http://sial.org/howto/perl/life-with-cpan/]]\\ 
-[[http://www.cpan.org/SITES.html]] 
-====== install GD module ====== 
-<code>sudo apt-get install libgd-gd2-perl</code> 
- 
-====== Setting vim template ====== 
-  - create a template (ex. ~/.vim_template/template.zz) 
-  - edit .vimrc & add one line:\\ autocmd BufNewFile *.pl  0r ~\.vim_template/template.zz 
- 
-====== Vim Regular Expressions ====== 
-[[http://vimregex.com/|Vim regex]]\\ 
-[[http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml|Vim Regular Expressions]] 
- 
-====== shell script ====== 
-[[shell script]] 
- 
-====== Study ====== 
-[[Protein Activity]] 
-===== CD-HIT ===== 
-<code>~serv/cdhit/cdhit -i ndbp.fa -o ndbp.40 -c 0.4 -n 2 -T 0 </code> 
-===== PISCES ===== 
-建議先cp 至欲使用之目錄\\ 
-更改捷徑 將bin/blastall blastpgp formatdb 連結至目前版本之執行檔\\ 
-<code>~serv/PISCES/bin/Cull_for_UserSEQ.pl -i ndbp.40 -p 25 -l 50-6000</code> (使用方式:README)\\ 
-若出現 mv ...錯誤訊息 不管他  再執行一次 
- 
-====== Linux C ====== 
-[[Linux C]] 
- 
-====== Perl ====== 
-  *[[http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlop.html|Perl operators and precedence]]  
-<code> 
-    left        terms and list operators (leftward) 
-    left        -> 
-    nonassoc    ++ -- 
-    right       ** 
-    right       ! ~ \ and unary + and - 
-    left        =~ !~ 
-    left        * / % x 
-    left        + - . 
-    left        << >> 
-    nonassoc    named unary operators 
-    nonassoc    < > <= >= lt gt le ge 
-    nonassoc    == != <=> eq ne cmp 
-    left        & 
-    left        | ^ 
-    left        && 
-    left        || 
-    nonassoc    ..  ... 
-    right       ?: 
-    right       = += -= *= etc. 
-    left        , => 
-    nonassoc    list operators (rightward) 
-    right       not 
-    left        and 
-    left        or xor 
-</code> 
-====== 未整理 ====== 
-cut -d ':' -f3,6  以分隔字元 :分欄(也可以用regexp) 將3 6欄擷取出\\ 
-sed '/.+_.+/d' [file] 將file中有NP_xxooxx的行刪掉\\ 
-my @sortbox =sort {$a->[0] <=>$b->[0]} @box;\\ 
-splice 要從array索引值大的開始刪\\ 
-shell:read (讀取輸入)+ 變數 使用:$變數\\    
-sed -n '3p' [file] 從file中取出第三行\\ 
-awk -f : 以:為分隔\\ 
-:%s/.*/\U&/ 小寫轉大寫\\ 
-  *merry的更新及cron.daily 
-sudo apt-get update\\ 
-sudo apt-get -y dist-upgrade (如果上面尚未更新完全,可以用這個)\\  
-至[[http://webcache.googleusercontent.com/search?q=cache:1LUc3gZ6gHYJ:blog.riaproject.com/server-setting/1212.html+ununtu+%E6%9B%B4%E6%96%B0&cd=1&hl=zh-TW&ct=clnk|cron.daily]]可以看如何讓這個更新自動化\\ 
-  *[[http://jakson.homeip.net/joomla/index.php?option=com_content&view=article&id=159:ssh-keygen----key-&catid=67:linux-setting-ssh&Itemid=125|ssh 免輸入密碼 keygen , 用 key 登入 ]]\\ 
-sudo apt-get install openssh-server\\ 
-====== Ubuntu ====== 
-  *[[http://superuser.com/questions/269961/resolv-conf-gets-refreshed-on-every-reboot|重開機的時候resolv.conf不會被Network Manager蓋掉]]\\ 
-    *指令:sudo chattr +i /etc/resolv.conf 
protected/member/data.1471845341.txt.gz · Last modified: by dirty