Sanitize the kernel, Bye-bye Cisco VPN

Gentoo, Network May 22nd, 2007

I’ve been using Cisco VPN client to access GWireless and Penn State Wireless for quite a long time since I managed to get it work. Two things bother me, the notice in dmesg

cisco_ipsec: module license ‘Proprietary’ taints kernel.

and that the Cisco VPN client stops working after a period inactivity. It fails to connect the Virtual Adapter once it disconnects, I have to restart the machine to get it work again.

Here is an alternative application vpnc in the portage. Before we move to the next step, we need enable Device Drivers | Network device support | Universal TUN/TAP device driver support in Linux kernel. David Ramsden hacked a script to convert the Cisco VPN Client’s profile to vpnc configuration file. Copy the converted conf to /etc/vpnc/default.conf and start the vpnc service. Done.

Current /etc/init.d/vpnc does not support profiles, I might hack a patch to cope with this problem later.

HOWTO display sharp Chinese in Gentoo Linux?

Desktop, Development, Gentoo May 11th, 2007

It has been the biggest headache to configure Linux desktop environment to display sharp Chinese glyphs. Personally, I would rather trace the segmentation errors rather than setup the Chinese font. For years, I was satisfied with the bottom line, i.e to browse the Chinese web page using Firefox, input Chinese when necessary.

It is quite embarrassing to stick to the ugly Chinese display as a geek, I would summarize my efforts to configure the Chinese fonts.
Read the rest of this entry »

HOWTO install CELL Environment in Gentoo

Gentoo, HPC April 19th, 2007

The CELL BE SDK developed by IBM and Barcelona Supercomputing Center targets RedHat Fedora Core 6 host system. Using the rpm2targz and rpm, we can also install the CELL SDK in Gentoo Linux as well.

Dependency and Tools

Since I don’t want to use RPM as my package management, that is the motivation for me to use Gentoo, I need to resolve the dependencies manually, the following package are installed to meet the dependency requirement:

emerge glut libXmu libXext

gcc make perl rsync flex byacc are in the base system.

To extract rpm, we also need to install rpm2targz and rpm:

emerge rpm rpm2targz

Download the RPMs

The CELL SDK files are scattered in AlphaWorks and Bsc:

Download the CELLSDK21.iso from AlphaWorks, you might need to register before access.

Download all the x86-based file from Bsc, to make your life easier, you could use this script:

# ppu
wget -c  http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-binutils-2.17.50-8.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gcc-4.1.1-10.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gcc-c++-4.1.1-10.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gcc-fortran-4.1.1-10.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gdb-6.6-15.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gcc-debuginfo-4.1.1-10.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-gdb-debuginfo-6.6-15.i686.rpm

# spu
wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-binutils-2.17.50-8.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-gcc-4.1.1-9.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-gcc-c++-4.1.1-9.i686.rpm

hwget -c ttp://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-gdb-6.6-12.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-newlib-1.15.0-7.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-gcc-debuginfo-4.1.1-9.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/spu-gdb-debuginfo-6.6-12.i686.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-sysroot-fc6-1.noarch.rpm

wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/ppu-sysroot64-fc6-1.noarch.rpm

# sysroot
wget -c http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/sysroot_image-2.1-8.noarch.rpm

Extract the RPMs

We need to convert all RPMs to tar, then untar it in the root of directory:

sudo mount CELLSDK21.iso /mnt/loop -o loop
for x in /mnt/loop/software/*i386.rpm
do
        rpm2tar $x
done

for x in *.rpm
do
        rpm2tar $x
done
BUILDDIR=`pwd`

cd /
for x in $BUILDDIR/*.tar
do
        sudo tar xvf $x
done

It would take a few hours depending on your network bandwidth. Unfortunately, the sysroot_image-2.1-8.noarch.rpm fails to covert to tar, using rpm2cpio as the rescure:

sudo rpm2cpio sysroot_image-2.1-8.noarch.rpm | cpio -i –make-directories

Test Drive

cd /opt/ibm/systemsim-cell/run/cell/linux
../run_gui

You MUST go to the specified path where .systemsim.tcl residents. Wait for the GUI window launches, then Click Go, if nothing is wrong, the Linux kernel is launched, and the sysroot_image is mapped as the guest OS system.

Warnning: The CELL simulator is extremely computing-extensive, you could click Stop to pause the simulator when it is idle.

Cleanup

We can unmerge the rpm right now if you want to a crusty system.

emerge -c rpm =db-3.2.9-r11 beecrypt =db-1.85-r3

YouTube On the Go

Development, Gentoo, Palm April 15th, 2007

Everybody loves YouTube, the hub of short video clips uploaded by the users. It makes more sense to watch YouTube clips than King Kong in the Metro. To watch one small clip, you need to:

  1. Install VideoDownloader Firefox Extension
  2. Download the video clips to the harddisk
  3. Manually convert the .flv to .avi using ffmpeg like this ffmpeg -i foo.flv foo.avi
  4. Copy to the Treo 650’s extension card

That is quite tedious. I need a tool to automate the above procedures, here come the tubefetch.txt:

$ ./tubefetch.py –help
TubeFetch: Download the video clips from YouTube
Version 0.1.0. developed by Kun Xi <kunxi@kunxi.org>
Usage: tubefetch.py [options] files …
                       
Examples:
  tubefetch.py -c http://the-url http://the-url2 …

Options:
  -h –help          print this information
  -v –version       version information
  -c                 convert the flv file to avi, needs ffmpeg

This script would download the flv files and convert them to avi file automatically, then copy the files to Treo 650 using CardReader, CardExport.

A better solution may go further:

  • Develop a Firefox addon: one-click would download/convert the file to the specified path
  • Develop a KPilot conduit, download the AVI files to Treo 650’s extension card when HotSync

Well, if I persist the enthusiasm for 3 months, I might roll up the sleeves and go through all the way to do so.

Update The DownloadHelper plugin is exactly what I am looking for. The author does not address the CJK file name issue, here is the modified version to bypass that problem.

PyAWS 0.1.0 released

Gentoo March 4th, 2007

PyAWS was ready for release for about one week. I just managed to squeeze some time to wrap up the package, develop the web site, and boom, it is released.

PyAWS is a Python wrapper for the latest Amazon Web Service, forked from the code base of pyamazon. This library is intentionally designed for an eBook management tool to fetch the meta data from Amazon. Well, the tool is still in blueprint, I would like to roll up the sleeves after the PyAWS is stable enough.

Currently, PyAWS only supports E-Commerce Service, I hope this library benefits to the community, at least the python developers do not need suffer from traversing the DOM tree any longer. Other services are still in the plan, and last but not the least, they are not free. Once I collect enough fund, or Amazon would grant me the free access to the premium services, I would start coding on that.

Thanks to Comix and feedparser, the Web site is shamelessly copied from the two.