Install Xcache to accelerate for PHP

In addition to eAccelerator I found a tool that can accelerate for the PHP. However the person who use it less apparently.

Install it also easily. But you must install php-devel befor. Because we will use phpize later.

The suggestion of the official website, if you use php 4 and you want to use 1.03 edition as follows;You use php5 above and you better went to use 1.20-rc1 edition

1.03(stable):http://210.51.190.228/pub/XCache/Releases/xcache-1.0.3.tar.gz

1.20-rc1(newest):http://210.51.190.228/pub/XCache/rc/1.2.0-rc1/xcache-1.2.0-rc1.tar.gz

#cd /usr/local/src

#wget http://210.51.190.228/pub/XCache/rc/1.2.0-rc1/xcache-1.2.0-rc1.tar.gz

#tar zxvf xcache-1.2.0-rc1.tar.gz

#cd xcache

#phpize // use phpize to create configure file.

#./configure --enable-xcache --enable...

#make

#make install

#cat xcache.ini >> /etc/php.ini

#$EDITOR /etc/php.ini //alter xcache settings to what you want and don't forget
to restart your web server.

Xcache also has Web UI:

Copy the directory "admin" to you web root. Maybe you create a directory for Xcache's admin.

#mkdir /your/webroot/xcachexcache

#cp -R admin/ /your/webroot/xcache/

# $EDITOR /etc/php.in

Alter the username and password to what you want.

[xcache.admin]
xcache.admin.user = "admin"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = ""

--------------------------------------------------------------------------------
You can use php page to create your password md5 code.


---------------------------------------------------------------------------------

Reatart you web server and connect your Xcache admin URL. ^^


除了eAccelerator之外,我又發現一套可以為php加速的工具,但是似乎欲的人比較少了些。

這套名字叫做Xcache安裝也是同樣簡單,只是前提是要先安裝php-devel,因為後面會用到phpize這個指令。

依據官方網站的建議,如果是php4以下的要用1.03版本,php5以上請使用1.20-rc1的版本

1.03版(stable):http://210.51.190.228/pub/XCache/Releases/xcache-1.0.3.tar.gz

1.20-rc1版(newest):http://210.51.190.228/pub/XCache/rc/1.2.0-rc1/xcache-1.2.0-rc1.tar.gz

#cd /usr/local/src

#wget http://210.51.190.228/pub/XCache/rc/1.2.0-rc1/xcache-1.2.0-rc1.tar.gz

#tar zxvf xcache-1.2.0-rc1.tar.gz

#cd xcache

#phpize // 使用 phpize 產生configure檔。

#./configure --enable-xcache --enable...

#make

#make install

#cat xcache.ini >> /etc/php.ini

#$EDITOR /etc/php.ini
//修改php.ini的Xcache設定,隨自己的狀況修改;別忘修改之後要重新啟動網頁伺服器。

Xcache 也有網頁控制介面:

把Xcache裡的admin這整個資料夾複製到你的網頁根目錄裡面,也許你會新增一個資料夾來放置。

#mkdir /your/webroot/xcache

#cp -R admin/ /your/webroot/xcache/

# $EDITOR /etc/php.in //修改php.ini裡的xcache的帳號密碼,密碼要填上MD5碼。

[xcache.admin]
xcache.admin.user = "admin"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = ""

--------------------------------------------------------------------------------
你可以用PHP的工具來產生md5碼


---------------------------------------------------------------------------------

重新啟動網頁伺服器,然後連上你的Xcache admin的URL。收工!輕輕鬆鬆!^^

Install eAccelerator ( to accelerate for PHP )

One day I went to library and use the Internet. When connect to my website and found the reaction speed of the web page was slow and I probably waited for five seconds for loading completely. I thinks that if a foreign person to connect to my website and it must be more slow! Hence I want to accelerate my httpd and I found the eAccelerator. eAccelerator's installion and configure is very simple. I used the rpm method:( Tarball method can be found at nternet. So, I no longer illustrate with example. )

RPM:

Download rpm package from mysite ( FC6/httpd-2.3.3-5/PHP-5.1.6) or search from internet.

#wget http://acmevil.taes.tp.edu.tw/drupal/files/php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

#rpm -Uvh php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

Install done.

Configure: /etc/php.d/eaccelerator.ini

zend_extension="/usr/lib/php/modules/eaccelerator.so"
eaccelerator.shm_size = "16"
eaccelerator.cache_dir = "/var/cache/php-eaccelerator" eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.name_space = ""
eaccelerator.check_mtime = "1"
eaccelerator.filter = ""
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only = "0"
eaccelerator.compress = "1"
eaccelerator.compress_level = "9"
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.allowed_admin_path = ""

Save it. Restart your httpd.

P.S: If you don't have /etc/php.d/eaccelerator.ini and you must add one.

eAccelerator also has web UI:

#cp /usr/share/doc/php-eaccelerator-5.1.6_0.9.5/*.php /your/web/root/eaccelerator

#$editor //your/web/root/eaccelerator/control.phpeaccelerator

Alter the usrname and password

/** config **/

$user = "admin";

$pw = "eAccelerator";

/** /config **/

Then connect http://ypur.domainname.com/eaccelerator/control.php


有一天我到圖書館上網。連到我的網站的時候,發現網頁的反應速度慢了一點,我大概等了五秒才全部開好。裡想,那如果是國外的人連到我的網站不就更慢了!於是就找到了eAccelerator。
eAccelerator的安裝非常簡單,尤其是用RPM這個方法:( Tarball 的方法在網路上容易找到,我就不再舉例說明。 )

RPM:

我的網站 ( FC6/httpd-2.3.3-5/PHP-5.1.6)下載rpm套件或從網路上搜尋適合您的版本。

#wget http://acmevil.taes.tp.edu.tw/drupal/files/php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

#rpm -Uvh php-eaccelerator-5.1.6_0.9.5-1.fc6.i386.rpm

安裝完了!別懷疑,就這麼簡單!

