<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Aery's Note</title><link>http://blog.blueshop.com.tw/guancheng713/</link><description>Note everything!</description><managingEditor>Aery</managingEditor><dc:language>zh-TW</dc:language><generator>.Text Version 0.95.2004.101</generator><item><dc:creator>Aery</dc:creator><title>My New blog</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/10/23/57443.aspx</link><pubDate>Thu, 23 Oct 2008 16:31:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/10/23/57443.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/57443.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/10/23/57443.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/57443.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/57443.aspx</trackback:ping><description>最近想開始來整理一些東西~這邊po文常常會怪怪的&lt;br /&gt;
而且想換個功能多一點的~比較能控制的&lt;br /&gt;
so~搬家囉~&lt;br /&gt;
&lt;a href="http://blog.gclin.org/"&gt;http://blog.gclin.org/&lt;/a&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/57443.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>設定vsftp Virtual User對MySQL認證 on Ubuntu</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/07/05/55772.aspx</link><pubDate>Sat, 05 Jul 2008 20:18:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/07/05/55772.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/55772.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/07/05/55772.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/55772.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/55772.aspx</trackback:ping><description>&lt;p&gt;安裝相關套件及建立guest帳號&lt;br /&gt;
  sudo apt-get install vsftpd mysql-server-5.0 libpam-mysql&lt;br /&gt;
  sudo useradd web_edit&lt;/p&gt;
