Archive for April, 2007

OpenVPN on FC4 note

Sunday, April 15th, 2007

Server

  1. yum install openvpn
  2. cp -R /usr/share/openvpn/easy-rsa /etc/openvpn
  3. cd /etc/openvpn/easy-rsa
  4. vim vars:
    # easy-rsa parameter settings
    # NOTE: If you installed from an RPM,
    # don't edit this file in place in
    # /usr/share/openvpn/easy-rsa --
    # instead, you should copy the whole
    # easy-rsa directory to another location
    # (such as /etc/openvpn) so that your
    # edits will not be wiped out by a future
    # OpenVPN package upgrade.
    # This variable should point to
    # the top level of the easy-rsa
    # tree.
    
    export D=`pwd`
    
    # This variable should point to
    # the openssl.cnf file included
    # with easy-rsa.
    
    export KEY_CONFIG=$D/openssl.cnf
    
    # Edit this variable to point to
    # your soon-to-be-created key
    # directory.
    #
    # WARNING: clean-all will do
    # a rm -rf on this directory
    # so make sure you define
    # it correctly!
    
    export KEY_DIR="/etc/openvpn/keys"
    
    # Issue rm -rf warning
    
    echo NOTE: when you run ./clean-all, I will be doing a rm -rf on $KEY_DIR
    
    # Increase this to 2048 if you
    # are paranoid.  This will slow
    # down TLS negotiation performance
    # as well as the one-time DH parms
    # generation process.
    
    export KEY_SIZE=1024
    
    # These are the default values for fields
    # which will be placed in the certificate.
    # Don't leave any of these fields blank.
    
    export KEY_COUNTRY=US
    export KEY_PROVINCE=CA
    export KEY_CITY=SANDIEGO
    export KEY_ORG="TAROTOAST.COM"
    export KEY_EMAIL="chang.peter@gmail.com"
  5. chmod 700 *
  6. mkdir /etc/openvpn/keys
  7. make sure in Bash shell (still at /etc/openvpn/easy-rsa directory)
  8. ./vars
  9. ./clean-all
  10. ./build-ca
    Enter ROOTCA for common name
  11. ./build-key-server server
    Enter ROOT for common name
  12. ./build-key [computername] <– repeat for # of computers want to allow connect
    Enter [computername] as common name
    EX: ./build-key AMD64
    EX: ./build-key X40
  13. ./build-dh
  14. vim /etc/openvpn/server.conf:
    port 1194
    proto tcp
    dev tun
    ca keys/ca.crt
    cert keys/server.crt
    key keys/server.key
    dh keys/dh1024.pem
    server 10.11.12.0 255.255.255.0
    client-config-dir ccd
    push "dhcp-option DNS SERVERIP"
    push "dhcp-option DNS SERVERDNS"
    ifconfig-pool-persist ipp.txt
    push "redirect-gateway"
    keepalive 10 120
    comp-lzo
    persist-key
    persist-tun
    status server-tcp.log
    verb 3
  15. Create log files: touch /etc/openvpn/server-tcp.log /etc/openvpn/ipp.txt
  16. vim /etc/init.d/openvpn:
    Uncomment line 114
    /sbin/modprobe tun >/dev/null 2>&1

    Insert after line 115

    iptables -t nat -A POSTROUTING -s 10.11.12.3 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.4 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.5 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.6 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.7 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.8 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.9 -j SNAT --to SERVERIP
    iptables -t nat -A POSTROUTING -s 10.11.12.10 -j SNAT --to SERVERIP
  17. service openvpn start

Client (Windows Vista with UAC on)

  1. Download and install OpenVPN Gui 1.0.3 with OpenVPN 2.0.9 [Here]
  2. Scary warning will pop up telling you the driver will not work, install it anyway. OpenVPN’s developers fixed it already.
  3. Make a shortcut on desktop to GUI executable “C:\Program Files\OpenVPN\bin\openvpn-gui-1.0.3.exe”
  4. Use WinSCP to download these files onto the client computer:
    /etc/openvpn/keys/ca.crt
    /etc/openvpn/keys/AMD64.key
    /etc/openvpn/keys/AMD64.crt
  5. Put above files along with this VPNServer.ovpn in C:\Program Files\OpenVPN\config
    VPNServer.ovpn
    client
    dev tun
    proto tcp
    remote SERVERIP 1194
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    ca ca.crt
    cert AMD64.crt
    key AMD64.key
    ns-cert-type server
    push "dhcp-option DNS SERVERIP"
    push "dhcp-option DNS SERVERDNSIP"
    comp-lzo
    verb 3
    route-method exe
    route-delay 2
    
  6. Right click on the shortcut to openvpn-gui-1.0.3.exe, select Run As Administrator
  7. On the taskbar, right click the openvpn gui icon, select connect