設定 eaccelerator的設定檔: /etc/php.d/eaccelerator.ini (如果沒有php.d這個資料夾,就把設定檔加在php.ini裡或是新建一個資料夾來符合路徑位置。)

zend_extension="/usr/lib/php/modules/eaccelerator.so"
eaccelerator.shm_size = "16"
eaccelerator.cache_dir = "/var/cache/php-eaccelerator" eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.name_space = ""
eaccelerator.check_mtime = "1"
eaccelerator.filter = ""
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only = "0"
eaccelerator.compress = "1"
eaccelerator.compress_level = "9"
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.allowed_admin_path = ""

存檔、重新啟動httpd(網頁伺服器)

收工、喝茶去~~~

等等,eAccelerator還有網頁介面的控制,你可以:

#cp /usr/share/doc/php-eaccelerator-5.1.6_0.9.5/*.php /your/web/root/eaccelerator

把php-eaccelerator的doc裡的所有*.php複製到網頁根目錄

#$editor //your/web/root/eaccelerator/control.php

修改control.php裡的帳號跟密碼

/** config **/

$user = "admin";

$pw = "eAccelerator";

/** /config **/

最後連上你control.php的URL就可以了!

喝茶去吧~~~ ^^

Reslove the Header and Footer graphics of foliage theme not be found解決佈景Foliage頭尾無法顯示圖片

Changed Foliage this theme several days ago, but discovered the Header and Footer graphics not found. Resolve this problem when tried to modify foliage theme yesterday

I found a easy way to resolve this problem. I modified two among those lines in the themes/foliage/style.css

Original

}
#header {
background-color: #8c3;
background-image: url('themes/foliage/head960.jpg');
height: 100%;
border: 1px solid #ccc;
....

}
#footer {
background-color: #8c3;
background-image: url('themes/foliage/foot960.jpg');
height: 30px;
border: 1px solid #ccc

Later

}
#header {
background-color: #8c3;
background-image: url('head960.jpg');
height: 100%;
border: 1px solid #ccc;
....

}
#footer {
background-color: #8c3;
background-image: url('foot960.jpg');
height: 30px;
border: 1px solid #ccc;

Finally, save it and reload your indrx and then the header and footer graphics will be found. ^^


幾天前換了Foliage這個佈景,卻發現Header 和 Footer 的圖片無法顯示。直到昨天嘗試去修改佈景的時候才解決了這個問題。

原來這個Bug很容易修正,只要修改foliage裡的style.css就可以了,修改的地方如下: themes/foliage/style.css


#header {
background-color: #8c3;
background-image: url('themes/foliage/head960.jpg');

修改這一行變成:

background-image: url('head960.jpg');
................................

}
#footer {
background-color: #8c3;
background-image: url('themes/foliage/foot960.jpg');

修改這一行變為:

background-image: url('foot960.jpg');

之後,存檔、收工。回到首頁重新整理試試看. ^^

The years urges a person old.歲月催人老

Yesterday at the time of teaching the kids how to do web pages. A little boy raised hand to ask question and when I walked to his backed. I found suddenly his eyes good brightness in astonishment and think of my eyes of the past was also such. Just be blighted through years now and having already can't used the look in the eyes to attract other people and only will frightened the other people ...... 昨天在教小朋友做頁的時候,一個小男孩舉手發問,我走到他的後面時,我突然發現他的眼睛好明亮。我愣了一下,後來想到我以前的眼神也是如此的。只是現在經 過歲月的摧殘,已經不能用眼神吸引別人了,只會把別人給嚇跑....

Create Google SiteMap for Free

http://www.sitemapdoc.com/Default.aspx

This website can support us to create google sitemap for free.

And I also use it to test the URLs of my site that whether have the link mistake or not. ^^




http://www.sitemapdoc.com/Default.aspx

這個網站可以免費製作google sitemap,我也用它來測試我的URL是否有錯誤或找不到目標的情形!^^

Installs LifeType for Students架設LifeType(Resolve Big5 Code)

Why would choose LifeType? Because it is the multiple blog and is matching our demand. However I detect that use the Big5 will produce disorderly yard after install version lifetype-1.1.2 disorderly code. Use the Libiconv for Linux and Convertz for Windows all can't resolve my problem. Hence I used the most stupid method to install LifeType:

If you have the big5 code problem. Skip the first five steps and Start from the sixth step.

Step 1:

Download the version lifetype-1.06 . Because this version can support Big5 code.

http://prdownloads.sourceforge.net/lifetype/lifetype-1.0.6.tar.gz?download

#tar zxvf lifetype-1.0.6.tar.gz

#mv lifetype-1.0.6 blog

//Rename : lifetype-1.0.6 become blog

#chmod 777 blog/config/config.properties.php

//Let config.properties.php be rewritable.

Step 2:

Create a database user for this lifetype

Step 3:

Open your browser and connect

http://your.domainname.com/blog/wizard.php

Step 4:

Next by next...

Step5:

#rm -rf blog/wizard.php

Now, LifeType-1.0.6 is done. But I want to upgrade to version lifetype-1.1.2

Step6:

Backup the file blog/config/config.properties.php and move it to other directory.

Delete all of the blog directory.

#rm -rf blog/*

//Delete all files(config.properties.php excepted)

Step7:

Download LifeType-1.1.2 from

http://prdownloads.sourceforge.net/lifetype/lifetype-1.1.2.tar.gz

and command

#tar zxvf lifetype-1.1.2.tar.gz

#mv lifetype-devel-20061112/* blog/

And then cover blog/config/config.properties.php with the bcakup file

config.properties.php

#mv config.properties.php blog/cinfig/config.properties.php

mv: Cover blog/cinfig/config.properties.php or not? y

Step 8:

Connect http://your.domainname.com/blog/wizard.php again

and next by next. It will upgrade automaticly.

Step 9:

#rm -rf blog/wizard.php

Well done. ^^


為什麼會選擇LifeType呢?因為他是多人使用的blog,正合需要。不過在安裝lifetype-1.1.2版的之後卻發現,使用Big5會產生亂 碼,使用Linux上的Libiconv及Windows上的Convertz均解決不了我的問題。於是用了最笨的方法來安裝LifeType:

