2010-01-03 21:28

Here is how to configure easily your Thinkpad fingerprint reader under Ubuntu Karmic, using ThinkFinger.

Install the thinkfinger-tools (for acquiring/verifying) and libpam-thinkfinger (for PAM integration):

sudo aptitude install thinkfinger-tools libpam-thinkfinger

Then you can test acquisition/verification. As a user, issue the commands:

tf-tool --acquire
# swipe 3 times your finger
tf-tool --verify
# swipe your finger, then another finger...

Note: tf-tools should work without being root if the user belongs to the plugdev group.

Then plug the reader to PAM as explained in /usr/share/doc/libpam-thinkfinger/README.Debian:

sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable

Now restart your system and try swiping your finger in place of typing the password. A “Password or swipe finger:” prompt displays to authenticate you at GDM login and when you type “sudo”.

Notes:

  • Test several programs in the Administration menu. “swipe finger” is not always showed but should work though.
  • To my knowing, it doesn’t work when locking screen (gnome-screensaver).

References :

2010-01-03 21:28 · Tags: , , , ,
2010-01-02 14:43

Looking for a simple and lightweight terminal, I found urxvt.

xvt and rxvt don’t support Unicode characters. You have to use urxvt :

aptitude install rxvt-unicode

Not that I find xterm too slow for my use. My “geek curiosity” took over. I don’t like terminal tabs but instead open plenty of different terminal windows. urxvt could certainly do the job.

Then you can customize urxvt using the ~/.Xdefaults file :

vi ~/.Xdefaults
Rxvt*scrollBar: False
Rxvt*background: black
Rxvt*foreground: white
Rxvt*geometry: 110x35

The geometry I use allow me to open 4 terminal windows in my screen.

Note: you can also put parameters in ~/.Xresources but you’ll have to restart X or use the xrdb -merge ~/.Xresources command to load parameters.

I also suggest you the use of a keyboard shortcut to start your terminals. In Gnome :

  1. Set your default terminal in System > Preferences > Prefered Applications
  2. Then in System > Preferences > Keyboard Shortcuts, set the Start Terminal entry. I use Alt+X.

References :

2010-01-02 14:43 · Tags: , , ,
2009-12-10 21:30

To disable a plugin in Dotclear 2.1.6 without the administration interface, it’s very simple. Just create an empty _disabled file in the plugin directory :

touch plugins/myplugin/_disabled

To enable it again? Just remove the file.

Reférence :

  • vi inc/core/class.dc.modules.php
2009-12-10 21:30 · Tags:
2009-12-10 21:09

Problem:

I want to create a server-www alias that connects me to the SSH server and change the directory to /var/www/ right after the connection.

There it is :

ssh -t server 'cd /var/www && $SHELL'

And for the alias, add this in your ~/.bashrc:

alias server-www="ssh -t server 'cd /var/www && $SHELL'"
server-www # test it !

References :

2009-12-10 21:09 · Tags: ,
2009-12-10 20:36

Under Ubuntu, the keyring is automatically locked by default while hibernating. When starting Ubuntu after hibernation, it prompts you for the keyring password.

To disable this lock:

  1. Go in Applications > System Tools > Configuration Editor
  2. Uncheck /apps/gnome-power-manager/lock/gnome_keyring_hibernate

Note: you can also launch the config editor with the gconf-editor command.

Reference:

  • A “lock” search in the configuration editor.
2009-12-10 20:36 · Tags: , , , ,
2009-12-10 00:23

When you have enabled automatic login under Gnome/Ubuntu, the window asking your password to unlock the keyring at startup is very annoying ! Network-manager needs it to be able to use the Wifi keys.

If your keyring password is the same as your login password, the keyring is unlocked automatically when you type in your password to log in. This is not possible with autologin.

A solution is to put an empty keyring password. This is bad for security of all your passwords.

The best solution would be to store the wifi keys in the default keyring, and to store all the other passwords in another keyring. Maybe I didn’t check correctly, but from what I seen most applications only use the default keyring.

Average solution: put a “foo” password to the default keyring, unlocked at Gnome startup by a script. This is better than an empty password.

Here is my solution:

We change the default keyring password:

  1. Go in Applications > Accessories > Passwords and encryption keys (don’t loose 2 hours like me looking for it in System > Preferences, where it should be)
  2. Right click on the default keyring > Change password

We then create the python script with the following code:

vi ~/.lordiam.py
#!/usr/bin/python
import gnomekeyring
#gnomekeyring.lock_sync(None);
gnomekeyring.unlock_sync(None, 'mypassword');

We prevent other user from reading the file:

chmod 700 ~/.lordiam.py

We test it. Expect 0 as return code (the warning is normal):

~/.lordiam.py
echo $?

Now, we add the script at startup in System > Preferences > Startup Applications:

Command: /home/USER/.lordiam.py

Finally, we reboot the PC to test the whole thing.

Notes:

  • The fact that the script is called before network-manager start is a chance. I didn’t found how to put a priority on it in the Gnome startup programs.
  • What is the ‘login’ keyring for ? From what I understand, it is for storing passwords which will be forgotten at session end.
  • For the script, we choose a common name, less remarkable than unlock_keyring.py. We also put the script as hidden file. It is better than nothing.

References:

  • apt-get source libpam-gnome-keyring
  • apt-get source python-gnomekeyring
2009-12-10 00:23 · Tags: , , ,
2009-12-03 22:42

Some Thinkpads, like the T43, have several heat and fan problems.

On a default Linux installation, my T43 processor is at about 46°C, and the GPU at about 49°C, for an external temperature of 19°C.

The BIOS fan management algorithm is very bad. After a cold boot, the fan starts running non stop after a few minutes of use.

Fortunately, it is possible to use programs to take control of the fan in place of the BIOS.

To start, the thinkpad_acpi module must allows us to change the fan speed:

# vi /etc/modprobe.d/thinkpad.conf
options thinkpad_acpi fan_control=1 experimental=1

Your choice to reload the module or reboot your system.

# rmmod thinkpad_acpi
# modprobe thinkpad_acpi

Now you can take control of your fan:

# cat /proc/acpi/ibm/fan
# echo level 0 > /proc/acpi/ibm/fan
# echo level 7 > /proc/acpi/ibm/fan # full speed !!
# echo level auto > /proc/acpi/ibm/fan # back to normal, BIOS management

Now go here and copy the content of the script in /usr/local/bin/tp-fancontrol.

# mv index.php /usr/local/bin/tp-fancontrol
# chmod a+x /usr/local/bin/tp-fancontrol

Then, test the script:

# tp-fancontrol
# tp-fancontrol -s 5 # for a fan that starts later

In order to start the script at boot, we also fetch the tp-fancontrol.init.debian script on the same page. We add it at the system boot.

# mv index.php /etc/init.d/tp-fancontrol
# chmod a+x /etc/init.d/tp-fancontrol
# vi /etc/init.d/tp-fancontrol
DAEMON=/usr/sbin/fancontrol
# /etc/init.d/tp-fancontrol start
# /etc/init.d/tp-fancontrol stop
# update-rc.d tp-fancontrol defaults # note: only adding "start" scripts is also possible

The final touch is to edit the script to change the minimum fan triggering tresholds, so that the fan starts later when the system begins to heat:

# vi /usr/local/bin/tp-fancontrol
MIN_THRESH_SHIFT=5
INTERVAL=10 # you can also increase the speed update interval

A 5 seconds increase allows the fan to become quiet again when the computer activity is low.

References:

2009-12-03 22:42 · Tags: , ,