Paul - The Programmer

simple & stupid

Goodbye 2010 && Hello 2011

This is the last day of 2010.

This is a busy year. Our new apartment is ready after 4 months decorating. We plan to move in in few months.

This is also an exciting year. We have a new member in our family.

The year 2010 is a year ought to be remembered.

Happy new year : )

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 :

http://ubuntuforums.org/showthread.php?t=195557

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.

#!/usr/bin/python

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

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

    @dbus.service.method("org.gnome.ScreenSaver")
    def Lock(self):
        os.system( "xscreensaver-command -lock" )


if __name__ == '__main__':
    object=ScreenDbusObj()
    gobject.MainLoop().run()

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/myscreen-dbus.py &

in the System/Preferences/Sessions.

Colorific Man Page

 

# For colourful man pages (CLUG-Wiki style)
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'

Add the above in the .bashrc or .profile file

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.

 

 

Apply for Google adsense but be declined

As you see in the title, my application for Google adsense get declined within half of an hour. :-(

Well, let's try next. Maybe this is a motivation for me to update my blog more frequently.