Tips & Tricks

Thinkpad T410 wireless network problems with Debian/Ubuntu/Linux

The 2.6.34 linux kernel with this configuration does not seem to have the wireless reset bug anymore.

I created the configuration by using the .config from the 2.6.32 debian kernel configuration. Then via make oldconfig, I used the default option with pretty much all questions that were asked.

Also with this kernel:

  • suspend-resume via hibernate-ram works well if you wait with closing the lid until it is suspended.
  • back-light control works
  • ethernet card works out of the box
  • camera + micro etc works out-of the box with skype

To use this config, copy it to the untared linux kernel, and call make oldconfig; make. Then, use the bzImage, and create a initrd image. You can write me an email / read-up somewhere else how to install a custom kernel if you need more help with this.

Opening pdf files with external xpdf / okular in google chrome

(for-what-its-worth, the problem might have gone away with some updates)

If you are using google chrome on linux and the pdf is broken, this might be helpful for you. If you want to use an external application to open pdf files when you download them.

  • Google-chrome utilizes something of the running gnome-session to start an external pdf reader
  • If you don't have gnome running (like me, I run windowmaker), then chrome by default uses the file /usr/share/applications/AdobeReader.desktop file.
  • If you want to use xpdf to open pdfs, you want to change the Exec line in this file to xpdf %U. However, chrome forgets to put quotation marks around file names passed to xpdf -- even putting xpdf "%U" there, does not help. The work-around is to create an executable xpdf-wrapper with the content: xpdf "$*" somewhere and use this in the .desktop file to call xpdf.

Automatically killing CPU-intensive chrome processes

The nice thing about Google Chrome is that each tab is a single process. Even better, the flash plugin runs in an own process, too. That means, if flash is eating too much CPU, you can kill the process from the shell and the rest of the browser will continue to work. Pages with flash will have a little crashed icon where the flash plugin was. Once you reload the tab, the flash reappears again. When you keep your tabs open, flash sometimes cloaks up my CPU. In this case, I go to the shell to kill the high-CPU chrome processes - and most of the times, it is only flash that is killed. To do exactly this, you might find the following Perl-script useful. Writing this post took probably double the time of writing the script - so, don't expect the script to be too fancy.

#!/usr/bin/perl -w

my $topout = `top -b -n 1`; # get top output

my @top = split('\n', $topout);

map { shift @top } (1..7); # throw away the header

foreach my $i (1..5) { # only go through the 5 top - processes sorted by CPU usage

my @fields = split('\s+', " " . (shift @top));

print $fields[1] . " -- " . $fields[9] . " -- " . $fields[12] . "\n";

if ( ($fields[12] eq "chrome") and ($fields[9] > 50)) {

`kill -9 $fields[1]`;

}

}