Paul - The Programmer

simple & stupid

Install sunpinyin on Debian

The default scim-pinyin engine is too hard to use. It almost have no support to Chinese words. I have to pick up the Chinese characters carfully.

The great google told me sunpinyin is a better choice.

I don't like to download the sunpinyin source code from its google-code repository and compile it by myself. My laptop is not so powerful for gcc compiling. I prefer Debian package installation.

I only find the sunpinyin package in the expriemental repository.  So, I take the risk to install a experimental package. I just had enough for the scim-pinyin. ;-)

Warning: The expriemental packages is not complete distribution. They may do harm to your system without care.

You have been warned.

Let's go on.

1) Add the experimental repository to the /etc/apt/source.list

deb experimental main

2) Since I am using the scim. I install the sunpinyin engine for scim.

$ sudo apt-get update
$ sudo apt-get install -t experimental scim-sunpinyin

You may want to try the ibus. Some says ibus is more user-friendly than scim.

3) Configure the scim to set the scim-sunpinyin engine the default Chinese input engine.

Now I feel more comfortable for typing in Chinese. :-)

Configure Logitech C160 webcam in Debian wheezy

1. Build the quickcam kernel module -- the easiest way

The module-assitant is a tool for building Debian kernel module from source. With the help of module-assitant, the needed module can be built without building the whole kernel. It fetches module-source package that have been prepared for the Debian via apt and produeces the *.deb package.

1.1 Install module-assitant

# aptitude install module-assistant

1.2 Download needed kernel headers and tools

# m-a prepare

1.3 Check the sources.list if the contrib and non-free repositories are included.

1.4 Build the quickcam kernel module

# m-a a-i qc-usb-source

1.5 Check if the /dev/video0 node is created

2. Install camera software

# aptitude camorama

3. Plug the webcam into usb and startup the camorama. If everything goes well, you should see the picture captured in the application window.

It works like a charm.  ;-)

solve the KMS incompatible issue of ATI card

From Debian Sequeeze on, the KMS is enabled by default. But the ATI card is not compatible with the KMS.

When  the KMS enabled, the score of glxgears is around 40 FPS on my laptop which has a ATI Radeon X300.

The worst thing is the system becomes unstable, the screen could be frozen at anytime.

Disable the KMS by the way of /etc/modprobe.d/radeon-kms.conf.

Update this file with command:

echo 'options radeon modeset=0' > /etc/modprobe.d/radeon-kms.conf

Then reboot the system.

Now the score of glxgears gets back to around 1700 FPS.

Lock screen with xscreensaver by Gnome menu 'System / Lock Screen'

First of all, the xscreensaver should be installed and replace the default gnome-screensaver.

You may follow the instructions from the post :

Then, to recover the menu 'System / Lock Screen',  the dbus object org.gnome.ScreenSaver should be created.

I use the below python script to create the org.gnome.ScreenSaver.


import dbus
import dbus.service
import dbus.glib
import gobject
import os

class ScreenDbusObj(dbus.service.Object):
    def __init__(self):
        session_bus = dbus.SessionBus()
        dbus.service.Object.__init__(self,bus_name, '/org/gnome/ScreenSaver')

    def Lock(self):
        os.system( "xscreensaver-command -lock" )

if __name__ == '__main__':

Keep this script running on the background. The 'Lock Screen' button will call the method Lock and the method Lock will execute the xscreensaver-command -lock.

To automatically start this script, add the command,

i.e. /path-to-the-script/ &

in the System/Preferences/Sessions.

Upgrade from Debian stable to testing

I upgrade the Debian Lenny on my old laptop to Debian testing brunch this weekend.

Now I have more latest version of packages. 

Gnome is upgraded to 2.3. The new icon theme is much better than 2.2. 

Grub 2.0 with eye candy background is also okay. 

The Totem movie player from Gnome finally can play the rmvb and avi movies.

The full screen flash can work in current Google Chrome 8.0.552.208 beta.

The new kernel version 2.6.32 has replaced the old one.  The latest open source ATI driver is upgraded as well.

BTW. The latest open source driver requires the non-free ATI firmware which now is in the Debian non-free repository.

The bad thing is the ATI mobility Radeon X300's 3D acceleration seems not okay.

Before upgrade the FPS of glxgear is above 1000+ FPS. But now it drops to 100 FPS.

The 3D acceleration is enabled which is indicated by  the Xorg.log.

One forum thread points out that  the glxgear does not reflect the real OpenGL benchmark. The Lib Mesa should be upgraded.

So, I updated the Mesa to the latest version 7.9. But latest Mesa lib didn't bring any help.

Moreover, the Google earth can get the whole system hangs in current environment.  This must be related to the low OpenGL FPS.

The Jython from Debian repository can not be integrated within the eclipse pydev.

So I removed the Debian Jython and install the  Jython 2.5.2 from the official Jython website.

Everything else seems quite good in the Debian testing.

I should keep searching on the solution for this 3D acceleration problem.