EvoTalk

Archive for the ‘Unix’ Category

1. 安裝「python-2.5.4」
2. 安裝「PyGtk, PyOpenGL, PyGtkGlExt, PyWin32 all in one installer」
使用 「Glade」拉界面 ,「Pythonwin」  IDE  debug,

10 七月, 2009

Redirection

Posted by: asd In: Unix| 程式設計

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

得到目前正在執行的程式路徑,並切換 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);

 }

20 二月, 2009

Ubuntu 撥接上網

Posted by: asd In: Unix

#設定撥接的帳號密碼
sudo pppoeconf
#中斷連線
sudo poff -a
#手動連線
sudo pon dsl-provider

Tags:

19 三月, 2008

Ubuntu 7.1 Install sshd

Posted by: asd In: Unix

首先更新 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 [...]

Tags: ,

Page 1 of 512345