Sunday, June 24, 2012

Uninstall a Windows Service in Windows 7


cmd> sc delete "GNU Gatekeeper"

Saturday, June 23, 2012

Install OpenSIPS SIP server

What OpenSIPS is

OpenSIPS (Open SIP Server) is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities. OpenSIPS, as a SIP server, is the core component of any SIP-based VoIP solution. With a very flexible and customizable routing engine, OpenSIPS 'unifies voice, video, IM and presence services in a highly efficient way, thanks to its scalable (modular) design.

What OpenSIPS has to offer, comes in a reliable and high-performance flavour - OpenSIPS is one of the fastest SIP servers, with a throughput that confirms it as a solution up to enterprise or carrier-grade class.

Adding Debian package repository for the OpenSIPS project to your apt sources:
# vi /etc/apt/source.list
deb http://apt.opensips.org/ stable18 main

Adding the archive key to your keyring:
This archive self-signs packages uploaded to it (and packages uploaded are verified against a whitelist of trusted uploaders) using OpenPGP (GnuPG, to be more precise).

The key of the archive is in the key.asc file. You should add the key using something like this:
# wget http://apt.opensips.org/key.asc
# apt-key add key.asc
# apt-get update

# apt-get instal opensips

Reference:
http://www.opensips.org/
http://apt.opensips.org/

Password prompted slowly when using PuTTY to ssh into remote machine

It's most likely DNS issue. Here are few ways to solve:

Add DNS records to local and remote machine:
// on Windows
Edit c:\windows\system32\drivers\etc\hosts
192.168.0.10 debian.local

// on Linux or FreeBSD
# vi /etc/hosts
192.168.6.105 debian.local

Disable remote-controlled window title changing in PuTTY:
PuTTY Configuration > Terminal > Features > check "Disable remote-controlled window title changing".

Add this line to /etc/ssh/sshd_config file:
# vi /etc/ssh/sshd_config
UseDNS no

To restart sshd server:

On CentOS / RHEL / Fedora / Redhat:
# /etc/init.d/sshd restart
or
# service sshd restart

On Debian / Ubuntu:
# /etc/init.d/ssh restart
or
# service ssh restart

On FreeBSD:
# /etc/rc.d/sshd restart

On UNIX:
# kill -HUP `cat /var/run/sshd.pid`

Install sshd in debian

To install sshd in debian:

# apt-get install ssh

Saturday, June 16, 2012

電烙鐵使用心得

電烙鐵使用心得

有一些焊接電路板的需要,因此去買了一支120的電烙鐵,記錄一下使用心得。
烙鐵三兄弟:「烙鐵、助焊油膏與調光器」。


烙鐵的價格

我購買的是100多元的普通烙鐵,材質極差,兩三下就會變黑氧化而無法使用,十分不耐用。日系電烙鐵的最大優點在於其電烙鐵頭在高溫下不易氧化變黑,但價格較高,因為我不常用,所以買台製的,不過現在有點後悔,因為才一下子,烙鐵頭就氧化變黑了。

查了一下資料,用便宜的烙鐵,還要買「助焊油膏」,這類的烙鐵頭助焊油膏是用來保護烙鐵頭防止氧化的,用法是當烙鐵燒熱之後,三不五時將烙鐵頭直接插入油膏中,激起一陣清煙之後烙鐵頭自然恢復光亮如新的狀態

好的日製烙鐵頭可以在高溫 400 度以上,不會氧化變黑,而整支烙鐵最重要的無非就是烙鐵頭,因為這關係到焊接時是否吃錫順利,當然日系烙鐵在恆溫還有其他方面也都做的比較好。

比較好的日系牌子有兩大廠,goot 以及 hakko。 我在拍賣找到goot 最便宜的一般恆溫型
40W: KS-40R (290 元)
30W: KS-30R (290 元)

另外一款goot tq-90 或 tq-95兩段式升溫快速烙鐵,20W/130W兩段式快速加熱,輸出功率:Low 15W / High 150W,售價大約600-700元,網路上很多人推薦這款。


烙鐵的瓦數

