讓vsftpd service 可用ipv6 address連線 (環境: CentOS 5.X)
1. 編輯 /etc/vsftpd/vsftpd.conf
listen=NO #關掉ipv4-only sockets
listen_ipv6=YES #打開ipv4 ipv6相容的模式
2. restart vsftpd
# service vsftpd restart
個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2011年11月30日 星期三
2011年11月2日 星期三
linux bash getopt
getopt 是 shell 裡抓參數的好工具
例: getopt abc:d: 容許參數 -a -b -c -d, -c and -d 後面要接參數
#!/bin/sh
set - `getopt abc:d: $*`
while true; do
case $1 in
-a) echo option -a
shift ;;
-b) echo option -b
shift ;;
-c) echo option -c=$2
shift 2 ;;
-d) echo option -d=$2
shift 2 ;;
--) shift
break ;;
*) echo "error!"
exit 1 ;;
esac
done
執行結果
# ./go -a
option a
# ./go -c jack
option -c=jack
# ./go -b -c jack
option -b
option -c=jack
# ./go -b -c test -d
getopt: option requires an argument -- d
option -b
option -c=test
(使用後面要加參數的 option 會提示)
# ./go -b -c test -f
getopt: invalid option -- f
option -b
option -c=test
(使用未支援的參數會提示)
http://pank.org/blog/2004/05/getopt-example.html
python join
把string的list join成一個string
tmp = ["a", "b", "c", "d"]
" ".join(tmp)
a b c d
http://stackoverflow.com/questions/3627270/python-how-exactly-can-you-take-a-string-split-it-reverse-it-and-join-it-back
2011年11月1日 星期二
訂閱:
意見 (Atom)