Apr 22, 2009

จำกัดความเร็วของ apt-get ด้วย trickle

การติดตั้งซอฟต์แวร์ในเดเบียนทางอินเทอร์เน็ตโดย apt-get นั้นต้องใช้การดาวน์โหลดโดยใช้ ftp หรือ http ซึ่ง apt-get มีตัวดาวน์โหลดของมันเองคือ

/usr/lib/apt/methods/ftp

และ

/usr/lib/apt/methods/http

แต่มีข้อเสียคือมันบริโภคแบนวิดท์จนเกือบหมด ทำให้ทำอย่างอื่นแทบไม่ได้ เรามีวิธีแก้ไขได้หลายวิธี เช่น ทำ proxy ที่มีการจำกัดความเร็ว แล้วสั่งให้ apt-get ใช้ proxy ตัวนั้นทาง /etc/apt/apt.conf.d หรือกำหนดผ่านตัวแปรระบบชื่อ http_proxy และ ftp_proxy สำหรับวิธีที่ง่ายกว่านั้นคือ ใช้โปรแกรมที่ชื่อ trickle ครับ เริ่มด้วยติดตั้ง

$ sudo apt-get install trickle

การใช้งานก็ง่ายๆ เช่น

$ trickle -s -d 10 apt-get --download-only upgrade && apt-get upgrade

อธิบาย -d 10 คือจำกัดความเร็วที่ 10 KB/s

ถ้าไม่อยากสั่ง trickle ทุกครั้งก็อาจแก้ไขตัว ftp และ http ของ apt-get โดย

$ dpkg-divert --local --rename /usr/lib/apt/methods/http
$ cat > /usr/lib/apt/methods/http <<EOF
#!/bin/sh
/usr/bin/trickle -s -d 10 /usr/lib/apt/methods/http.distrib
EOF

$ chmod 755 /usr/lib/apt/methods/http

$ dpkg-divert --local --rename /usr/lib/apt/methods/ftp
$ cat > /usr/lib/apt/methods/ftp <<EOF
#!/bin/sh
/usr/bin/trickle -s -d 10 /usr/lib/apt/methods/ftp.distrib
EOF

$ chmod 755 /usr/lib/apt/methods/ftp

จากนั้นก็ใช้งาน apt-get ตามปกติโดยไม่ต้องเรียก trickle เอง


หมายเหตุ:

เราสามารถประยุกต์ใช้วิธีนี้กับโปรแกรมอื่นๆ ที่มีการเชื่อมต่อกับ intenet ได้


Apr 21, 2009

Uninstall Symantec AV with an unknown(lost) password

Here is a tip to uninstall Symantec Antivirus (corporate edition) when the uninstall password has been forgotten (NOTE: the default password is symantec) OR you are using a Symantec Antivirus Server to manage clients and the server has been reinstalled or corrupted thus losing the server group root certificate (stored in the ‘pki’ folder located in C:\Program Files\Symantec AntiVirus, this should always be backed up!).

1. Open the registry editor on the client (regedit)

2. Find the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion\AdministratorOnly\Security

3. Change the data stored within the UseVPUninstallPassword value from 1 to 0

4. Clost regedit and try uninstalling Symantec Antivirus from the client. It should now uninstall without prompting for the password.

Apr 20, 2009

Make DVD from 6 vcds (or more) using ffmpeg

You can make DVD from 6 vcds by using ffmpeg re-encode vcd mpeg file to dvd-format.

Requirement:
- linux or windows
- ffmpeg
- dvd authoring software ( e.g. k9copy , k3b ..etc)


use below command:

vcd -> pal-dvd

$ ffmpeg -threads 2 -i source-vcd.mpg -target pal-dvd -s cif -b 1150k -aspect 4:3 -ac 2 -ab 224k destination-dvd.mpg

or vcd -> ntsc-dvd

$ ffmpeg -threads 2 -i source-vcd.mpg -target ntsc-dvd -s qvga -b 1150k -aspect 4:3 -ac 2 -ab 224k destination-dvd.mpg

Note:
-
one DVD can contain 400 minutes of vcd if you use this method.