DONE [aha

The above mostly follows [this thread] except some minor changes in client side config.

small update

Sunday, April 15th, 2007
  • byebye SK2, hello Akismet
  • byebye Counterize, hello Counterize II
  • byebye localhost mysqld, hello BH’s mysqld (via ssh tunnel)
  • byebye K2, hello other wp themes

Sharing Hapiness

Friday, April 13th, 2007

今天當了見證人,看著兩個好朋友變成一對夫妻。

早上 6:2x 開始賴床,到了 6:50 終於起床去洗澡換衣服準備出門。終於到了車上的時候已經是 7:30 了。開往辦事處的路上一面聽著收音機,聽到說路況好像不是很好,說不定會遲到,但是沒想到還是早了 10 分鐘到。還有時間就去買了個 JBX 的早餐,邊吃邊喝咖啡等著今天的新郎與新娘到來。

8:15 我的電話響了,終於到了呢。幫她們開門之際,新郎還不忘很搞笑的問我有沒有準備演講,跟我說我得講個 10 分鐘,要我趕快想台詞。我大概愣了 5 秒後發現原來他在惡搞我,唉呀,等下得整回來。新郎拿的他的高級 dSLR 相機請我幫她們過程中拍照,我肖想玩 dSLR 很久了,當然馬上答應。dSLR 真的好棒阿 XD 不管是 zoom、調整光圈、調整 exposure、調整 flash 程度,整個都非常的專業,室內照片的效果真的是比傻瓜相機好太多了。於是我就很黑皮的隨便一直亂照,不管是她們在填表格、新娘跑去刷卡結帳、新郎新娘在等待時候的親密小動作,我都記錄下來了。唉呀就是這些小動作在看照片的時候才會微笑呀。

本來以為並不需要做 ceremony ($50),但是發現原來這個 ceremony 是法律上規定一定要的,所以臨時決定當場在那邊做。幫我們辦事的處理員,唔,就叫他 Jermy 吧。8:40,他叫我們先到對面的 Marriage Room 進去等候,我們在裡面還沒亂照夠的時候 Jermy 就套著一件神父裝走了近來,真有搞笑的感覺。

再來 Jermy 就領著新郎跟新娘一起互訴 oath,基本上這段跟電影情節的確是一樣的,就一堆 yes i do。Jermy 跟我說我可以在旁邊隨意移動亂拍照,我的確就隨意移動亂拍照 XD。場面是似這樣:有個稍微有花草裝飾的小講台,然後 Jermy 一臉專業的問著問題。講台前面站著這對新人,滿臉笑容的望著 Jermy,兩手還不忘握著搓來搓去,閃弊了。然後我在旁邊繞著這三個人不斷的用這台 dSLR 照阿照阿照阿。講台後面、新郎新娘左邊、右邊、講台與新郎新娘中間、Jermy 面錢的講稿,反正想的到的拍照角度都照了,如果有人從後面整個拍起來我的移動應該很搞笑。

8:50,最後那句 You may kiss the bride 應該是閃耀高潮吧。雖然這只是法律上的手續,對她們兩而言只是像實間到要繳稅一樣,但是隨著越多個 i do,她們臉上的笑容也越來越開心。雖然很閃,但是見證了很開心的這一刻也會讓自己開心呢,嗯,會傳染的。

Best Wishes :)

Bluehost 筆記

Wednesday, April 4th, 2007

結果選了 Bluehost。原因很多而且說不清,但是簡單說就是讀了很多 BH Forum 上面的文章後最後 follow my heart 所作的決定。是不是因為裡面 moderator 說 BH 是 CEO 的 baby 我不知道,反正綜合了很多文章最後內心裡面的奇妙邏輯決定要 BH 的。

