Monday, December 22, 2008

CD/DVD burning broken in openSuse 11.1

CD/DVD burning seems to be broken/not working by default in openSuse 11.1 - at least on my PC with a pretty standard 5-years old DVDRW drive from LG. There seems to be a problem with device permissions: the /dev/sr0 device (my DVDRW drive) is owned by root:disk and therefore not accessible for CD burning software (/usr/bin/wodim to be exact) when executed by regular users. Here is a workaround for this problem:
  • make your user a member of "cdrom" group
  • create /etc/udev/rules.d/99-my.rules file with the following entry:
    KERNEL=="sr*[0-9]", GROUP="cdrom", MODE="0660"
  • set setuid bit for /usr/bin/wodim (note: this has some security implications; make sure you understand what it is all about):
    chmod u+s /usr/bin/wodim
  • reboot
  • this assumes your CD/DVD writer is mapped to a /dev/sr* device (should be the case for all drives, but I couldn't verify that).
  • if this rule causes any side-effects to other /dev/sr* devices you may have installed, restrict the rule for specific device instead of using regular expression.
It would be of course possible to make your user a member of "disk" group, but it would be a real security problem, as this would also allow for low level access to hard disks.

  • the bug has already been reported on Novell's bugzilla
  • making wodim setuid seems to be not needed after all (udev rule is enough).

Friday, December 19, 2008

openSuse 11.1 and ath5k

I've just upgraded to the latest openSuse 11.1. Everything went smooth except for some issues with wireless networking (Atheros wifi card with AR2413 chip) - not really problems of openSuse itself, but it turned out that:
  • madwifi-0.9.4 doesn't compile with kernel-2.6.27 sources provided with openSuse (I haven't tried to google this problem or use madwifi from trunk)
  • standard ath5k driver now works fine with my card (to my surprise) - no need to compile madwifi anymore; however
  • ath5k doesn't seem to support WPA2; I had to switch to WEP for now :(

Friday, December 5, 2008

GNOME menu structure in openSuse

If you don't like the structure of traditional GNOME menu in openSuse 11.0, with its plethora of sub-categories in each submenu, then here is a simple workaround: just copy or rename /etc/xdg/menus/ to This file defines how menu entires should be laid out in the menus with respect to their "Categories" definitions in *.desktop files. The defines a simple layout with top-level categories only - see screenshots. The only side effect of this trick that I noticed so far is no menu entry for YaST, but this can be added manually with menu editor.

Wednesday, November 12, 2008

Ubuntu bootsplash corruption

If you have ever recreated your swap partition and you're using Ubuntu, then you might have experienced a problem I had with bootsplash no longer working correctly. Even with /etc/fstab updated with new UUID of the swap partition the bootsplash would be interrupted with console messages. The solution:
  • get the UUID of swap partition, e.g. blkid /dev/sda3
  • update /etc/fstab swap entry with new UUID
  • update /etc/initramfs-tools/conf.d/resume with new UUID
  • recreate initramfs: sudo update-initramfs -u
If your swap partition doesn't have an UUID (this can happen if you recreated it with other Linux distribution), then you should recreate it in Ubuntu with mkswap.

Friday, September 12, 2008

Sunday, August 31, 2008

Received first donation!

One of my pet projects - KleanSweep - got a first PayPal donation! I've received a lot of positive feedback throughout past few years, but this is the first time someone decided to support my project by donation. This is very refreshing and encouraging. The donator comes from Netherlands and would like to be anonymous. Here is what he wrote to me - something that really stirred me:
"I think Linux users sometimes forget to make a small donation (if you can afford it of course) to people, like you, who make Linux possible. You put time and effort in it and we can use it, so for me it's normal to donate".

Thank you, the donator!

Wednesday, August 27, 2008

Must-have VIM plugins

A few cool vim plugins I use for programming:
  • Bufexplorer - nice buffer explorer
  • Taglist - source code browser for popular programming languages (C, C++, python...), similar to modern IDEs; relies on ctags.
  • A (a.vim, Alternate Files Quickly) - provides shortcuts for switching between source and header files quickly; supports C, C++, ADA95.
  • C (c.vim, C/C++ Support) - lots of helpers for C/C++ programmers: code snippets, common idioms (e.g. for loop, try ... catch blocks etc.) and more - all of that is customizable.
  • AutoClose - smart auto close for pair of characters - type "(" and it will automatically put ")" with cursor in-between; support quotes, brackets, square brackets as well as custom characters.
  • code_complete - one of my most recent findings - a real lifesaver; provides code snippets with ability to switch between parameters: type "for"< TAB >, and it will automatically insert "for" loop for you with placeholders for loop parameters; pressing < TAB > will move to next parameter. See screenshot. Snippets are fully customizable.
  • LustyExplorer - filesystem and buffer explorer; takes little space, has nice autocompletion and has one feature I like in particular: <Leader > lr opens the filesystem explorer at the directory of the current file. Really useful.
  • NERD Commenter - provides keystrokes for commenting out code for many filetypes. Supports tens of popular configuration files and programming languages.
  • NERD tree - another filesystem explorer
