#!/usr/bin/env python
import sys, glob
if len(sys.argv[1:]) < 2:
print """USAGE: %s....
Displays old FourCC and optionally changes it to the given new one.""" % (
sys.argv[0])
sys.exit(1)
newFourCC = sys.argv[1]
assert len(newFourCC) == 4
for arg in sys.argv[2:] :
for fname in glob.glob(arg) :
f = file(fname, "r+b")
f.seek(0x70)
a = f.read(4)
f.seek(0xbc)
b = f.read(4)
print 'old fourcc %s: ' % fname, a, b
f.seek(0x70)
f.write(newFourCC)
f.seek(0xbc)
f.write(newFourCC)
f.close()
Monday, October 08, 2007
Python Script สำหรับเปลี่ยน FourCC ของไฟล์ AVI
ไปเจอสคริปต์ในเน็ต เอามาแก้ดูก็ใช้ได้ดีบนวินโดวส์นะ
Monday, June 04, 2007
Syncing Google Calendar with Phone Mobile (various approach)
I just purchase a cheap multimedia phone Nokia 3110 classic. Since this Mobile support GPRS/EDGE and have built-in Calendar & SyncML (are there still any phone without this functionality). I'm interest in synching its calendar with my Google Calendar. Somehow I have multiple calendar which I want to sync with my mobile phone Calendar, so the solution must be able to sync multiple calendar with my phone. There's somehow many solutions
- Syncing Google Calendar with Outlook Calendar and sync again with Nokia PC Suite - I can't do this since I'm not using Outlook anymore.
- Gcalsync - This seems to be the best solution. Somehow it's not 100% working for me. Gcalsync refuse to connect to my Calendar (invalid ports). And I can't set my phone proxy as said in Gcalsync web-site. Anyways I can sync the calendar if I specified my full private URL, thus means I can only sync 1 calendar.
- Scheduleworld - A free services, using Open-Source sync server funambol & SyncML, which you can store your mobile phone contacts, calendar, and notes on server. Scheduleworld can also sync with Google Calendar, although only one calendar at a time (but you can specify any Calendar). This works for me. But again, one calendar.
- Goosync - A (partially) free services to sync Google Calendar with Mobile phone Calendar using SyncML. This seems to be my perfect solution. Somehow syncing multiple calendar is not free. Free service only allow you to sync your default Calendar. I don't sure if this works because I didn't try it out, but looks very promising.
- WAP page of Google Calendar - Google actually have a WAP page to access Calendar on Mobile phone. Anyways think of the cost that I need to pay to access it every time. Anyways I can use this to add my event & appointment.
Friday, May 25, 2007
Setting per-node slot for SGE
Instead of disable hyper-threading, we can also
Then change the number after "hostname=" to appropriate value
qconf -sq all.q
Then change the number after "hostname=" to appropriate value
Thursday, May 24, 2007
IPMI Tool
IPMI setup on Linux
- service ipmi start
- ipmitool -I open chassis status
- ipmitool -I open sdr list
- ipmitool -I open sensor list
Sunday, May 13, 2007
Solaris 10 Patch (update) management
คำสั่งที่สำคัญ
- pprosetup - Setup patch เช่น บอกให้รันทุกวัน ทุกเดือน ฯลฯ
- pprosvc - download & install patch (น่าจะคล้ายๆ yum)
- smpatch - ลง patch (ใช้เวลาที่ลง patch ไม่ได้)
Thursday, May 03, 2007
Wednesday, May 02, 2007
Start GT4.0.4 container on WindowsXP
- Request for hostcert on Windows machine
C:\GT4\bin>grid-cert-request -service host -host localhost -caEmail ca@hpcnc.cpe
.ku.ac.th -orgBaseDN "ou=ThaiGrid,o=Grid" -dir C:\GT4\etc\grid-security
- Put hostcert to destined directory. Send cert request to CA to sign, put it back to C:\GT4\etc\grid-security\
- Init proxy for globus container
C:\GT4\bin>grid-proxy-init -hours 2000 -cert C:\GT4\etc\grid-security\hostcert.p
em -key C:\GT4\etc\grid-security\hostkey.pem -out C:\GT4\etc\grid-security\hostp
roxy.pem
Your identity: O=Grid,OU=ThaiGrid,CN=host/localhost
Creating proxy, please wait...
Proxy verify OK
Your proxy is valid until Wed Jul 25 01:37:18 ICT 2007
Warning: Please check file permissions for your proxy file.
C:\GT4\bin>
- Edit C:\GT4\bin\globus-start-container.bat. Modify X509_USER_CERT and X509_CA_CERT to point to correct directory
- Start globus container
globus-start-container
Tuesday, May 01, 2007
SGE script to submit amber
#!/bin/bash
#$ -V
#$ -cwd
#$ -pe mpich 4
/opt/mpich/intel/bin/mpirun -np $NSLOTS -machinefile $TMPDIR/machines /share/apps/amber9/exe/sander.MPI -O -i min1.in -o min1.out -p 1jso.top -r 1jso_min1.rst -c 1jso.crd -ref 1jso.crd
Monday, April 30, 2007
Request for server SSL certificates using existing Grid CA
It's possible to have Grid CA to sign normal server program certificates. To do that
And e-mail certreq.pem to Grid CA to sign with "grid-ca-sign", as usual
openssl req -new -key key.pem -config globus-user-ssl.conf -out certreq.pem
And e-mail certreq.pem to Grid CA to sign with "grid-ca-sign", as usual
Wednesday, April 04, 2007
Wednesday, February 28, 2007
Python distutils MANIFEST
MANIFEST list files included in 'sdist' target of setup.py. Somehow sometimes people forgot to list every important files in here. To solve this, create MANIFEST.in and list those missing files in it.
Just in case I forgot again
MANIFEST.in
include *.txt
include src/*.i
Then rebuild the packages
Just in case I forgot again
MANIFEST.in
include *.txt
include src/*.i
Then rebuild the packages
Monday, February 26, 2007
TRAC & SQLite
TRAC Upgrade
- trac-admin /path/to/trac/env upgrade
- sqlite3 /path/to/.db
- >.dump
- >.output /tmp/dumped-db.sql
- > Ctrl-D
- sqlite3 /path/to/new.db
- >.read /tmp/dumped-db.sql
- > Ctrl-D
- SQLite support in PHP is conflict with python-sqlite and mod_python. Need to disable it at /etc/php.d/pdo_sqlite.ini (or either remove php-pdo package).
Thursday, February 22, 2007
heartbeat setup
สิ่งสำคัญในการ setup heartbeat2+crm
- Permission ของ /var/lib/heartbeat, /var/run/heartbeat ต้องถูกหมด (ดูได้จาก blog เก่า)
- ucast ต้องใส่ ip ให้ถูก
- ต้อง cleanup resource หนึ่งครั้ง (crm_resource -C -r
ดูได้จาก crm_resource -L)
Wednesday, February 21, 2007
Tuesday, February 20, 2007
Important files for heartbeat
Important files for heartbeat that need to have hacluster:haclient ownership
/var/run/heartbeat/ccm
/var/run/heartbeat/ccm
/var/lib/heartbeat/crm
/var/lib/heartbeat/pengine
/var/lib/heartbeat/cores/hacluster
/var/lib/heartbeat/cores/hacluster/*
Monday, February 12, 2007
Wednesday, February 07, 2007
Setting up drbd for ROCKS
อืม... ถ้าจะใส่ drbd ลงใน NPACI Rocks สิ่งที่น่าจะทำก็น่าจะมี
- Setup /etc/drbd.conf ให้ถูกตั้งแต่ตอน
- กำหนด label ใน replace-auto-partition
- cat /proc/partitions
- ไล่ทีละอัน หาว่าอันไหนมี label ตรงตามชื่อที่กำหนดไว้
- ลบออกจาก fstab หลังจากลงเสร็จ
- สร้าง /etc/drbd.conf โดยอิงตาม device ที่หาเจอ
- เริ่ม drbd (/etc/init.d/drbd น่าจะทำให้)
- ใส่ post-drbd ใน /etc/rocksconfig.d/ ให้เรียก drbdadm -- -do-what-I-say primary all ที่เครื่องที่ควรจะเป็น primary
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 ทิ้งไว้ถึงจะลงได้จริงๆ)
Wednesday, January 10, 2007
Sun freeware
กันลืมครับ (ลืมไปทีแล้ว กว่าจะรื้อฟื้นได้)
ซอฟต์แวร์พวกฟรีๆทั้งหลายบน SUN สามารถหาได้ที่ www.sunfreeware.com (mirror ที่ http://www.sunfreeware.com/ftp.html) ให้ดาวน์โหลดโปรแกรม pkg-get มาก่อน จากนั้นติดตั้งโดย
ซอฟต์แวร์พวกฟรีๆทั้งหลายบน 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 รายชื่อโปรแกรมได้
Subscribe to:
Posts (Atom)