原创 The symble '-' in Linux
This is a wonderful symble in the linux. It can change the data stream which would go to a file to the stdout.It can im
原创 Revert Ubuntu control panel (還原Ubuntu 控制欄)
gconftool --recursive-unset /apps/panelrm -rf ~/.gconf/apps/panelRestart the Ubuntu
原创 Mount the windows ftp server to linux
mount -t cifs -o username=xxx,password=xxx,uid=1000,gid=1000,iocharset=utf8 //ftp/folder /mnt/mntpoint Note: The mount
原创 Add sudo privilege for normal user in Ubuntu
sudo vim /etc/sudoers Add follow line UserName ALL=(ALL) ALL under root ALL=(ALL) ALL 點贊 收藏 分享 文章舉
原创 Run shell application in ruby
exec 'echo "hello $HOSTNAME"' system 'echo "hello $HOSTNAME"' today = `date` 可以用以上三種方式在ruby腳本中執行shell程序,ruby確實很靈動啊。。
原创 Ruby CGI lib compare with Python CGI lib: Get form value
This is the Ruby require 'cgi' dcgi=CGI.new dcgi["name"]==dcgi.params["name"][0] This is the Python import 'cgi' fo
原创 SSH session key (證書認證方式SSH登錄配置)
Create the authorized_keys on client ssh-keygen -t rsa Copy the public key to the hostAdd public key info into autho
原创 Ubuntu Network_manager trouble
Download network-manager.deb and network-manager-GNOME.deb : apt-get install network-manager network-manager-GNOME --r
原创 Read file line by line (Bash shell script, sed usage)
#!/bin/sh filename=aaa num=`cat $filename |wc -l` echo $num i=1 while [ $i -le $num ] ; do line=`sed -n "$i,$i p
原创 開啓Ubuntu的NAT網絡共享(封包轉發方式局域網內共享上網)
We need open the ipv4 forwarding on the host sysctl -w net.ipv4.ip_forward = 1 Add follow lines into /etc/rc.locat t
原创 cx_Freeze
from cx_Freeze import setup, Executablesetup( name = "hello", version = "0.1",
原创 【大數算法】( 十進制整數四則運算) 十進制運算與二進制比較與思考
序 這兩天心血來潮, 想熟悉下Eclipse。 偶是寫Python的, 一般都在Ubuntu上用VIM做編輯器, PDB做調試工具, 自帶的python2.7解釋器, git做版本控制。 用着挺爽, 也就沒有搞啥IDE, 但是最近
原创 Sqlite3
import sqlite3 conn = sqlite3.connect(dbpath) c = conn.cursor() c.execute('''INSERT INTO `wine` (`inde`, `name`, `repos
原创 斐波拉切數列研究
斐波拉契(Fibonacci)數列來源於兔子問題,它有一個遞推關係, f(1)=1 f(2)=1 f(n)=f(n-1)+f(n-2),其中n>=2 {f(n)}即爲斐波拉契數列。 ■斐波拉契數列的公式
原创 測試&開發 誰坑了誰?
測試與開放本來都是軟件工程中必不可少的常見工作, 個人認爲並沒有嚴格的界限來劃分測試與開發。 雖然在全球大分工工作環境下,流水線式生產幾乎隨處可見,然而Agile式開發的興起恰恰反駁了所謂的大