2012-06-08

用遠端XWin控制你的 ubuntu

在 Ubuntu 11.04 用遠端XWin來控制你的另一台 Ubuntu ,可以試試用 xdmcp。

首先在主控端安裝 xdmcp Protocol :
sudo apt-get install xnest

接著在被控端,依照參考資料的第 2 篇「Enabling XDMCP in Ubuntu 11.04」的做法,完成之後,就大功告成了。



參考資料:
  1. 遠端控制你的 ubuntu - vino, xrdp, ssh
  2. Enabling XDMCP in Ubuntu 11.04

2012-03-27

virtualbox 也有 web 介面的控制台

看到這一篇「在ubuntu中安裝及設定phpvirtualbox」,才知現在連 virtualbox 也有 web 介面的控制台,真是越來越方便了。

2012-03-23

Single Sign-On 資料蒐集

一直在想找 Single Sign-On (SSO) 的資料,今天竟無意間在 HowtoForge - Linux Howtos and Tutorials 看到了這一篇「Configuring CAS On Ubuntu For Two-Factor Authentication With WiKID」,先記錄下來,過幾天來研究看看。不知道這個與 LDAP 是否有關連?等研讀後,再說。

另外 HowtoForge - Linux Howtos and Tutorials 這個站對我來說,似乎有些不錯的教學資料可以挖一挖。

2012-03-19

XP 檔案開啟關聯設定

有時 XP 檔案開啟之關聯設定,當改變選取開啟的應用程式時,不知為何,總是無法正常顯示在「建議的程式」或是「其他程式」之中,今天又再一次碰到這種奇怪的狀況,原先設定使用 PDF-XChange Viewer 來開啟 PDF 檔,不知何故,開啟的設定竟然跑掉,竟變成使用 Firefox 開啟!!

不信邪,便一再重新設定「檔案開啟」的應用程式,都沒辦法如願,最後只好請求 Google 大神協助,找到了 FileTypeMan 這隻免安裝程式,才把問題解決掉!!原來是我自己再前一陣子,將 PDF-XChange Viewer Portable 版的目錄,由 C: 改到 D: ,造成 PDF-XChange Viewer 無法正常顯示在「建議的程式」之中,透過 FileTypeMan 修改錯誤的 registry,完成後,就可看到 PDF-XChange Viewer 可以正常顯示在「建議的程式」之中了!!!

參考資料:FileTypesMan 可更改 Windows 7 檔案類型的預設圖示(免安裝 繁體中文版)

2012-03-17

Ubuntu 雙網卡與 Internet 連線


# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
     address 192.168.1.11
     netmask 255.255.255.0
     gateway 192.168.1.1

# The 2nd network interface
auto eth1
iface eth1 inet static
     address 192.168.0.11
     netmask 255.255.255.0
     gateway 192.168.0.1

# 第二張網卡設了 gateway,需另外增加 route 規則才能讓  LAN 網路暢通。
# Add static route for eth1
up route add -net 192.168.0.0/24 gw 192.168.0.1 dev eth1

# 若要能連上 internet,需再加設 route 規則才能連。
# Add static route for internet connection via eth0
up route add -net 0.0.0.0/0 gw 192.168.1.1 dev eth0

2012-03-14

啟動php5-fpm出現pm.start_servers is not set


若啟動 php5-fpm 出現以下的警告訊息:

[WARNING] [pool www] pm.start_servers is not set. It's been set to 20.


解決方式就是編輯 /etc/php5/fpm/pool.d/www.conf 這個檔,並將 pm.start_servers 的註解拿掉。

Ref: php5-fpm incomplete install - no config file

2012-03-13

使用 Apache Bench 來測試 Web Server

測試環境:Ubuntu 11.04, cherokee 1.2.101

1. Stop Web Server.
       sudo /etc/init.d/cherokee stop

2. Install apache2-utils.
        sudo apt-get install apache2-utils

3. Start Web Server
        sudo /etc/init.d/cherokee start

4. 開個終端機
        ab -n400 -c400 http://server/


This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.11 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Finished 400 requests


Server Software:        Cherokee/1.2.101
Server Hostname:        192.168.1.11
Server Port:            80

Document Path:          /drupal/
Document Length:        7930 bytes

Concurrency Level:      400
Time taken for tests:   35.510 seconds
Complete requests:      400
Failed requests:        177
   (Connect: 0, Receive: 0, Length: 177, Exceptions: 0)
Write errors:           0
Non-2xx responses:      177
Total transferred:      1898081 bytes
HTML transferred:       1795825 bytes
Requests per second:    11.26 [#/sec] (mean)
Time per request:       35510.233 [ms] (mean)
Time per request:       88.776 [ms] (mean, across all concurrent requests)
Transfer rate:          52.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       85  121  19.8    119     159
Processing:  3565 19163 7843.7  15815   35318
Waiting:     3265 18942 7782.1  15803   35299
Total:       3720 19285 7842.8  15914   35431

Percentage of the requests served within a certain time (ms)
  50%  15914
  66%  19418
  75%  25004
  80%  27121
  90%  33780
  95%  34568
  98%  35323
  99%  35392
 100%  35431 (longest request)


2012-03-11

用 Bad Behavivor 阻擋網路蟑螂

我經常在網路上的論壇經常會碰到一些網路蟑螂(spambots),經常到處製造許多的垃圾訊息,讓人很討厭又頭疼!!

今日無意間看到有個部落格竟然使用 Bad Behavivor 這個東西,並說「阻擋了 286 個過去 7 天試圖闖關的垃圾迴響與引用。」好奇之下,造訪了這個網站,查看一番。OSS的,太棒了,且可根據您的網站 GPL v2, v3 也相對提供符合的版本,也對多種不同的 blog, CMS ...提供了配合的安裝版本,當然 Drupal版本 也是其中之一。