Archive for the ‘Linux’ Category

Installing (and only installing) Cygwin X Server for “ssh -X”

Monday, March 1st, 2010

The following packages are needed: ssh, Xorg sever, twm. I am using  cygwin 1.7.1. Maybe something more … I installed everything under X11 to get it work by clicking the X/Win Server menu, which brings up an xterm window where I do “ssh -X” without problem….

Quick LAMP on debian

Monday, December 14th, 2009

$ sudo apt-get install mysql-server phpmyadmin apache2

Then visit: http://server-ip/phpmyadmin

Tip: Do not leave root password empty, as phpmyadmin by default won’t let you log on with empty password.

apt-get update with public key not available warning

Monday, December 14th, 2009

Question:

W: GPG error: http://ftp.us.debian.org sid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: You may want to run apt-get update to correct these problems

Answer:

xguan@p4:~$ gpg –keyserver subkeys.pgp.net –recv-keys 9AA38DCD55BE302B
gpg: requesting key 55BE302B from hkp server subkeys.pgp.net
gpg: /home/xguan/.gnupg/trustdb.gpg: trustdb created
gpg: key 55BE302B: public key “Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>” imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
xguan@p4:~$ gpg -a –export 55BE302B | sudo apt-key add -
OK
xguan@p4:~$

Encoding video for Zune 80GB using ffmpeg

Saturday, January 10th, 2009

I am able to put an old 45min *.rm video file to my Zune 80GB, using encode-handheld-2.5.pl + a version of ffmpeg that supports x264 video and aac audio.

Building ffmpeg:

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-libfaac --enable-libx264 --enable-gpl
make

Converting:

./encode-handheld.pl -t ipod -f input-file -n new-title-for-the-video-file-to-show-in-zune-ui

Batch processing photos with gm

Tuesday, January 6th, 2009
for i in `find -iname '*.jpg' -printf '%f\n'`; do echo $i; gm convert -resize 50% $i small-$i; rm $i; done

Need more work to let it process photo inside folders.

APE to Mp3

Sunday, June 22nd, 2008

1) APE to WAV: http://supermmx.org/linux/mac/ (seems not included in most distributions, need to compile by yourself): mac cd.ape cd.wav -d
2) WAV to MP3: lame –preset standard cd.wav cd.mp3

3) Split: mp3splt -f -c cd.cue -o “@n” cd.mp3

4) Tag: mp3info -a artist -l album 01.mp3

Some programming quotes

Tuesday, May 13th, 2008

“The likelihood of keeping all or part of a software artifact consistent with any corresponding text that describes it, is inversely proportional to the square of the cognitive distance between them.” — http://c2.com/cgi/wiki?LocalityOfReferenceDocumentation

“We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.” — Larry Wall

Manual grub installation to MBR

Monday, May 5th, 2008


# grub is located at /dev/hda2:/boot/grub
grub> root (hd0,1)
# install grub to MBR of /dev/hda
grub> setup (hd0)
grub> quite