首先先安裝有支援Big5的版本,現在我知道的就是lifttype-1.0.6版的,再升級到最新版的(目前是lifetype-1.1.2版)

步驟1:

下載支援Big5的lifetype-1.06 .http://prdownloads.sourceforge.net/lifetype/lifetype-1.0.6.tar.gz?download

然後解壓縮

#tar zxvf lifetype-1.0.6.tar.gz

#mv lifetype-1.0.6 blog

//重新命名為blog(資料夾名稱隨便自己設置)

#chmod 777 blog/config/config.properties.php

//把 config.properties.php設為可讀寫,安裝時資料會寫入此一檔案。

步驟 2:

新增一個給LifeType的資料庫使用者

步驟 3:

打開瀏覽器在網址列填上您的LifeType的網址,後面加上/wizard.php,像這樣

http://your.domainname.com/blogsite/wizard.php

步驟 4:

依序填完資料然後Next by next...

步驟 5:

#rm -rf blog/wizard.php

//移除安裝精靈wizard.php

現在1.0.6版的已經裝好了. 但是現再要一次升級到 lifetype-1.1.2

步驟 6:

備份檔案 blog/config/config.properties.php然後移到別的資料夾去。

接著,刪除所有檔案,只留下config.properties.php

#rm -rf blog/*

//刪除所有檔案(config.properties.php除外)

步驟 7:

下載 LifeType-1.1.2

http://prdownloads.sourceforge.net/lifetype/lifetype-1.1.2.tar.gz

接著

#tar zxvf lifetype-1.1.2.tar.gz

#mv lifetype-devel-20061112/* blog/

//把解壓縮後, lifetype-1.1.2裡的所有檔案移到blog底下

用備份起來的config.properties.php 去覆蓋現在的config.properties.php

#mv config.properties.php blog/cinfig/config.properties.php

mv: 是否覆蓋 blog/cinfig/config.properties.php or not? y

步驟 8:

再次連上 http://your.domainname.com/blog/wizard.php

這時候安裝精靈就會依不依不當您升級了。

步驟 9:

移除wizard.php

#rm -rf blog/wizard.php

結束 ^^

< When Things Start to Think:當鞋子開始思考> by Neil Gershenfeld---second half part | Until The Twelve of Never

Followed a friend before at the time of going shopping or chatting or having a meal, I had ever wanted to go to some ideas: Walk on the street of the hot summer and by this time if our clothes are a temperatures to regulate and the power comes from us to take a stroll. This clothes can let our body keep in the steady temperature and humidity. This clothes looks the same with general clothes ---perhaps we can make it bright and dazzling more. "Wear Computer" also is the automatic record and analyzes our physiology condition and does the best reaction. Past is the big one computer and the most people can not afford to buy. Afterwards is that everyones can buy desktop computer. And then is the notebook, PDA .......the end is? Perhaps we are to wear computer when go out.

There is a words in our Chinese say:"The knowledge of book hates few when goes to use ". In addition to encouraging a person to study much and it also point out the weakness of books at the right moment--- it can't be token the knowledge for wanting immediately. Because no one would everyday bring a heap of book when goes out and in order to prevent that have it maybe to use, and you don.t know whether use them or not? The e-book may correct this weakness and perhaps we only need to bring "one page" to go out and can renew the book's content, translate book's categorical data at any time, search date of library,that's all only at this one page. But, we lost much fun in the meantime and also get many "restrictions". In regard to the electronics paper, it has no way to be read under any light and the angle.(in dark, no one can be read) I want at the time of reading from sit to change lie, in addition to adjusting body, we have to also adjust the light and the angle. the traditional paper book doesn't have those problems; The electronics paper is to need to be maintained and be charged but the traditional paper book doesn't need at all. Traditional book can also be marked and commented; Another, the traditional paper book can be bumped and pressed and even you can use to be a pillow and use to be padded high to take some thing and press the instant noodles cover....... Can the electronics paper attain these? Perhaps it can be done but you will not do so. The electronics paper and traditional book are each to have merits and shortcomings, how do you chose? Or choose the third kind thing that has the merits of them ?!

"Print" is much experience that the persons all had: The decision wants to print of data--> print on the paper--> take to use. But, it is still a piece of paper finally. If "print out" to be like playing Lego? If we can become all blocks of Lego to be micro-computers and use each blocks that has different characteristic to assemble the articles that we want. Let it be activity, test right away. Even print out the article that in the computer, belong to personal realistic thing of manufacturing. So, the margin of the things in the computer and the reality almost nonexistent.
Imaginably, evolving of digital science and technology aroused the development of the worlds and this world would be more and more interesting!



以前跟朋友在逛街或聊天或吃飯的時候,我曾經想過到一些ideas。走在炎熱夏天的街道上,這時候如果我們的衣服本身就是一台溫度調節,電力來自於我們的 走動,這件衣服可以隨著我們的設定而讓我們的身體保持在一定的溫度與溼度,這件衣服看起來就跟一般的衣服沒兩樣--也許我們可以做得更炫。"穿在身上的電 "也是如此,自動記錄並分析我們的生理狀況並做出反應調節。以前是大到大多數人買不起的電腦,後來是人人都買得起的桌上型電腦,再來是筆記型電腦、 PDA.......最後?也許我們是穿著電腦出門的。

