Friday, January 08, 2010

Complete guide สำหรับการ Convert หนัง HD ทีเป็น MKV มาเล่นบน PS3 พร้อมมี Subtitle ไทย

ขอจดทิ้งไว้จะได้ไม่ลืม มันลืมๆรายละเอียดทุกทีเลยเวลาจะทำ อันนี้เป็นวิธีการที่ทำแล้วสำเร็จบน Ubuntu Linux 9.10 (Karmic Koala) แต่จริงๆจะทำบน Windows ก็ได้ (ง่ายกว่าด้วย) โดยเอาหนังวางไว้บน External HDD อะไรก็ได้ที่ใหญ่พอ

อันนี้เป็นวิธี Convert หนัง HD ใน Format MKV (H264+DTS|AC3) ให้เป็น Format ที่เล่นได้บน PS3 พร้อม Subtitle ภาษาไทย

สั้นๆก่อน จริงๆแล้วการเล่นหนัง HDบน PS3 มันมี 2 ทาง ทางแรกคือไฟล์ MP4 ซึ่งพวก Anime Fansub จะชอบแจกแบบนั้น MP4 ใช้ได้ดีและมีซับไตเติ้ลแยกได้ (ไม่แน่ใจว่าภาษาไทยเวิร์คหรือเปล่านะ) แต่ปัญหาหลักคือไฟล์ MP4 มันต้องเป็นไฟล์ๆเดียว ทำให้ไฟล์วีดีโอยาวๆ 2 ชม. จะไม่สามารถเก็บลงบน External HDD ที่เป็น FAT32 (ขนาดไฟล์สูงสุด 4GB) ได้ ซึ่งปกติหนัง 720p ที่เป็น H264 MKV มักจะขนาดประมาณ 6GB ถ้า 1080p ก็ 8GB หรือมากกว่านั้นอีก ทำให้ไม่มีทางเลือก ต้องเล่นด้วยฟอร์แมต AVCHD เท่านั้น เพราะ AVCHD เป็นฟอร์แมตลักษณะเดียวกับ DVD (VIDEO_TS, AUDIO_TS) คือเป็นไฟล์หลายๆไฟล์แยกกัน แต่รวมเป็นวีดีโอเรื่องเดียว ทำให้เราแยกไฟล์เป็นไฟล์ย่อยๆที่เล็กกว่า 4GB ได้ (หวังว่าปัญหานี้คงจะหมดไปเมื่อ exFAT กลายเป็นที่นิยมนะ)

อีกปัญหาของชาวไทยคือ Subtitle ถ้าไม่ติดเรื่อง Subtitle หรือคิดว่าอ่าน Subtitle อังกฤษก็ได้ ก็สบาย ไม่ต้องทำอะไรมาก แต่ถ้าจะอ่าน Subtitle ไทย ทางเลือกจะเริ่มจำกัด อย่างแรกคือจะใช้วิธีแกะ Subtitle จาก Subtitle ที่เป็นรูปภาพนี่ทำไม่ได้ เพราะ OCR Software ของไทยยังไม่ดีพอ เอา OCR ฝรั่งมา Learn ก็ไม่ได้ เพราะภาษาเรามีการตัดคำไม่เหมือนภาษาอังกฤษ ทางเลือกเลยเหลือแค่ ต้องหา Subtitle ดีๆ ใน Format ที่เป็นภาพ ซึ่งส่วนใหญ่ก็จะต้องมาจากตัวหนังของจริง อาจจะมาจาก DVD หรือ Blueray Disc (BD) ก็ได้ หรือบางทีจะมีมือเทพที่มาแปลแบบดีมาก หรือไม่ก็มานั่งพิมพ์บทแปล จากเสียงพากย์ทั้งหมด มาแปลแล้วแจกตามเน็ต ถ้าเป็นอย่างหลังเอามาเป็น Text Subtitle พวก SRT ก็ได้ แหล่งหา Subtitle ดีๆ ก็เช่น 1080ip.com และ thaidvico.com

นิดนึงคือ ตัวไฟล์ MKV นั้น ควรจะที่ Resolution ตรง หรือใกล้เคียงกับ Resolution ที่ต้องการ เช่น 1280x720 หรือ 1980x1080 เพราะว่า PS3 จะไม่ปรับให้ตัวภาพอยู่ตรงกลางจอ ถ้าเกิดว่า Resolution ของภาพไม่พอดี ส่วนใหญ่ความกว้างจะพอดี แต่ความสูงจะน้อยไป เช่น 1980x800 สิ่งที่เกิดคือภาพจะเด้งไปชนขอบบนเสมอ ตรงด้านล่างจะเป็นแถบดำขนาดใหญ่ ถ้าไม่ซีเรียสก็ไม่เป็นไร

โปรแกรมที่ใช้
  1. SmartLabs tsMuxeR - ใช้แยกและรวม Stream ในไฟล์ MKV ให้เป็น Format AVCHD สามารถรวม Subtitle stream แบบ SUP (BD Subtitle) ดาวน์โหลดเวอร์ชัน Windows หรือ Linux ตามสะดวก โปรแกรมเป็นแบบคอมไพล์แล้ว (ไม่ใช่ Open Source) แต่รันได้ปกติบน Karmic
  2. BDSup2Sub - อันนี้ใช้ Convert subtitle ใน Subpicture Format (.idx, .sub) ซึ่งถอดออกมาจาก DVD ให้กลายเป็น .SUP ซึ่งเป็น Format ที่ tsMuxeR support โปรแกรมเป็น Java เพราะฉะนั้นถ้าจะรันบน Ubuntu ต้องลง sun-java6-bin ก่อน (sudo apt-get -y install sun-java6-bin)
  3. iconv - คำสั่ง iconv ไว้ convert character encoding ในกรณีที่ไฟล์เซฟมาเป็น tis-620 (windows-874) ให้กลายเป็น UTF-8 (Linux ส่วนใหญ่จะทำงานเฉพาะกับ UTF-8 ถ้าไม่ใช่นี่จะมีปัญหาร้อยแปด)
  4. สคริปต์ Python เปลี่ยนชื่อไฟล์ที่ผมเขียนเอง เพราะ PS3 AVCHD รับเฉพาะไฟล์ที่ชื่อไฟล์เป็นแบบ Dos 8.3 เท่านั้น ถ้าบน Windows จะมีโปรแกรมชื่อ AVCHDME ใช้แทนกันได้ Content ใน สคริปต์เป็นเช่นนี้


#!/usr/bin/python

import os, re
from optparse import OptionParser

usage = '%prog [options] /path/to/avchd/dir'

opt_parser = OptionParser(usage=usage)
opt_parser.add_option('-d', '--debug', dest='debug', action='store_true', default=False, help = 'debug')

options, args = opt_parser.parse_args()

def dosname(file) :
name_map = [
('index.bdmv', 'INDEX.BDM'),
('MovieObject.bdmv', 'MOVIEOBJ.BDM'),
(re.compile(r'(?P.*)\.clpi', re.IGNORECASE) , '.CPI'),
(re.compile(r'(?P.*)\.m2ts', re.IGNORECASE) , '.MTS'),
(re.compile(r'(?P.*)\.mpls', re.IGNORECASE) , '.MPL'),
]
for src, dst in name_map :
if type(src) == type('') :
if file == src :
return dst
else :
mo = src.match(file)
if mo :
return mo.group('name') + dst
return None

def avchdme(src_path, debug) :
'''Convert file name to AVCHD with Dos short file name style for PS3'''

for ent in os.listdir(src_path) :
full_path = os.path.join(src_path, ent)
if os.path.isdir(full_path) :
avchdme(full_path, debug)
else :
newname = dosname(ent)
if newname :
src = full_path
dst = os.path.join(src_path, newname)
if debug :
print 'renaming %s to %s' % (src, dst)
else :
os.rename(src, dst)

for arg in args :
avchdme(arg, options.debug)

เอาสคริปต์มาเซฟเป็นไฟล์ชื่อ ps3me ที่ไหนก็ได้ (แนะนำ /usr/local/bin) อย่าลืม chmod a+x ด้วยจะได้รันได้ กระบวนการทั้งหมดจะใช้เวลาประมาณ 10-15 นาที แล้วแต่ขนาดไฟล์ ไม่มีการ Re-encode ไฟล์ใหม่จึงไม่เสียเวลามาก เท่าที่ลองดู พบว่าเวลาจะสัมพันธ์กับขนาดไฟล์เป็นหลัก

วิธีการทำ
  • ต่อ External HDD เข้ากับเครื่อง ซึ่งต้อง Format เป็น FAT32 เท่านั้น (ถ้าจะ Format บน Ubuntu ก็ใช้ mkfs.vfat ได้) และสร้าง Directory AVCHD ไว้ที่นอกสุด
  • ไฟล์ต้นฉบับแนะนำให้เก็บไว้บนคอมพิวเตอร์ แต่ไฟล์ปลายทางเราจะให้เขียนลงบน External HDD เลย ถ้าให้ทั้งอ่านเขียนลงบน HDD เดียวกันจะนานมาก
  • ถ้า Subtitle เป็นไฟล์ภาพ (.idx, .sub) ซึ่งจะมาคู่กัน
    • เปิด BDSup2Sub ซึ่งดาวน์โหลดมาเป็นไฟล์ .jar ด้วย Java
    • java -jar BDSup2Sub.jar
    • กด Load Subtitle file .idx หรือ .sub ก็ได้
    • ตรง Convert Resolution เลือก Format ของหนังให้ตรงกับที่ต้องการ (1080p หรือ 720p) โปรแกรมจะปรับขนาดของ Subtitle ให้ด้วย นอกนั้นทิ้งไว้คงเดิม กด OK
    • ตามประสบการณ์ พบว่าต้อง Move subtitle ทั้งหมดเนื่องจากเวลารวมแล้วจะตกขอบ ให้ไปตรง Edit->Move All Captions ตรงแกน X เลือก move to center (ดูเหมือนไม่มีผลอะไร แต่พบว่าบางที Subtitle ไปตกซ้ายสุดของจอจนตกขอบก็มี) ตรงแกน Y เลือก Keep Y Position ก็ได้ ถ้าเอาชัวร์ ให้กด move outside bounds แล้วใส่ Offset Y ไว้ที่ 50 เสร็จแล้วกด Move All
    • ตรง Windows หลัก กดเลือก Output Format เป็น SUP(BD) นอกนั้นทิ้งไว้คงเดิม
    • กด File->Save/Export โปรแกรมจะเซฟไฟล์เป็น .sup ให้ จำ Path เอาไว้
  • ถ้า Subtitle เป็นไฟล์ text (.srt)
    • ลองเปิดไฟล์ด้วย gedit ดู ถ้าพบว่าอ่านไม่ออก จะต้อง Convert ด้วย iconv ก่อน โดย
    • iconv -f tis-620 -t utf-8 -o destinatino_subtitle_file.srt source_subtitle_file.srt
    • ที่เหลือปล่อยให้ tsMuxeR จัดการทั้งหมดเลย
  • เรียกคำสั่ง tsMuxerGUI (./tsMuxerGUI)
  • กด Add ไฟล์ MKV รอสักเล็กน้อย จะ List stream มาให้เราดูว่ามีอะไรบ้าง
  • ถ้าจะ add subtitle ที่เป็น .sup ให้กด add อีกที แล้วเลือกไฟล์ .sup ของเรา ตรง Language เลือกเป็นภาษาไทย (tha พิมพ์ tha ติดกันเลยก็ได้)
  • ตรง Split & Cut ให้เลือก Split by size very แล้วใส่ 4GB
  • ถ้ามี Text Subtitle ให้ไปที่ tab subtitles แล้วเลือก Font บน Ubuntu แนะนำ Norasi ดีกว่า
  • ตรง Vertical Position ให้ติ้กตรง Bottom of Screen แล้วใส่ offset สัก 50 เพื่อจะได้ไม่ตกจอ
  • ตรงกรอบ Output เลือก AVCHD Disk แล้ว Browse directory ปลายทาง โดยเลือก /AVCHD ของ External HDD ไว้
  • กด Start Muxing แล้วรอๆๆ ไม่นานมาก พอเสร็จแล้วจะมี directory BDMV และ Certificate โผล่มาใน /AVCHD
  • เอาสคริปต์ ps3me มารัน โดยสั่ง ps3me /media/Mobile/AVCHD ทีนึง สคริปต์จะเปลี่ยนชื่อไฟล์ให้เป็น Dos 8.3 filename compat
  • เสร็จแล้วอย่าลืม Safe Remove Hardware
