Paul - The Programmer

simple & stupid

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.

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