我們中國有一句話說:「書到用時方恨少」。除了勉勵人要多讀書之外,它也剛好指出書籍的缺點---不能即時吸取到想要的知識,因為沒有人會每天把一大堆書出門以防備不時之需,而且你還不確定是不是用得到?電子書就可能改正這個缺點,也許我們只需帶著"一頁"出門,隨時可以更新書籍的內容、變換書籍的類 別、搜尋圖書館的資料,都只在一頁薄薄的""。但,在這同時我們失去了許多的樂趣,也得到許多的"限制":就電子紙來說,它並沒有辦法在任何燈光及角度 下閱讀(黑暗全部都不行)。在閱讀的時候我想要從坐著換成躺著,除了調整身體之外,我們也得調整光線及光入射的角度。傳統的紙張書籍根本不用這麼麻煩的閱 讀;電子紙張是需要保養及充電的,傳統指張一點都不需要,還可以在上面做記號、眉批;還有一點,傳統紙張書籍耐撞耐壓,你可以用來當枕頭、用來墊高取物、 壓泡麵蓋......,電子紙張可以做到這些嗎?也許可以,但是你不會這樣做。電子紙張與傳統書籍各有優缺點,你會怎麼選呢?還是會出現兩個優點兼備的第 三樣東西?!

"列印"是許多人都有過的經驗:決定要印的資料-->印在紙上-->拿去用。但是,它 終究還是一 張紙。如果"列印"像在玩樂高積木呢?如果我 們可以把每一塊樂高積木都變成微電腦,利用每一塊積木的不同特性來組裝我們想要的物件,裝好馬上就可以讓它活動、測試。甚至列印在電腦裡的物件,屬於個人 製造的現實東西。那麼,電腦裡的東西與現實的差距就幾乎不存在了。
可想而知,數位科技的演化帶動了世界的發展,這個世界將會越來越有趣!

The website of the free translation / 免費翻譯的網站 / 無料で翻訳するのウェブサイト/免费翻译的网站 | Until The Twelve of Never

http://www.mytrans.com.tw/Eng/trantrial/freedict.aspx?w=

This website can translate English into the Chinese BG5 or Japanese and Chinese GB, but have the word number restriction. But, I don't understand Japanese. So, when following their online chat what can I only type Japanese but don't understand them to say?


このウェブサイトは日本語を中国の話 (繁体字 ) 、英語及び中国の話 (簡体字 ) に翻訳することが出来るが、字数の制限があります。もっと多いサービスを使用するのは支払う、しかしチャットから言うと、十分だよ!^^





這個網站可以把正體字翻譯成英文或日語及簡體字,但是有字數限制。因為我看不懂日文,所以當跟他們在線上聊天的時候我只能打日文卻看不懂他們說什麼?只是,可以把他的語言翻譯成你的語言然後丟訊息給你,你也可以翻譯成他的語言來跟他聊天。哈!^^




这个网站可以把简体字翻译成繁体字或日语及英语,但是有字数限制。因为我看不懂日文,所以当跟他们在线上聊天的时候我只能打日文却看不懂他们说什么?只是,可以把他的语言翻译成你的语言然后丢信息给你,你也可以翻译成他的语言来跟他聊天。哈!^^

< When Things Start to Think:當鞋子開始思考> by Neil Gershenfeld---first half part | Until The Twelve of Never

When meander along in the library and want

to find a book to read. I come in sight of this

words, hence take it to go to the library

counter then passed my library card......

"When things start to think" I think the

meanings of this words be: The thing

knows how to learn, record, analysis and

does appropriate of reaction. That means the thing that we

make starts having AI. The trend that manufactures computers

now is also a trait of this aspect develop. For example the

computer now has already canned control the whole software &

hardware equipments with all family. At you are just preparing to

go home,computer is already dealing with food for you and

opening air conditioner and even preparing hot water lets you

take a shower; Return to your house, the light turned on

automatically and you will find that publish the latest message

newspaper to have already prepared. The coffee that is by the

side of the newspaper still reek continuously; The computer would

even analyze your motion of now to decide to broadcast music

and adjust indoor temperature, humidity, let you be placed in

comfortably. Above, included the AI of science and technology

application and even is already the "personalization".

This book has several to let me more interested in subject matter.

For instance

"Smart shoes", it can record various physiology and mental state

of wearing reaction to adjust to wear current environment condition.

When two people meet, it can also tell the shoes of the other party

now his host's mood or physiology reaction and then the shoes of

the other party can also appropriate judgment current condition

form and tell host the reaction that should adopt or avoid which

actions of occurrence;

"Electronic books" is the function that can repeat an usage,

download, automatic renewal content and can print out an etc.

Laying aside book to use the electronic books or continuing study

a book?

"Go world" - wear in the computer of the body, the computer

should fit an user and not the user wants to continue to match with it;

"Smart things": When we bring more intelligent science and

technology to the crowd. The computer can disappear from the

world finally;

"The 3D printer": It can printout the things that saw on the computer

just and isn't the part that threw away raw material. But it was like

Lego similar to add raw material.




"如果鞋子電腦開始被視為一項好主意;
如果大家開始認為,人與東西都理所應當具有相關的權利;
如果電腦消失,整個世界都成了我們的介面----那們我就成功了。"

當在圖書館閒逛,想找本書來讀的時候,我看到了這一段話,於是就拿著它走向

圖書館櫃檯,遞出了我的圖書借閱證......

"When things start to think" 我想這句話的意思是:事物懂得學習、紀錄、

分析並做出適當的反應,也就是說我們所製造的東西開始有AI。現在製作電腦的

趨勢也是傾向於這一方面的發展。例如現在的電腦已經能夠控制整個家庭所有的

軟硬體設備,在您正準備回家的時候,腦已經在幫你料理食物、打開冷氣、甚至

準備放熱水讓您洗澡;回到家一開門,燈光自動開啟,你會發現刊著最新訊息報紙

已經準備好了,報紙旁邊的咖啡還冒著縷縷的白煙;電腦更會分析你現在的情緒來

決定播放的音樂,調整室內的氣溫、溼度,讓你都處在舒服的狀態之.....。以上,

就包含了科技應用的AI,甚至於已經是"個人化"的表現了。

這本書有幾個讓我比較感興趣的主題。譬如說"會思考的鞋子",它能紀錄穿戴

者的各項生理及心理反應來調適穿戴者目前的環境狀況,當人相遇時,它還能告

訴對方的鞋子現在他的主人的心情或生理反應,然後對方的鞋子也能適當的判斷

目前的況狀而告訴主人該採取的反應或避免哪些舉動的發生;

