2011年12月29日 星期四
2011年12月14日 星期三
2011年11月29日 星期二
`gets' function is dangerous
最近在讀蔡明志老師的C語言入門書,讀到字串那一段程式的實作發生一些情況,我是使用gcc為編譯器,使用`gets' function會出現`gets' function is dangerous,,,.的訊息,但是程式還是可以執行,後來改用fgets就ok了參考了 Hsian兄的blog
2011年11月23日 星期三
使用python寫cgi網頁
作業系統 ubuntu 11.10
網頁伺服器 Apache HTTP Server
如何使用python 在 ubuntu linux上跑cgi 網頁呢?以下是我參考Sheng Bao兄 的實做
修改完後:wq 接下來cd進入/usr/lib/cgi-bin
localhost/cgi-bin/hello.py 這網址的/cgi-bin/就是當我們設定 default 時的cgi網頁預設路徑,裡面有存放hello.py
網頁伺服器 Apache HTTP Server
如何使用python 在 ubuntu linux上跑cgi 網頁呢?以下是我參考Sheng Bao兄 的實做
首先進入 /etc/apache2/sites-available/default
進入後下指令打開default這檔案#sudo vi default |
打開default後找到這一段
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
把它修改成如下圖反白處
記住:當你修改時,我假設你的apache http server 是還未啟動的狀態 |
進入之後並sudo vi hello.py<----開始編寫python cgi 網頁 |
這是一個python cgi 網頁的例子 hello.py完成後一定要再下sudo chmod 775 hello.py, 這樣hello.py才能執行 hello.py 完成後啟動 apache http server 接下來點擊 firefox 並在網址處打上localhost/cgi-bin/hello.py |
2011年11月19日 星期六
2011年11月16日 星期三
2011年10月22日 星期六
kindle
2011年10月14日 星期五
2011年10月7日 星期五
2011年9月27日 星期二
install Mysql server in ubuntu 11.04
~$ sudo apt-get install mysql-server
/* during the installing it will ask you mysql server's password,,just type the password you want */
~$ sudo mysql -u root -p
/*enter the password */
mysql>
/* during the installing it will ask you mysql server's password,,just type the password you want */
~$ sudo mysql -u root -p
/*enter the password */
mysql>
2011年9月21日 星期三
2011年8月21日 星期日
2011年8月8日 星期一
beginning python p318, install twisted and test it by telnet in ubuntu 11.04
coding
test use telnet!
in book beginning python page 318, there is an example for the twisted python programming. However, I do not know how to use telnet to test it,, here is what I discover,,.
2011年8月7日 星期日
install vim in ubuntu 11.04, because vi in ubuntu is so hard to use!!!
for example I am in root -->#
#apt-get install vim
-->yes
ok!!!
#apt-get install vim
-->yes
ok!!!
2011年8月3日 星期三
2011年7月30日 星期六
2011年7月25日 星期一
2011年7月22日 星期五
2011年7月21日 星期四
2011年7月9日 星期六
2011年7月7日 星期四
訂閱:
文章 (Atom)