ทดสอบโดยการเอา HDD เสียบที่ PS3 ไปตรง Video จะเห็น USB Disk โผล่มา กด O เลือก AVCHD แล้วจะเล่นหนังทันที กดปุ่มสามเหลี่ยม เพื่อเปิด Subtitle (ภาษาไทยจะเป็น Other ตามลำดับที่ใส่ใน tsMuxeR) หรือเปลี่ยน Audio Channel ได้

Wednesday, September 02, 2009

Disable touchpad when USB Mouse connected on Ubuntu (Jaunty)

Do you have problem with Synaptics touchpad Palm detection? Do you accidentally touch the touchpad while typing? On Windows Vista, there is an option to disable touchpad when USB Mouse connected, but how to do that on Ubuntu? Here's how I 'properly' did it on my Ubuntu 9.04 (Jaunty).
  • Create a Dbus signal handler script using Python. Here's the script
#!/usr/bin/python

global DeviceName, AddAction, RemoveAction, bus, hal_manager

#DeviceName = 'usb_device_15ca_c3_noserial_if0_logicaldev_input'
DevicePattern = r'usb_device.*_input'
DeviceCap = 'input.mouse'
AddAction = '/usr/bin/gconftool --set --type=bool /desktop/gnome/peripherals/mouse/touchpad_enabled false'
RemoveAction = '/usr/bin/gconftool --set --type=bool /desktop/gnome/peripherals/mouse/touchpad_enabled true'

import dbus # needed to do anything
import dbus.decorators # needed to receive messages
import dbus.glib # needed to receive messages
import gobject # needed to loop & monitor
import os # needed to
import re, time

DeviceRe = re.compile(DevicePattern, re.IGNORECASE | re.DOTALL)

#@dbus.decorators.explicitly_pass_message
def add_device(*args, **keywords):
Path = args[0].split('/')
device_obj = bus.get_object('org.freedesktop.Hal', args[0])
device = dbus.Interface(device_obj, dbus_interface = "org.freedesktop.Hal.Device")

cap = device.QueryCapability(DeviceCap)

if cap and DeviceRe.match(Path[-1]) :
os.system(AddAction)

#@dbus.decorators.explicitly_pass_message
def remove_device(*args, **keywords):
Path = args[0].split('/')
try :
device_obj = bus.get_object('org.freedesktop.Hal', args[0])
device = dbus.Interface(device_obj, dbus_interface = "org.freedesktop.Hal.Device")
cap = device.QueryCapability(DeviceCap)
except :
# assume true, since device might be already removed
cap = True

if cap and DeviceRe.match(Path[-1]) : # Device found
os.system(RemoveAction)

bus = dbus.SystemBus() # connect to system bus
hal_manager_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
hal_manager = dbus.Interface(hal_manager_obj, 'org.freedesktop.Hal.Manager')