"電子書籍"則是可以重複使用、下載、自動更新內容、可列印等等的功能,拋開

書本用電子書籍或是繼續閱讀傳統書籍呢?

"行遍天下"---穿在身上的電腦,電腦應該要迎向使用者,而不是使用者要繼續

配合它;

"會思考的東西",當我們把更聰明的科技帶進人群時,電腦終於可以消失無蹤

了;

"3D列印機",可以印出來剛剛在電腦上看到的東西,不是把原料去掉不要的部

份,而是像樂高積木一樣把原料加進去。

The Meaning of The Life

The meaning of the life isn't lie in living of length, lie in whether lead splendid.


生命的意義不在於是否活的長短,在於是否過得精采!

Robots.txt

Found an interesting thing:Robots.txt .After research, originally it is a tool that prevents robot to record some web pages or data from website. Avoid the web pages to be exposed and be searched by the internet user. For example there is a directory in your website root that be called "securitydir" and you don't hope that the directory can't be searched by internet user but other directories can be recorded by robot. So, you have to add a Robots.txt in your website root and then disallow "securitydir" to be searched.

The main semantics of the "robots.txt" file are "User-agent" and "Disallow".

User-agent:This is the name of the robot that the record is describing access policy for.

For example:

User-agent: *

Access all robot to record.

User-agent: abcd

Only allow the name robot "abcd" to record.

Disallow: This can be a full path or a partial path that is not to be visited.

For example:

Disallow: /securitydir

Disallow both /securitydir and /securitydir/index.html

Disallow: /securitydir/

Allow /securitydir.html but disallow /security/index.html

Disallow: /123abc.html

Disallow 123abc.html to be retrieved.

For two instances:

1 . No robot can retrieve any URLs that starting with "/user/admin" or "/tmp" or

/user.html

----------------

# Robots.txt for http://www.myexample.com

User-agent: *

Disallow: /user/admin

Disallow: /tmp

Disallow: /user.html

---------------

2. No robot can retrieve any URLs that starting with "/user/admin" or "/tmp", except the

robot called "Ican".

----------------

# Robots.txt for http://www.myexample.com

User-agent: *

Disallow: /user/admin

Disallow: /tmp

User-agent: Ican

Disallow:

-----------------

Try it. ^^


發現了一個有趣的東西:Robots.txt .在研究一番之後,原來他是防止網路機器人Robot收錄網站某些網頁或資料的一種工具,避免網路使用著利用搜尋引擎去搜尋到不想曝光的網頁。

舉例來說,在您的網頁根目錄裡有個資料夾叫做"securitydir"是您不想被收錄索引的資料夾,您不希望被網路使用著搜尋到,但是對於其他的網頁資料卻可以開放被索引,這時候您就要再網站根目錄裡放一個robots.txt.的檔案,以達到上述的目的。

Robots.txt的主要語法有兩個:"User-agent" 和 "Disallow" 。

User-agent:這主要設定允許的robot可以進行收錄的動作,此為robot的名字

例如:

User-agent: *

允許所有的robot執行動作

User-agent: abcd

只允許名為abcd的robot進行動作

Disallow: 此為設定以哪些路徑或部分路徑開頭的URL完全禁止,也可以是檔案。

例如:

Disallow: /securitydir

不允許securitydir及securitydir以下的檔案被檢索

Disallow: /securitydir/

允許/securitydir.html 但是不允許 /security/index.html被檢索

Disallow: /123abc.html

不允許123abc.html 該檔案被檢索

再舉兩個完整的例子:

1 . 不允許 "/user/admin" 及 "/tmp" 開頭的URL和 /user.html被檢索,設定內容如下

----------------

# Robots.txt for http://www.myexample.com

User-agent: *

Disallow: /user/admin

Disallow: /tmp

Disallow: /user.html

---------------

2. 除了名為Ican的robot可以進行檢索 "/user/admin" 和 "/tmp"之外,其他robot一概被禁止。

----------------

# Robots.txt for http://www.myexample.com

User-agent: *

Disallow: /user/admin

Disallow: /tmp

User-agent: Ican

Disallow:

-----------------

試試看吧! ^^

Resolve Blank Page in Drupal

Found a problem while wanting to modify drupal module this morning:

My admin/modules page became blank.

Check to just find that is originally out of memory.

Modified the memory_limit=16 M in the php.ini

memory_limit=16 M => memory_limit=40 M

(The 40 M is what I establishes. I don't knowing would not calculate until how

much at the right moment)

and then restart httpd.

This problem is resolved. ^^


今天早上修改drupal的模組時,發現了admin/modules變成了空白頁,查了一下。

原來只要修改了php.ini裡的memory_limit = 16M,

memory_limit=16 M => memory_limit=40 M (40M是我設的,不知道要多少才算剛好)

然後重新啟動httpd。

這個問題就解決了。^^

Ffmpeg for Gallery2

 Why want to install Ffmpeg?In fact is because I packed gallery2 for wanting an ability in the gallery2 to play the vedio and movies and sounds files.

In order to let the ffmpeg support more file formats, we must install the other encodings packages first before installing ffmpeg. I am to use a lazy person installing method, RPM -Uvh.

All of these set packages are supported Fedora Core 6 and can be got in the nether download.

1. support mp3 --Explain

#rpm -Uvh lame-3.97-1.fc6.i386.rpm

2. support ogg vorbis--Explain

# rpm -Uvh libogg-1.1.3-2.fc6.i386.rpm

#rpm -Uvh libvorbis-1.1.2-1.2.1.i386.rpm

4. support xvid--Explain

#rpm -Uvh xvidcore-1.1.0-4.lvn6.i386.rpm

5. support x264--Explain

#rpm -Uvh x264-0.0.0-0.3.20061023.fc6.i386.rpm

6. support mpeg4 (Explain) & aac (Explain)

#rpm -Uvh libfaad2-2.0rc1-51736cl.i386.rpm

#rpm -Uvh faac-1.24-3.fc6.i386.rpm

7. support 3gp--Explain