40W 的拿來對付主板和顯卡,會比較好用。但對電路板或訊號線材有可能過熱了些,可以買「調光器」,利用調光器可以控制電力輸出的功能來控制烙鐵的溫度。調光器 是什麼?您有經驗在卡拉OK包廂裡,見過電燈使用旋鈕開關控制亮度的玩意吧,這類的調光器可以在電氣行或水電行買到,最方便的產品是附上插座的調光器,將 電風扇、檯燈或烙鐵插上調光器,就可以自由控制輸出功率。當銲接電路板或小型接點時,將調光器的功率輸出減半,烙鐵就不會過熱;當銲接喇叭端子等大型接點 時,40瓦全力輸出就綽綽有餘。


型狀種類

常見的電烙鐵有筆型和槍型,有塑膠柄 和木柄。木柄的通常比較便宜。不過便宜的東西好像特別容易壞.......除了外觀的不同之外,電烙鐵有分直熱型和旁熱型,旁熱型的電烙鐵很容易分辨,於 烙鐵尖端可以看到兩根螺絲鎖住烙鐵頭。直熱型的日製品最多,大家可以看到烙鐵頭是由套筒套住(烙鐵頭可交換)。其中以直熱式的效率最高。


以下純為個人使用心得

  • 焊電線時,電線應該完全包覆在焊鍚裡面,不可只焊在表面,否則容易脫落。
  • 如果是很多細線組成的電線,應交岔捲成單一條線,再焊入焊鍚內,否則不好焊,也易鬆動。
  • 烙鐵絕不可碰觸到其他零件、塑膠或電路板。
  • 焊小零件可先用膠布將零件固定在桌上,避免晃動。
  • 太精細的工作,不方便用手的話,可利用夾子。
  • 焊的時間,儘量縮短,以免燒毀零件。
  • 烙鐵頭過大,很容易造成過多的熱量而導致零件燒毀。如果烙鐵頭熱容量比被焊接物小,那麼加熱時間會變的很長,也很可能導致被焊接零件的塑膠部份先損毀。
  • 可以將焊鍚加在電線上,再焊在電路板上,比較好焊。
  • 如果電線太粗的話,那焊鍚的量不能太少,否則無法焊牢。但焊鍚避免塗到焊點以外的地方,可能造成短路。
網路查到的注意事項:
  • 其實不管哪一牌保養是一定要的。用完之後清除殘鍚,再上一點鍚包住烙鐵頭(這個動作很重要,一定要做)
  • 如果真的烙鐵頭已經不能吃鍚了,可以去電子材料行買一種叫:烙鐵頭還原劑。
  • 千萬不要拿東西去刮烙鐵頭,這樣用還原劑都救不了。

Reference:
http://save-coco.blogspot.tw/2009/11/blog-post.html
http://www.pcdvd.com.tw/showthread.php?t=971363&page=1&pp=10
烙鐵焊接圖文教學1.0版.pdf
youtube smd 解焊

Friday, June 15, 2012

搭配WLAN HomePlug發展潛力看好


搭配WLAN HomePlug發展潛力看好