# Add listeners for all devices being added or removed
bus.add_signal_receiver(add_device, 'DeviceAdded', 'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
bus.add_signal_receiver(remove_device, 'DeviceRemoved', 'org.freedesktop.Hal.Manager',
'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')

# Run remove action once to enable touchpad
os.system(RemoveAction)
time.sleep(1)

# Find mouse first
udis = hal_manager.FindDeviceByCapability('input.mouse')
for udi in udis :
Path = udi.split('/')
if DeviceRe.match(Path[-1]) : # Check if this is our prefer mouse
os.system(AddAction)
break # no need to keep looking

# monitor
loop = gobject.MainLoop()
loop.run()
  • If you wonder how I got the HAL path of USB mouse, try connecting your mouse and do "lshal", look for "Mouse" and see how your path looks like. Change the path properly if the default one is not match.
  • Add the script to run when log-in by going to System->Start up Applications
  • Log-out and re-Log-in again. That's it.
Another way to do this is to handle it in UDEV. However, I found that GNOME will always try to enable it back that way. Besides, UDEV is run by root, but touchpad setting is per-user. Disabling Touchpad permanently (in Mouse setting) and use synclient to control touchpad is another way to go.

Saturday, August 01, 2009

View a movie on PS3 with decent Subtitle

Most of the method I found when I search for "AVCHD Subtitle .sub" which point me to either mkv2vob or tsMuxer. Most of them refer to text base subtitle (.srt) file which is good for English base subtitle. But for me I'm Thai. If possible, I would love to have the method that works for picture-base Thai subtitle. Don't ask why I am not converting this file to text base subtitle, there is no free good Thai OCR available to do that (yet).

And at last I found it. With the following toolchain you can create an AVCHD content to be played on PS3 with subtitle on/off capability, using picture-base subtitle taken from Bluray disc!
  • BDSup2Sub - Use this tool to convert .sub and .idx distributed in the Internet back to PGS .sup file (BD subtitle). Don't forget to change the resolution. I think it should be possible too to take this from a BD movie directly (but I rarely found anyone distribute subtitle file in .sup format, since .sub works well computer-base player like VLC or Media Player Classic).
  • tsMuxer - As with normal AVCHD creation, use tsMuxer to mux MKV video and audio stream, then select add and add .sup subtitle file created above. If you have a compatible MKV (H264+(AC3 or DTS)), the conversion takes only about 5-10 minutes. I would recommend writing directly to your external hard drive where you will use to plug to PS3, since speed here depend mostly on hard drive speed.
  • AVCHDMe - After the the creation of AVCHD, use AVCHDMe to make sure that the created AVCHD is playable on PS3. Mostly this only concern 8.3 file name, so I guess just renaming the file manually may work.
With this, I can view HD content with decent translation on screen. The only problem I face is that the movie has been pushed back up to top of screen, leaving a blank black panel on the bottom (instead of black panel on both top and bottom). Other than that, everything seems fine.

Tuesday, March 17, 2009

MBPurple 0.2.1 for PortableApps

New Microblog-Purple for Pidgin 2.5 PortableApps, where you can store your Pidgin on thumbdrive and bring it wherever you go, is released! Download it here

Thanks to rottnkorpse for very quick help!

Sunday, March 15, 2009

Adium port for MBPurple released!

Thanks for @jsippel for your hard work. Now the first release of Adium port for #mbpurple is here (base on 0.2.1). Enjoy!

Friday, March 13, 2009

Using PS3 to view MKV with Thai Subtitle

No, the subject is misleading. Actually I found no viable solution for viewing MKV on PS3 properly. Many will thought that I found a way to do this on Linux, but no.

The problem is sound driver. It seems that with latest mplayer-ps combination with spu-medialib, HD MKV can be viewed without any problem. (not to mention that latest mplayer now has improve x264 support + multi-thread decode on ffmpeg!). However, sound driver for any PS3-base Linux support only 2 channels!

The method I am using right now is very simple. I use mkv2vob to translate the MKV file into AVCHD-compatible format on my 80GB USB HDD. mkv2vob also handle size-limit on FAT32 by separating file into small pieces. The only problem lies in subtitle. I want the thai subtitle to be displayed on PS3!

The solution is to use SSA sub, with Thai font specified in SSA, and then use mkv2vob with "load subtitle file" enabled!. I tested this with Eagle Eye and it worked well! Thai subtitle displayed correctly on my TV screen!

The only problem is that movie screen is not in the middle of my TV. I saw on some forum said that this was because the size of original MKV file is not exact 720p or 1080p. Anyway it is a very minor point, at the least we have lots of space for subtitle.

Friday, January 23, 2009

PackageManagerCheatsheet - Naked Ape Wiki

PackageManagerCheatsheet - Naked Ape Wiki

This page include Debian, Red Hat, Sun package management cheatsheet.

Wednesday, December 10, 2008

Faxing in Ubuntu

Today, I have a mission to send out as many fax as possible to attract customer with my laptop and modem. I don't have much choice, Windows used to have good faxing support but that's gone from Vista (fax only available in Vista Business or Ultimate), so Hardy is my only quick choice now (not mentioning other commercial software for Windows).

efax command line works well and can send fax, but I have some problem on converting postscript printed file into tiffg3, because all page is not being converted, some part is being cropped. And I don't want to use command line all the time. Anyways I will document how to do that here.
  • Have your file ready in PS format, easiest way is to use "print to file" option in Print menu of Oo.O.
  • Use ghostscript to convert from PS to Tiffg3, format accepted by efax program
    gs -q -sDEVICE=tiffg3 -dNOPAUSE -sOutputFile=letter-%03d.tiff invitation_cmu.ps < /dev/null
  • You'll get letter-001.tiff - letter-00x.tiff, counted by number of pages in the PS file. Last, use efax to send it out
    efax -t  file...
I search again and found that gfax might be my helper. Anyways, gfax is not working with my mode, although I told gfax to use efax. I don't sure why, but from quick search it seems that some initialize modem command might not compatible with my modem. And there is no debugging or customize initialize command configuration available. So I try efax-gtk next. And efax-gtk works quite well on my Dell XPS M1330 Modem!
  • efax-gtk can send out single/multiple PS file by itself. I just need to change modem initialize command a bit. The key is
    .... M1L3
    Command in the latter part of Modem Init command dialog box. Also, the modem reset command is not working well, so I replaced it with hang-up command
    H
    Note that all command will always being prefixed with "AT", as normal modem command. Ah... I miss the AT command
  • Next, I don't want to just use efax-gtk. I want to print form OO.O directly to efax-gtk!. That can be easily done. First, add a new printer through system-config-printer GUI utility. Select "New Printer" -> "AppSocket/JetDirect" and specify "localhost" and port "9900" in the diaglog box (Yes, efax-gtk is also a network server)
  • Next printer type is "Generic", and model is "Raw Queue", which means we'll just get PS file from printing. After that, name the printer anything meaningfull.
  • Now open efax-gtk and leave it run in tray, then print directly to the new printer. After a while, a efax-gtk dialog will appear to ask for telephone number. It works!

Sunday, December 07, 2008

Office2007 on my hardy




Just want to mention that the instruction here is really working, even with my Office 2007 Thai Edition (btw, licensed to my organization).

(The transparent floating windows in the middle is Compiz effect on gimp whole screenshot acquire)

Saturday, November 22, 2008

20th Centry Boy - Part I

Just finished watching 20th Century Boy movie adaptation from the very famous manga with the same name.

I'm one of the fan of this series. Actually I really admire Mr. Naoki Urasawa in his talent on almost every Manga. I red 20th, Monster, and now still reading Pluto. He's quite amazing.

Anyways, my impression with 20th CB Part I is not good. I think the movie is suit more for manga fan, but for the people never read the manga version, I think they'll get confuse. Note that, this comment came directly from the one watching the movie with me. She never read the manga version. Oh, and she likes Death Note movie adapation, so there's nothing against Japanese movie.

I personally thought that the movie is OK, because I'm the fan. I reconsidered it and thought that the movie miss so many points in manga. Of course this is unavoidable since it is a very long manga. But many good points, that shouldn't be missed out, were missing ( I will try to recall it since the last time I red the manga is around 1 year ago) Some of these were
  1. The movie could not convince audience enough to believe that someone like "Friend" might exist. The "Friend" organization and Yumin party looked so unrealistics. I thought this is partly because the very fast pace of movie.
  2. The appearance of Fukube was so few. I think movie cut out the scene about teacher-ask-for-who-bend-spoons off. So the "Psychic" plot is all blown out.
  3. Otcho appearance was too short and weightless. I didn't see why he should come back to Japan. In manga, he spent a lot of time in Thailand, and there are lots of flashback on him. In movie, I didn't feel anything when he said "I'm Shokun" in the end. But the phrase really move me when I red manga.
  4. The cut is a bit confusing. Flash back and flash forward is not well handle enough.
  5. No explanation about robot at all. No details about the kidnapped professor that made the robot (he didn't appear at all in the movie). I thought most audience in theater feel that the robot is actually a robot (actually it is a big car dressed like robot). Anyways the robot in the movie looks cool enough. I think I understand immediately how they make it "looks like" robot.
  6. In manga, up until the point where movie ends, I feel that "Friend" is brilliant in the way how he cheat and fake to make people belive him. Up to this point, the only real thing was the deadly virus. In movie, this point is not well handle enough. The "Friend seminar" scene made me think that people attended the ceremony were all dumbasses who believe that "Friend" is real thing. And Friend looked unreal and unconvincing.
  7. Nothing much said about the burglar "God". His name never even being mentioned in the movie.
  8. I think the ending should adapt exactly like the ending of part I in manga (the scene where Kanna bring flower to pay respect to Kenji and scene flash to Yumin party come up to get the honourary at UN). I personally think that, in mang, this was being handle this very well. The ending in movie didn't make me feel like "I wanna watch the 2nd part!".
  9. I thik the actor taking the role of "Kenji" is too handsome :P. Anyways this is not that big deal.
  10. I did't think they had to insert the "Otcho in the jail" scene at all. It could be left for 2nd part.
  11. The joint before and after "Kenji-decision-to-go-against-Friend" was not well handled enough. I recall that Kenji lives for many years underground and train himself to go against Friend. He did try to recruit his childhood friend as ally. In movie, it seems as if it happened just after his convenient store was set on fire, if people not paying attention to the date appeared on screen.
  12. The scene where "Friend" confronted with "Kenji" on the robot. "Friend" appearred on the big structure, the same one in Osaka Expo. In movie, there was no explanation about this structure at all. Actually there was no explanation about Expo at all too, just a bit mentioned about Osaka. For foreigner like me, they wouldn't undrestand what really is the structure.
(That's all I can think of for now)

Anyways, if my memory is correct, the song that Kenji sang on the road is "that song", right? I think the song is nice.

Also, I don't sure about this, but I think the theather that I watch intentionally cut out some part of movie to make the length a bit shorter. I notice that from incontinuous dialog in many scenes. For example, the very first scene where manga writer talk with Otcho has been cut a bit. In my watch, after he ask if Otcho is human, he suddenly talking about his manga. There are other points like this in the movie as well. Anyways I think that mostly 5-10 minutes has been cut off. I will wait for DVD version to see if this is true or not. If this is not true, then the editing of this movie has some problem.

Friday, November 21, 2008

Optimal mencoder option for me

Yesterday, I recorded a local Thai drama series, "Jai Rao", at channel 3 since my wife had a meeting so she couldn't watch it.(NOTE: This is for home use only, I didn't mean to distribute it!). The recording is done on my desktop machine using SnaZio (V One Multimedia) DVR tool came with my video capture card. It can record to DVD-compatible MPEG2 stream, the stream can't be converted to DVD easily due to some incompatibility, so I need to convert to some other viewable format.

As said in my last post, the format I chose was DivX, due to its quality and size. Since I have change my laptop, it seems that my laptop is powerfull enough to test drive the quality of encoding.

I think the best optimal option for mencoder is
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vqscale=5:threads=2:aspect=4/3 -oac mp3lame -lameopts preset=standard -ffourcc DX50 -edl edl1.txt - o output.avi input.mpg
The vqscale=5 yield best quality and good file size. The total file size is about 1G from 4.2G MPEG2 source file, note that I remove the commercial ad and other TV program at the end of file so the actual source file size would be about 3G.

Note that, actually the default option for lavcopts (vcodec=mpeg4:vhq) is actually sufficient for viewing on most CRT TV already. I believe that the difference is hardly noticable on 21"-29" CRT TV. For best quality file, 2 pass XVID encode will yield much better result but consume lots more time. The encoding is done within about 1 hr for me.

Friday, November 07, 2008

MBPurple 0.2.0 is released

For almost 3 months of development, now Microblog-purple version 0.2.0 is released, with some more features. This is also a major code restructuring to allow more services on MBPurple.
Note that, this new version is INCOMPATIBLE with older version, so you will need to remove and re-add the plug-in to get all new features. You will be prompted a warning message if you still using the old plug-in.
All users are recommended to upgrade. Proceed to MBPurple and download the 0.2.0 now. Instruction for Ubuntu (8.10.1 interpid ibek) is here. Thanks to @sugree for ppa package!

Wednesday, October 08, 2008

เล่น Final Fantasy 12 จบแล้ว

(แก้ไข ใส่เนื้อเรื่องหน่อย กันลืม)
ต้องขอจดไว้ซะหน่อย นี่เป็นเกมส์ที่ผมใช้เวลาเล่นยาวนานที่สุดตั้งแต่เล่นเกมส์มา เวลาในเกมส์บอกว่าประมาณ 120 ชม.กว่าๆแล้ว แต่เวลาจริงๆที่เล่นคือประมาณปีกว่า นับว่าผมเองอึดใช่เล่นเลยทีเดียว ส่วนหนึ่งก็เป็นเพราะผมเองไม่ค่อยมีเวลามาเล่น (แก่แล้ว) แต่การเล่นเกมส์นานขนาดนี้ทำให้ผมได้มุมมองใหม่ๆหลายอย่างจากการเล่นเหมือนกัน

ขอพูดถึงเกมส์นี้ก่อน Final Fantasy 12 เป็นซีรียส์ล่าสุด (ในปัจจุบัน ตอนที่ FF13 ยังไม่ออก) เนื้อเรื่องให้บรรยากาศสไตล์ยุโรปยุคกลางผสม Mecha นิดหน่อยตามสไตล์ของไฟนอล บรรยากาศของเรื่องนี้ออกแนว Fantasy ค่อนข้างมาก ประมาณเดียวกับ FF9 แต่สไตล์ภาพดูขึงขังไม่เหมือน FF9 เนื้อหากล่าวถึงสงครามระหว่างสองมหาอำนาจ อาร์เคเดีย และโรซาเรียน ซึ่งส่งผลกระทบต่อประเทศเล็กๆชื่อว่าดัลมัสก้าซึ่งอยู่ตรงกลางระหว่างสองประเทศพอดี ตัวเอกของเรื่องเป็นเจ้าหญิงแห่งดัลมัสก้าชื่อว่า แอช (Ashe ขอเรียกแบบนี้ตามเสียงพากย์นะ) ซึ่งต้องเสียสามีที่พึ่งแต่งงานกันหมาดๆไปกับสงครามยึดพื้นที่ของอาร์เคเดีย จนเธอต้องกลายเป็นหัวหน้ากลุ่มต่อต้านเพื่อเรียกร้องเอกราชคืนจากอาร์เคเดีย แต่ตัวเรื่องนี้จะเล่าผ่านมุมมองของวาน (Vaan) โจรลักเล็กขโมยน้อยที่อาศัยอยู่ในราบานัสตรา เมืองหลวงเก่าของดัลมัสก้า วานเป็นผู้ได้รับผลกระทบโดยตรงจากสงครามเพราะต้องสูญเสียพี่ชายไปจนต้องกลายมาเป็นโจร ตอนแรกๆคนจะนึกว่าวานเป็นพระเอก คือผมว่ามันก็เหมือนจะเป็นพระเอกอยู่หรอก แต่จริงๆแล้วเนื้อหาของเรื่องนี้มันเน้นที่แอชไม่ใช่วาน เนื่อหาของ FF12 ให้บรรยากาศที่คล้ายคลึงกับ Star wars มาก ทั้งเรื่องสงคราม หัวหน้ากลุ่มต่อต้านที่เป็นผู้หญิงและเจ้าหญิง บรรยากาศของ Mecha ในเรื่อง โดยเฉพาะตอนสุดท้ายเอฟเฟ็กเสียงเหมือนดู Star wars มาก โดยเฉพาะเสียงหายใจในหมวกของพวก Judge ยังกะ Darth Vader อ้อ ขาดไปแค่เจไดเนาะ แต่ฝ่ายอาร์เคเดียมีพวก Judge ก็คงคล้ายๆกับพวก Sith Lord แต่ Judge จริงๆก็เหมือนแม่ทัพเฉยๆน่ะแหละ บางคนก็เป็นคนดี บางคนก็ไม่ดี

แรกๆเนื้อหาของเรื่องจะเน้นไปที่การพยายามกู้เอกราชของแอช วานและเพื่อนสาวเพเนโล (Penelo) บังเอิญต้องไปช่วยเหลือแอช ร่วมกับบัลเธียร์ (Baltheir, ภาคญี่ปุ่นเรียก Balflea) และฟราน (Fran) สลัดอากาศที่บังเอิญต้องมาเกี่ยวข้องด้วย เรื่องเริ่มซับซ้อนเมื่อแอชรู้ว่าจริงๆแล้วอาร์เคเดียจงใจจะไม่เจรจากับดัลมัสก้าและกะบุกยึดอยู่แล้ว โดยจัดฉากว่าทหารคนเก่งของดัลมัสก้าคือ บาช (Basch) ลอบปลงประชนม์กษัตริย์ของดัลมัสก้าเอง ระหว่างการเจรจาสงบศึก เพื่อทำให้ราชบังลังค์ดัลมัสก้าระส่ำระสาย แต่จริงๆแล้วเป็นพี่น้องฝาแฝดของบาช ชื่อโนอา (Noah) ซึ่งอยู่กับฝ่ายอาร์เคเดียเป็นคนจัดฉากตะหาก ไปๆมาๆบาชก็มาเป็นเพื่อน ครบ 6 คนพอดีจัดได้สองกลุ่ม ตรงนี้ผมว่าเป็นจุดด้อยของการเป็นเกมส์ คือพอมีเพื่อนครบทีมแล้ว มันก็จะมีเพื่อนเพิ่มไม่ได้ เพราะจะทำให้สับสนเรื่องการฝึกตัวละคร อัพเลเวลต่างๆ ทำให้เนื้อเรื่องของคนที่จะมาเป็นเพื่อนกลุ่มตัวเอกก็จะตันไป เกมส์นี้เลยมีระบบผู้ช่วย คือเป็นตัวละครประเภทควบคุมไม่ได้ แต่จะมาคอยช่วยตามเนื้อเรื่อง แต่ก็มีได้แค่ทีละคน ตรงนี้สมัย FF4 แก้โดยการยอมให้มีเพื่อนเพียบเลย เปลี่ยนไปมาตามเนื้อเรื่อง แต่ตัวละครก็จะไม่ค่อยต่อเนื่อง บางเกมส์อย่างซุยโคเดนก็เอาเป็นว่ามีเพื่อนได้โคตรเยอะเลย (108 คน เอาคนที่บังคับได้น่าจะราวๆ 40-50 คน) หรือภาคหลังๆของไฟนอลก็จะเป็นกลุ่มใหญ่ประมาณ 6-10 คน ไปเลย แต่ก็คือห้ามตาย เพื่อนไม่มีทางจากไปเด็ดขาด ไม่งั้นต้องมาคิดว่าจะถ่ายทอดเลเวลกับของกันยังไงให้ไม่ขัดเขิน ตรงนี้ผมว่าเป็นโจทย์ของการทำเนื้อเรื่องเกมส์ rpg สไตล์ญี่ปุ่นเหมือนกัน

พอเนื้อเรื่องดำเนินไปเรื่อยๆก็ตามสูตรหนังสงครามแฝงปรัชญญานิดหน่อย ตามสไตล์ญี่ปุ่น ที่จะต้องมีการพูดถึงต้นเหตุของสงคราม หนทางหยุดสงคราม มนุษย์ไม่หยุดฆ่าฟันกันเองหรอก! อะไรพวกนี้ ซึ่งผมรู้สึกว่าพักหลังจะมาเยอะมากตาม anime เพียบไปหมดเลย สำหรับ FF12 แอชซึ่งจริงๆแล้วเป็นเจ้าหญิงที่ดูไม่ค่อยเป็นผู้นำเท่าไหร่ต้องผ่านการทดสอบทางใจหลายด่าน เพราะเธอเองไม่ได้เป็นคนที่อยากได้อำนาจ แต่การกู้เอกราชแน่นอนย่อมทำให้เกิดทั้งคนรักและคนเกลียด

เนื่องเรื่องมาขมวดปมตรงที่ว่าจริงๆแล้วในโลกมีชนเผ่าที่เป็นเหมือนเทพเจ้า เรียกว่าเผ่า อ็อกคูเรียน (Occurian สะกดยังงี้ป่าวหว่าจำบ่ได้) ซึ่งมีวิทยาการก้าวล้ำนำหน้าจัด เป็นคนคอยจัดฉากว่าใครจะได้เป็นคนปกครองโลก โดยเคยทำมาทีแล้วกับบรรพบุรุษของแอช ปรากฎว่าจริงๆแล้วทางตัวร้ายคือเวยน์ (Vayne) เจ้าชายของอาร์เคเดียผู้อยู่เบื้องหลังเหตุการณ์ทั้งหมด มีจุดประสงค์จริงๆคือจะครองโลก เพื่อต่อต้านการอยู๋เบื้องหลังของอ็อกคูเรียนด้วย โดยอาศัยความช่วยเหลือของเวนาท์ (Venat) ซึ่งเป็นเผ่าอ็อกคูเรียนที่ทรยศมา

พอเนื้อเรื่องมาเป็นงี้ก็เลยกลายเป็นว่าการกู้เอกราชสามารถจบได้แบบสมประโยชน์ เพราะทุกคนมีศัตรูคนเดียวกันนั่นเอง เพียงแต่เวยน์เองก็ดูเหมือนจะอยากได้อำนาจด้วย สุดท้ายแอชซึ่งได้รับเลือกจากอ็อกคูเรียนให้ถือครอง Nethicite ซึ่งเป็นศิลาเวทย์มนตร์ที่มีพลังทำลายล้างสูงมาก (ประมาณว่าเป็นนิวเคลียร์ว่างั้น) ตัดสินใจไม่ใช้ Nethicite และยอมทำลายต้นกำเนิดของ Nethicite ทิ้งเพื่อไม่ให้มีอาวุธอันตรายเช่นนี้เหลืออีก และสุดท้ายแอชและผองเพื่อนก็ร่วมกันบุกไปจัดการกับเวยน์ที่เกิดกู่ไม่กลับ อยากจะครองโลกจัด จนชนะและก็เกิดความสงบสุข แอชกลับไปครองดัลมัสก้า ส่วนอาร์เคเดียปกครองต่อโดยลาร์ซ่า (Larsa) ตัวละครที่มาเป็นเพื่อน NPC ช่วงหนึ่ง และเป็นน้องชายของเวยน์ ทุกคนก็แยกย้ายกลับไปดำรงชีวิตอย่างมีความสุข

เนื้อเรื่องตอนท้ายๆตรงเวยน์นี่ผมงงๆนิดหนึ่งว่าทำไมมันจะต้องดันทุรังยึดโลกต่อด้วย ทั้งๆที่แอชเองก็ตัดสินใจหันหลังให้กัลเผ่าอ็อกคูเรียน แต่คล้ายๆกับว่าเวยน์พยายามจะยึดมั่นในสิ่งที่ตัวเองทำมาจนถึงที่สุดก็เท่านั้น อีกส่วนหนึ่งคงเพราะนี่มันเป็นเกมส์ ต้องมีบอสตัวสุดท้าย ถ้าเกมส์จบแบบว่าทุกฝ่ายลงเอยกัน จับมือกัน เย้ จบ ก็คงหมดสนุก (ของเกมส์) เวยน์เลยซวยไปต้องมาเป็นบอสตัวสุดท้าย และบอสตัวสุดท้ายก็ต้องตัวใหญ่ๆ บินได้ ดูแล้วน่าเกรงขามไปพร้อมๆกัน ก็เลยเหมือนกลายเป็นว่าเวยน์โดนมารเข้าสิงยังไงไม่รู้

เนื้อเรื่องไม่ได้พูดถึงอ็อกคูเรียนต่อเลยนอกจากเวนาท์ที่เหมือนจะไปพร้อมกับเวยน์ จริงๆแล้วเผ่านี้ก็ยังอยู่ ก็งงว่าแล้วทำไมไม่ส่งใครมาลงโทษแอชเลยหว่า

ในส่วนของเกมส์นี้โดยรวมๆ นี่เป็นเกมส์ที่ดูเหมือนจะมีชื่อเสียงพอสมควร จากข้อดีอะไรหลายๆอย่างในเกมส์ เช่น ระบบต่อสู้แบบใหม่ (เข้าใจว่ามาจากภาคออนไลน์ FF11) กราฟิกแบบใหม่ๆ เป็นภาคแรกที่ไม่มีการตัดฉากต่อสู้เลย สู้มันบน field เลย ซึ่งผมคิดว่าดีมากๆ แต่จุดที่ผมไม่ชอบก็คือระบบการเก็บไอเทมที่ยากมาก (เพราะของในหีบสมบัติมัน random) หรือการต้องมานั่งเก็บของจากมอนสเตอร์มาสร้างเป็นอาวุธ ซึ่งผมว่าดีนะแต่ของสุดยอดๆนี่เก็บยากมากๆ ประมาณว่าต้องเก็บของหายากชุดนึง เพื่อมาสร้างเป็นของอีกชุด เพื่อเอาไปสร้างเป็นอาวุธ เข้าใจว่าระบบพวกนี้มันส่งมาจากเกมส์ออนไลน์ ที่ออกแบบพวกนี้มาเพื่อดูดเวลาในการเล่นเกมส์จากคนเล่นไป และเนื่องจากผมไม่ค่อยมีเวลาเล่นเกมส์นี้ ระบบพวกนี้เลยกลายเป็นจุดเสียใหญ่ทำให้ผมรู้สึกไม่ค่อยดีกับเกมส์ภาคนี้เลย ยิ่งผมเป็นพวกชอบเล่นจบแบบสมบูรณ์สุดๆ (ตั้งแต่ ff4 มาแล้ว ผมคิดว่าผมเล่นสมบูรณ์มาทุกภาคนะ) ภาคนี้เป็นภาคแรกที่ต้องยอมแพ้ ไม่ได้ไปปราบบอสลับ อาวุธสุดยอด อะไรทั้งหลายแหล่จนหมด เพราะไม่ไหวจริงๆ จริงๆเป็นเพราะเหมือนเจ้า ps2 ทำท่าจะพังๆด้วย ผมเลยรีบๆเล่นจบก่อนเครื่องพัง

สรุปแล้วความรู้สึกที่มีต่อเกมส์นี้ค่อนข้างเฉยๆ ตอนแรกๆดูดีมาก เล่นๆไปแล้วเออ ก็สนุกดีนะ แต่ตอนท้ายๆพอพยายามให้สมบูรณ์แล้วเสียเวลาจัดมาก ในส่วนของเนื้อเรื่อง ช่วงหลังๆของเกมส์ก็ดาวน์ๆลงมา เนื้อเรื่องทั้งหมดดูแล้วเหมือนแค่เป็นส่วนเสี้ยวของมหากาพย์อันยิ่งใหญ่ แต่เนื่องจากมันไม่ได้มีภาคต่อ (จริงๆแล้วมี Revenant wing แต่ดูเหมือนภาคพิเศษมากกว่า) เป็นหลักเป็นแหล่ง ก็เลยเหมือนว่าสิ่งดีๆของมหากาพย์เรื่องนี้กลับไม่ได้รับการถ่ายทอดเท่าที่ควร เนื้อเรื่องของวาน ซึ่งตอนแรกดูเหมือนจะมีส่วนเกี่ยวข้องกับแอช สุดท้ายก็ไม่มีอะไร ก็คือวานกับเพเนโลก็คือเด็กในเมืองธรรมดา บาชซึ่งเหมือนจะมีความหลังก่อนมาเป็นทหารของดัลมัสก้าก็ไม่มีอะไร แทบไม่ได้พูดถึง บัลเธียร์ซึ่งจริงๆเป็นลูกของซิดก็สรุปแล้วคือเป็นลูกของซิด แต่ไม่ชอบพ่อเลยแอบไปพาชนเผ่า Viera หญิง (Fran) มาหนีตามกันไปก็แค่นั้น การถ่ายทอดเรื่องราวความหลังของตัวละครผมว่าค่อนข้างน้อยมาก อ้อ ภาคนี้ตัวละครชื่อซิด (Cid) เป็นฝ่ายผู้ร้ายด้วย เป็นอะไรที่แปลกพอสมควรสำหรับ Final Fantasy

แต่ก็เป็นธรรมดาของเกมส์ rpg อ่ะนะ ผมพบว่าเกือบทุกเกมส์มันจะหลุดๆในส่วนเนื้อเรื่อง เพราะไม่งั้นอาจจะทำให้เกมส์ไม่สนุก แต่ถ้าทำดีๆก็ออกมาดีได้นะ ผมประทับใจกับ FF10 มาก เพราะทำเนื้อเรื่องลงตัว สานกับระบบของเกมส์ได้ดีกว่า หวังว่า FF13 จะออกมาดีเหมือน FF10 นะ

ที่แปลกอีกอย่างคือมนต์อสูร ซึ่งภาคนี้เรียกว่า Esper ภาคนี้มนต์อสูรทั้งหมด มาจากพวกบอสเก่าๆ หรือตัวละครฝ่ายผู้ร้ายของ Final Fantasy เก่าๆทั้งหมด แทนที่จะเป็นซีรียส์ บาฮามูท ลิเวียธาน ฯลฯ เหมือนเดิม ส่วนชื่อพวกมนต์อสูรเก่าๆกลับกลายไปเป็นแค่ชื่อเรือเหาะของฝ่ายอาร์เคเดียไปหมด ตัวอย่างของมนต์อสูรที่ผมจำได้จากภาคเก่าก็เช่น Zeromus (บอสภาค FF4) Exodus (เห็นว่าภาคญี่ปุ่นใช้ชื่อว่าเอ็กซ์เดธ บอส FF5) Chaos (บอส FF9 กับ FF1) ระบบมนต์อสูรผมว่าทำได้ไม่ค่อยดี คือไอเดียดีแล้วที่ให้ออกมาเดินกับคนเลย แล้วก็ attack ธรรมดาได้ ตรงนี้เหมือนๆกับ FF10 แต่ปัญหาคือ คุมการขยับไม่ได้ เป็นเหมือน NPC ไปหมด (ตรงนี้จริงๆนับเป็นฟีเจอร์แบบนึงของเกมส์นี้ด้วย เพราะจงใจให้ผู้เล่นต้องเดาว่าทำยังไง Esper ถึงจะใช้ท่าสุดยอด) ปัญหาคือภาคนี้จะเน้นการต่อสู้แบบรุมมาก (เหมือนเกมส์ออนไลน์) แต่เรียก Esper ออกมาแล้วเพื่อนจะหายหมด เหลือแค่คนเรียกกับตัว Esper เอง ทำให้โดนรุมได้ง่าย แถมเวลาเรียกมาสู้บอสก็คุมท่าสุดยอดไม่ได้ ทำให้เวลาเจอบอสที่เก่งจัดๆ (อัดทีสองทีก็ไปแล้ว) อาจจะหายไปก่อนจะได้ใช้ท่าสุดยอด อันนี้ใน FF10 ก็เป็น แต่ใน FF10 เราควบคุม Aeon ได้เต็มที่ ช่วงหลังๆของเกมส์เลยเหมือนจงใจเรียกมาให้ใช้ท่าสุดยอด (กับกันการโจมตีจากศัตรู) มากกว่า สาเหตุอีกประการคือระบบการใช้เวทย์มนตร์ รวมไปถึงท่าสุดยอดของ Esper ที่ดูเหมือนเกมส์จะกันไว้ให้เวทย์ใหญ่ใช้ได้ทีละคน (รวมศัตรูด้วย) คงเพราะข้อจำกัดว่าไม่งั้นภาพเอฟเฟ็กคงมั่วพิลึก แต่กลายเป็นช่องโหว่ว่าระหว่างที่มีคนใช้ท่าใหญ่ ถ้าเราโจมตีธรรมดาๆจะอัดได้หลายทีเลย การใช้ท่าสุดยอดของ Esper ที่เสียเวลาแถมต้องเสี่ยง ก็เลยเป็นอะไรที่ไม่ค่อยคุ้มเท่าใช้หลายๆคนอัดด้วยอาวุธแรงๆไปเรื่อยๆนัก (จริงๆตรงนี้ FF10 ก็เป็นเหมือนกัน แต่เป็นเฉพาะถ้าขุนตัวละครจนเก่งสุดยอดเพื่อไปปราบบอสลับ ถ้าเล่นตามปกติก็น่าจะไม่เป็นแบบนี้)

ว่าแล้วก็กะจะไปเล่นต่อให้ชนะ Zodiark เอ หรือเอาจนชนะ Omega ดี คงไม่ไหวแน่ แค่นี้ก็ซัดไปร้อยกว่าชม. แล้ว แค่พยายามจะผสมเอาดาบ Tournesol เล่มเดียวก็กินเวลาไปมากโข

สงสัยสุดท้ายก็ไม่ได้เล่นต่อ ว่าแล้วก็เตรียมเล่นอย่างอื่นต่อแทนดีกว่า อ๊ะๆแต่ ps2 จะพังก่อนไหมเนี่ย

Wednesday, September 24, 2008

Windows Vista, Ubuntu Linux, and Media Direct on DELL XPS M1330

My laptop, DELL XPS M1330, was broken two days ago! The machine refused to boot, even the bios screen was not coming up. Thanks to the quick and decent services from Dell, they quickly replace my laptop motherboard the next business day and my laptop is back to work. I think this is the good side of Dell as many suggest, their services. But I wonder why my laptop was broken, although I just purchased it less than a month ago.

Anyways, I just found out that my media direct (small "home" button) stop working. It just goes directly to the same GFXGrub boot screen that I installed for my Ubuntu + Windows dual boot. At first, I thought that this is the doing of replaced motherboard, some internal nvram or something might be changed. So I follow many guides spread in the internet to use "rmbr" command supplied with MediaDirect CD to fix the problem.

The rmbr tool is actually a tool to instruct the machine to boot from a partition when power button is pressed, and boot from another partition when mediadirect button is pressed. The command is like
rmbr DELL 2 4
Where "DELL" is my manufacturer model, 2 is the number of partition for power button, and 4 is number of partition for mediadirect button. I believe what it really does is, modify MBR to boot from partition #2, and put "something" in some place to boot from #4 when mediadirect is pressed. (I think the "something" is actually goes into MBR as well after some experiments below, and also according to many web sites in the internet.)

I expermented a bit with rmbr. It really crashed the whole partition table if the number of partition exceed 4 (aka. use it on non-primary partition). I had to use testdisk to recover my partition. Somehow testdisk recovered the wrong order of my partition, which was because the odd structure of my partition due to MediaDirect partition. But testdisk can also change the type of any partition from logical to primary as well. So now my last partition is MediaDirect although the numbering is 4 (I got 7 partitions).

Because of the lost of partitions, I have to modify my Grub menu.lst, fix Windows using restore DVD supplied with my Notebook (using "Repair" functionality, a small link on the bottom of the screen that show "Install NOW"), then manually fix boot.ini in MediaDirect partition (it was actually FAT32, with partition type set to 0xc to hide it).

After a bit of experments, I found that the culprit is actually GFXGrub. I managed to make everything back to works as it should without grub. However, once GFXGrub was installed, media direct will boot to Grub instead of MediaDirect. So I just add a new menu option to my Grub to boot to MediaDirect. It works now, although not neatly.

I believe that once my laptop can boot to Grub from power button, and boot to MediaDirect directly using mediadirect button. Don't sure if that happened when I use normal Grub, or after I replace it with GFXGrub. Anyways my everydays works are in Vista|Ubuntu, not MediaDirect, so the priority goes to that.

Sunday, September 07, 2008

Sharing Thunderbird between Vista & Ubuntu

ปัญหาอย่างหนึ่งที่ตะก่อนผมเจอระหว่างการใช้ Windows กับ Linux สลับๆกันก็คือเรื่อง Mail คือเพราะใช้ Thunderbird บน Windows มาตลอด เวลาจะส่งเมล์ต้องกลับไปส่งใน Windows ตลอดเลย จำได้ว่าตอนนั้นพยายามลองใช้วิธี share profile ข้าม OS กันแต่ปรากฎว่าไม่ค่อยจะเวิร์ค จำไม่ได้ว่าเพราะอะไร แต่คงเป็นเพราะเวอร์ชันมันต่างกันมาก (บนวินโดวส์เวอร์ชันล่าสุด บน Linux ใช้ของที่มีอยู๋ตอนนั้นไม่ได้เอามาลงเอง) แต่นั่นมันก็นานแล้วตั้งแต่สมัย Fedora Core 2 ได้ ตอนนี้ HDD ที่พอแล้วหันกลับมาลอง เทคนิคเดิมระหว่าง Vista กับ Ubuntu 8.0.4.1 ปรากฎว่าเวิร์คดี แถมใช้ Profile ที่อยู่บน NTFS ซะด้วย

วิธีแก้ง่ายๆก็ใช้วิธีเรียก
thunderbird -profilemanager
แล้วก็ลบ profile เก่า เลือกอันใหม่ แล้วบอก directory เก็บ Profile แค่นี้ก็เรียบร้อย แถม add-on ก็มาหมดด้วย หรือจะใช้วิธีไปแก้ไฟล์ profiles.ini ก็ได้ อย่าลืมเปลี่ยน IsRelative เป็น 0

จริงๆแล้ววิธีนี้ควรจะใช้ได้กับ Firefox ด้วย แต่ลองแล้วปรากฎว่า
  1. FoxyProxy ไม่ค่อยเวิร์ค เพราะเก็บ path ที่ชี้ไปที่ database แบบ absolute เลย เป็น /D:/Doc/xxx อะไรยังงี้
  2. อันนี้น่ากลัวกว่า คือมันมี add-on ของ Ubuntu โผล่เข้าไปผสมด้วย (Ubuntu Firefox add-ons)
ผมเลยตัดสินใจไม่ใช้ firefox profiles ร่วมกันละกัน ไม่เป็นไรเท่าไหร่แค่ browsing history ปกติก็ไม่ได้เก็บ bookmark ไว้ในเครื่องอยู่แล้ว

Thursday, September 04, 2008

DELL XPS M1330

พึ่งได้โน้ตบุ้คใหม่มากำลังเห่อ Dell XPS M1330 ซื้อจากคนในเว็บบอร์ด Overclockzone.net ครับ ราคาได้พิเศษพอสมควร แถมด้วยประกันสามปีด้วย

เมื่อวานนั่งพยายามทำให้มันลงได้ทั้ง Vista + Hardy Heron + Media Direct พร้อมๆกัน Media Direct นี่เป็น OS ตัวเล็กๆของ Dell (จริงๆคือ WindowsXP) ที่ทำหน้าที่ทำให้โน้ตบุ้คกลายเป็นเครื่องเล่น DVD ได้โดยไม่ต้องเข้าวินโดวส์ ไหนๆก็มีฟีเจอร์นี้แล้วก็ขอใช้บริการมันสักหน่อย ปัญหาคือเจ้า Media Direct นี้มันฟิก คือต้องลงเป็น partition สุดท้ายของ HDD

วิธีง่ายๆที่ผมใช้ก็คืออาศัย CD ของตัว Media Direct มาช่วย Reinstall โดยบอกว่าจะมี 2 partition นอกจาก media direct เสร็จแล้วค่อยไปลบ partition ที่สอง แล้วแตกออกเป็น Linux กับ Swap เอาอีกที ก็เวิร์คดีครับ

ถัดมาก็คือ GFX Grub บน Ubuntu แบบว่าไม่ชอบหน้า Grub ดำๆอ่ะ (ใช้ fedora มาก่อน) เลยหา gfxboot มาลง
- How to : Install GFX Grub In Ubuntu. « Tux Enclave.
ก็เวิร์คดีนะ ตอนนี้ขอลง Driver ต่างๆบน Windows ก่อนเอาให้ใช้งานได้เหมือนเดิมก่อน รอก่อนนะ mbpurple

Monday, September 01, 2008

autoconf + Mingw is not working on Windows

Today I try to merge Makefile and Makefile.mingw on #mbpurple project. At first I thought it should be easy, since I had some experience with automake + autoconf + libtool. Somehow it turn out unsuccess because of few things
  1. Pidgin use Mingw. Mingw has a separate system tree from Cygwin. It doesn't understand /home/username, which is only available through Cygwin shell. So all include header files which use absolute path failed. Relative path is a must.
  2. From #1, many internal command of automake and libtool assume absolute path, so the path generated from these tools are unusable by makefile itself. For example, dependencies generated in .Plo contains c:\Cygwin\blah\blah, Cygwin Makefile treat this as "multiple target presence", then failed.
  3. The speed of execution on Windows is slow. automake will invoke config.sub and missing when something's changed. Sometimes perl just crash. This has almost no effect on Linux since execution of libtoolize && aclocal && autoheader && automake && autoconf is quick enough, but not the case for Windows.
So I decided to revert back to just plain Makefile and have a variable to detect for Cygwin. Maybe this is another reason that Pidgin on windows is built using Makefile only.

Saturday, August 16, 2008

Microblog-Purple 0.1.2

Last week I create 2 releases of #mbpurple (Microblog-purple), a plug-in for Pidgin that make you communicate with Microblog like twitter.com. Latest release is 0.1.2. These releases fix lots of bug that occurred when there's something wrong with network connection, which may crash Pidgin. At least for me it's very stable now. Also, a potential memory leak has been fixed too.

Download it at Microblog-Purple project page.

Friday, August 15, 2008

OpenVPN on Vista

OpenVPN GUI ที่ใช้อยู่เกิดมีปัญหากับ Vista เพราะ add default route ไม่ได้ วิธีแก้ตอนนี้ง่ายๆคือไปหา OpenVPN เวอร์ชันใหม่ (ตอนนี้เป็น 2.1_rc9) มาลง และเวลารัน ให้กด Run as Administrator ด้วย ไม่งั้นจะติด permission add route ไม่ได้

อันนี้ผมลองลงด้วยการ Run as administrator ด้วยแล้วนะ ก็ยังไม่ได้ ต้อง Run as administrator ตลอดเวลาเลย

Sunday, August 03, 2008

:: JustUsers.net :: การแปลง DVD9 เป็น DVD5 ที่ถูกต้อง

ในที่สุดก็มีคนทำ doc วิธีการทำ CCE9Pass จนได้ เยี่ยมจริงๆ

:: JustUsers.net :: การแปลง DVD9 เป็น DVD5 ที่ถูกต้อง

ขออนุญาตก๊อปมานะครับ กลัวหายไป

** content ด้านล่างนี้ ก๊อปปี้มาจากเว็บข้างต้นทั้งสิ้น ผมไม่ได้ทำเอง **

ก่อนอื่นต้องศึกษาโครงสร้างของ DVD ก่อนครับ โดยใช้โปรแกรม DVD Remake Pro
เปิดโปรแกรม DVD Remake Pro แล้ว Import DVD
ทั้งนี้ DVD อาจอยู่ในรูป image file แล้ว mount ด้วย alcohol 120% หรือ daemon tool แต่ถ้าเป็นแผ่น DVD ที่ยังมีการ protect ไว้ แนะนำว่าให้ทำ image โดยใช้ dvddecryptor ก่อน
แต่อย่างที่บอกละครับว่า dvddecryptor มันนานแล้วอาจไม่มีการพัฒนาต่อ ให้ลง anydvd ก่อน แล้ว set ค่า โดยใช้การถอดรหัสของ anydvd ช่วยตามรูป



หลังจากนั้นก็แค่ update anydvd เป็น version ใหม่ๆ ท่านก็สามารถใช้ dvddecryptor ในการถอดรหัสทำ image file ได้ตลอด หลังจากนั้นไปที่ dvddecryptor เลือก mode เป็น ISO Read
แล้วกด decrypt รอสักพักก็จะได้ dvd image นามสกุล ISO ไว้ในเครื่อง
เมื่อ Import DVD แล้วให้กด Select ตามรูป



ก่อนที่จะทำอะไรต่อให้ Save Projectไว้ก่อน ไปที่ file Save project
ตัว DVD Remake Pro จะมีหน้าตาดังรูป



ด้านซ้ายมือจะเป็น VTS ต่างๆ สังเกตว่า VTS ที่ใหญ่ที่สุดจะเป็นตัวหนัง+Menu ส่วน VTS ที่เหลือจะเป็น special feature เป็นส่วนใหญ่
DVD ที่ผมใช้เป็นตัวอย่างคือ นางฟ้าชาลีภาค 2
เรามาดู VTS อันแรก Video Manager



ตรง domain content ที่เป็นช่อง 4 เหลี่ยม แถวยาวจะแสดงว่าแต่ละ VTS นั้นมี Block อะไรบ้าง อย่างเช่น Video Manager block ส่วนใหญ่จะเป็น title ของ บริษัทหนัง หรือ คำเตือน หรือ Menu เลือกภาษา เลือกที่แต่ละ Block แล้วกด Play ปุ่มสามเหลี่ยมด้านล่างก็จะรู้ว่าเป็น Block เปล่าๆ หรือมี Content อะไร จริงๆ ดูจากขนาดก็น่าจะทราบได้

หลังจากนั้น Block ไหนที่เราไม่ต้องการก็ให้ กด Mouse click ขวา แล้ว Hide Block แต่จำว่าหลัง Save Project แล้ว ถ้าเราต้องการ Block ไหนกลับมาจะใช้ Restore Block ไม่ได้



โดยปกติผมจะไม่ยุ่งกับ Video Manager เพราะอาจทำให้เปิดแผ่น DVD ไม่ติด ยกเว้น Block คำเตือนภาษาต่างๆ หรือปิด Button ใน Menu เลือกภาษา
ถ้า VTS ไหนมั่นใจแน่ๆ ว่าไม่เอา เลือก Hide all block ไปเลย



ที่นี้มาดูขั้นตอนสำคัญของการใช้ DVD Remake Pro คือ ปิด Button ที่ไม่ใช้งาน
ไปที่ VTS ใหญ่สุด เป็นตัวหนัง+ Menu
เลือก ที่ VTS6 จะเป็นตัวหนัง



หรือจะเลือกที่ Menu ตามภาพ



ก่อนอื่นถ้าหากว่าเจอ Menu เลือกภาษา ให้ปิดภาษาที่ไม่ได้ใช้ก่อนเลย เช่น ภาษาจีน เลือก Hide Button



หลักการมีอยู่ว่าก่อนที่จะปิด Button ไหน ให้ท่านลองกดใช้งาน Button นั้นดูก่อนว่ามัน Link ต่อไป Menu อะไร อาจจะลองเล่นในเครื่องเล่น DVD ดูก่อน หรือใช้ Program เช่น PowerDVD
อย่าง Button ที่เราปิดตามข้างบน จะทำให้ไม่สามารถเข้า Menu นี้ได้



หากต้องการปิด Button Designing Angels ตามรูป



ก่อนอื่นต้องดูว่า Designing Angels อยู่ใน VTS ไหน จากภาพ อยู่ใน VTS ที่ 2



ถ้าใน VTS นั้นๆ Block มี Block ที่เราต้องการปิดเท่านั้น ไม่มี Block อื่นๆ ที่เป็น Feature อยู่เลย (ไม่สน Block ที่เป็น Blank ไม่มีตัว file หนัง) อาจ Hide all block ไปได้เลย แล้วก็ไป Hide Button ต่อกันไปได้เลย
หลักๆในการปิด Button ก็มีเท่านี้

เรามาดูรายละเอียดที่ตัวหนัง VTS6 พบว่ามี Stream เสียง หลายเสียง (ดูที่ Audio Tasks ด้านขวามือ)



โดยหลักแล้ว DVD ส่วนใหญ่จะมีเสียง
Dolby Digital 5.1 Eng
Dolby Digital 5.1 Thai
DTS
Commentary

โดยปกติ ตัด DTS และ Commentary ออกไป คงเสียง Eng และ Thai ไว้
ถามว่าจะรู้ได้อย่างว่า stream ไหนเป็นเสียงอะไรบ้าง ดูจาก PowerDVD ได้



หลังจากนั้นก็ Disable Track in all PGC สำหรับเสียงที่ไม่ต้องการ
และอย่าลืมไปปิด Button เสียงที่เรา Disable ไปด้วย

ส่วน Subtitle ขอย้ำนะครับ ว่าให้เก็บไว้หมด ไม่ควรไปยุ่ง อะไรกับมัน เพราะการตัดทิ้งหรือไม่ ไม่มีผลกับคุณภาพ DVD ที่ได้แปลงแล้วแต่อย่างใด

หลังจากที่ปิด Feature ที่ไม่ต้องการจนพอใจเลือก Export DVD เลือก folder ที่จะ Save
หลังจากนั้นจะได้ Vob file เลือก file .IFO อันแรกซึ่งจะเป็น Menu ตามรูปเพื่อเล่นกับ PowerDVD แล้วดูว่าใช้ได้ตามความต้องการหรือยัง ก่อนที่จะใช้ DVDShrink หรือ Nero Recode สร้าง image ต่อไป



จาก การดู รายละเอียดของ DVD โดยใช้ DVD Remake Pro เราจะพบว่า DVD บางเรื่องมีขนาดตัวหนัง+Menu ไม่เกิน DVD5 เช่นเรื่องนี้ เราแค่ปิด feature แล้วใช้ DVD shrink รวมเป็น image ก็ได้ โดยไม่จำเป็นต้องใช้ DVD Rebuilder+CCE ด้วยซ้ำไป (สมัยก่อนผมใช้วิธีนี้เพราะ Com ไม่แรง)แต่ถ้าหากพบว่าใช้ DVD Remake Pro ลดขนาด DVD ไปแล้ว ยังเกินกว่า 5.5 G หรือ ต้องการเสียง Eng และ Thai
แนะนำว่าต้องใช้ DVD rebuilder+CCE ตามที่ผมจะกล่าวต่อไปนี้ (นำเอา file DVD ที่ตัด feature และ ปิด Button แล้ว ไปลดขนาดลง โดยใช้ DVD rebuilder+CCE)

หากหนัง DVD มีความยาวเกินกว่า 2.5 ชั่วโมงให้ใช้ DVD FAB ในการแบ่งเป็น DVD5 2 แผ่นแทน

ก่อนอื่นให้เข้าไปที่ rebuilder.ini ใน folder DVD-RB PRO เพิ่มข้อความตามรูป แล้ว Save



ซึ่งจะทำให้ได้ขนาด DVD เต็ม DVD5 ไม่งั้นอาจจะเจอปัญหาแปลงแล้ว ต่ำกว่า 4G หรือเกินกว่า 4.37 G

หลังจากนั้น Set ค่าตามรูปได้เลย











General set up ไม่ต้องไป set อะไรเลย ครับ เพราะเราเลือกเสียงกับ Sub จากใน DVD Remake Pro แล้ว

ในส่วนการ Set up ค่าของ CCE ใช้ตามรูป (คือ ค่า Default)





ให้เลือกใช้ 6 pass ดีที่สุดแล้วครับ เกินกว่านี้ดู TV ก็แยกไม่ออกหรอกว่าดีขึ้นหรือไม่
หลังจากนั้นก็กด Back Up ถ้า Com ผม Athlon X2 3800 Ram2 G ก็ใช้เวลาประมาณ 4-6 ชั่วโมงแล้วแต่ความยาวหนัง

ISO ที่แปลงเสร็จแล้วจะอยู่ใน folder output ซึ่ง folder เหล่านี้ สามารถ set เองได้ในหน้า general set up




Software ที่ใช้ทั้งหมด
- AnyDVD
- Cinema Craft Encoder SP v2.70.2.0
- DVDFab Platinum v.2.9.7.5
- DvdReMakePro 3.14
- DVD Rebuilder Pro
- DVD Decryptor 3.5.4.0


แนะนำเพิ่มเติม
1. ถ้าใช้ DVD Remake Pro disable Audio track ไปแล้ว ก็ ให้มา กดเป็นกากบาทตรง track ใน DVD Rebuilder pro ด้วย เวลาเข้า player มันจะไม่มี ให้เลือก มันจะข้ามไปให้ ไม่งั้น มันจะเป็นช่องเสียงว่างๆ ...
2. ใช้ DVD Deceypter อ่านออกมาอย่าให้อยู่ในรูป ISO ให้ออกมาเป็น mode file เลยดีกว่า เพราะถ้าเครื่องไม่แรงเนี้ย กว่าจะ export ออกมาได้ทีนี่นานอะ ให้ใช้เป็น mode file แล้ว ใช้ dvd remoke export เฉพาะ modifield แทนอะ แล้วก็ copy ไปแทนที่ folder เดิม ทุ่นเวลาได้เยอะเลย
อีกอย่างเลือก เป็น 64FPU หรือ 64IEEE ด้วยก็ดีนะ ... อย่าไปใช้ standard อะ ... ตามรูปๆๆ iDCT นี่อะ


1 กรกฎาคม 2549

Friday, August 01, 2008

Microblog-Purple 0.1

It's beginning on Thursday 2 weeks earlier. I start feeling irritate more and more with my Google Twitter Gadget. The update failed silently, bugs in GUI that made lots of empty space between each tweet, and I have to re-login every time I turn on my laptop. And well, I'm more used to the way twitter communicate with my IM. Having it only on desktop gadget made me miss a lot of tweets.

So I decided to do something. And here it is. Microblog-purple project is a Pidgin plug-in that make your Pidgin or any LibPurple-base client, like Finch (tested) or Adium (hopefully it'll works. Waiting for @markpeak), communicate with twitter.com directly. I spent last two weeks coding this during my free time, with the help of my friends. The very first alpha came out last week (in SVN), and now I think it's stable enough to have the official release (0.1).

Please see the download page to download the plug-in for your platform. Right now we have Windows and Ubuntu (32|64)bit. Many thanks to
  • @sugree - features, bug fixes, Windows installer, and Ubuntu port
  • @chanwit - nice patch for text formatting. make my life much easier.

Wednesday, May 28, 2008

Water leakage

This is the third time that we 've leakage in our house. This time it's quite serious, because I don't know when it start "massive" leaking. I woke up this morning and found that our bathroom is flood with lots of water.

it is really broken into two pieces. this is what's left attached to my wall.

I found that our pipe connector was just broken into 2 pieces. It occurred before stop-valve so there's no choice but to stop water coming to both of our bathrooms. Today me and my wife have to use water stocked from bucket by our external or kitchen faucet.

The problem occurred because we use galvanize-base pipe connector. All 3 leakages have exactly the same problem. Either water supply in Thailand is not clean enough, or the galvanize pipe connector is not durable enough. I don't know which one. But I'll not using this type of connector again. This is just about a year and a half since my house is finished.

The copper-base connector seems to be more durable. I bought one ready for this fix.

copper-base pipe connector. Thai name is "เกลียวนอกเกลียวใน"

From the quick look, this is the last joint with galvanize connector. Hope that our showers is not connected with galvanize.

Right now I'm still waiting for water supply technician to help me. I don't dare to fix it myself or it might broken the PVC pipe, which will lead to a lot of chaos.

Update 12:00pm

The fix was just finished. I found a lots of tip

1. Don't use lead or galvanize connector. It's fragile. Use copper instead.

2. Don't use plier to wheel the connector to PVC pipe. It might break the pipe, especially after some demolition using nail to demolish the rest of connector

3. Use lots of rubber tape for the connector, don't put stop-valve directly with PVC pipe. It might break PVC pipe when moved. Copper connector can help lessen the force apply to the pipe


The key to destroy the connector is by using concrete nail. Slowly and softly hammer the rest of connector with concrete nail. Be patient.

Thursday, May 22, 2008

Getting issuer hash from a root CA

I forgot this all the time
openssl x509 -issuer_hash -noout -in cacert.org.crt

Sunday, April 20, 2008

DVD Encoding with Mplayer2

I recently having some problem playing the recorded TV program from my Snazio Video Capture card. The card can record to MPEG1, MPEG2 stream, and also VCD and DVD format, even the DivX format is supported. However, the generated DVD stream is not compliant with DVD format and need to be reencoded! Recorded DivX file also have problem in picture/sound synchronization.

I usually do the record using DVD format and write the raw .mpeg file to playback on my Philips DVP-3040K. It works fine unless the file size is less than 2GB, which is the limit of ISO format file size. However, some TV program in Thailand is 2 hours+ length, which usually yield about 4GB file size.

One way to fix this is to stop recording in the middle :). But that requires me to sit and wait for commercial ads to press stop. So I need some solution to quickly fix the stream and put it into DVD-Video.

I tried Cuttermaran + BatchDemux + DVDAuthorGUI and it works quite well for me. Except that the generated DVD Video can play but not seek on my DVP-3040K! (Somehow it can seek on other DVD player.......). So I need to find some other solution.

If I need to do encoding, DivX encode would be great. I had done XVID encoding and it works very well in term of quality and file size. However, the quality of generated file, when played on my DVP-3040K, will be a little bit worse than DVD-Video file, which is not too bad. The worst thing is that the player stop playing the video after about 1:30 hour of playing. I can't seek to the point after that too. I wonder why this is happening but seems DVP-3040K has some trouble with large DivX file...... (it has problem with DVD image too, can't see any file after 700th file on my DVD-Image).

So I tried TMPGenc DVD Author, a good old tool that I used for so long. There's no problem in the output but the time required to produce one takes about 2 hours, not including time to cut the commercial ad out. I want some quicker solution. Which I think I found at last......

Mplayer 1.0rc2 now can generate EDL files, a file list the start/end point to skip the play back. Combining with Mencoder, this can be used to quickly generate a DVD Video that's playable on my DVP-3040K.
mplayer -edlout edl.txt file.mpg

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 -o C:\Temp\output.mpg -edl edl.txt TV_20080417_203429.mpg

Press "i" during play back to record start/end point of commercial ads. This is very quick and the file can also being used for other application as well (it's just a text file). The quality of encoded DVD is good enough (a little bit worse than TMPGenc). But it took only 60 minutes to encode the video on my laptop. Should be quicker on faster desktop machine.

The generated output.mpg still need to be process by TMPGenc DVD Author or DVDAuthorGUI, but it takes about 20-30 minutes to work with that (not including DVD Writing time of course). At least I find something that's working well and quick for me.

Saturday, February 23, 2008

Video encoding

อาทิตย์ที่ผ่านมา ผมเกิดมีโอกาศจะต้องทำอะไรๆเกี่ยวกับการแปลง/อัดหนังจากทีวี และดีวีดี จากแต่เดิมที่คิดว่าทำเป็นอยู่แล้วพบว่าตัวเองยังไม่รู้อะไรอีกเยอะเลยครับ

โจทย์ของผมมี 2 ข้อ 1. มีดีวีดีแต่เป็น DVD9 จะเก็บยังไงให้สะดวก 2. มีหนังทีวีที่อัดมา (หนังไทยนี่แหละ) แล้วจะมาแปลงให้ดูได้ทำยังไงถึงจะดีที่สุด

โจทย์จริงๆก็ไม่ยากครับ tool ที่จะช่วยนั้นหาได้ไม่ยากเลย มีทั้งฟรีและไม่ฟรี แต่สิ่งที่แตกต่างกันคือ คุณภาพและความถูกต้องของผลลัพธ์

เอาโจทย์แรกก่อน ไม่ขอบอกว่าหนังอะไรละกันครับ แต่เป็นหนังซีรีส์ของ US (มั้ง) ที่คงยังไม่มีลิขสิทธิ์ในไทยแน่ๆ เพราะได้แผ่นมาจากเพื่อนที่อยู่ต่างประเทศ ก่อนอื่นผมลองด้วย dvdshrink กับ dvd fab platinum ก่อนเลย ผลที่ได้ไม่ค่อยจะดีเท่าไหร่ เพราะคุณภาพของหนังลดไปเหลือแค่ 62% หลังตัด subtitle และเสียงต่างๆออกไปหมดแล้ว พอดูด้วยเครื่องเล่น DVD ปรากฎว่าภาพบางช่วงมืดๆสว่างๆด้วย แปลกดี และภาพก็แตกเห็นเป็นเหลี่ยมๆ ผมดูแล้วรับไม่ค่อยได้เท่าไหร่ อ้อ เครื่องเล่นของผมคือ Philips DVD3040k เล่น Divx ได้ แถมเล่น Divx Subtitle หรือจริงๆก็คือไฟล์พวก .srt ได้ด้วย

ผมมาคิดๆดูคุณภาพมันลดไปตั้ง 40% มันก็คงจะไม่แปลกที่มันจะห่วยลงมาก อีกอย่างคือมันเป็นหนังซีรีส์ รวมเวลาของหนังทั้งหมดแล้วราวๆ 200 นาทีแน่ะ ยาวกว่า DVD หนังปกติ (ในแผ่นไม่มี Extras เลย) คงเป็นอีกสาเหตุที่คุณภาพของหนังลดลงมาก ผมเลยมองหาทางเลือกอื่นคือใช้ Encoder คุณภาพสูงมากๆมาช่วย ผมเห็นที่เขานิยม
กันมากๆก็คือ CCE รู้จักแต่ชื่อย่อแต่ไม่รู้สักทีว่าจริงๆมันคืออะไร ลองถาม Google ดูก็คิดว่าคงเป็น Cinema Craft Encoder ครับ เป็น Encoder ที่ Encode VBR multipass ได้หลายๆ Pass แบบว่ากดเลือกๆได้เลยว่าจะเอากี่ Pass ปัญหาของผมคือ CCE เป็นแค่ Encoder แต่เราต้องการ DVD Editor มาตัดพวก Subtitle, เสียงภาษาอื่นๆทิ้งไปเพื่อเพิ่มที่ด้วย สุดท้ายมาลงที่ DVD Rebuilder Pro ซึ่งจะตัดเสียงพวกนี้และส่งต่อให้ CCE Encode และลดขนาดเหลือ DVD5 ได้

แต่ปรากฎว่าผลกลับไม่เป็นอย่างที่คิด เพราะ DVD RB ดันทำไฟล์ออกมา โดยตัดเหลือแค่หนังตอนแรกเท่านั้น ผมเข้าใจว่าปกติมันคงจะเซ็ตเอาไว้ดึงเอาหนังหลักกับเมนู โดยตัด Extras ทั้งหมดทิ้งไป ผลเลยกลายเป็นยังงี้ ผมลองเลือกแบบไม่ตัดอะไรเลยก็ไม่สำเร็จ แถมทำแต่ละทีเสียเวลาชมัดเลย สุดท้ายผมเลยไม่ได้เลือกวิธีนี้

ระหว่างนั้นผมลองอีกวิธีคือการทำ paralle mencoder โดยใช้ xvidenc ซึ่งให้ผลดีกว่าใช้ lavc มากเลยครับ ภาพคมชัดดีทีเดียว ขนาดไฟล์ก็เล็กลงจนสามารถเก็บลงใน DVD5 แผ่นเดียวได้ ที่ติดปัญหาก็คือเรื่องซับไตเติ้ล ผมใช้ subrip ดึง sub ออกมาและปรับๆนิดหน่อยก็ใช้ได้ จริงๆแล้วซับอังกฤษมีให้ดาวน์โหลดด้วยแหละครับถ้าหาดีๆ แต่ timing มันจะไม่ตรงกัน (ไม่รู้ทำไม)

แต่โจทย์เรื่องหนังทีวีนี่หนักหน่อย แรกสุดก็ใช้ TMPGenc Dvd Author3 ซึ่งก็ได้ผลดีทีเดียว คือหนังออกมาเวิร์คใช้ได้ แต่ไม่ชัดครับ ไม่รู้ทำไม TMPGenc แต่ก่อนถือว่าใช้ได้แต่ตอนนี้พอ encode ออกมาแล้วกลับไม่ค่อยจะชัดเท่าไหร่ ขนาดปรับขนาดให้ออกมาใหญ่มากก็ยังไม่ชัด

ทางเลือกอื่นๆก็มีอีกหลายทาง แต่ปัญหาคือทำยังไงถึงจะตัดโฆษณาออกไปได้ โปรแกรมที่น่าใช้อีกตัวคือ Cuttermaran อ้อ แล้วก็ Adobe Premiere ด้วย แต่ทั้งคู่ก็ยังให้ผลได้ไม่ดี Adobe Premiere จริงๆแล้วคงใช้ได้ แต่เวลา Encode นานมากเลยทีเดียว ผมพยายาม Encode ผ่าน CCE แล้วปรากฎว่าไฟล์ออกมาเสียงกับภาพไม่ตรงกัน Cuttermaran ตัด Mpeg ได้โดยไม่ต้อง reencode แต่เสียงกับภาพจะเหลื่อมกันอีก มีวิธีแปลกๆอีกคือใช้โปรแกรม Comskip ซึ่งจะ detect หาโฆษณาและตัดออกให้อัตโนมัติ แต่ว่ารันตั้งนานก็ยังวิเคราะห์ไม่เสร็จสักที ตัดเองยังเร็วกว่าครับ (เพราะหนังไม่ยาว) แล้วก็อีกวิธีก็คือใช้ Mpalyer เล่นในโหมด edlout เพื่อระบุช่วงเวลาที่จะ skip แต่บน Windows กลับไม่เวิร์ค EDL ที่สร้างออกมา timing ผิดหมดเลย สุดท้ายก็ต้องยอมแพ้กลับไปใช้ TMPGenc แต่ Encode เป็น Divx นะ ก็เวิร์คดีครับ แค่ไม่ค่อยชัด เอาไว้คราวหน้าค่อยลอง Cuttermaran + Mplayer ดีๆอีกที

Saturday, December 08, 2007

Convert ชื่อไฟล์ภาษาไทยที่มาแบบผิดๆ ให้อ่านออก

เนื่องจากโปรแกรมที่ใช้ดาวน์โหลดไฟล์ตอนนี้มีปัญหากับภาษาไทย (ทีเ่ป็น tis-620) พอสมควร เลยต้องเขียนโปรแกรมมาแก้ชื่อไฟล์จากเดิมภาษาไทย (แบบผิดๆ ที่เป็น utf8 ทั้งๆที่จริงๆต้องเป็น tis-620) ให้กลายเป็น tis-620 แบบที่อ่านได้ใน windows

import os, sys, string

encoder = 'cp874'
decoder = 'utf8'

def replace_invalid_char(line,utf_char,tis_char):
return line.replace(utf_char,tis_char)

def convertline(line):
# CHECK INVALID CHAR
# line=replace_invalid_char(line,"\xe2\x80\x98","'")
# line=replace_invalid_char(line,"\xe2\x80\x99","'")
# line=replace_invalid_char(line,"\xe2\x80\x9c",'"')
# line=replace_invalid_char(line,"\xe2\x80\x9d",'"')
# line=replace_invalid_char(line,"\xe2\x80\xa6","...")
# line=replace_invalid_char(line,"\xef\x9c\x8f","\xe0\xb8\x8d") #YOR YING
# line=replace_invalid_char(line,"\xef\x9c\x9a","\xe0\xb8\xba") #PINTU
# line=replace_invalid_char(line,"\xe2\x80\x93","-")
# line=replace_invalid_char(line,"\xef\x82\xae","->")
# line=replace_invalid_char(line,"\xef\xa3\x82","?") # UNKNOWN
# line=replace_invalid_char(line,"\xef\xa3\x83","?") # UNKNOWN
return line.decode(decoder).encode(encoder)

f = open('error.txt', 'w')
for root, dirs, files in os.walk('.') :
for ent in files + dirs :
if ent == '.' or ent == '..' :
continue
try :
new_name = convertline(ent)
except :
f.write('convert:' + os.path.join(root, ent) + '\n')
continue
if new_name != ent :
src = os.path.join(root, ent)
dest = os.path.join(root, new_name)
#print 'renaming ' + src + ' -> ' + dest
try :
os.rename(src, dest)
except :
f.write('permission:' + src + '->' + dest + '\n')
f.close()


เอาบางส่วนของโค้ดมาจาก http://www.thaitux.info/node/115 ครับ

Friday, November 16, 2007

ลง Office2007 ไม่ได้!

เจอปัญหาแปลกๆอีกล่ะ สาเหตุเพราะ... นะ เพราะ WindowsXP ที่ลงน่ะแหละ แต่สรุปว่าไฟล์บางไฟล์ที่ควรจะมี มันกลับหายไป ไฟล์นั้นคือ c:\program files\common files\microsoft shared\web server extensions\40\bin\fp4autl.dll ไปดาวน์โหลดไฟล์จาก

http://www.dlldump.com/download-dll-files_new.php/dllfiles/F/fp4autl.dll/4.0.2.7523/download.html


มาวางก็เป็นอันใช้ได้

Thursday, November 01, 2007

Convert WMA to MP3 - LinuxQuestions.org

Command สำหรับการแกะ wav ออกจากไฟล์ wma บน Linux
mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader input_file

จะได้ไฟล์ autidodump.wav มา แก้ได้โดย -dumpfile (มั้ง)

Monday, October 08, 2007

Python Script สำหรับเปลี่ยน FourCC ของไฟล์ AVI

ไปเจอสคริปต์ในเน็ต เอามาแก้ดูก็ใช้ได้ดีบนวินโดวส์นะ
#!/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, 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
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
Anyways I found my solution. I setup Gcalsync to sync my personal Calendar, while setting Scheduleworld to sync my work Calendar. This updates my phone Calendar with both Google Calendars that I want. I'll wait until Gcalsync work totally for me and switch back to 100% Gcalsync. For now this is just works.

Friday, May 25, 2007

Setting per-node slot for SGE

Instead of disable hyper-threading, we can also
qconf -sq all.q

Then change the number after "hostname=" to appropriate value

Thursday, May 24, 2007

IPMI Tool

IPMI setup on Linux
  1. service ipmi start
  2. ipmitool -I open chassis status
  3. ipmitool -I open sdr list
  4. ipmitool -I open sensor list

Sunday, May 13, 2007

Solaris 10 Patch (update) management

คำสั่งที่สำคัญ
  1. pprosetup - Setup patch เช่น บอกให้รันทุกวัน ทุกเดือน ฯลฯ
  2. pprosvc - download & install patch (น่าจะคล้ายๆ yum)
  3. smpatch - ลง patch (ใช้เวลาที่ลง patch ไม่ได้)

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

Boot Linux without hyperthread

kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/hdb1 ro single noht

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
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

Add ROCKS frontend to SGE queue

  • qconf -mhgrp @allhosts
    • Edit hostlist to add your frontend

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

Monday, February 26, 2007

TRAC & SQLite

TRAC Upgrade
  • trac-admin /path/to/trac/env upgrade
SQLite Save & Restore
  1. sqlite3 /path/to/.db
  2. >.dump
  3. >.output /tmp/dumped-db.sql
  4. > Ctrl-D
  5. sqlite3 /path/to/new.db
  6. >.read /tmp/dumped-db.sql
  7. > Ctrl-D
TRAC Problem with latest updated centosplus (4.4).
  • 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
  1. Permission ของ /var/lib/heartbeat, /var/run/heartbeat ต้องถูกหมด (ดูได้จาก blog เก่า)
  2. ucast ต้องใส่ ip ให้ถูก
  3. ต้อง cleanup resource หนึ่งครั้ง (crm_resource -C -r ดูได้จาก crm_resource -L)

Wednesday, February 21, 2007

สร้าง httpd ssl certificates แบบไม่มี passphrase
  1. cd /etc/httpd/conf/
  2. openssl genrsa -out server.key 1024
  3. make server.crt
  4. ใส่ข้อมูลให้ถูก
  5. mv -f server.key ssl.key
  6. mv -f server.crt ssl.crt
  7. service httpd restart

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

Link a SVN repository with others

http://weierophinney.net/matthew/archives/132-svnexternals.html

Wednesday, February 07, 2007

Setting up drbd for ROCKS

อืม... ถ้าจะใส่ drbd ลงใน NPACI Rocks สิ่งที่น่าจะทำก็น่าจะมี
  1. Setup /etc/drbd.conf ให้ถูกตั้งแต่ตอน
    1. กำหนด label ใน replace-auto-partition
    2. cat /proc/partitions
    3. ไล่ทีละอัน หาว่าอันไหนมี label ตรงตามชื่อที่กำหนดไว้
    4. ลบออกจาก fstab หลังจากลงเสร็จ
    5. สร้าง /etc/drbd.conf โดยอิงตาม device ที่หาเจอ
  2. เริ่ม drbd (/etc/init.d/drbd น่าจะทำให้)
  3. ใส่ 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 ทิ้งไว้ถึงจะลงได้จริงๆ)
โดยรวมๆแล้วสนุกดีเหมือนกันเจ้า 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

Wednesday, September 07, 2005

Adding driverdisk to Compute Node in ROCKS

This should be usefull for us. We can install compute node which required some driver disk. Just grab it from ROCKS mailing-list.


if you can PXE boot your compute nodes, then on your frontend, try:

# cd /home/install
# mkdir driverdisk
# cp /home/install/driverdisk/dd.img

# vi /tftpboot/pxelinux/pxelinux.cfg/default

change the line:

append ks initrd=initrd.img ramdisk_size=150000 lang= devfs=nomount headless pxe kssendmac selinux=0

to:

append ks initrd=initrd.img ramdisk_size=150000 lang= devfs=nomount headless pxe kssendmac selinux=0 driverdisk=http://10.1.1.1/install/driverdisk/dd.img

Sunday, August 14, 2005

cksfv 1.3 patch for x86_64

I've made cksfv version 1.3, a SFV checksum checker for Linux, a patch to make it works under Linux x86_64 platform. Here's the patch

diff -Naru cksfv-1.3/src/crc32.c cksfv-1.3-mod/src/crc32.c
--- cksfv-1.3/src/crc32.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/crc32.c 2005-08-14 00:08:13.000000000 +0700
@@ -18,6 +18,7 @@

#include
#include
+#include
#include
#include

@@ -91,11 +92,11 @@
};