&lt;p&gt;先建立vsftpd這個資料庫，然後建立users這個資料表&lt;br /&gt;
  CREATE TABLE `users` (&lt;br /&gt;
  `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,&lt;br /&gt;
  `username` VARCHAR( 30 ) NOT NULL ,&lt;br /&gt;
  `password` VARCHAR( 50 ) NOT NULL ,&lt;br /&gt;
  UNIQUE (`username`)&lt;br /&gt;
  ) ENGINE = MYISAM ;&lt;/p&gt;
&lt;p&gt;INSERT INTO `users` (`username` ,`password`) VALUES ('user', PASSWORD('pass'));&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;修改/etc/pam.d/vsftpd&lt;br /&gt;
  sudo vi /etc/pam.d/vsftpd&lt;/p&gt;
&lt;p&gt;auth	required pam_mysql.so user=vsftpd passwd=bWrRDD host=localhost db=vsftpd table=users usercolumn=username passwdcolumn=password crypt=2&lt;br /&gt;
  account	required pam_mysql.so user=vsftpd passwd=bWrRDD host=localhost db=vsftpd table=users usercolumn=username passwdcolumn=password crypt=2&lt;/p&gt;
&lt;p&gt;修改/etc/vsftpd.conf&lt;br /&gt;
  sudo vi /etc/vsftpd.conf&lt;br /&gt;
  guest_enable=YES&lt;br /&gt;
  guest_username=web_edit&lt;/p&gt;
&lt;p&gt;sudo /etc/init.d/vsftpd restart&lt;/p&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/55772.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>在Ubuntu 裡安裝 PDT + Xdebug + 決解在8.04的錯誤</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/05/07/54966.aspx</link><pubDate>Wed, 07 May 2008 01:19:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/05/07/54966.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/54966.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/05/07/54966.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/54966.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/54966.aspx</trackback:ping><description>&lt;pre id="line1"&gt;PDT 1.0 + Xdebug in Ubuntu 安裝過程 [討論區 - 程式編輯器]&lt;br&gt;&lt;a href="http://twpug.net/modules/newbb/viewtopic.php?topic_id=2887"&gt;http://twpug.net/modules/newbb/viewtopic.php?topic_id=2887&lt;/a&gt;&lt;br&gt;&lt;/pre&gt;我是照這篇去做的，完成之後會出現一個錯誤訊息如下：&lt;br&gt;Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.&lt;br&gt;&lt;br&gt;解決方法很簡單，手動建立$HOME/.mozilla/eclipse這個目錄即可&lt;br&gt;來源：&lt;a href="https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/188380"&gt;https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/188380&lt;/a&gt;&lt;br&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/54966.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>Excel自動抓取內容的下拉選單</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/28/54916.aspx</link><pubDate>Mon, 28 Apr 2008 23:21:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/28/54916.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/54916.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/28/54916.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/54916.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/54916.aspx</trackback:ping><description>先點選要設定下拉選單的欄位&lt;br&gt;然後 工具列的 資料 =&amp;gt; 資料驗證&lt;br&gt;&lt;br&gt;在 "儲存格內允許" 的下拉選單，選擇 "清單" 這個項目&lt;br&gt;在 "來原" 的文字方塊內輸入資料來源，例如：=$A$1:$A$9 或是指定工作表 &lt;span style="font-size: 12pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;=&lt;b&gt;Sheet2!&lt;/b&gt;$A$1:$A$9&lt;br&gt;最後在copy到其他欄位即可&lt;br&gt;&lt;/span&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/54916.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>SVN檔案庫轉移</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/22/54843.aspx</link><pubDate>Tue, 22 Apr 2008 07:53:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/22/54843.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/54843.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/04/22/54843.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/54843.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/54843.aspx</trackback:ping><description>&lt;p&gt;今天在移機的時候發生了一些小問題&lt;br /&gt;
  其中一個就是svn的檔案庫狀況如下&lt;br /&gt;
  直接copy整個檔案庫的目錄至新伺服器&lt;br /&gt;
  然後dav_svn也設定好了&lt;br /&gt;
  從client可以做checkout、export...&lt;br /&gt;
  但是commit的時候會出現錯誤訊息&lt;br /&gt;
  MKACTIVITY of /svn/!svn/act/...... : Could not read status line: connection was ....&lt;/p&gt;
&lt;p&gt;找了一下資料發現可能是版本的問題&lt;br /&gt;
  網路上有些做法就是改參數重新編譯、去找舊的檔案來蓋掉目前的&lt;br /&gt;
  不過這太麻煩了，而且有些風險存在&lt;/p&gt;
&lt;p&gt;之後我發現了一個比較好的方式來做SVN的轉移&lt;br /&gt;
  就是先做匯出的動作&lt;br /&gt;
  svnadmin dump 檔案庫 &amp;gt; svn_dump&lt;/p&gt;
&lt;p&gt;然後把這個檔案傳到新的伺服器上&lt;br /&gt;
  scp svn_dump user@hostname:path&lt;/p&gt;
&lt;p&gt;在新的伺服器上建立一個新的檔案庫，並匯入&lt;br /&gt;
  svnadmin create 檔案庫&lt;br /&gt;
  svnadmin load 檔案庫 &amp;lt; svn_dump&lt;/p&gt;
&lt;p&gt;呼~搞定下班 ^^&lt;/p&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/54843.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>Yahoo! Domains Discount the first year($1.99/1st)</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/02/19/54356.aspx</link><pubDate>Tue, 19 Feb 2008 23:31:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/02/19/54356.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/54356.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/02/19/54356.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/54356.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/54356.aspx</trackback:ping><description>&lt;P&gt;&lt;SPAN class=price&gt;&lt;STRONG&gt;&lt;FONT size=6&gt;$1.99&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=term&gt;/1st yr&lt;/SPAN&gt;&lt;SPAN class=disclaimernum&gt;&lt;FONT size=1&gt;&lt;SUP&gt;&lt;BR&gt;&lt;/SUP&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=regular&gt;($9.95 / year after)&lt;/SPAN&gt; &lt;BR&gt;&lt;SPAN class=new_customers&gt;(Discount for new customers only)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=new_customers&gt;&lt;A href="http://smallbusiness.yahoo.com/domains/?p=BESTDEAL"&gt;&lt;FONT color=#0000ff&gt;http://smallbusiness.yahoo.com/domains/?p=BESTDEAL&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/54356.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>UTF-8與session_start()</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2008/01/13/54052.aspx</link><pubDate>Sun, 13 Jan 2008 19:24:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2008/01/13/54052.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/54052.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2008/01/13/54052.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/54052.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/54052.aspx</trackback:ping><description>&lt;P&gt;剛剛發生了一件很怪的事&lt;BR&gt;我已經把session_start();放到設定檔的最前面了&lt;BR&gt;甚至是刪到只剩session_start();他還是會發生錯誤&lt;BR&gt;Warning: session_start(): Cannot send session cookie - headers already sent by ......&lt;/P&gt;
&lt;P&gt;之前遇到這個就是把output buffer打開&lt;BR&gt;今天心血來潮找了一下原因~~~~~&lt;BR&gt;原來是UTF-8的BOM搞的鬼&lt;BR&gt;我這個檔案是用Notepad++開的&lt;/P&gt;
&lt;P&gt;解決方式：&lt;BR&gt;再用Nodepad++開啟然後&amp;nbsp;&amp;nbsp; 格式 =&amp;gt; 編譯成 UTF-8 碼〈檔首無 BOM〉=&amp;gt; 存檔&lt;BR&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/54052.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>解決vim中文編碼問題</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/30/53878.aspx</link><pubDate>Sun, 30 Dec 2007 02:19:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/30/53878.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53878.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/30/53878.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53878.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53878.aspx</trackback:ping><description>&lt;P&gt;在vimrc裡面加上&lt;/P&gt;
&lt;P&gt;let &amp;amp;termencoding=&amp;amp;encoding&lt;BR&gt;set fileencodings=utf-8,gbk,ucs-bom,cp936&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53878.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>Ubuntu常用指令與技巧</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53876.aspx</link><pubDate>Sat, 29 Dec 2007 17:02:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53876.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53876.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53876.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53876.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53876.aspx</trackback:ping><description>&lt;P&gt;Ubuntu常用命令與技巧 &lt;BR&gt;sudo apt－get install 軟體名 安裝軟體命令 &lt;BR&gt;sudo nautilus 打開文件（有root權限） &lt;BR&gt;su root 切換到“root”&lt;/P&gt;
&lt;P&gt;ls 列出當前目錄文件（不包括隱含文件） &lt;BR&gt;ls -a 列出當前目錄文件（包括隱含文件） &lt;BR&gt;ls -l 列出當前目錄下文件的詳細資訊&lt;/P&gt;
&lt;P&gt;cd .. 回當前目錄的上一級目錄 &lt;BR&gt;cd - 回上一次所在的目錄 &lt;BR&gt;cd ~ 或 cd 回當前使用者的宿主目錄 &lt;BR&gt;mkdir 目錄名 創建一個目錄 &lt;BR&gt;rmdir 空目錄名 刪除一個空目錄 &lt;BR&gt;rm 文件名 文件名 刪除一個文件或多個文件 &lt;BR&gt;rm -rf 非空目錄名 刪除一個非空目錄下的一切&lt;/P&gt;
&lt;P&gt;mv 路經/文件 /經/文件 移動相對路經下的文件到絕對路經下 &lt;BR&gt;mv 文件名 新名稱 在當前目錄下改名 &lt;BR&gt;find 路經 -name “字符串” 搜尋路經所在範圍內滿足字符串匹配的文件和目錄&lt;/P&gt;
&lt;P&gt;fdisk fdisk -l 查看系統分區資訊 &lt;BR&gt;fdisk fdisk /dev/sdb 為一塊新的SCSI硬碟進行分區 &lt;BR&gt;chown chown root /home 把/home的屬主改成root使用者 &lt;BR&gt;chgrp chgrp root /home 把/home的屬組改成root組&lt;/P&gt;
&lt;P&gt;Useradd 創建一個新的使用者 &lt;BR&gt;Groupadd 組名 創建一個新的組 &lt;BR&gt;Passwd 使用者名 為使用者創建密碼 &lt;BR&gt;Passwd -d使用者名 刪除使用者密碼也能登陸 &lt;BR&gt;Passwd -S使用者名 查詢賬號密碼 &lt;BR&gt;Usermod -l 新使用者名 老使用者名 為使用者改名 &lt;BR&gt;Userdel–r 使用者名 刪除使用者一切&lt;/P&gt;
&lt;P&gt;tar -c 創建包 –x 釋放包 -v 顯示命令過程 –z 代表壓縮包 &lt;BR&gt;tar –cvf benet.tar /home/benet 把/home/benet目錄打包 &lt;BR&gt;tar –zcvf benet.tar.gz /mnt 把目錄打包並壓縮 &lt;BR&gt;tar –zxvf benet.tar.gz 壓縮包的文件解壓恢復 &lt;BR&gt;tar –jxvf benet.tar.bz2 解壓縮&lt;/P&gt;
&lt;P&gt;make 編譯 &lt;BR&gt;make install 安裝編譯好的源碼包 &lt;BR&gt;reboot Init 6 重啟LINUX系統 &lt;BR&gt;Halt Init 0 Shutdown –h now 關閉LINUX系統&lt;/P&gt;
&lt;P&gt;uname -a 查看內核版本 &lt;BR&gt;cat /etc/issue 查看ubuntu版本 &lt;BR&gt;lsusb 查看usb設備 &lt;BR&gt;sudo ethtool eth0 查看網卡狀態 &lt;BR&gt;cat /proc/cpuinfo 查看cpu資訊 &lt;BR&gt;lshw 查看當前硬體資訊 &lt;BR&gt;sudo fdisk -l 查看磁盤資訊 &lt;BR&gt;df -h 查看硬碟剩余空間 &lt;BR&gt;free -m 查看當前的記憶體使用情況 &lt;BR&gt;ps -A 查看當前有哪些進程 &lt;BR&gt;kill 進程號(就是ps -A中的第一列的數字)或者 killall 進程名( 殺死一個進程) &lt;BR&gt;kill -9 進程號 強制殺死一個進程&lt;/P&gt;
&lt;P&gt;常用apt命令：&lt;/P&gt;
&lt;P&gt;apt-cache search package 搜索包 &lt;BR&gt;apt-cache show package 獲取包的相關資訊，如說明、大小、版本等 &lt;BR&gt;sudo apt-get install package 安裝包 &lt;BR&gt;sudo apt-get install package - - reinstall 重新安裝包 &lt;BR&gt;sudo apt-get -f install 修復安裝”-f = –fix-missing” &lt;BR&gt;sudo apt-get remove package 刪除包 &lt;BR&gt;sudo apt-get remove package - - purge 刪除包，包括刪除配置文件等 &lt;BR&gt;sudo apt-get update 更新源 &lt;BR&gt;sudo apt-get upgrade 更新已安裝的包 &lt;BR&gt;sudo apt-get dist-upgrade 昇級系統 &lt;BR&gt;sudo apt-get dselect-upgrade 使用 dselect 昇級 &lt;BR&gt;apt-cache depends package 了解使用依賴 &lt;BR&gt;apt-cache rdepends package 是查看該包被哪些包依賴 &lt;BR&gt;sudo apt-get build-dep package 安裝相關的編譯環境 &lt;BR&gt;apt-get source package 下載該包的源代碼 &lt;BR&gt;sudo apt-get clean &amp;amp;&amp;amp; sudo apt-get autoclean 清理無用的包 &lt;BR&gt;sudo apt-get check 檢查是否有損坏的依賴&lt;/P&gt;
&lt;P&gt;清理所有軟體緩存（即緩存在/var/cache/apt/archives目錄里的deb包 ） &lt;BR&gt;sudo apt-get clean&lt;/P&gt;
&lt;P&gt;刪除系統不再使用的孤立軟體 &lt;BR&gt;sudo apt-get autoremove&lt;/P&gt;
&lt;P&gt;資料來源：&lt;A href="http://www.busfly.cn/post/Ubuntu-cmd.html"&gt;http://www.busfly.cn/post/Ubuntu-cmd.html&lt;/A&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53876.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>Ubnutu 7.10更新後發生的錯誤</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53875.aspx</link><pubDate>Sat, 29 Dec 2007 16:41:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53875.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53875.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53875.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53875.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53875.aspx</trackback:ping><description>&lt;P&gt;在處理時有錯誤發生：&lt;BR&gt;ttf-opensymbol&lt;BR&gt;openoffice.org-core&lt;BR&gt;openoffice.org-common&lt;BR&gt;openoffice.org-style-human&lt;BR&gt;python-uno&lt;BR&gt;openoffice.org-writer&lt;BR&gt;openoffice.org-calc&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&lt;TEXTAREA class=php name=code rows=6 cols=50&gt;#!/bin/bash 
# 
# 修正 Ubuntu 7.04 fc-cache failed to write cache ?? 
#sudo touch /usr/share/fonts 
sudo touch /usr/share/fonts/X11 
sudo touch /usr/share/fonts/X11/100dpi 
sudo touch /usr/share/fonts/X11/75dpi 
sudo touch /usr/share/fonts/X11/Type1 
sudo touch /usr/share/fonts/X11/encodings 
sudo touch /usr/share/fonts/X11/encodings/large 
sudo touch /usr/share/fonts/X11/misc 
sudo touch /usr/share/fonts/X11/util 
sudo touch /usr/share/fonts/truetype 
sudo touch /usr/share/fonts/truetype/arphic 
sudo touch /usr/share/fonts/truetype/baekmuk 
sudo touch /usr/share/fonts/truetype/freefont 
sudo touch /usr/share/fonts/truetype/kochi 
sudo touch /usr/share/fonts/truetype/openoffice 
sudo touch /usr/share/fonts/truetype/thai 
sudo touch /usr/share/fonts/truetype/ttf-arabeyes 
sudo touch /usr/share/fonts/truetype/ttf-bengali-fonts 
sudo touch /usr/share/fonts/truetype/ttf-bitstream-vera 
sudo touch /usr/share/fonts/truetype/ttf-dejavu 
sudo touch /usr/share/fonts/truetype/ttf-devanagari-fonts 
sudo touch /usr/share/fonts/truetype/ttf-gentium 
sudo touch /usr/share/fonts/truetype/ttf-gujarati-fonts 
sudo touch /usr/share/fonts/truetype/ttf-kannada-fonts 
sudo touch /usr/share/fonts/truetype/ttf-lao 
sudo touch /usr/share/fonts/truetype/ttf-malayalam-fonts 
sudo touch /usr/share/fonts/truetype/ttf-mgopen 
sudo touch /usr/share/fonts/truetype/ttf-oriya-fonts 
sudo touch /usr/share/fonts/truetype/ttf-punjabi-fonts 
sudo touch /usr/share/fonts/truetype/ttf-tamil-fonts 
sudo touch /usr/share/fonts/truetype/ttf-telugu-fonts 
sudo touch /usr/share/fonts/type1 
sudo touch /usr/share/fonts/type1/gsfonts 
sudo touch /usr/share/X11/fonts 
sudo touch /usr/share/X11/fonts/100dpi 
sudo touch /usr/share/X11/fonts/75dpi 
sudo touch /usr/share/X11/fonts/Type1 
sudo touch /usr/share/X11/fonts/encodings 
sudo touch /usr/share/X11/fonts/encodings/large 
sudo touch /usr/share/X11/fonts/misc 
sudo touch /usr/share/X11/fonts/util 
sudo touch /usr/local/share/fonts 
sudo touch /var/lib/defoma/fontconfig.d 
sudo touch /var/lib/defoma/fontconfig.d/A 
sudo touch /var/lib/defoma/fontconfig.d/B 
sudo touch /var/lib/defoma/fontconfig.d/C 
sudo touch /var/lib/defoma/fontconfig.d/D 
sudo touch /var/lib/defoma/fontconfig.d/E 
sudo touch /var/lib/defoma/fontconfig.d/F 
sudo touch /var/lib/defoma/fontconfig.d/G 
sudo touch /var/lib/defoma/fontconfig.d/H 
sudo touch /var/lib/defoma/fontconfig.d/J 
sudo touch /var/lib/defoma/fontconfig.d/K 
sudo touch /var/lib/defoma/fontconfig.d/L 
sudo touch /var/lib/defoma/fontconfig.d/M 
sudo touch /var/lib/defoma/fontconfig.d/N 
sudo touch /var/lib/defoma/fontconfig.d/O 
sudo touch /var/lib/defoma/fontconfig.d/P 
sudo touch /var/lib/defoma/fontconfig.d/R 
sudo touch /var/lib/defoma/fontconfig.d/S 
sudo touch /var/lib/defoma/fontconfig.d/T 
sudo touch /var/lib/defoma/fontconfig.d/U 
sudo touch /var/lib/defoma/fontconfig.d/V 
sudo touch /var/lib/defoma/fontconfig.d/a 
sudo touch /var/lib/defoma/fontconfig.d/j 
sudo touch /var/lib/defoma/fontconfig.d/m 
sudo touch /var/lib/defoma/fontconfig.d/u &lt;/TEXTAREA&gt;&lt;/P&gt;
&lt;P&gt;資料來源：&lt;A href="http://www.busfly.cn/post/ubuntu－failed－to－write－cache.html"&gt;http://www.busfly.cn/post/ubuntu－failed－to－write－cache.html&lt;/A&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53875.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>putty上使用UTF-8</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53874.aspx</link><pubDate>Sat, 29 Dec 2007 15:41:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53874.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53874.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/29/53874.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53874.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53874.aspx</trackback:ping><description>&lt;P&gt;在Putty的設定Window =&amp;gt; Translation 裡面 &lt;/P&gt;
&lt;P&gt;有個UserFontEncoding，把這個下拉選單改成UTF-8&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53874.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>在Eclipse上安裝Subclipse(SVN)</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/28/53864.aspx</link><pubDate>Fri, 28 Dec 2007 01:14:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/28/53864.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53864.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/28/53864.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53864.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53864.aspx</trackback:ping><description>&lt;P&gt;Eclipse選單 =&amp;gt; Help =&amp;gt; Software Updates =&amp;gt; Find and Install...&lt;/P&gt;
&lt;P&gt;點選Search for new features to install =&amp;gt; Next &amp;gt;&lt;/P&gt;
&lt;P&gt;按下New Remote Site，並在下列兩個項目擇一新增，然後Next &amp;gt;&lt;/P&gt;
&lt;P&gt;Name: Subclipse 1.2.x (Eclipse 3.2+)&lt;BR&gt;URL:&amp;nbsp; http://subclipse.tigris.org/update_1.2.x&lt;/P&gt;
&lt;P&gt;Name: Subclipse 1.0.x (Eclipse 3.0/3.1)&lt;BR&gt;URL:&amp;nbsp; http://subclipse.tigris.org/update_1.0.x&lt;/P&gt;
&lt;P&gt;勾選Subclipse Plugin，然後Next =&amp;gt; Next =&amp;gt; Finish&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53864.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>CentOS安裝Ruby MySQL Native Lib時發生的錯誤</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53823.aspx</link><pubDate>Mon, 24 Dec 2007 21:00:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53823.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53823.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53823.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53823.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53823.aspx</trackback:ping><description>&lt;P&gt;&lt;FONT size=2&gt;checking for mysql_query() in -lmysqlclient… no&lt;BR&gt;checking for main() in -lm… yes&lt;BR&gt;checking for mysql_query() in -lmysqlclient… no&lt;BR&gt;checking for main() in -lz… yes&lt;BR&gt;checking for mysql_query() in -lmysqlclient… no&lt;BR&gt;checking for main() in -lsocket… no&lt;BR&gt;checking for mysql_query() in -lmysqlclient… no&lt;BR&gt;checking for main() in -lnsl… yes&lt;BR&gt;checking for mysql_query() in -lmysqlclient… no&lt;BR&gt;*** extconf.rb failed ***&lt;BR&gt;Could not create Makefile due to some reason, probably lack of&lt;BR&gt;necessary libraries and/or headers. Check the mkmf.log file for more&lt;BR&gt;details. You may need configuration options.&lt;BR&gt;Provided configuration options:&lt;BR&gt;–with-opt-dir&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;所以得先 remove MySQL 然後再重新安裝 MySQL 跟 MySQL Development Lib&lt;BR&gt;&lt;BR&gt;yum remove mysql&lt;BR&gt;yum install mysql&lt;BR&gt;yum install mysql-devel&lt;BR&gt;&lt;BR&gt;要在 CentOS 安裝 Rails Gem，那就&lt;BR&gt;&lt;BR&gt;gem i rails -y 即可。&lt;BR&gt;&lt;BR&gt;&lt;FONT color=red&gt;gem install mysql -- --with-mysql-include=/usr/include/mysql/mysql --with-mysql-lib=/usr/lib/mysql/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;參考資料：&lt;A href="http://faq.serverdiy.org/read.php?tid=71"&gt;http://faq.serverdiy.org/read.php?tid=71&lt;/A&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53823.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>關閉指定目錄的PHP</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53822.aspx</link><pubDate>Mon, 24 Dec 2007 18:38:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53822.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53822.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53822.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53822.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53822.aspx</trackback:ping><description>&lt;SPAN class=postbody&gt;apache的設定： &lt;BR&gt;&amp;lt;Directory /usr/local/apache/htdocs/upload&amp;gt; &lt;BR&gt;php_flag engine off &lt;BR&gt;#如果是php3換成php3_engine off &lt;BR&gt;&amp;lt;/Directory&amp;gt;&lt;/SPAN&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53822.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>線上更新時間</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53821.aspx</link><pubDate>Mon, 24 Dec 2007 18:33:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53821.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53821.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53821.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53821.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53821.aspx</trackback:ping><description>&lt;P&gt;時間設定&lt;BR&gt;Linux 如果需要做時間校正可以執行下面 shell script :&lt;TEXTAREA class=jscript name=code rows=6 cols=50&gt;#!/bin/sh

timesrv=stdtime.sinica.edu.tw
ntpdate="/usr/sbin/ntpdate"

x=`$ntpdate -o 1 $timesrv 2&amp;gt;&amp;amp;1`
y=`echo $x | grep "Can't adjust the time of day"`
if [ "$y" != "" ] ; then
$ntpdate -b -o 1 $timesrv
$ntpdate -o 1 $timesrv
fi
/sbin/hwclock --systohc&lt;/TEXTAREA&gt;&lt;/P&gt;
&lt;P&gt;如果只是要做一次校正, 則可直接執行:&lt;TEXTAREA class=jscript name=code rows=6 cols=50&gt;/usr/sbin/ntpdate stdtime.sinica.edu.tw&lt;/TEXTAREA&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53821.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>iptables的用法</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53820.aspx</link><pubDate>Mon, 24 Dec 2007 18:30:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53820.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53820.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53820.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53820.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53820.aspx</trackback:ping><description>&lt;P&gt;[root@test root]# iptables [-t filter] [-AI INPUT,OUTPUT,FORWARD]&lt;BR&gt;&amp;gt; [-io interface] [-p tcp,udp,icmp,all] [-s IP/network] [--sport ports]&lt;BR&gt;&amp;gt; [-d IP/network] [--dport ports] -j [ACCEPT,DROP]&lt;BR&gt;參數說明：&lt;BR&gt;-A ：新增加一條規則，該規則增加在最後面，例如原本已經有四條規則，&lt;BR&gt;　　 　使用 -A 就可以加上第五條規則！&lt;BR&gt;-I ：插入一條規則，如果沒有設定規則順序，預設是插入變成第一條規則，&lt;BR&gt;　　 　例如原本有四條規則，使用 -I 則該規則變成第一條，而原本四條變成 2~5&lt;BR&gt;　 INPUT ：規則設定為 filter table 的 INPUT 鏈&lt;BR&gt;　 OUTPUT ：規則設定為 filter table 的 OUTPUT 鏈&lt;BR&gt;　 FORWARD：規則設定為 filter table 的 FORWARD 鏈&lt;BR&gt;　&lt;BR&gt;-i ：設定『封包進入』的網路卡介面&lt;BR&gt;-o ：設定『封包流出』的網路卡介面&lt;BR&gt;　 interface ：網路卡介面，例如 ppp0, eth0, eth1....&lt;BR&gt;　&lt;BR&gt;-p ：請注意，這是小寫呦！封包的協定啦！&lt;BR&gt;　 tcp ：封包為 TCP 協定的封包；&lt;BR&gt;　 upd ：封包為 UDP 協定的封包；&lt;BR&gt;　 icmp ：封包為 ICMP 協定、&lt;BR&gt;　 all ：表示為所有的封包！&lt;BR&gt;　&lt;BR&gt;-s ：來源封包的 IP 或者是 Network ( 網域 )；&lt;BR&gt;--sport：來源封包的 port 號碼，也可以使用 port1:port2 如 21:23&lt;BR&gt;　　　　 同時通過 21,22,23 的意思&lt;BR&gt;-d ：目標主機的 IP 或者是 Network ( 網域 )；&lt;BR&gt;--dport：目標主機的 port 號碼；&lt;BR&gt;　&lt;BR&gt;-j ：動作，可以接底下的動作；&lt;BR&gt;　 ACCEPT ：接受該封包&lt;BR&gt;　 DROP ：丟棄封包&lt;BR&gt;　 LOG ：將該封包的資訊記錄下來 (預設記錄到 /var/log/messages 檔案)&lt;/P&gt;
&lt;P&gt;範例：&lt;BR&gt;　&lt;BR&gt;範例一：所有的來自 lo 這個介面的封包，都予以接受&lt;BR&gt;[root@test root]# iptables -A INPUT -i lo -j ACCEPT&lt;BR&gt;# 注意一下，因為 -d, --dport, -s, --sport 等等參數都沒有設定，這表示：&lt;BR&gt;# 不論封包來自何處或去到哪裡，只要是來自 lo 這個介面，就予以接受！&lt;BR&gt;# 這個觀念挺重要的，就是『沒有設定的規定，則表示該規定完全接受』的意思！&lt;BR&gt;# 例如這個案例當中，關於 -s, -d...等等的參數沒有規定時！&lt;BR&gt;　&lt;BR&gt;範例二：來自 192.168.0.1 這個 IP 的封包都予以接受：&lt;BR&gt;[root@test root]# iptables -A INPUT -i eth0 -p tcp -s 192.168.0.1 -j ACCEPT&lt;BR&gt;# 新增一條規則，只要是來自於 192.168.0.1 的封包，不論他要去哪裡，&lt;BR&gt;# 使用的是那個協定 (port) 主機都會予以接受的意思～&lt;BR&gt;　&lt;BR&gt;範例三：來自 192.168.1.0 這個 C Class 的網域的任何一部電腦，就予以接受！&lt;BR&gt;[root@test root]# iptables -A INPUT -i eth0 -p tcp -s 192.168.1.0/24 -j ACCEPT&lt;BR&gt;# 這個是網域的寫法喔！稍微注意一下的是，在範例二當中我們僅針對一個 IP ，&lt;BR&gt;# 至於這個範例當中，則是針對整個網域來開放吶！而網域的寫法可以是：&lt;BR&gt;# 192.168.1.0/24 也可以是 192.168.1.0/255.255.255.0 都能夠接受喔！&lt;BR&gt;　&lt;BR&gt;範例四：來自 192.168.1.25 的封包都給他丟棄去！&lt;BR&gt;[root@test root]# iptables -A INPUT -i eth0 -p tcp -s 192.168.1.25 -j DROP&lt;BR&gt;　&lt;BR&gt;範例五：只要是想進入本機的 port 21 的封包就給他丟棄&lt;BR&gt;[root@test root]# iptables -A INPUT -i eth0 -p tcp --dport 21 -j DROP&lt;BR&gt;　&lt;BR&gt;範例六：來自 192.168.0.24 這個 IP 的封包，想要到我的 137,138,139 埠口時，都接受&lt;BR&gt;[root@test root]# iptables -A INPUT -i eth0 -p tcp -s 192.168.0.24&lt;BR&gt;&amp;gt; --dport 137:139 -j ACCEPT&lt;BR&gt;　&lt;BR&gt;範例七：只要是接觸到我主機的 port 25 就將該封包記錄 (LOG) 下來&lt;BR&gt;[root@test root]# iptables -A INPUT -p tcp --dport 25 -j LOG&lt;BR&gt;# 還是請特別注意到『規則的順序排列』的問題喔！&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;iptables 的其他相關參數說明：&lt;/P&gt;
&lt;P&gt;[!] --syn ：這個設定僅能用於 -p tcp 的規則中，因為 TCP 封包有 syn 的旗標存&lt;BR&gt;　　在啊！當 TCP 封包存有 syn 旗標，表示這個連線是對方『主動』連過來的！&lt;BR&gt;　　若於 --syn 之前加上 ! 表示該封包不帶有 syn 的意思～(剛好相反之意！)&lt;BR&gt;--icmp-type：可以管制 ICMP 封包的某些類型！還記得我們在 網路基礎 裡面&lt;BR&gt;　　談到的 ICMP 的某些類型吧！對啦！如果您不想要讓對方 ping 到您的機器，&lt;BR&gt;　　就是利用這個項目啦！&lt;BR&gt;　&lt;BR&gt;範例二：別的主機 ping 我們主機時，我們主機不予以回應&lt;BR&gt;[root@test root]# iptables -A INPUT -p icmp --icmp-type 8 -j DROP&lt;BR&gt;# 當您下達這樣的指令後，就表示未來別人對您使用 ping 的時候，&lt;BR&gt;# 我們的主機將不會回應，所以對方主機就會顯示我們主機『無法連接』的狀態！&lt;BR&gt;　&lt;BR&gt;-m ：表示封包的狀態，狀態有底下數種：&lt;BR&gt;　-m mac --mac-source aa:bb:cc:dd:ee:ff&lt;BR&gt;　　　這個就是我們上面提到的可以控制『網路卡卡號, MAC』的設定方法囉！&lt;BR&gt;　　　那個 aa:bb:cc:dd:ee:ff 就是網路卡的 MAC ！&lt;BR&gt;　-m state --state &amp;lt;狀態&amp;gt;&lt;BR&gt;　　　有數種狀態，狀態有：&lt;BR&gt;　　　INVALID：無效的封包，例如資料破損的封包狀態&lt;BR&gt;　　　ESTABLISHED：已經連線成左熙s線狀態；&lt;BR&gt;　　　NEW：想要新建立連線的封包狀態；&lt;BR&gt;　　　RELATED：這個最常用！表示這個封包是與我們主機發送出去的封包有關，&lt;BR&gt;　　　　可能是回應封包或者是連線成奶妨嶊熄e封包！這個狀態很常被設定，&lt;BR&gt;　　　　因為設定了他之後，只要未來由本機發送出去的封包，即使我們沒有設定&lt;BR&gt;　　　　封包的 INPUT 規則，該有關的封包還是可以進入我們主機喔！&lt;BR&gt;　　　　可以簡化相當多的設定規則啦！&lt;BR&gt;　&lt;BR&gt;範例三：讓 bb:cc:dd:aa:ee:ff 網路卡無法使用我們主機的資源&lt;BR&gt;[root@test root]# iptables -A INPUT -p all -m mac --mac-source&lt;BR&gt;&amp;gt; 01:01:01:01:02:01 -j DROP&lt;BR&gt;# 這種方式可以用來管制網路卡卡號喔！就不怕別人使用 IP 搞怪了！&lt;BR&gt;　&lt;BR&gt;範例四：讓已經建立或者是與我們主機有關的回應封包通過，但是讓不合法的，&lt;BR&gt;　　　　以及想要嘗試新建立的封包被抵擋在外！&lt;BR&gt;[root@test root]# iptables -A INPUT -p tcp -m state&lt;BR&gt;&amp;gt; --state ESTABLISHED,RELATED -j ACCEPT&lt;BR&gt;[root@test root]# iptables -A INPUT -p tcp -m state&lt;BR&gt;&amp;gt; --state INVALID,NEW -j DROP&lt;BR&gt;# 需要設定兩條喔！至於封包狀態則可以使用逗號隔開！逗號兩邊不要有空格&lt;BR&gt;　&lt;BR&gt;-j &amp;lt;動作&amp;gt;：除了比較常見的 ACCEPT 與 DROP 之外，還有哪些動作？&lt;BR&gt;　REDIRECT --to-ports &amp;lt;port number&amp;gt;&lt;BR&gt;　　　這個也挺常見的，基本上，就是進行本機上面 port 的轉換就是了！&lt;BR&gt;　　　不過，特別留意的是，這個動作僅能夠在 nat table 的 PREROUTING 以及&lt;BR&gt;　　　OUTPUT 鏈上面實行而已喔！(關於連線流程，請參考圖八)&lt;BR&gt;　MASQUERADE：封包偽裝&lt;BR&gt;　　　這個就是 NAT 主機最重要的一個機制啦！進行封包的偽裝！&lt;BR&gt;　&lt;BR&gt;範例五：將要求與 80 連線的封包轉遞到 8080 這個 port&lt;BR&gt;[root@test root]# iptables -t nat -A PREROUTING -p tcp --dport 80&lt;BR&gt;&amp;gt; -j REDIRECT --to-ports 8080&lt;BR&gt;# 這玩意最容易在您使用了非正規的 port 來進行某些 well known 的協定，&lt;BR&gt;# 例如使用 8080 這個 port 來啟動 WWW ，但是別人都以 port 80 來連線，&lt;BR&gt;# 所以，您就可以使用上面的方式來將對方對您主機的連線傳遞到 8080 囉！&lt;BR&gt;　&lt;BR&gt;範例六：進行封包的偽裝，將來自 192.168.0.0/24 的封包的來源 IP 偽裝成為&lt;BR&gt;　　　　本機的 ppp0 那個介面的 IP&lt;BR&gt;[root@test root]# iptables -t nat -A POSTROUTING -s 192.168.0.0/24&lt;BR&gt;&amp;gt; -o ppp0 -j MASQUERADE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;紀錄與回復防火牆規則&lt;BR&gt;[root@test root]# iptables-save &amp;gt; filename&lt;BR&gt;# 將目前的防火牆機制儲存成 filename 那個檔案！該檔案為 ASCII 格式，&lt;BR&gt;# 您可以進入查黎@下喔！&lt;BR&gt;[root@test root]# iptables-restore &amp;lt; filename&lt;BR&gt;# 將 filename 那個防火牆檔案 (注意！並不是 shell scripts 的格式) 的規則&lt;BR&gt;# 讀入目前的 Linux 主機環境中！&lt;/P&gt;
&lt;P&gt;文章來源：&lt;A href="http://linux.vbird.org/"&gt;鳥哥的 Linux 私房菜&lt;/A&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53820.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>MySQL的 root 忘記密碼</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53819.aspx</link><pubDate>Mon, 24 Dec 2007 18:28:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53819.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53819.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53819.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53819.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53819.aspx</trackback:ping><description>&lt;P&gt;/etc/rc.d/init.d/mysqld stop&lt;/P&gt;
&lt;P&gt;/usr/bin/safe_mysqld --skip-grant-tables &amp;amp;&lt;/P&gt;
&lt;P&gt;mysql -u root -p mysql&lt;/P&gt;
&lt;P&gt;update user set password=password("新密碼") where user="root" and host="localhost";&lt;/P&gt;
&lt;P&gt;flush privileges;&lt;/P&gt;
&lt;P&gt;quit&lt;/P&gt;
&lt;P&gt;/etc/rc.d/init.d/mysqld stop&lt;/P&gt;
&lt;P&gt;/etc/rc.d/init.d/mysqld start&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53819.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>指定帳號從特定ip才能連線 by pam</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53818.aspx</link><pubDate>Mon, 24 Dec 2007 18:26:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53818.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53818.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53818.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53818.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53818.aspx</trackback:ping><description>&lt;P&gt;在 /etc/pam.d/system-auth 加入&lt;BR&gt;account required /lib/security/pam_access.so&lt;/P&gt;
&lt;P&gt;在 /etc/security/access.conf 加入&lt;BR&gt;-:帳號1 帳號2:ALL EXCEPT ip1 ip2&lt;/P&gt;
&lt;P&gt;參考來源：&lt;A href="http://www.adj.idv.tw/server/linux_pam.php"&gt;http://www.adj.idv.tw/server/linux_pam.php&lt;/A&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53818.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>用php下載指定檔案並重新命名(另存新檔)</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53816.aspx</link><pubDate>Mon, 24 Dec 2007 18:16:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53816.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53816.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53816.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53816.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53816.aspx</trackback:ping><description>&lt;P&gt;&lt;SPAN class=postbody&gt;上傳的程式碼(放在表單後的JavaScript)：&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;TEXTAREA class=jscript name=code rows=6 cols=50&gt;&amp;lt;script language="javascript"&amp;gt;
function validate()
{
  // 切割檔案路徑
  var Ary = document.getElementById('file').value.split('\\');
 
  // 建立隱藏標籤
  var hideTag = document.createElement("input");
  hideTag.setAttribute('name', 'filename');
  hideTag.setAttribute('type', 'hidden');
  document.getElementById('form1').appendChild(hideTag);
 
  // 置入檔名到隱藏標籤
  hideTag.value=Ary[Ary.length-1];
 
  return true;
}
document.getElementById('form1').onsubmit = function() { return validate(); };
&amp;lt;/script&amp;gt; &lt;/TEXTAREA&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=postbody&gt;&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;上傳的程式碼(接收上傳檔案的PHP)：&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&amp;nbsp;&lt;TEXTAREA class=php name=code rows=6 cols=50&gt;&amp;lt;?php
function ch_filename($name)
{
   $arr = explode('.', $name);
   $arr[0] = (rand()%100).substr(md5($arr[0]), 0, 28);
   return join('.', $arr);
}

if($_FILES['file']['size'] &amp;gt; 0)
{
   $filename = ch_filename($_POST['filename']);
   move_uploaded_file($_FILES['file']['tmp_name'],'upload/'.$filename);
   
   // 新增資料到資料庫(filepath|filename)
   $db-&amp;gt;query("UPDATE `news` SET `file` = '".$_POST['filename']."|upload/".$filename."';");
}
?&amp;gt;&lt;/TEXTAREA&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;下載的超連結：&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;TEXTAREA class=xml name=code rows=6 cols=50&gt;&amp;lt;a href="get_file.php?path=&amp;lt;?=$filepath?&amp;gt;&amp;amp;filename=&amp;lt;?=urlencode($filename)?&amp;gt;"&amp;gt;&amp;lt;?=$filename?&amp;gt;&amp;lt;/a&amp;gt;&lt;/TEXTAREA&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&amp;nbsp;get_file.php 程式碼： &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;SPAN class=postbody&gt;&lt;TEXTAREA class=php name=code rows=6 cols=50&gt;&amp;lt;?php
if(empty($_GET['path']) || empty($_GET['filename']))
{
   echo '非正常路途徑進入本頁或參數錯誤';
   exit();
}

if(file_exists($_GET['path']))
{
   $FILEname = urlencode($_GET['filename']);
   
   if(ini_get('zlib.output_compression'))
      ini_set('zlib.output_compression', 'Off');
   
   header("Content-Type: application/octetstream; name=$FILEname"); //for IE &amp;amp; Opera
   
   header("Content-Type: application/octet-stream; name=$FILEname"); //for the rest
   
   header("Content-Disposition: attachment; filename=$FILEname;");
   
   header("Content-Transfer-Encoding: binary");
   header("Cache-Control: cache, must-revalidate");
   header("Pragma: public");
   header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
   header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
   
   readfile($_GET['path']);
}
else
   echo '檔案不存在';
?&amp;gt;&lt;/TEXTAREA&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53816.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Aery</dc:creator><title>用PHP正則表達式清除字符串的空白</title><link>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53813.aspx</link><pubDate>Mon, 24 Dec 2007 18:09:00 GMT</pubDate><guid>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53813.aspx</guid><wfw:comment>http://blog.blueshop.com.tw/guancheng713/comments/53813.aspx</wfw:comment><comments>http://blog.blueshop.com.tw/guancheng713/archive/2007/12/24/53813.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.blueshop.com.tw/guancheng713/comments/commentRss/53813.aspx</wfw:commentRss><trackback:ping>http://blog.blueshop.com.tw/guancheng713/services/trackbacks/53813.aspx</trackback:ping><description>&lt;P&gt;&lt;TEXTAREA class=php name=code rows=6 cols=50&gt;&amp;lt;?php
$str = " This line contains\tliberal \r\n use of whitespace.\n\n";

// First remove the leading/trailing whitespace
//去掉開始和結束的空白
$str = trim($str);

// Now remove any doubled-up whitespace
//去掉跟隨別的擠在一塊的空白
$str = preg_replace('/\s(?=\s)/', '', $str);

// Finally, replace any non-space whitespace, with a space
//最後，去掉非space 的空白，用一個空格代替
$str = preg_replace('/[\n\r\t]/', ' ', $str);

// Echo out: 'This line contains liberal use of whitespace.'
echo "&amp;lt;pre&amp;gt;{$str}&amp;lt;/pre&amp;gt;";
?&amp;gt;
&lt;/TEXTAREA&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=postbody&gt;&amp;nbsp;參考來源：&lt;a href="http://xwarez.com.ru/html/3/33/PHPgengbingaicai.html"&gt;http://xwarez.com.ru/html/3/33/PHPgengbingaicai.html&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src ="http://blog.blueshop.com.tw/guancheng713/aggbug/53813.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>