2005/7  陳冠宏
電力線(電線)為現存家中各廳房最普遍存在的線路,大部分產品皆須透過電線供電,因此運用電線做為家庭網路的骨幹傳輸介質,不需重新佈線,能夠節省施工成本、時間,並保有裝潢的完整性...
電力線(電線)為現存家中各廳房最普遍存在的線路,大部分產品皆須透過電線供電,因此運用電線做為家庭網路的骨幹傳輸介質,不需重新佈線,能夠節省施工成本、時間,並保有裝潢的完整性。在此觀念下,一種運用電線達到上網需求的技術-HomePlug因而被提出。
目前,家庭有線網路傳輸技術主要有:Ethernet、HomePNA(Home Phone Networking Alliance)以及HomePlug三種,此三種有線網路通訊技術主要差別在於,使用的傳輸介質不同,Ethernet使用俗稱「網路線」的UTP-5銅質雙絞線,HomePNA則是使用「電話線」,HomePlug則採用電源線。Ethernet、HomePNA與HomePlug為了滿足使用者對於頻寬的需求,紛紛制訂新標準提高能夠支援的頻寬,因此就家庭用戶而言,頻寬並非最大的考量議題,最大的問題出現在線路是否需重新鋪設,以及採用新設備能為用戶帶來的便利性有多少。
HomePlug為一種針對區域網路(家庭、企業、校園、政府),透過內部電線連結資訊、通訊、家電產品,達到隨插即用的網路連結目的之技術。從技術特性觀察,HomePlug雖然為有線網路傳輸技術,卻具備無線網路「不需額外佈線」的特點,從產品應用市場觀察,HomePlug能內建於多種區域網路數位產品。由於HomePlug對使用者鋪設與使用的方便性,預計在家庭網路時代將逐漸嶄露頭角。
HomePlug應用於多種區域網路市場 
HomePlug能用在多種區域網路市場,此處針對三種應用情境,描述HomePlug在辦公室、家庭與醫院三類市場的應用模式。
HomePlug於辦公室網路應用模式 
辦公室存在上網需求的終端產品包括:PC、Server、Printer、DTV(Digital TV)、WLAN Access Point(AP)、PDA、Notebook PC(NB)等。PDA、NB可透過Wireless傳輸技術上網,而PC、Server、Printer、DTV與AP為固定式產品且皆須供電,因此可透過電線當做企業內部骨幹網路,以HomePlug技術建構辦公室網路環境。
HomePlug於家庭網路應用模式 
數位家庭存在上網需求的產品包括Printer、PC、DTV、音響、冰箱、微波爐、DVD Player、IP Phone、AP、NB、PDA等。其中的音響與主機或電視,能夠過電源線直接傳送聲音訊號,不需額外佈建音源線,而DVD Player也可以透過電線同時提供兩台以上DTV收看影片,圖2的WLAN AP為WLAN+HomePlug的AP,因此AP插上插座後可直接提供NB、PDA上網服務。未來用於家庭的IP Phone,也只需一條電線便可同時滿足供電與連網的需求。
HomePlug於醫院網路應用模式 
HomePlug還能用在特殊應用的市場,例如醫院,這種對電磁波嚴格管制,無法使用Wireless產品的市場。醫師看診必須透過網路傳遞病患資料以及開處方籤,透過HomePlug架構醫院網路骨幹,不需重新鋪設新線路、不需更動設備位置,不僅節省成本,時間、人力,更可透過電線直接將Wireless網路延伸至可以使用無線上網的區域,不會干擾診斷儀器。
HomePlug與WLAN相輔相成 
HomePlug與WLAN兩者皆為區域網路傳輸技術,而WLAN從2000年以來市場發展快速且被廣泛討論,因此HomePlug技術往往拿來與WLAN做競爭技術的比較,用來分析HomePlug未來的發展機會,是否會遭受WLAN嚴重的打壓,有沒有發展機會。此處比較兩種技術在「支援頻寬」、「佈線」以及「移動性」三方面的特性,分析HomePlug與WLAN未來發展機會與合作模式。
.支援頻寬:HomePlug新的技術規格HomePlug AV,可支援頻寬達200Mbps,而WLAN 802.11n也能支援到100Mbps的頻寬,因此以頻寬而言,兩種技術皆可滿足Audio與Video應用服務。
.佈線:可由兩個方向觀察,一為「家庭骨幹」,一為「上網裝置」,以下分別說明。WLAN AP在家庭骨幹網路部分必須鋪設網路線,連結至SOHO Router或Switch才能上網,而具備HomePlug Module的設備,在家庭骨幹部分不需鋪設網路線,直接透過電線即可上網。因此在「家庭骨幹」部分,HomePlug相較於WLAN AP反而具備不需鋪設線路的Wireless特性。從「上網裝置」觀點分析,使用HomePlug上網的設備必須接一條電線,而使用WLAN的設備則沒有此項困擾。
.移動性:由上述內容可知,採用WLAN的設備移動性較佳,而採用HomePlug可省卻骨幹佈線的不便性。由此特性分析可發現,HomePlug適合用在非移動性且擁有插電需求的數位產品,如DTV、NB、AP、PC等產品,WLAN適合用在移動性上網產品,如NB、PDA、WiFi Phone等產品。
從HomePlug與WLAN的技術特性觀察,HomePlug能夠搭配WLAN建構區域網路,而非競爭的角色,如此就能夠不需架設網路線,也能夠享受無線上網的移動樂趣。而WLAN對於金屬、石塊、鋼筋混凝土存在穿透力不足的缺憾,此時也可藉由HomePlug將網路延伸該處,達成Wireless All the Way的需求。根據工研院IEK調查,台灣HomePlug產品出貨量在2002年原以北美為出貨量最大宗,到2004年歐洲成為最大的出貨量地區。比對北美、歐洲WLAN普及率可以發現,北美由於建築材質多為木頭或是大型建築,WLAN涵蓋率、穿透力佳,因此WLAN普及率較高。而歐洲的建築多為石頭建築,房舍也比較小,人民對於房屋的完整性較不願破壞,因此WLAN普及率不如北美,也造就HomePlug產品於歐洲發展的機會,台灣出貨歐洲地區的HomePlug產品比率也逐漸超越北美地區
介紹現有的HomePlug產品 
目前大部分數位產品尚未內建HomePlug模組,因此有些過渡性商品紛紛被提出,以滿足過渡時期使用者需求,以及用以教育市場。以下介紹幾種現有產品,藉此瞭解目前廠商HomePlug產品發展方向。
PowerlineAdapter(Ethernet/USB)/
WLAN Powerline Adapter 
此項產品一端插到插座,另一端透過網路線或是USB連接PC、NB等數位產品,透過具有HomePlug模組的SOHO Router/Residential Gateway,或是SOHO Router/Residential Gateway外接相同的Ethernet/USB Powerline Adapter即可連結網路。
由於WLAN AP本身就必須接電線與網路線,因此將WLAN與HomePlug整合,推出WLAN Powerline AP,可以簡化鋪設無線區域網路在線路佈設的複雜性。
Powerline Camera/Jack 
監視器往往置於戶外,並且同時需要架設電線與網路線,因此透過HomePlug能將兩條線簡化成一條線,方便施工。而Powerline Jack則是直接將HomePlug Module整合至插座,使用者家中不需佈設網路線,即可達到上網目的。
客製化設計為HomePlug產品發展關鍵 
HomePlug由於透過電線作為傳輸介質,因此在使用上會因為各國電線品質不一、電線設計的差異性,使用的不便性,目前業者產品銷售普遍遭遇的問題如下。
首先是不同電表、不同電力迴路下無法相通。一戶家庭可能住在3層樓的屋子,每層樓皆使用獨立的電表,在此狀況下,同一戶家庭若採用HomePlug架構家庭網路,則不同樓層網路的互聯會出問題,此刻必須在電表裝置Bridge產品,解決此項問題。
其次,是各國電線老化程度不同,造成訊號衰減程度不一。東南亞、印度等國家,由於電線品質較差,因此使用HomePlug產品時,會因此產生訊號不穩定的狀態。
再者,是法令的限制造成無法銷售或是降低使用者購買意願。各國對於電線作為通訊用途的相關法令,尚處於模糊未明的階段,因此有些國家未明訂能夠使用HomePlug產品(如:英國),也降低民眾使用HomePlug產品的意願。從上述的問題描述能夠得知,HomePlug產品銷售,受到各國電線狀況不一致,因此必須高度客製化、區域化,充份反應使用者需求,如此使用者才願意購買該項產品,這也是廠商銷售HomePlug產品必須留意的關鍵。
HomePlug與WLAN是互補性產品,透過相互搭配能夠在不需鋪設骨幹網路的情況下,建構無線的區域網路環境,發揮快速鋪設、美觀、節省成本的優點,因此HomePlug結合WLAN為其一的市場發展機會。使用HomePlug不需鋪設區域網路的骨幹網路,因此能夠用於存在供電需求、不需移動的上網終端設備。WLAN穿透性受到建築結構與材料影響,因此在歐洲、中東等國家WLAN普及程度較低,也因此HomePlug產品於這些市場存在較佳的發展機會。
(本文作者為工研院IEK產業分析師) 
http://www.mem.com.tw/article_content.asp?sn=0701020382