-int crc32(register int fd, unsigned long *main_val, unsigned long *main_len)
+int crc32(register int fd, uint32_t *main_val, uint32_t *main_len)
{
char buf[BUFFERSIZE], *p;
int len = 0, nr;
- unsigned long crc = ~0, crc32_total = ~0;
+ uint32_t crc = ~0, crc32_total = ~0;

while ((nr = read(fd, buf, sizeof(buf))) > 0)
for (len += nr, p = buf; nr--; ++p) {
diff -Naru cksfv-1.3/src/newsfv.c cksfv-1.3-mod/src/newsfv.c
--- cksfv-1.3/src/newsfv.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/newsfv.c 2005-08-14 00:12:17.000000000 +0700
@@ -18,20 +18,21 @@

#include
#include
+#include
#include
#include
#include

extern void pnsfv_head();
extern void pfileinfo(char**);
-extern void pcrc(char*, unsigned long);
-extern int crc32(int, unsigned long*, unsigned long*);
+extern void pcrc(char*, uint32_t);
+extern int crc32(int, uint32_t *, uint32_t *);

int newsfv(char **argv)
{
int fd, rval = 0;
char *fn;
- unsigned long len, val;
+ uint32_t len, val;

pnsfv_head();
pfileinfo(argv);
diff -Naru cksfv-1.3/src/readsfv.c cksfv-1.3-mod/src/readsfv.c
--- cksfv-1.3/src/readsfv.c 2001-07-06 13:33:08.000000000 +0700
+++ cksfv-1.3-mod/src/readsfv.c 2005-08-14 00:08:56.000000000 +0700
@@ -19,6 +19,7 @@

#include
#include
+#include
#include
#include
#include
@@ -28,7 +29,7 @@
#include
#include

-extern int crc32(int, unsigned long*, unsigned long*);
+extern int crc32(int, uint32_t *, uint32_t *);
extern void prsfv_head(char*);

int find_file(char*, char*);
@@ -39,7 +40,7 @@
FILE *fd;
char buf[512], *end, filename[512], crc[9], path[256];
int file, rval = 0;
- unsigned long len, val, sfvcrc;
+ uint32_t len, val, sfvcrc;

if (quiet == 0) {
prsfv_head(fn);

Wednesday, July 06, 2005

Tuesday, June 21, 2005

IBM eServer - IBM Virtualization Engine

IBM eServer - IBM Virtualization Engine

Application Response Measurement - ARM

Application Response Measurement - ARM

Another Unix standard

Application Response Measurement - ARM

Main Page - Fedora Directory Server

Fedora Directory Server

Very interesting... now we have another choice other than OpenLDAP

Main Page - Fedora Directory Server

Bug 160470 - Intel 845 with i810 driver can't do Ctrl+Alt+Fn

This is a solution to my FC4 bugs.

Bug 160470 - Intel 845 with i810 driver can't do Ctrl+Alt+Fn:
"Right, it does, if one makes no errors in extracting files from the rpm. I forgot a simple dot and so the file size of lib was zero. Of course X is not able to load data from a zero size lib. ;-) So here's a small step by step to prevent other from making the same mistake -become root and cd to roots home
$cd -make a backup of libvga.a
$cp /usr/X11R6/lib/modules/libvgahw.a /usr/X11R6/lib/modules/libvgahw.a.org
-get the last FC3 xorg X11 (maybe you have to choose another ftp server or another platform) $wget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/fedora.redhat.com/linux/core/updates/3/i386/xorg-x11-6.8.2-1.FC3.13.i386.rpm -extract the libvgahw.a from the rpm (here I missed the dot in front of /usr) $rpm2cpio xorg-x11-6.8.2-1.FC3.13.i386.rpm | cpio -ivd ./usr/X11R6/lib/modules/libvgahw.a -copy it to the right place
$cp ./usr/X11R6/lib/modules/libvgahw.a /usr/X11R6/lib/modules/libvgahw.a -remove rpm and temprary lib (be carefull not to delete your /usr!)
$rm -rf ~/usr $rm xorg-x11-6.8.2-1.FC3.13.i386.rpm -restart your X server -> Done! cheers Lars"

Have to tried it tonight

Monday, June 20, 2005

Making Bootable Linux CDs

Making Bootable Linux CDs

SunOS 5.10 Admin Tips

จดไว้กันลืม
  1. List packages installed in the system - pkginfo or pkginfo -i to list only installed package
  2. List file in the installed package - pkgchk -l
  3. List all service - svcs
  4. Control service - svcadm

Monday, June 13, 2005

NewsForge | Plone CMS for enterprise intranet applications

NewsForge | Plone CMS for enterprise intranet applications: "Plone CMS for enterprise intranet applications
Wednesday June 01, 2005 (09:01 AM GMT)
By: Donna M. Snow

Printer-friendly Email story
The open source Plone content management system is one of the best collaborative tools for enterprise intranets. Plone's core features include an enterprise-level content management system, a solid workflow engine, a wiki, role-based membership, and a search engine. It bring the benefits of sharing information to your enterprise intranet.

Falk AdSolution

Plone can handle basic CMS functions, but if that's all you want it for, there are smaller, lighter options such as Drupal and Mambo. Plone is better suited for larger enterprise implementations where there is a large user base and a need for customized application development within the organization.

Plone's workflow engine allows users to move vital documents through appropriate channels without the nightmare of passing documents through email. Plone users have the ability to work together on various types of content within the Plone interface.

Plone is easy to use and can handle many users. Non-technical employees will find the Plone interface easy to use for keeping content updated without having to learn HTML. You can add content types (such as events, news, links, documents, files, or photos) easily through a browser-based interface. An administrator can add a multitude of content types to the interface through the 200+ products available at http://sourceforge.net/projects/collective/. Plone also utilizes kupu, a visual editor that resembles a mini-version of Microsoft Word. Plone's advanced publishing feature allows users to prepare material ahead of time and schedule publication for a later date. You can also specify a date on which material is to expire, at which time it will no longer be visible to Web site visitors.

Plone's creators, notably Alan Runyan and Alexander Limi, based"

Friday, June 03, 2005

Edit texture attribute in Maya 6.5

  1. Go to Windows->Rendering Editors->HyperShade
  2. Select Textures tab
  3. Select Textures node. Press Ctrl+A or Windows->Attributes Editors
  4. Change the textures path in right panel