12 十一月, 2009
Create PyGtk Programming Environment on Windows
Posted by: asd In: Code Snippet| Script| Unix| 程式設計
1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」 IDE debug,
12 十一月, 2009
Posted by: asd In: Code Snippet| Script| Unix| 程式設計
1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」 IDE debug,
Reference 3. All about redirection
redirect stdout to a file
ls -l > ls-l.txt
redirect stderr to a file
grep da * 2> grep-errors.txt
redirect stdout to a stderr
grep da * 1>&2
redirect stderr to a stdout
grep * 2>&1
redirect stderr and stdout to a file
rm -f $(find / -name core) &> /dev/null
27 二月, 2009
Posted by: asd In: C++| Code Snippet| Unix
得到目前正在執行的程式路徑,並切換 working directory 至此路徑。
view plain
C:
#include <unistd.h>
char buf[256] = {'\0'};
char *pch;
readlink("/proc/self/exe", buf, sizeof(buf));
if (pch = strrchr(buf, '/'))
{
*pch = '\0';
printf("working directory:%s\n", buf);
chdir(buf);
}
#設定撥接的帳號密碼
sudo pppoeconf
#中斷連線
sudo poff -a
#手動連線
sudo pon dsl-provider
首先更新 apt-get
編輯 /etc/apt/sources.list,加入台大站台
view plain
CODE:
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-updates main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-backports main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-security main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ dapper-security main restricted universe multiverse
執行
apt-get update
安裝 sshd
apt-get [...]