I consider some of them as a must-have vim companion: code_complete, AutoClose, A, LustyExplorer / Bufexplorer. Let me know if you think I missed a useful plugin!

Tuesday, August 12, 2008

Encrypted loop device on boot

There are a lot of tutorials on how to setup an encrypted LUKS home / root / swap partitions available, but I couldn't find any description about setting up an encrypted loop device on boot. It's easy to create an encrypted file and mount it manually, but I just couldn't find a way to configure it with /etc/crypttab to have it mounted on boot. So, here is the solution for Ubuntu 8.04 (should work on other distros that support crypttab too):
  1. Create an encrypted file first - this is covered in a lot of tutorials, but let's do it here (you need to be root to do this):
    • create empty /.cryptdata file
      dd if=/dev/zero of=/.cryptdata count=10 bs=1M
    • mount it via loop device
      losetup /dev/loop0 /.cryptdata
    • create an encrypted volume out of it
      cryptsetup luksFormat /dev/loop0
    • open the volume
      cryptsetup luksOpen /dev/loop0 cryptdata
    • format the volume (create filesystem)
      mke2fs -j /dev/mapper/cryptdata
  2. Add the following entry to /etc/crypttab:
    cryptdata /.cryptdata none luks
  3. Add the following entry to /etc/fstab:
    /dev/mapper/cryptdata /home/cryptdata ext3 relatime 0 2
  4. Create mountpoint for the encrypted filesystem:
    mkdir /home/cryptdata
Starting from now, the encrypted file will be mounted via loop device on system startup; you'll be asked for encryption password.

Distro hopping is over...

For a last couple of months I've been switching distros a lot just to find out that each has its own problems and bugs. Eventually I ended up with latest Ubuntu 8.04 . It's not perfect, but it is closest to what I expect from modern distro; let's hope their new QA efforts will soon bring some improvements. Some complaints regarding distros I recently tried:
  • OpenSuse 11.0 - after initial excitement I started to be fatigued by some irritating bugs (e.g. repository refreshing errors - why does it result in error message-box??). Other than that, changes to zypper were very nice (read: speed).
  • Sabayon 3.5 - I've always felt Gentoo is too much work for a daily use; Sabayon is a nice way to try out Gentoo without getting your hands dirty. I was initially very impressed by it, but it soon turned out that Entropy/Equo didn't play nice with Portage. After waiting for a few weeks for this bug to be fixed (and it's still not fixed), I came to the conclusion that Sabayon probably needs more manpower to work on bugs. Anyway, this is a very nice distro with a lot of potential.
  • Ubuntu 8.04 - a lot of people complain about getting wireless networking to work; Surprisingly to me, I had problems too (I've an Atheros-based NIC that has always been working fine with madwifi drivers for me) - my NIC was connecting to wrong AP on boot, but I finally found a workaround.

So, for now I will stick with latest Ubuntu. Distro hopping is over.

Tuesday, June 17, 2008

June - new great software

This month seems to be very fruitful when it comes to software - just to mention three products:
I've been playing with newest Opera for a couple of hours but unfortunately, despite of all the nice features, performance improvements etc. it keeps crashing on flash web sites on both computers that I tried (one with OpenSuse 10.3, the other with Fedora 8)... That's a pity (and yes, I setup plugin directories so that flash plugin is listed only once, and yes - I tried both stable and devel releases of flash player, that is 9 and 10). On the other hand, Firefox 3 works just fine. Now I'm eager to burn and install the newest OpenSuse :)

Wednesday, May 28, 2008

Computer Science graduation

I've just graduated master degree studies in computer science today :) Yeeeeah!

Thursday, May 1, 2008

Flock 1.1 - Picasa support

The new Flock 1.1 finally supports Picasa Web Albums :). This is really nice addition that encouraged me to make Flock my default web browser. With built-in feed reader (which is really slick by the way), media bar, powerful bookmark handling, GMail, Picasaweb and Blogger support (just to name a few I use - there are more!) this is really a superb web browser. Let's see how it works long-term. BTW, this post was published with integrated Flock's blog editor.

Wednesday, April 30, 2008

Triumph (6 months old)

Distro switching

I've been experimenting with Linux distros again... Enough to say, after my Ubuntu 7.10 - OpenSuse 10.3 - Ubuntu 7.10 trip (described previously here) I decided to keep looking for a replacement of Ubuntu. This led me to Fedora 8; it stayed on my hdd for a few weeks and worked well albeit a bit slow. This led me to.... OpenSuse again. Yap. I decided to give it a try again, this time being more careful when mixing repos. And you know what... with zypper utility, package management in OpenSuse becomes easier and snappier. It's not as fast as apt-get, but it's way faster than yast; it can be compared to yum when it comes to speed. I can live with that. So far, I'm very happy with OpenSuse and I'm eager to install version 11. I still have Fedora 8 on my laptop at work. Time permitting I may upgrade it to Fedora 9 (just to see what's new) or will move to OpenSuse 11. Time will tell.
In the meantime Ubuntu 8.04 was released... and I'm no longer tempted to install a new version of it: reading all the complaints confirms my feelings about lack of QA for this distro.... This is really sad.

Sunday, March 9, 2008

Nowa praca

Minął właśnie miesiąc od czasu, jak zmieniłem pracę. Z dużej korporacji przeszedłem do mniejszej, ale bardzo prężnej firmy - Astaro AG - która właśnie otwiera swoją siedzibę w Bydgoszczy. Ku mojej ogromnej radości, mam możliwość programować w nowoczesnym C++ i to - uwaga - pod Linuksem, jako że produkt jest oparty na tym systemie :). Cóż, nigdy nie podejrzewałem, że dane będzie mi robić to, co interesuje mnie najbardziej w rodzinnym mieście... A tu niespodzianka :). Na zdjęciu: Astaro Security Gateway (home edition), który broni teraz mojej sieci domowej przed czarnymi charakterami ;)

Tuesday, January 15, 2008

Biwa o Atlantyk

Kilka tygodni temu zakończyłem czytanie "Bitwy o Atlantyk" B. Ireland'a - całkiem przyzwoitej lektury wprowadzającej w temat walki niemieckich u-bootów w trakcie II wojny światowej. Główne wnioski, jakie płyną z tej pozycji są następujące: zagrożenie ze strony u-bootów zostało zmitologizowane i w rzeczywistości los im nie sprzyjał - olbrzymi wzrost produkcji okrętów (pomoc, a później włączenie się Stanów Zjednoczonych i ich gospodarki do wojny), coraz skuteczniejsze konwojowanie (więcej konwojów, wzrost doświadczenia ich załóg), wynalazki aliantów, złamanie Enigmy - wszystko to przyczyniło się do nieuchronnej porażki U-Bootwaffe; dość powiedzieć, że spośród 40 tys. służących w niej marynarzy, do domów nie powróciło 28 tys. Książka Ireland'a ma niestety trzy wady: po pierwsze jest dość krótka, po drugie - miejscami wydaje się chaotyczna (czytając wielokrotnie łapałem się na tym, że gubię wątek...hmm, może to ze mną coś nie tak ;)), po trzecie - brak bibliografii (hmmm....). Niemniej, jak wspomniałem, pozycję tą można potraktować jako dobry wstęp do tematu i oceniam ją na 4/5. Teraz jestem gotów na "Hitlera wojnę u-bootów" - tom 1 już wziąłem w obroty i po przeczytaniu jakichś 100 stron mogę z czystym sumieniem powiedzieć - to jest TO! Książka napisana z niesamowitym przywiązaniem do detali i ogromną znajomością tematu - wystarczy spojrzeć na spis treści albo kilkadziesiąt stron aneksów w drugim tomie aby wiedzieć, że autor bardzo rzetelnie podszedł do sprawy. Mniam. Przetrawienie tej pozycji zajmie mi pewnie kilka dobrych miechów i prawdopodobnie zaspokoję swoją wtedy ciekawość w kwestii u-bootów (no, może skuszę się jeszcze na książkę traktującą o operacji Paukenshlag.... widziałem że wyszła takowa)... Wrócę wtedy być może do tematu D-Day (w kolejce do przeczytania czeka "Kompania spadochronowa" Webster'a....). Ech... wakacji chcę, wakacji!

Thursday, January 10, 2008

Back to Ubuntu

After a one-week OpenSUSE adventure I've restored my /dev/sda1 with Ubuntu installation (thanks heaven there is partimage, so it took me only around 20 minutes). The lesson I learned: don't mix community repos in OpenSUSE (especially Pacman and Community GNOME:Stable unless you know what you're doing) ;). Future direction: I'm tempted to install Debian 4.0 and either use extensively or upgrade to Debian testing... Maybe I'll give it a shot in virtual machine first.