Scrum - managing software projects and product

Scrum - is an iterative and incremental agile software development method for managing software projects and product or application development. Scrum has not only reinforced the interest in project management[citation needed], but also challenged the conventional ideas about such management. Scrum focuses on project management institutions where it is difficult to plan ahead. Mechanisms of empirical process control, where feedback loops that constitute the core management technique are used as opposed to traditional command-and-control oriented management.[citation needed] It represents a radically new approach for planning and managing projects, bringing decision-making authority to the level of operation properties and certainties.[1]

Reference:
http://en.wikipedia.org/wiki/Scrum_(development)

Kill kick out terminate a MySQL user session

Kill kick out terminate a MySQL user session

mysql> SHOW FULL PROCESSLIST;
mysql> KILL ID_PROCESS

Thursday, June 14, 2012

How to shutdown mysql on Windows

You can use either the utility "net":

cmd> net start mysql
cmd> net stop mysql

, Or use the mysqladmin:

cmd> mysqladmin -u root -p shutdown

Note: The user must have the SHUTDOWN privileges.

Wednesday, June 13, 2012

Install Virtualbox on FreeBSD 安裝

Sent to you by Danny via Google Reader:

via Hsian Studio by Anati on 5/23/11

* 從ports來安裝

# cd /usr/ports/emulators/virtualbox-ose
# make install clean