#rpm -Uvh 3gpwiz-1.3-0.pm.1.noarch.rpm

8. another packages related to ffmpeg

#libid3tag-0.15.1b-3.fc6.i386.rpm

#a52dec-0.7.4-8.fc6.i386.rpm

#gsm-1.0.10-6.fc6.i386.rpm

#imlib2-1.3.0-3.fc6.i386.rpm

9. install ffmpeg

#ffmpeg-0.4.9-0.7.20060918.fc6.i386.rpm

Finally, administer your gallery2's modules and type ffmpeg path(maybe

/usr/bin/ffmpeg) and enable it to work.

Steps be down.^^

Reference website:

http://blog.5ilinux.com/archives/2006/08/ffmpeg.html


為何要安裝Ffmpeg呢?其實是因為我裝了gallery2,為了要能在gallery2上播放影片及影音檔案,如此而已。

為了要讓ffmpeg支援更多的檔案格式,在安裝ffmpeg之前先安裝其他encoding的套件。對了我是用懶人安裝法,RPM。

這些套件全部都是support Fedora Core 6 and 可以在下面的download下載到。

1. 支援 mp3 --說明

#rpm -Uvh lame-3.97-1.fc6.i386.rpm

2. 支援 ogg vorbis--說明

# rpm -Uvh libogg-1.1.3-2.fc6.i386.rpm

#rpm -Uvh libvorbis-1.1.2-1.2.1.i386.rpm

4. 支援 xvid--說明

#rpm -Uvh xvidcore-1.1.0-4.lvn6.i386.rpm

5. 支援 x264--說明

#rpm -Uvh x264-0.0.0-0.3.20061023.fc6.i386.rpm

6. 支援 mpeg4 (說明) & aac (說明)

#rpm -Uvh libfaad2-2.0rc1-51736cl.i386.rpm

#rpm -Uvh faac-1.24-3.fc6.i386.rpm

7. 支援 3gp--說明

#rpm -Uvh 3gpwiz-1.3-0.pm.1.noarch.rpm

8. 其他Ffmpeg的相依性套件

#libid3tag-0.15.1b-3.fc6.i386.rpm

#a52dec-0.7.4-8.fc6.i386.rpm

#gsm-1.0.10-6.fc6.i386.rpm

#imlib2-1.3.0-3.fc6.i386.rpm

9.安裝 ffmpeg

#ffmpeg-0.4.9-0.7.20060918.fc6.i386.rpm

最後進入gallery2的網站管理去設定ffmpeg的路徑(也許是/usr/bin/ffmpeg),然後啟動它。^^

參考網站

http://blog.5ilinux.com/archives/2006/08/ffmpeg.html

Keep one's promise:一言九鼎(Yi yan2 jiu3 ding3)

Saw a Discovery program tonight and introduce concerning pottery-troops issues.But among issues impression was most deep to speak of the thing " Ding Ding":The position of the private doctor equal to five Dings.

"Ding" original meanings be an usually three-legged ancient Chinese cooking vessel and is cast into by the bronze.It become container of offering sacrifices to the god afterwards and then become the symbol of the nations finally.So choose site for capital and then be called "settle Ding" certain place in a certain place;And"Ding3 zu2 san fen(division into three three centses)" then mean three square situations to stand opposite each other.

"Nine Dings" are the Dingses that the Da Yu casts after ascending the throne.Da Yu it is rumored have a great achievement because of regulate rivers and watercourses and then the Shun abdicates the throne to him.The Da Yu is divided into nine states of his territories and used the gold that nine state leaders pay tribute to cast into nine Dings and used to symbolize the nation that he rules. that is "nine Dings".It stress "the row Ding and food" more in the Eastern Zhou Dynasty. Represent the grade system of emperor, seignior and private doctor according to nine Dingses, seven Dingses and five Dingses.

"Keep one's promise一言九鼎(Yi yan2 jiu3 ding3)" of cause is at the Warring Kingdoms of Chinese, group of heroes set up separatist regime of time.

All countries value a talented person very much for strengthening an own strength. The Ping-Yuan gentleman of JHAO country kept many skillful persons and then prepare to be at any time to work for him. These people are called the retainer.
Have once, the Qin country takes the offensive JHAO country. The Ping-Yuan gentleman wants to plea for help from Chu country and plan from retainers to choose 20 persons who versed in literary and military arts to follow behind him to go to Chu country and persuade Chu's king to cooperate withstand Qin. But he picks around, only can select 19 people. At this time, a by the name Mao-Suei of the retainers come out to say:"please let me follow behind you and go to Chu country together!" Ping-Yuan gentleman has no confidence in him, but the end still promised.

Went to Chu's country, the Ping-Yuan gentleman work hard canvass Chu's king and speak of noon from the sunrise and still have no result. Hence, Mao-Suei wearing a sword ascend the rank then arrives at two king in fronts. Chu's king speaks loudly:"Go away! I get into conversation with your host , you to do what?"
Mao-Suei press sword to come forward to say to Chu's king: "Chu's country although has many people, now ten steps inside, no one can protect you. Your life is in my hand." Then he lecture Chu's king's and point out the advantage to cooperate withstand Qin country. Chu's king says hurriedly:"All right! All right!" and covenanted a cooperation agreement with Chu country on the palace right away.
Ping-Yuan gentleman applauds Mao-Suei after returning to Chu country hence say:"Sir speak with Chu's king of some kind of talk ,indeed powerful, be like nine Dingses and big clock, make Chu country be a value greatly."
So the meanings for "keep one's promise(一言九鼎(Yi yan2 jiu3 ding3))" would be parable that a words has power and be like nine Dingses so heavy. It can also say to be a honesty or keep engagement.

The reference website:

http://www.chinalane.org/hist001/bookstore/fun/00000309.html

今晚看了Discovery的一個節目«雜亂兵俑疑雲»,裡面讓我印象最深刻的是它提到了「鼎」這個東西:在古代,士大夫的地位就等於五個鼎。

