Initial D 「Rage Your Dream」 Cover by 真栗Makuri
2017年8月30日 星期三
2017年8月24日 星期四
用Clonezilla做備份
要做系統備份,可以用再生龍Clonezilla。有兩種做法:
在選擇Clonzilla的時候還會有穩定版(stable, Debian-based)與替代版(alternative, Ubuntu-based)這兩種,與要備份的主機板開機方式有關:
- 做在USB隨身碟上:《在Mac上製作USB開機的Clonezilla Live》
建議做成i386, i686-pae, i686這幾種,建議用穩定版 - 做在外接硬碟上:《製作硬碟開機的Clonezilla Live》
建議做成amd64這一種,建議用替代版
在選擇Clonzilla的時候還會有穩定版(stable, Debian-based)與替代版(alternative, Ubuntu-based)這兩種,與要備份的主機板開機方式有關:
- 穩定版:用在BIOS開機的機器上
- 替代版:用在uEFI開機的機器上
Labels:
Backup備份與轉移,
Clonezilla再生龍,
USB碟與SD卡
2017年8月23日 星期三
NFS4的idmapping
對於NFS version4(nfs4),client上面需要從server得到idmapping所需的資訊
例如說user1, uid=1111,那就必須要在nfs server上面有這個使用者,當server用nfs4分享user1的資料夾到client上面的時候,才能夠正確顯示。這可能是因為nfs4在傳送資料夾權限的時候不是用UID,而是用ID,所以才需要用到idmapping
若是分享的資料夾在nfs server上面沒有帳號,則idmapd從server傳送uid對應id表的時候,就會出現nobody
例如說user1, uid=1111,那就必須要在nfs server上面有這個使用者,當server用nfs4分享user1的資料夾到client上面的時候,才能夠正確顯示。這可能是因為nfs4在傳送資料夾權限的時候不是用UID,而是用ID,所以才需要用到idmapping
若是分享的資料夾在nfs server上面沒有帳號,則idmapd從server傳送uid對應id表的時候,就會出現nobody
2017年8月22日 星期二
百萬瓦(MW)的耗電量
- 一小時會用掉 1000度電:1MW•h = 1000 * 1kW•h = 1000度
- 一天用掉 24,000度=2.4萬度
- 一個月用掉 720,000度=72萬度
- 一年用掉 8,760,000度=876萬度
假設一度電5塊,一個月電費就是360萬,一年的電費就是4320萬
2017年8月21日 星期一
修改GROMACS的.tpr檔案
GROMACS裡面的.tpr檔案(又稱run input file)是跑分子模擬最重要的檔案。這個檔案合併了下面幾項資訊:
要看這個檔案用gmx dump,要修改用gmx convert-tpr去修改,例如說:
- .gro file:分子結構資訊,每個原子的座標
- .top file:分子topology資訊,原子在分子如何互相連結的資訊
- .mdp file:模擬的參數設定
- .ndx file (optional):原子的index file
要看這個檔案用gmx dump,要修改用gmx convert-tpr去修改,例如說:
- gmx convert-tpr -s md.tpr -o md_ca.tpr(選C-alpha)
- gmx convert-tpr -s md.tpr -until 20000 -o md_upto_20ns.tpr
- gmx dump -s md.tpr > md.tpr.ascii
2017年8月18日 星期五
The version ('80100') of the host compiler ('Apple clang') is not supported
之前《安裝CUDA到Mac上》,後來更新了Xcode版本以後再度編譯Nvidia samples,出現了下面的錯誤訊息:
/Developer/NVIDIA/CUDA-8.0/bin/nvcc -ccbin clang++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery.o -c deviceQuery.cppnvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).nvcc fatal : The version ('80100') of the host compiler ('Apple clang') is not supported make: *** [deviceQuery.o] Error 1看起來是新版的Xcode裡面的Apple clang版本相沖Nvidia CUDA Toolkit:
- Xcode 8.3.3 配上 Command Line Tools (macOS 10.12) for Xcode 8.3
- CUDA Driver Version: 8.0.90(從8.0.61安裝patch升級上來)
- Xcode 8.0 (8A218a) 配上 Command_Line_Tools_macOS_10.12_for_Xcode_8 (8.0)
- CUDA Driver Version: 8.0.90(從8.0.61安裝patch升級上來)
2017年8月16日 星期三
安裝NTP時間伺服器
當手下有許多電腦,希望對同一台機器同步時間,這台機器上面需要裝NTP:
- sudo apt-get install ntp
server 211.22.103.158 preferserver 211.22.103.157 server 118.163.81.62server 118.163.81.63 restrict 211.22.103.158 # clock.stdtime.gov.twrestrict 211.22.103.157 # tock.stdtime.gov.twrestrict 118.163.81.62 # tick.stdtime.gov.twrestrict 118.163.81.63 # watch.stdtime.gov.tw都設定好以後,啟動ntp服務並確認開機會執行:
restrict 192.168.1.0 mask 255.255.255.0 nomodify
- sudo service ntp restart
- sudo chkconfig --list ntp
2017年8月12日 星期六
冷氣的能源效率比(EER)
所謂的冷氣能源效率比EER (Energy Efficiency Ratio),或者稱作COP (Coefficient of Performance),就是每單位電功率的電力可以得到的冷氣能力。計算公式:
- EER = 冷房能力/使用電力
2017年8月11日 星期五
冷氣能力(冷凍噸)換算
kW | kcal/h | 美制噸(USRT) | 公制噸 | 台制噸 | BTU/h | |
1 kW | 1 | 860 | 0.284 | 0.259 | 0.430 | 3412 |
1000 kcal/h | 1.163 | 1000 | 0.331 | 0.301 | 0.500 | 3968 |
1美制冷凍噸(RT) | 3.516 | 3024 | 1 | 0.911 | 1.512 | 11999 |
1公制冷凍噸 | 3.860 | 3320 | 1.098 | 1 | 1.660 | 13174 |
1台制冷凍噸 | 2.326 | 2000 | 0.661 | 0.602 | 1 | 7936 |
10000 BTU/h | 2.930 | 2520 | 0.833 | 0.759 | 1.260 | 10000 |
注意,這邊的RT用美制噸,或簡寫成USRT
2017年8月10日 星期四
讓SSH僅允許用金鑰登入
用ssh登入遠端主機有兩種方式:
- 輸入帳號密碼,參考《SSH遠端連線,接視窗回本機使用》
- 帳號配合金鑰,參考《SSH遠端登入不用密碼》
Match User user1,user2,user3
PasswordAuthentication no
Labels:
帳號管理,
InfoSec資訊安全,
Linux,
SSH
2017年8月9日 星期三
讓sort用多核心跑
GNU sort(就是在Linux裡面預設的,作者是Mike Haertel與Paul Eggert),裡面有個平行化的選項,如果不選的話預設就會開多核心。這邊測試《PDB中最常出現的氨基酸片段》裡面排序進一億筆5-mer,得到的速度與用單核心來比較
Labels:
Bash與Shell命令稿,
Linux,
Parallel平行處理,
PDB,
sed與awk
2017年8月8日 星期二
看port被佔用的情形
要看有哪些port開啟,被什麼程式佔用,有下面幾招:
- netstat -lntu
- lsof -i -P -n
- sudo lsof -i -P -n | tee >(head -n 1) >(grep LISTEN) >/dev/null
- sudo lsof -i -P -n | tee >(head -n 1) >(grep LISTEN | grep sshd) >/dev/null
- sudo lsof -i -P -n | tee >(head -n 1) >(grep -v LISTEN | grep sshd) >/dev/null
- sudo lsof -i -P -n | tee >(head -n 1) >(grep :80) >/dev/null
- sudo lsof -i:80
- sudo netstat -apn 或 sudo netstat -lpn
- sudo netstat -apn | tee >(head -n 1) >(grep LISTEN) >/dev/null
- sudo netstat -apn | tee >(head -n 1) >(grep ssh) >/dev/null
- sudo netstat -apn | grep :80
- sudo nmap -sT -O localhost
2017年8月7日 星期一
氨基酸B、Z、X、J、O、U
蛋白質的氨基酸序列中,除了原本的20種氨基酸以外,有時候會出現:
- B:也稱Asx、此位置是Asparagine (N)或Aspartic acid (D)
- Z:也稱Glx、此位置是Glutamine (Q)或Glutamic acid (E)
- X:也稱Xaa代表此位置未知、或是在此位置可以是任何一種氨基酸
- J:也稱Xle,代表此位置是Leucine (L)或Isoleucine (I)
- O:也稱Pyl,全稱Pyrrolysine,第22種氨基酸
- U:也稱Sec,全稱Selenocysteine,第21種氨基酸
2017年8月6日 星期日
PDB中最常出現的氨基酸片段
想要知道五個連續氨基酸出現次數用下面兩個指令就可以得到:
第2個指令是計算個數的檔案,結果存在prot_sorted_5peptide.count裡面,計算的時間約莫是五分鐘,下面是分析的指令:
- wget ftp://ftp.wwpdb.org/pub/pdb/derived_data/pdb_seqres.txt
- cat pdb_seqres.txt | grep -e "mol:protein" -A 1 \
| sed '/^--$/d' | grep -v "^>" \
| awk '{while(length($0)>=5){print substr($0,1,5);gsub(/^./,"")}}' \
| grep X -v | sort | uniq -c | sort -k 1 -n -r \
> prot_sorted_5peptide.count
第2個指令是計算個數的檔案,結果存在prot_sorted_5peptide.count裡面,計算的時間約莫是五分鐘,下面是分析的指令:
2017年8月5日 星期六
2017年8月4日 星期五
Ubuntu 16.04將開機硬碟變成RAID-1
原本的系統安裝在/dev/sda上面,想要把這個系統多加入一個大小一樣的硬碟/dev/sdb,然後讓兩個硬碟變成RAID-1(Mirror)。原本的硬碟上面有三個分割區:
- /dev/sda1:BIOS Boot Partition
- /dev/sda2:掛載到/boot
- /dev/sda3:掛載到/
2017年8月3日 星期四
安裝GRUB在GPT分割的硬碟上
在下指令 grub-install 到硬碟的時候出現下面的錯誤訊息:
Installing for i386-pc platform.grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..grub-install: error: will not proceed with blocklists.這代表說這個用GPT分割的硬碟沒有BIOS Boot Partition,雖說可以成功使用EFI的主機板開機,但若是BIOS的主機板則無法開機~
2017年8月2日 星期三
Ubuntu 16.04改網卡的名稱
以前的網卡名稱會類似:
在以往的Debian/Ubuntu上,可以透過修改/etc/udev/rules.d/70-persistent-net.rules這個檔案,直接透過網卡的MAC address來指定其名稱(interface name),但在Ubuntu15, 16這個檔案不見了。對於server的管理來說,能夠自行綁定名稱在設定上會比較方便 :
- eth0:第一張網卡
- eth1:第二張網卡
在Ubuntu15以後,這些名稱都改變了,會像是:
- ens1f2:某張雙孔網卡的第一個孔
- ens1f3:某張雙孔網卡的第二個孔
- enp4s0:主機板上的網孔
- enp5s0:主機板上的網孔
2017年8月1日 星期二
將sshd開在許多個port上面
加密連線服務sshd預設是開在port 22上面,若想要開在其他的port上面,並且把port 22給關掉,修改/etc/ssh/sshd_config開頭是Port的那幾行,如下:
Port 11111然後重新啟動sshd的服務:
Port 22222
Port 33333
Port 44444
- sudo service ssh restart
Labels:
Debian,
InfoSec資訊安全,
Linux,
SSH
訂閱:
文章 (Atom)