2013年8月31日 星期六

Openwebmail 安裝

安裝openwebmail


rpm -ivh –force – -nodeps openwebmail-*

rpm -ivh –force – -nodeps openwebmail-data-*


設定 openwebmail


開啟  /var/www/cgi-bin/openwebmail/etc/dbm.conf 貼上下面內容


dbm_ext  .pag

dbmopen_ext   none

dbmopen_haslock   no


開啟 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf


domainnames  xxxx.idv.tw ( 修改為自己的網址)


default_iconset  Cool3D.Chinese.Traditional (中文顯示)


開啟 /var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf

修改

smtpserver 127.0.0.1 (smtpserver IP位址)


設定openwebmail

下達只令 /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

問說要不要傳 report

Send the site report?(Y/n) y 選y即可

PS:

第一次設定時出現sending report...

Couldn't open SMTP servers 127.0.0.1 at port 25! at cgi-bin/openwebmail/openwebmail-tool.pl line 1520.

Google 好久才找到原來是在 openwebmail.conf 裡 smtpserver IP設錯了


2013年8月25日 星期日

修改WordPress 首頁文章摘要的字數(長度)

方法一:
WordPress 首頁文章摘要的字數(長度) ,是利用the_excerpt()Function 來產生的,預設是55,我們可開啟程式目錄下的/wp-includes/formatting.php 檔案,找尋
  $excerpt_length = apply_filters('excerpt_length', 55);
並將 55 修改為你要顯示的長度即可。
PS: 若日後有修改或是升級WordPress ,此設定需重新修正。

方法二:
此方法則是在主題下的functions.php 中加入下面的程式碼也可以達到一樣的效果
add_filter( 'excerpt_length', 'bb_excerpt_length', 999 );
function bb_excerpt_length( $length ) {
return 130;  //修改想要的長度
}
 

2013年8月24日 星期六

Suffusion 主題中文化

Suffusion 主題版本 4.4.6
安裝好後,在控制台內可看到 <一> Suffusion Options 的選項點選進去後,可看到上方出現<二> "You are using a version of WordPress that is not in American English. Translations for your language might be available."訊息,點選might be available.進去後依照步驟指示即可將前台顯示中文化了.
中文化快速步驟
1.先至 http://pool.aquoid.com/wp-login.php?action=register 註冊 註冊後會將登入密碼mail 至註冊信箱裡
2.至http://pool.aquoid.com/translations/login?redirect_to=http%3A%2F%2Fpool.aquoid.com%2Ftranslations%2Fprojects%2Fsuffusion 登入
3.登入後點選 Suffusion 進入

4.點選 Chinese (Taiwan) 90%+ 進入

5.拉到畫面最下方Export all current as <1>下拉選擇為mo格式
6.按Export 滙出<2>,即可下載mo檔

7.下載後請將suffusion-zh-tw.mo 改為 zh_TW.mo
8.並將zh_TW.mo檔放置 wp-content/themes/suffusion/translation/  則完成中文化.

Lynx安裝介紹(在文字界面下上網)

Lynx是個純文字網頁瀏覽器,可以讓使用者在PuTTY終端上使用的瀏覽器。

安裝方法很簡單

yum install lynx

隱藏Apache & PHP 的版本序號


為了提高Apache 可以試著把Apache & PHP 的版本序號隱藏 
首先先將Apache 的 /etc/apache2/apache2.conf 或 /etc/httpd/conf/httpd.conf 
開啟後將下面ServerTokens 和 ServerSignature值修改如下
 ServerTokens ProductOnly 
ServerSignature Off 
再將php.ini (\etc\php.ini)裡 expose_php On 改成 expose_php Off 
最後重新Restart Apache 
# service httpd restart

WordPress 顯示首頁文章縮圖(特色圖片)

在WordPress 裡張貼新文章時,可以選擇該文章的特色圖片,但有些佈景主題卻無法在首頁顯示特色圖片,此時我們可以利用 the_post_thumbnail 這Function 來幫我們完成.

the_post_thumbnail('thumbnail'); // 小圖(最大150 x150)

the_post_thumbnail('medium'); // 中等大小(300 X 300)

the_post_thumbnail('large'); // 大圖 (1024 X 1024)

the_post_thumbnail('full'); // 原尺寸

the_post_thumbnail( array(90,90) ); // 自訂

Apache Virtual Host 設定 foe CentOS 6.4

先看  /etc/httpd/conf.d/  下有沒有 vhost.conf   有的話直接開啟 , 若無的話則自已建一個內容如下

NameVirtualHost *:80

<VirtualHost *:80>
 #設定 DocumentRoot
 DocumentRoot /var/www/html/www
 #設定所對應的 網址
 ServerName www.bearxxx.idv.tw
</VirtualHost>
 
<VirtualHost *:80>
 #設定 DocumentRoot
 DocumentRoot /var/www/html/mail
 #設定所對應的 網址
 ServerName mail.bearxxx.idv.tw
</VirtualHost

最後別忘了重啟apache
# service httpd restart 

2013年8月22日 星期四

線上高亮(Syntax Highlighting)語法產生

有時文章內容會輸入一些程式碼,此時便想要將程式碼內容上色以便閱讀,經由Online syntax highlighting所提供的功能,可以直接將語法貼上後,快速產生HTML原始碼,只要將這段原始碼貼入文章內,就可產生輕鬆閱讀的文章囉。
趕快來體驗把
http://tohtml.com/

2013年8月21日 星期三

Ruby 安裝 for Centos 6.4

安裝Ruby前的準備
1. yum install gcc g++ make automake autoconflibssl-devel libyaml-devel
至 Ruby Programming Language 中文官方網頁
http://www.ruby-lang.org/zh_tw/ 下載Ruby 2.0.0
ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
2
tar zxvf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure
make  //進行編譯 (要花點時間,請耐心等待)
sudo make install
RubyGems─管理你的紅寶石 套件管理
在 Ruby 1.9 之前,RubyGems 需要額外安裝,因為它不是官方的套件。而在 Ruby 1.9 之後,已被收錄至 Ruby 標準發行版中。
所以不用在裝 RubyGems 只要進行rmp更新
3.
gem update
gem cleanup   // (清除舊版的)
RubyGems 本身的更新
請於命令列模式下輸入下列指令:
gem update --system
就可以自動升到最新的 RubyGems。不過有時候會有點問題,此時需要再執行:
update_rubygems
gem install rails (下載要花點時間,會很慢請耐心等待)

TOSHIBA L850 安裝windows 7

現在的NB很多都是 UEFI BIOS, 所以若要安裝作業系統時,會產生無法光碟開機。
L850 也是, 想裝widows 7 時發現怎麼老是無法由光碟開機, 最後在google 大師的開示下終於找到答案了
那就是 要將BIOS裡的 Boot Mode 改為 CSM Boot 即可.
步驟如下:
1. 進入BIOS
2.Security >> Secure Boot  >> 改為Disabled。
3.Advanced >> System configuration >>  Boot Mode >> 改為 CSM Boot。

使用中文時用 PieTTY 取代 PuTTY

提供在PuTTY登入時,顯示中文及輸入中文時一個快速解決的選擇
PieTTY可快速切換的多國語言支援,使用PieTTY登入,工具列>> 選項 >> 字元編碼 >> Unicode UTF-8
選擇後即可支援中文了.