「鼎」在古代是煮東西的器具,有三條腿,由青銅鑄成,後來又變成祭祀神祇的器皿,最後變成國家的象徵。所以在某個地方定都就叫做「定鼎」某地;而「鼎足三分」則意指三方局勢互相對立。大禹巨型雕塑亮相武漢http://big5.xinhuanet.com/gate/big5/news.xinhuanet.com/politics/2006-09/20/content_5113943.htm

「九鼎」是大禹登帝位後鑄造的鼎。相傳大禹因治水有功,舜把帝位禪讓給他。禹把他的領土分為九個州,用九州首領進貢的金,鑄成九個鼎,用來象徵他統治的國家,就是「九鼎」。而在東周時期更講求「列鼎而食」,根據九鼎、七鼎、五鼎的等級制來代表天子、諸侯及士大夫。

「一言九鼎」的由來要說到戰國時代,諸侯割據。各國為了加強自己的力量,十分重視人才。趙國的平原君便養了許多有本領的人,準備隨時為他做事。這些人叫做食客。

有一次,秦國進攻趙國,平原君要向楚國求救,打算從食客中選二十個能文能武的人,跟隨他前往楚國,說服楚王合力抗秦。但是他挑來挑去,也只能選出十九人。這時,一個名叫毛遂的食客站出來說:「請讓我跟隨你,一同到楚國吧!」平原君雖然對他沒有信心,但最後還是答應了。

到了楚國,平原君努力游說楚王,從日出談到中午,還是沒有結果。於是,佩着劍的毛遂便登上台階,來到二王面前。楚王大聲喝道:「還不退下!我在跟你的主人談話,你來幹什麼?」

毛遂按劍上前對楚王說:「楚國雖然人多,但現在十步之內,沒有人能保護你。你的性命就在我的手。」接着他教訓了楚王一頓,指出了聯合抗秦的好處。楚王連忙說:「對!對!」而且馬上在殿上和趙國定下了合作協議。

平原君回到趙國後,讚賞毛遂說:「先生對楚王的一番說話,果然份量十足,就像九鼎和大呂鐘一樣,使趙國大受重視。」



所以「一言九鼎」的意思便是比喻一句話很有份量,就像九鼎那麼重。也可以說是誠實不欺、信守約定。

參考網站:

http://www.chinalane.org/hist001/bookstore/fun/00000309.html

Sendmail+Mailscanner+ClamAV | Until The Twelve of Never

E-mail is a kind of ways to exchange messages that many people use now . But it s an undisputable fact that e-mail become the shortcut of the virus dissemination , and advertise letter is also a severe problem with the most internet users currently.

The MailScanner is a free and well-known mail anti-virus software and is also the tool that defends the advertisement letter mail.It supports various anti-virus softwares, including ClamAV etc..
The ClamAV is also a free E-mail anti-virus software, and then provides an on-line immediately real time service. It can detect more than 40,000 kinds of viruses, worms, the Trojan programs. ClamAV has a set of anti-virus experts who distribute in the world everywhere currently and renew for 24 hours and safeguard the virus database. If anyone finds the suspicious virus can also make contact with them at any time and them renew the virus yard immediately to be the latest protection action in cutty time.

Install(Suppose you have already installed sendmail.)

Step 1

Install MailScanner

Download from offical websitehttp://www.mailscanner.info/

Download Stable versionVersion 4.54.6-1 for RedHat, Fedora and Mandrake Linux (and other RPM-based Linux distributions)

this version for Fedora Core.

And command

#tar zxvf MailScanner-4.56.8-1.rpm.tar.gz
#cd MailScanner-4.56.8-1

#./install.sh

Installing............(Come some coffee ^.^)

When process be down. Then check the content in this file

/etc/MailScanner/MailScanner.conf

Max Children = 5

//How many MailScanner processes do you want to run at a time?

Virus Scanning = yes

//Open the anti-virus function.

Virus Scanners = clamav

//Which Virus Scanning package to use.
  Use SpamAssassin = yes

//Do you want to find spam using the "SpamAssassin" package?

//You must install spamassassin before.

Save it.

Step 2

Install ClamAV

You must add account for clamav before install clamav.

#groupadd clamav

#useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

#cd /usr/local/src

Download ClamAV tarball package from http://www.clamav.net/stable.php

#wget http://nchc.dl.sourceforge.net/sourceforge/clamav/clamav-0.88.6.tar.gz

#tar zxvf clamav-0.88.6.tar.gz

#cd clamav-0.88.6

#./configure --sysconfdir=/etc

#make

#su -c "make install"

..........wait line......... ....

#vim /etc/clamd.conf

1.Add a # front the word "Example" (disable Example)

2.Alter "User clamav" to be "User root" and enable.(Remove #)

#vim /etc/freshclam.conf

1.Disable the "Example".

2.Enable the "Check=24".

Step 3

Restart MailScanner

#service MailScanner stop

#chkconfig sendmail off

(Hereafter will be started sendmail by MailScanner. We must prohibit sendmail to run

at a time)
#killall sendmail

(Kill all sendmail process in the memory.)
#service MailScanner start

Installing is well done. ^^

The reference website

http://cha.homeip.net/blog/archives/2005/01/sendmail_mailsc.html

http://www.neo.com.tw/archives/000323.html


E-mail是現在許多人使用的一種傳遞訊息的方式,但是變成病毒散播的捷徑卻是不爭的事實,而且廣告信也是也是目前許多網際網路使用者最頭痛的問題。

MailScanner是一個免費且著名的郵件掃毒軟體,也是防廣告信郵件的工具。它支援多種防毒軟體,包含ClamAV等。

ClamAV也是免費的電子郵件防毒軟體,又提供線上即時更新的服務。目前可以偵測超過40,000 種病毒、蠕蟲、木馬程式,並且有一組分佈在世界各地的病毒專家,24小時更新及維護病毒資料庫,任何人發現可疑病毒也可以隨時跟他們取得聯繫,立刻更新病毒碼,在極短的時間內完成最新的防護動作。

步驟1(假設Sendmail已安裝完成)

安裝MailScanner

從官方網站下載Stable的版本

Version 4.54.6-1 for RedHat, Fedora and Mandrake Linux (and other RPM-based Linux distributions)

然後

#tar zxvf MailScanner-4.56.8-1.rpm.tar.gz

#cd MailScanner-4.56.8-1

#./install.sh

等待......

接著修改/etc/MailScanner/MailScanner.conf裡的幾個設定

Max Children = 5

//這表示你開機時要執行多少個MAilScanner子程序,主記憶體在64MB以下建議設為1

Virus Scanning = yes

//開啟防毒功能

Virus Scanners = clamav

//您要使用的防毒軟體為何,這裡設為ClamAV
  Use SpamAssassin = yes

# 如果你要使用SpamAssassin才開啟,但是你之前必須先安裝。

儲存

步驟 2

安裝ClamAV

安裝之前先建立clamav帳號

#groupadd clamav

#useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

#cd /usr/local/src

下載ClamAV 穩定版本 http://www.clamav.net/stable.php

或直接下載下面的連結的版本

#wget http://nchc.dl.sourceforge.net/sourceforge/clamav/clamav-0.88.6.tar.gz

#tar zxvf clamav-0.88.6.tar.gz

#cd clamav-0.88.6

#./configure --sysconfdir=/etc

#make

等待.......

#su -c "make install"

等待....

編輯Clamav的設定檔

#vim /etc/clamd.conf

1. Example 之前加個# (disable Example)

2.修改 "User clamav" to "User root" 然後 enable.(Remove #)

再編輯freshclam設定檔

#vim /etc/freshclam.conf

1.一樣在 Example 前加上#.

2.拿掉 Check=24 前的#。可以修改數字,此為24小時更新一次。

步驟 3

重起MailScanner

#service MailScanner stop

#chkconfig sendmail off

(停止sendmail在開機時自動執行的設定)
#killall sendmail

(刪除所有sendmail可能存在記憶體的process)
#service MailScanner start

安裝完成 ^^

參考網站:

http://cha.homeip.net/blog/archives/2005/01/sendmail_mailsc.html

http://www.neo.com.tw/archives/000323.html

Install Drupal

I use Fedora Core 5

httpd-2.2.2-1.2、php-5.1.6-1.2、mysql-5.0.22-1.FC5.1、

phpmyadmin-2.9.02 and so on.

and so on.

Step 1:

We want to download drupal package to your website directory from the

official website or download directly from the link Drupal-4.7.3

or you can command

#wget http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.3.tar.gz

Step 2:

Extract the package by your extracted tool.

Use linux , maybe you can command

#tar zxvf drupal-4.7.3.tar.gz

#mv drupal-4.7.3 drupal /* rename the directory. */

Step 3:

Let's create a datebase drupal first.

You can use the mysql manage tool phpmyadmin to easy create a datebase

and then import database.4.1.mysql (where is in the drupal/datebase/

directory ) to the drupal (the datebase).

Step 4:

Use your editor to alter the settings.php where is in the drupal/sites/default/

Find this row:

$db_url = "mysql://username:password@localhost/database"

Change username, password,localhost and database to be new.

for example:

$db_url = "mysql://acmevil:********@mysql.taes.tp.edu.tw/drupal"

and then find this row

$base_url = ' ';

Input your complete url of website , remember don't add "/" in the end of

url.

For my example:

$base_url = 'http://acmevil.taes.tp.edu.tw';

Save it.

P.S I discover that $base_url= ' '; can be empty, but I don't know

whether it has influence or not.

Step 5:

Go to your URL of Drupal and create a account immediately. Because the

first account is the website's admimistrator.

Enjoy! ^^

1.首先,我們要先去下載drupal安裝包,可以從Drupal官方網站下載,或者直接點選下載

Drupal-4.7.3,中文版可從Drupal Taiwan | 繁體中文支援站 下載。下載到您網站的

根目錄

2.解壓縮:用您習慣的解壓縮工具來解壓縮,譬如:

#tar zxvf drupal-4.7.3.tar.gz

#mv drupal-4.7.3 drupal //把drupal-4.7.3改成drupal

3.進入您的資料庫,新增一個資料庫(我是用phpmyadmin 來控制mysql),為drupal。

然後從在drupal/datebase的目錄裡有三個.sql檔案,我們將要匯入一個至剛剛所新

增的資料庫(drupal)裡,如果您的使用mysql且在4.1版之後的請匯入

database.4.1.mysql。 請根據您的資料庫版本來選擇匯入的sql檔案。

4.至drupal/sites/default/這一目錄裡修改settings.php這一個檔案。

找到這一行

$db_url = "mysql://username:password@localhost/database"

修改 username(資料庫使用者名稱)、 password(資料庫使者密碼)、

localhost(MySQL主機位置)、database(給drupal使用的資料庫名稱)

再找到以下這一行

$base_url = ' ';

填入drupal網站的完整網址,記得最後面不要加反斜線/。

例如: $base_url = 'http://acmevil.taes.tp.edu.tw';

存檔

P.S我發現上面這一行似乎不填也可以,留空。不過我不知道會不會有影響?

5.現在可以進入您的Drupal網站了。切記!第一個註冊的就是網站管理員喔!

現在就可以好好享受囉! ^^

Why I Choosed Drupal?

Very long has not played Servers and website set of. Because the school requests each people all to have the person website, thereupon when stroll the internet has discovered Drupal . Moreover Drupal is choosed one of open source CMS final five announced, this lets my interest be soaring. Under the curiosity obligation, wants to have a look Drupal to have what differently with before other frame station set of, with Wordpress, Xoops, Mambo, Joomla and so on has differently what.


很久沒有玩SERVER及網站套件,由於學校要求每個人都得要有個人網站,於是乎在逛網站時發現了Drupal,而且Drupal被選為五大CMS之一,這更讓我興趣高昂。在好奇心的驅使下,想看看Druapl跟之前其他的架站套件有何不同,跟WordpressXoopsMamboJoomla 等有何不同。