Friday, January 19, 2007

My experience with Asus WL500GP

หลังจากได้เล่น ASUS WL500GP (Wireless Router + 4 ports LAN + partial ADSL support, 8MB Rom, 32MB Memory) มาสองวัน คงต้องบันทึุกสิ่งที่ทำซะหน่อยเดี๋ยวจะลืมว่าทำอะไรลงไปมั่ง
  • OpenWRT - Firmware ตัวแรกที่ลองลง โดยรวมๆแล้วดีมากเลย เล็ก feature ครบ package เพิ่มเพียบ แต่จะเน้นว่าให้ลง package อื่นเพิ่มเอง แนะนำว่าถ้าลง X-wrt ไปด้วย (เป็น package เพิ่มเติม แก้ web interface เป็นหลัก) จะได้ web interface ที่สวยและดีมากเลย (มี real time monitoring บนเวปที่เป็น svg ด้วย) ข้อเสียคือ ใช้ USB2 แล้วช้าครับ เหมือนจะบั๊ก
  • Oleg's Firmware - Custom firmware จาก original firmware ของ asus ตัวนี้จะดีตรงที่ได้ feature ทุกอย่างของดั้งเดิมมาด้วย แต่แก้ลำบาก ตอนที่ลองใช้นี่เหมือนว่า jffs จะใช้ไม่ค่อยจะได้ แถมไม่มีการทำให้แบบอัตโนมัติด้วยคงต้องโมเอง เน้นว่าแก้อะไรให้ใช้ flashfs save file เก็บไว้แล้วมันจะโหลดกลับมาทีหลัง มี package ให้ลงเพิ่มเยอะพอสมควร ข้อดีอีกอย่างคือได้ ntfs แถมมาด้วย (แต่เขียนไม่ได้นะ)
  • dd-wrt - ณ ตอนนี้เป็น firmware ที่ยังใช้อยู่ จะออกแนวคล้ายๆ Oleg คือลงปุ้ปครบหมดเลย ตัวใหญ่พอๆกัน (3.5M ได้ OpenWRT แค่ 1.6M เอง) แต่เหมือนจะอยู่ตรงกลางระหว่าง Oleg กับ OpenWRT คือแก้ให้มี JFFS ได้ ลงนี่นั่นเพิ่มได้ง่ายพอควร package compat กับ openwrt ด้วย (แม้กระทั่ง kernel module) ที่สำคัญ USB2 มันเร็วใช้ได้แฮะ (ราวๆ 6-7MB/s hdparm ได้ 90MB/s) แต่กำลังสงสัยว่าเป็นเพราะต้อง mount แบบยาวๆหรือเปล่า (mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt แทนที่จะเป็น mount /dev/sda1 /mnt) หรือว่าจริงๆ OpenWRT มันก็เร็วได้หว่า
  • NSLU2-linux - อันนี้ไม่ได้เกี่ยวอะไรโดยตรงกับ WL500GP NSLU2 เป็น NAS Device ของ Linksys ซึ่งเป็น Linux เหมือนกัน เข้าทำนองเดียวกับพวก wrt นี่แหละ แต่จุดสำคัญคือมันใช้ CPU คล้ายๆกับพวก WRT ทำให้มีแพกแกจย่อยที่ support ทั้ง OpenWRT, Oleg, dd-wrt ออกมาด้วย package ย่อยส่วนใหญ่ก็มาจากโปรเจ็คนี้แหละ (แต่ๆละตัวใหญ่ๆทั้งนั้นเลย ต้องเสียบ flash ทิ้งไว้ถึงจะลงได้จริงๆ)
โดยรวมๆแล้วสนุกดีเหมือนกันเจ้า router ตัวนี้ แถมน่าจะใช้ประโยชน์ได้เยอะเลย น่าเสียดายขาดพอร์ต adsl ไปแต่ใช้คู่กับ billion bipac ที่แถมมากับ true ก็โอเคนะ

Wednesday, January 10, 2007

Sun freeware

กันลืมครับ (ลืมไปทีแล้ว กว่าจะรื้อฟื้นได้)