有關 BH 的一些 note:

Installing SVN 1.4.3 (source)

#

# this is how I installed subversion 1.4.3 on my bluehost account

#mkdir ~/src

# get and make 'apr-0.9.13' (this isn't included in the subversion tarball)

cd ~/src

wget http://apache.ausgamers.com/apr/apr-0.9.13.tar.gz

tar -xzf apr-0.9.13.tar.gz

cd apr-0.9.13

./configure --prefix=$HOME

make

make install

# get and make 'apr-util 0.9.13' (this isn't included in the subversion tarball either)

cd ~/src

wget http://apache.planetmirror.com.au/dist/apr/apr-util-0.9.13.tar.gz

tar -xzf apr-util-0.9.13.tar.gz

cd apr-util-0.9.13

./configure --prefix=$HOME --with-apr=$HOME

make

make install

# get and make 'subversion-1.4.3'

cd ~/src

wget http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz

tar -xzf subversion-1.4.3.tar.gz

cd subversion-1.4.3

./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl

# at this point there's a bit of complaining about berkeley db, let's ignore that...

make

make install

# check it works!

cd

svn --version

# yay!

SSH

Helpdesk 裡面說要寫信到 support@bluehost.com,但是其實不是。寫過去只會被退回說現在必須開 ticket 才行。正確做法是進入 cPanel (BH 的 cPanel 好像比 HM 的好看) 然後注意看右下角會看到一個 SSH Access 的選像,點下去就會把你丟到正確的地方了。填好資料 (domain name 和 cPanel 的密碼) 然後送出後的下一頁就可以夾帶檔案。把駕照用數位相機拍下來夾上去就 ok 了。

SSH 是個 chroot 的環境,但是但部分軟體像上面那樣,只要 configure 實後記得加 –prefix=$HOME 其實都可以裝。有個很爛的就是他對外所有連結只能 port 80。不能 ssh 回家耶,不能 sftp 回家耶,有沒有爛到這種程度 \囧/

Domains

BH 只收 5 個 addon domain,加上原本的 master domain,全部只能有 6 個。搞不好我會開始反悔了。不過說真的她資料夾的放法有夠弱,我還不知道有比 1&1 更弱的放法。她所有 addon domain 的資料夾都是掛在 ~/public_html/ 下面,並不能由選單上面選擇說你要放在 ~/domains/domain1/ 之類的更合邏輯的資料夾。根據 forum 上指出,其實打電話去可以叫 tech support 幫忙手動改,所以可能會等把所有 addon 都放上後再一次看哪些要改全部一起改吧。

Support

他們的 Support 系統如果拿 1&1 的來比的話,1&1 根本是大便。電話打進去如果沒有馬上接起來的話,會每分鐘跟妳說你前面還有幾個人在等,我等最久也才 5 分鐘左右。跟 1&1 的 3x 分再加後面的 1x 分 on hold 比起來,天使吧。

他們的 Ticket 也回應頗快,每個丟出去的 Ticket 都有個 Due Time,都是 12 HR 內得回應。好吧目前為止我只丟了兩個,但是這兩個都有在時限內回,而且都回的頗快的。至少到目前為止都還很滿意。

Bandwidth

從台灣學網對 1&1 和對 BH 的速度比起來,BH 很明顯快太多了 (160KB/s vs 38KB/s),然後我從家裡對 1&1 和 BH 的測試則是 1&1 略快。不過可能是 BH 對每個 TCP connection 有限制,所以我把 FlashGet 調成 6 條後速度也是一樣 max 在 cable 的頻寬。1&1 <–> BH 的速度還真黑皮,每個 TCP connection 的速度都是 1MB/s,然後同時 wget 四個檔,全部也都是 1MB/s。

將陸續增加..

梅子口味的幸福

Tuesday, April 3rd, 2007

看著海苔魚片

看著超味魷魚

看著模範生點心餅

看著還貼著 $12 元的巧克力酥片

看著兩袋三葉鹹葡萄乾

看著四包ㄋㄟㄋㄟ補給站

看著四包獨享杯

看著一排的密蘭諾鬆塔

看著兩排的番薯糖

看著… 驚!開味名菜-愛之味麻婆豆腐

<請填入 HAPPY 的大笑臉>

All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh