Category Archives: IT & Tech

Interesting stuff from the world of bits, bytes and hardware.

Fixing Google Chrome Alsa plugin volume issues

If you’re on Linux, this may have happened to you: Google Chrome’s flash plugin all of a sudden sets the audio playback volume to 100% whenever you play a youtube video which may end up in serious sound distortion for all other apps on your system, including google chrome.

 

Here’s how to fix it:

 

– make sure you have the “pavucontrol” application install (pulse audio volume control panel)

 

– with a youtube or other flash video running, fire up pavucontrol, it should look something like this:

https://dl.dropbox.com/u/1983539/pavucontrol.png

Simply drag the “chrome alsa” volume slider to 30% or so and you should be all set to enjoy non-distorted sound in both chrome and Linux (Ubuntu 10.04 in my case) again.

 

How to generate a self-signed root CA certificate (that you can import in Firefox ;-)

For a job-related project I’ve been fiddling with openssl to create a new CA instance for self-signed certificates.

 

Initially I had problems importing our root CA cert into firefox, but finally got it working after some googling. The main problem is that by default on Red Hat 5.x, the file /etc/pki/tls/openssl.conf has the following entry set to FALSE:

 

basicConstraints=CA:FALSE

So you when you create the root CA certificate using

/etc/pki/tls/misc/CA -newca

the root ca cert will end up with the above constraint set to FALSE. Firefox doesn’t like that and will consequently refuse to import the certificate as a new CA.

Solution: Simply fire up your text editor of choice (I prefer GNU Emacs ;)) and change the line above in your openssl.conf file to read

basicConstraints = CA:TRUE

and you should have no problems importing the certificate into Firefox and other browsers.

 

Remember to undo the change before you generate your first self signed server certificate or you may run into other problems when trying to use these certificates in web- or mail servers.

It’s also worthwhile checking the other stuff in openssl.conf if you want to change settings such as default key length or certificate validity periods.

 

Fixing Linux Mint LMDE Flash Plugin sound issues

I recently updated my main Linux machine to Linux Mint Debian Edition (LMDE) because I’m not happy with Canonical’s “unity” strategy and trying to kill Gnome 2.x outright instead of fixing what’s wrong with it.

Most stuff worked well out of the box, but somehow the flash plugin could no longer play sounds.

A post on the Linux Mint forums was especially helpful in fixing this issue. As the “root” user, issue the following command:

 

touch /etc/asound.conf

Then, open the above file in your favourite text editor (mine’s “emacs”) and add the following lines:

pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}
pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}

 

Save the file and reboot your system and from then on, the flash plugin in Firefox / Chrome / what have you should be able to play sound again.

 

Another serious bout of nethack addiction

Following the recent announcement of the “nethack & variants” world championships, I’ve dug into that fantastic game once more which I have been playing since the late eighties, back then on my meagre Amiga 500.

 

Only today, I managed a decent game playing the usual “Ranger – Elf – Chaotic” character again, even meeting my ghost on level #9 or so of the gnomish mines.

 

Some random nymph stole my +2 elven cloak and bow on the Oracle level (hadn’t seen that in a while either as I’m usually headed straight down the Mines when I find them), only one altar in Minetown and not many else extras to speak of didn’t make things easier.

 

Eventually I made it to the bottom of the mines, plundering the wine cellar and all, but my AC never got below -3 at 63HP, so when faced with an air elemental on the mine bottom and a winged gargoyle on the level #9, I was faced with choosing my favourite kind of death.

 

I wish I would have kept that chickatrice corpse I had, but for fear of fumbling, falling down the stairs without remembering to unwield it first I carelessly dropped it.

 

Well, “hoover the male elven ranger” died with nearly 40k points, so it wasn’t a bad game at all. I’ve also picked up collecting and identifying daggers, they make a great weapon for throwing once your skill picks up (I could throw four at atime), sadly for lack of potions and scrolls, I never got around to blessing them or they would have made an even better weapon.

 

Bring on the next character! I’ve never ascended, and I probably never will, but one can dream. I had really forgotten what a wonderful game nethack is.

 

Resetting google chrome / chromium on Linux

Just the other day, my favourite browser started acting up on Linux Mint 10: whenever I started google chrome or chromium, the entire window would lock up and I’d have to kill the process using xkill.

I decided to start with a fresh set of preferences which is no biggie as google chrome’s nice sync feature makes it a snap to restore one’s favourite bookmarks, accounts and so on, so here’s what I did:

 

Open up a shell and type the following commands (make sure neither chromium nor chrome are running beforehand):

$ cd ~
$ mkdir backup
$ mv .config/.chromium .config/google-chrome backup/

Start google chrome, and you should be greeted by the familiar welcome screen.

 

Caveat: Only tried this on Linux Mint 10 (Ubuntu based), YMMV depending on the distro of your choice.

 

Some unscientific Linux filesystem benchmarks

I just did some rudimentary benchmarking of various Linux filesystems on Ubuntu 10.10/32 bit, doing an rsync -av of /usr /about 3,5GB of data) to a USB-connected, freshly formatted ATA drive (Seagate Barracuda 750g), here are the results (caveat: I used the system for web browsing and some shell stuff during the runs, so take the numbers with a large grain of salt):

xfs: 10m 1sec

jfs: 9m 5sec

btrfs: 7m 29sec

ext4: 6m 47sec

All filesystems were formatted using default parameters.

If it wasn’t for the long delay creating a largish ext4 fs as it writes its inode tables, I guess I’d be using ext4 more! 😉 Nice work also on btrfs, I guess there’s some more performance to be gained as the file system comes of age.

Batch-Scaling a directory of jpeg images using ImageMagick’s “convert” cli tool

Recently, I had to scale down a series of images in different resolutions down to a web-friendly 600xsomething size so I could upload them to Zope’s internal Medusa ftp server without having to wait hours or breaking the resulting picture page with humongous images. Here’s how I did it, assuming the pics reside in a directory called “picdir” in my home directory:

cd ~/picdir
mkdir web # create a temporary dir to hold the scaled down images
for f in *jpg *JPG ; do
 convert -geometry 600x "$f" web/"$f"
 #convert to 600px width at most, let convert figure out the rest
  echo $file
done

Of course, this only works for landscape format pics, portrait format pictures will end up slightly larger because of their greater vertical size.

eee pc 1005p: Getting the “disable touch pad” function key to work on Ubuntu Lucid

Hi folks,

here’s something I came across while playing with Ubuntu 10.04 Lucid on my eee pc 1005p: Apparently, to get the “disable touchpad” function key working (fn-f3), you have to deselect the “disable touchpad while typing” setting in the gnome control center-> mouse input settings.

I found that with the above setting enabled, if you hit the function key to disable the eee’s touchpad, it will get re-enabled on the first keypress.

Hope that fixes the problems for some of you using the eee pc 1005p model.

Jolicloud rocks!

Just playing around with Jolicloud on my eee 1005p, and I really like what I’m seeing. Ok, it’s still based on Ubuntu 9.04, but seems to be a rock-solid netbook os featuring great looks for the n00bs and configurability for the hackers alike. Keep up the good work!

More on jolicloud: http://www.jolicloud.com/

Birders-HF.de: New feature

Our birdwatcher’s ranking site over at http://www.birders-hf.de/ now allows you to check for bird’s voices right from the species detail page. Thanks to the kind cooperation of soundarchiv.com, we’re now able to search their vast sound archives for matching samples of various bird calls!

Check out the new feature and tell us what you think.

Uwe

Birders-HF.de goes live

After a couple of weeks of sometimes hectic hacking, our local birdwatchers site http://www.birders-hf.de/ranking/ has finally gone online.

Thanks to the Python Django web framework,  the site was mostly a joy to develop, and during the times it wasn’t, it was mostly due to myself being unable to wrap my head around some of the more esoteric Django concepts.

For now, I’ll just sit back and watch the webserver access log roll by, always a great moment when you’re going to find out (or not, for that matter ;-)) wether people actually find a site you’ve created useful.

Also, I finally ordered the Django book so I’m looking forward to reading that and having a great many “aha, I wish I’d taken the time to read that!” moments.

If you’re interested in using the site for your own local county ranking, feel free to get in touch at the email address given at the site or by commenting here. Be warned though, I’m not making use of any l18n features that Django offers yet, so adapting the site to another language may imply a bit of work.

Uwe

Django rocks!

Finally seem to have gotten my head 1/3 of the way around the Python framework called “Django”, creating a site for birdwatchers within the county of Herford here:

http://birders-hf.gplrank.de/ranking/

I used Django 1.1.x for the site, and while some issues with mod_python seem to persist, everything is working generally well (using mysql as a db backend).

thanks Django folks, this is really cool stuff! The irc channel #django on irc.freenode.org has been of great help, too.

How to prevent package updates in Ubuntu

I recently updated my work machine from Mint 8 to Ubuntu Lucid and noticed in the process that Lucid comes with the very latest Bacula version, namely 5.0.1. Sadly, this client is incompatible with what we run at work, so I had to figure out a way to “hold” the packages at their karmic versions which still worked fine on lucid. Thanks to the excellent Ubuntu docs, I managed to put those packages “on hold” using the following commands:

echo bacula-fd  hold | dpkg --set-selections
echo bacula-common  hold | dpkg --set-selections

Once you run apt-get update, you’ll see the newer versions being held back.

Fixing the broken OSD on a T41 / Karmic

Thanks to the Ubuntu forums, I’ve finally managed to fix the broken osd / notification system in 9.10 on a t41 thinkpad (the bug affects all radeon based devices, I believe) by adding the line

Option "RenderAccel" "off"
to /etc/X11/xorg.conf

However I had to create xorg.conf first, check the Ubuntu forums for more information (search for “karmic no xorg.conf”), for example. It was also suggested to limit / set the AGPSize to “32”, but sadly this did not solve my problem.

On the upside, “Stellarium” runs again, on the downside, it’s now slow as molasses, but that’s still better than a segfault in my book. Why the developers broke something in karmic that worked without a hitch in jaunty and earlier is beyond me, however.