* 裝完設定

# echo 'vboxdrv_load="YES"' >> /boot/loader.conf
# echo 'vboxnet_enable="YES"' >> /etc/rc.conf
# pw groupmod vboxusers -m who_want_to_use_virtual_box

* usb支援設定

# pw groupmod operator -m who_want_to_use_virtual_box
# vim /etc/devfs.rules 加入以下設定
[localrules=10]
add path 'usb/*' mode 0660
表示將usb的device node設為operator群組都可以讀寫
# echo 'devfs_system_ruleset="localrules"' >> /etc/rc.conf

如果完成以上動作,只要建立vm的時候將usb controller開啟,那麼winxp啟動的環境下位於virtualbox視窗右下方有一個usb圖案,如果你有連結usb裝置的話,點選就會列出有那些usb裝置可以使用,只要點選了winxp就會偵測到有新裝置插入了

* 共用資料夾設定

當設好共用資料夾之後,要透過windows把這個共用資料夾當成網路磁碟來使用,因此我們要為此共用資料夾新增一個網路磁碟

start -> run -> cmd
C:\> net use z: \\vboxsvr\which_folder_want_to_share

* 直接啟動已建立的vm以xp為例

$ VBoxManage startvm winxp

How to run dd-wrt on VirtualBox

Go to dd-wrt's official website:
http://www.dd-wrt.com/site/support/router-database

search for "x86" in the input box.

Download dd-wrt for x86 platform:
DD-WRT X86 Public Vga: Console image

Convert the downloaded image file to virtualbox image:
cmd> "C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" convertdd dd-wrt_public_vga.image dd-wrt.vdi

Create a new virtual machine on VirtualBox:
Opearting System: Linux
Version: Other Linux

Use existing virtual disk: dd-wrt.vdi

VirtualBox Network Setting:
Attached to: Host-only Adapter

Go to File > Preferences > Network > Select "VirtualBox Host-Only Ethernet Adapter" > Edit:
IPv4 Address: 192.168.1.254
IPv4 Network Mask: 255.255.255.0

default password is:
username: root
password: admin

or admin/admin

Tuesday, June 12, 2012

Install Nginx, PHP-FPM and Varnish on FreeBSD 8.2

Install Nginx, PHP-FPM and Varnish on FreeBSD 8.2

# cd /usr/ports/www/nginx

# make install clean

Note: make sure you select important option such as:
HTTP_REWRITE_MODULE=on
HTTP_SSL_MODULE=on

and others as per your requirements.

# echo '### Nginx' >> /etc/rc.conf
# echo 'nginx_enable="YES"' >> /etc/rc.conf

# vim /usr/local/etc/nginx/nginx.conf

