Sharing

2011年10月18日 星期二

How to see Python code in Source Insight



資訊是從 http://wiki.python.org/moin/PythonEditors 找到的

1. 下載 Source Insight 的一個CLF文件
http://www.sourceinsight.com/public/languages/Python.CLF

2. 打開 Source Insight, 選擇options->Preferences->Language->Import->將剛剛的clf文件導入進來



3. options->Document options-> Add Type -> 輸入 Python

4. 接下來就會多一個 Python 的 Document Type, 選擇它之後, 要把其它的東西都設定好
    a. Language => Python Language
    b. File filter => *.py
    c. turn on "Include when adding to projects"
    d. turn on some "Editing Options" if need


這樣就大功告成啦!

2011年10月17日 星期一

How to import ssh key from puttygen?


如果在 Window 的系統上我們會用 puttygen 來生成 ssh key, 但如果我們要拿去 ubuntu 使用該怎麼做?

首先因為 ubuntu 上使用的 openSSH 的格式和 puttygen 的不同, 所以要先把 private key 轉換成正確的格式, 轉換成功後記得檔案要存成 id_rsa


接下來把 public key 直接當成純文字存到另一個檔案 id_rsa.pub

我們把這兩個檔案都上傳到 ubuntu 的機器, 然後放在 ~/.ssh/ 底下, 如果原本就有檔案存在, 就把它覆蓋掉

最後一件事是要記得改權限, 不然會被視為有問題!

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/pjack/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/pjack/.ssh/id_rsa

chmod 0600 .ssh/id_rsa

2011年9月28日 星期三

Test Ceph RBD + iSCSI performance

# 在 local
root@ubuntu1104-64-5:/mnt$ dd if=/dev/zero of=testfile bs=4096 count=10000 conv=fdatasync
10000+0 records in
10000+0 records out
40960000 bytes (41 MB) copied, 4.41257 s, 9.3 MB/s

# 在 local 測 rdb image
root@ubuntu1104-64-5:/mnt$ dd if=/dev/zero of=testfile bs=4096 count=10000 conv=fdatasync
10000+0 records in
10000+0 records out
40960000 bytes (41 MB) copied, 3.79785 s, 10.8 MB/s

# 用 Client 端測 rdb

root@ubuntu1104-64-6:~# dd if=/dev/zero of=testfile bs=4096k count=100 conv=fdatasync
100+0 records in
100+0 records out
419430400 bytes (419 MB) copied, 4.2075 s, 99.7 MB/s
root@ubuntu1104-64-6:~# dd if=/dev/zero of=testfile bs=4096k count=1000 conv=fdatasync
1000+0 records in
1000+0 records out
4194304000 bytes (4.2 GB) copied, 40.8692 s, 103 MB/s




# local 
root@ubuntu1104-64-5:~# dd if=/dev/zero of=testfile bs=4096k count=100 conv=fdatasync
100+0 records in
100+0 records out
419430400 bytes (419 MB) copied, 4.59282 s, 91.3 MB/s