ซอฟต์แวร์พวกฟรีๆทั้งหลายบน SUN สามารถหาได้ที่ www.sunfreeware.com (mirror ที่ http://www.sunfreeware.com/ftp.html) ให้ดาวน์โหลดโปรแกรม pkg-get มาก่อน จากนั้นติดตั้งโดย
pkgadd -d BOLTpkgxxx.gz
ถ้าจะดูชื่อ package อื่นๆใน SunOS ก็
pkginfo
พอได้ pkg-get มาแล้ว ให้แก้ /etc/pkg-get.conf ให้ใช้ mirror อื่นๆที่มันเร็วกว่า เสร็จแล้วเวลาจะดาวน์โหลดโปรแกรมฟรีจะทำคล้ายๆ yum, apt
pkg-get -i <ชื่อโปรแกรม>
สั่ง
pkg-get -a
เพื่อดู list รายชื่อโปรแกรมได้

Tuesday, October 17, 2006

Remove node from gfarm 1.3

This instruction apply to Gfarm 1.3.1 using Postgresql backend metadata storage only

1. Remove the node from your cluster. Ex: For NPACI Rocks 4.2
insert-ethers --remove compute-0-7
2. Use psql to access gfarm database. Make sure to change the port number to the correct port. Use 'ps auxw | grep postmaster' to find the port number
psql -p 10602 gfarm farm
3. From psql prompt, input
DELETE FROM filesectioncopy WHERE hostname='compute-0-7.local';
4.Exit from psql. Now the node has been removed permanently from database. Remove it from gfarm now.
gfhost -d compute-0-7.local
That should be all.

Monday, January 16, 2006

5. LVS: The ARP Problem

Another LVS note, in case I would forgot this. This is from http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.arp_problem.html

5. LVS: The ARP Problem: "2.4.26 and 2.6.4 will come with 2 new device flags for tuning the ARP stack: arp_announce and arp_ignore. All IPVS like setups can use arp_announce=2 and arp_ignore=1/2/3 to solve the 'ARP problem' with DR/TUN setups. These flags are going to replace the 'hidden' functionality which does not work well for directors when they are changing their role between master/slave for a particular VIP. The risk is that other hosts can probe for VIP using unicast packets for which the hidden flag always replies. I'll continue to support the hidden flag for 2.4 and 2.6 to help existing setups but switching to the new device flags (or other solutions) is recommended.

Documentation is in the 2.6 kernel docs (linux/Documentation/networking/ip-sysctl.txt).

arp_ignore: 1 - reply only if the target IP address is local address configured on the incoming interface. if eth0/arp_ignore=1 then all IPs on eth0 are replied, all others (on lo) are not."

Friday, January 13, 2006

Sunday, December 11, 2005

Save Mozilla profiles and mail and migrate to another machine

Mozilla profiles are stored at C:\Documents and Settings\\Application Data\Thunderbird\Profiles by default. There will be a random-named directory inside the Profiles directory. That's our profile directory. Save it somewhere (including all mails) and move it to another machine.

In another machine, install TB and then goes to the Thunderbird directory in Application Data. Open profiles.ini and replace [Profile0] section with

[Profile0]
Name=default
IsRelative=0
Path=D:\Documents and Settings\\Application Data\Thunderbird\Profiles\8c9mmh0q.default


In this case, I place the old profiles at D:\ so that it will not ever lost again.

Now, restart Thunderbird. This time thunderbird might crash, dont' worry. Just remove all extensions and re-install it and everything should works fine.

Monday, September 26, 2005

Backing up a DVD to AVI with merged subtitle using Mencoder

  • Encode Audio
    • mencoder vob_03_005t.vob -ovc frameno -oac mp3lame -o frameno.avi
  • Encode Video 1st pass
    • mencoder vob_03_005t.vob -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1973:vhq:vqmin=2:vpass=1:autoaspect -oac copy -o /dev/null
  • Encode Video 2nd pass
    • mencoder vob_03_005t.vob -ovc lavc -sub subtitle.srt -lavcopts vcodec=mpeg4:vbitrate=1973:vhq:vqmin=2:vpass=2:autoaspect -af volumn=10db -oac copy -o video.avi

HOWTO Mencoder Introduction Guide - Gentoo Linux Wiki

HOWTO Mencoder Introduction Guide

Wednesday, September 21, 2005

Setting-up a Certificates Authority using OpenSSL

I forget this almost everytime, so write it down here just in case.

  1. Have OpenSSl install somewhere.
  2. Go to /share/ssl or sometimes ssl directory
  3. Fix openssl.conf. Change "demoCA" to "somethingCA" that's more appropriate.
  4. Change "-days 365" in misc/CA.sh to "-days 3650"
  5. misc/CA.sh -newca. A directory called "somethingCA" will be here.
  6. Now create a cert request
    1. misc/CA.sh -newreq for cert with passphrase
    2. To create a cert request without passphrase. "openssl genrsa -out newkey.pem 1024" then "openssl req -new -key newkey.pem -out newreq.pem"
  7. Sign the generated request with "misc/CA.sh -sign". It always looking for "newreq.pem" so be carefull. The new certificates will be in newcert.pem
  8. Copy key and cert to the machine which want to use these. Put it in appropriate directory (/usr/share/ssl/certs/{slapd-key.pem,slapd.pem} for OpenLDAP)
  9. Find the hash number of ca by "misc/c_hash somethingCA/cacert.pem". The printed value is the file name. Copy somethingCA/cacert.pem to /usr/share/ssl/certs/.0.
For OpenLDAP
  1. Need to fix /etc/openldap/ldap.conf and /etc/openldap/slapd.conf to accept the new CA
  2. Fix the following configuration
    1. "TLS_CACERT /usr/share/ssl/certs/fde68c33.0" in /etc/openldap/ldap.conf
    2. "TLSCACertificateFile /usr/share/ssl/certs/fde68c33.0" in /etc/openldap/slapd.conf
Hope that I'll never forget this again.

Monday, September 19, 2005