gzip on;
    gzip_min_length 1000;
    gzip_proxied expired no-cache no-store private auth;
    gzip_disable "MSIE [1-6]\.";
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    server {
            server_name mydomain1.com mydomain2.com mydomain3.com;
            root /usr/local/www/nginx/drupal7; ## <-- Your only path reference.

            client_max_body_size 20M; # Maximum allowed size for uploaded files

            location = /favicon.ico {
                    log_not_found off;
                    access_log off;
            }

            location = /robots.txt {
                    allow all;
                    log_not_found off;
                    access_log off;
            }

            # This matters if you use drush
            location = /backup {
                    deny all;
            }

            # Very rarely should these ever be accessed outside of your lan
            location ~* \.(txt|log)$ {
                    allow 192.168.0.0/24;
                    deny all;
            }

            location ~ \..*/.*\.php$ {
                    return 403;
            }

            location / {
                    # This is cool because no php is touched for static content
                    try_files $uri @rewrite;
            }

            location @rewrite {
                    # Some modules enforce no slash (/) at the end of the URL
                    # Else this rewrite block wouldn't be needed (GlobalRedirect)
                    rewrite ^/(.*)$ /index.php?q=$1;
            }

            location ~ \.php$ {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    ### NOTE: If you are using drupal 7, you should have "cgi.fix_pathinfo = 0" in php.ini (but wait, according to PHP manual, we should modify the code instead?).
                    include fastcgi_params;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_intercept_errors on;
                    #fastcgi_pass 127.0.0.1:9000;  #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
                    fastcgi_pass unix:/tmp/php-fpm.sock;
            }

            ### disable PHP execution on upload attachement directory
            location /sites/default/files/ {
              location ~ .*\.(php)?$
              {
                 deny all;
              }
            }

            # Fighting with ImageCache? This little gem is amazing.
            location ~ ^/sites/.*/files/imagecache/ {
                    try_files $uri @rewrite;
            }
            # Catch image styles for D7 too.
            location ~ ^/sites/.*/files/styles/ {
                    try_files $uri @rewrite;
            }

            location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                    expires max;
                    log_not_found off;
            }

            # nginx status
            location /NginxStatus {
              stub_status on;
              access_log on;
              auth_basic NginxStatus;
              auth_basic_user_file conf/htpasswd;
            }
    }

# /usr/local/etc/rc.d/nginx start

Change this line for nginx:

# vim /usr/local/etc/php.ini
cgi.fix_pathinfo = 0

Note: If you are using drupal 7, you should have "cgi.fix_pathinfo = 0" in php.ini (but wait, according to PHP manual, we should modify the code instead?).

Install php and php-fpm:

// For PHP5.3
# cd /usr/ports/lang/php5 ; make install

// For PHP5.2
# cd /usr/ports/lang/php52 ; make install

===> The following configuration options are available for php5-5.3.8:
CLI=on "Build CLI version"
CGI=on "Build CGI version"
FPM=on "Build FPM version (experimental)"
APACHE=off "Build Apache module"
AP2FILTER=off " Use Apache 2.x filter interface (experimental)"
DEBUG=off "Enable debug"
SUHOSIN=on "Enable Suhosin protection system"
MULTIBYTE=on "Enable zend multibyte support"
IPV6=off "Enable ipv6 support"
MAILHEAD=on "Enable mail header patch"
LINKTHR=on "Link thread lib (for threaded extensions)"
===> Use 'make config' to modify these settings

// For PHP5.3
# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

// For PHP5.2
# cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini

Install PHP Extensions
// For PHP5.3
# cd /usr/ports/lang/php5-extensions ; make install

// For PHP5.2
# cd /usr/ports/lang/php52-extensions ; make install

Edit php-fpm.conf:
# vim /usr/local/etc/php-fpm.conf
; comment out following line and add the line below.
;listen = 127.0.0.1:9000
listen = /tmp/php-fpm.sock

request_terminate_timeout=30s

Edit rc.conf
# vim /etc/rc.conf
### php-fpm
php_fpm_enable="YES"

Change this line for nginx

# vim /usr/local/etc/php.ini

date.timezone = America/Vancouver
magic_quotes_gpc = Off
max_execution_time = 120
max_input_time = 60
memory_limit = 256M
upload_max_filesize = 20M
post_max_size = 30M
cgi.fix_pathinfo = 0
log_errors = On
error_log = /var/log/php_errors.log

Note: If you are using drupal 7, you should have "cgi.fix_pathinfo = 0" in php.ini (but wait, according to PHP manual, we should modify the code instead?).

# touch /var/log/php_errors.log
# chown www:www /var/log/php_errors.log
# chmod 660 /var/log/php_errors.log

# /usr/local/etc/rc.d/php-fpm start
# /usr/local/etc/rc.d/nginx restart

# tail /var/log/nginx-error.log

# tail /var/log/php-fpm.log

# tail /var/log/messages

Rotate Nginx and PHP log files:
# vim /etc/newsyslog.conf
/var/log/nginx-access.log 600 7 100000 * JC /var/run/nginx.pid
/var/log/nginx-error.log 600 7 100000 * JC /var/run/nginx.pid
/var/log/php-fpm.log 600 7 100000 * JC /var/run/php-fpm.pid
/var/log/php_errors.log 600 7 100000 * JC

# /etc/rc.d/newsyslog restart

Install Varnish

# cd /usr/ports/www/varnish ; make install clean

Reconfigure your web server to listen on localhost:8080

# echo 'varnishd_enable="YES"' >> /etc/rc.conf
# echo 'varnishd_flags="-s malloc,1G -a 127.0.0.1:80 -b 127.0.0.1:8080"' >> /etc/rc.conf
# echo 'varnishlog_enable="YES"' >> /etc/rc.conf

# /usr/local/etc/rc.d/varnishd start

# /usr/local/etc/rc.d/varnishncsa onestart

# tail /var/log/varnishncsa.log

# /usr/local/bin/varnishtest

# /usr/local/bin/varnishstat

# ls -lh /usr/local/varnish/`hostname`

Install webbench
# cd /usr/ports/benchmarks/webbench ; make install clean

# webbench -c 3000 -t 60 http://test.local/index.php

Reference:
Install Nginx, PHP-FPM and Varnish on FreeBSD 8.2
http://blog.ijun.org/2012/01/install-nginx-php-fpm-and-varnish-on.html

Apache MPM Worker + mod_fastcgi + PHP-FPM
http://gala4th.blogspot.com/2011/07/apache-mpm-worker-modfastcgi-php-fpm.html

Web Performance Tuning Tips Solutions for Drupal Sites
http://gala4th.blogspot.com/2010/12/web-performance-tuning-tips-solutions.html

Running Drupal with Nginx
http://wiki.nginx.org/Drupal

high performance caching reverse proxy: Varnish (安裝架設篇)
http://gala4th.blogspot.com/2010/12/high-performance-caching-reverse-proxy.html

[FreeBSD & Linux]網站分流:簡易架設 HAProxy 伺服器
http://blog.wu-boy.com/2008/06/freebsd-linux%E7%B6%B2%E7%AB%99%E5%88%86%E6%B5%81%EF%BC%9A%E7%B0%A1%E6%98%93%E6%9E%B6%E8%A8%AD-haproxy-%E4%BC%BA%E6%9C%8D%E5%99%A8/

Scaling Rails Site:Reading Material # 1
http://wp.xdite.net/?p=1597

Sunday, June 10, 2012

pretty BIOS GUI Interface - Unified Extensible Firmware Interface

pretty BIOS GUI Interface - Unified Extensible Firmware Interface

The Unified Extensible Firmware Interface (UEFI) is a specification that defines a software interface between an operating system and platform firmware. UEFI is meant as a replacement for the BIOS firmware interface, present in all IBM PC-compatible personal computers.[1][2] In practice, most UEFI images have legacy support for BIOS services. It can be used to allow remote diagnostics and repair of computers (and security exploits), even without another operating system. [3]

The original EFI (Extensible Firmware Interface) specification was developed by Intel. Some of its practices and data formats mirror ones from Windows.[4][5] In 2005, UEFI deprecated EFI 1.10 (final release of EFI). The UEFI specification is managed by the Unified EFI Forum.

Reference:
http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface