Thursday, December 11, 2008

Using dialup with 11.1 if NetworkManager does not handle your device

In openSUSE 11.1, NetworkManager is supposed to handle all dialup stuff. But, as far as I know, it can not handle e.g. plain old phone modems or dialup via bluetooth (rfcomm).
Unfortunately, if you now try to use the old methods of kinternet, wvdial or Umtsmon, you will find out that dialup will work with these, but you won't get a working resolv.conv and thus no name resolution. The reason is that the netconfig tools, which do rewrite resolv.conf apparently refuse to do that if NETWORKMANAGER=yes is configured in /etc/sysconfig/network/config.
One solution would be to switch to the old ifup method (NETWORKMANAGER=no), but then wireless LAN will basically be unusable.
Another, dirty and hackish solution is this:

Create a /etc/ppp/ip-up.local, containing
        #!/bin/sh
echo "nameserver $DNS1
nameserver $DNS2" >> /etc/resolv.conf

and a /etc/ppp/ip-down.local, containing
        #!/bin/sh
mv /etc/resolv.conf.netconfig /etc/resolv.conf

Make both of them executable. Dial up.

How does it work? The ip-up script gets the DNS servers in its environment. Just before it exits, it calls the ip-up.local script which then appends them to resolv.conf. During ip-down, the netconfig tools notice that the resolv.conf was changed externally and they refuse to touch it. They instead create resolv.conf.netconfig. ip-down.local now just replaces resolv.conv with resolv.conf.netconfig and everybody should be fine again.

To make this hack a bit more robust, you should probably check if the $DNS[12] variables are non-empty before adding them and you should check if resolv.conf.netconfig is newer than resolv.conf before restoring, but I leave that up to the reader.

Oh - and don't forget to file a bug against NetworkManager if it cannot handle your device!

Monday, December 08, 2008

Important Privacy Notice

If you care for your privacy, make sure to always delete /var/lib/zypp/AnonymousUniqueId before using any of the package management tools (YaST2, zypper).

Setting the repeat rate on an input device (Kernel 2.4 and 2.6)

If you ever come into the situation of having to set the repeat delay/period on an input device (/dev/input/eventX), with the additional challenge of needing it to work on both 2.4 and 2.6 kernels, maybe this code snippet might help you (fd is the filedescriptor of the device, opened writable):
        #include <linux/input.h>
struct input_event ie;
ie.type = EV_REP;
ie.code = REP_DELAY;
ie.value = 1000; /* 1 second initial delay */
if (write(fd, &ie, sizeof(ie)) == -1)
perror("REP_DELAY");
ie.code = REP_PERIOD;
ie.value = 250; /* 4 events per second */
if (write(fd, &ie, sizeof(ie)) == -1)
perror("REP_PERIOD");

Looks pretty trivial, doesn't it? But it took me quite some time to realize that I needed to write a "magic" event into the device to set the properties ;)

Wednesday, December 03, 2008

WINE followup: Open Source Software Rocks!

Just a short followup to my last post about WINE and the problems it had with "Avatar - Legends of the Arena": most likely, with the next WINE version it will just work out of the box, due to this commit to the WINE git repository.

Yay! That's quick bug fixing (or actually: implementing a feature). Thanks!

Sunday, November 30, 2008

WINE makes my kids happy

Of course my kids have a Windows 2000 on their machine, used only as a "game bootloader". And of course this Windows has no internet connectivity, since I would not even know how to keep it somewhat secure.
But now my son came up with that new, apparently uber-cool game from nick.com called "Avatar - Legends of the Arena", and he really wanted me to make it work with his machine. Unfortunately this game is - of course - only available for Windows, and it needs an internet connection - something I was not willing to enable on the Windows installation.

The way out of the dilemma: WINE.
There were only minor problems, e.g. that the game would install, but then still could not connect to the game server, but a look at the console output showed

fixme:wininet:InternetSetOptionW Option 28 STUB
fixme:wininet:InternetSetOptionW Option 29 STUB


And with the help of Marcus Meissner (also here), we found out that all that was needed to get it going was that the original W2K wininet.dll had to be copied to ~/.wine/drive_c/windows/system32/ and then the game could be started with

WINEDLLOVERRIDES="wininet=n" wine AvatarMP.exe

Cool stuff, WINE developers!

Now the next thing to get going is the TomTom Software ;)

Friday, November 28, 2008

Konqueror finally got decent adblock support!

Today I finally updated my machine to openSUSE 11.1 beta6 (was still running plain beta5 before). Then I started to wonder what this small red icon in the lower right corner of Konqueror (KDE 4) could be.
Clicking on it, it popped up an adblock dialog, listing all the blockable items on the current site and showing if they are already blocked or not. It also allows to add items to the block list.

Basically that's functionality that's present in Firefox extensions since years, but it is nice to finally see it also implemented in my favorite browser.

Thanks, KDE team!

Monday, November 10, 2008

NLUUG "Mobility" Conference

Last week, I was attending the NLUUG autumn conference, themed "Mobility" (Unfortunately, there is no usable english page, but at least the programme should be available here). I was giving two talks on the topics "suspend" and "UMTS/3G", which went pretty well.
Apart from the 10+ hours train ride to and from Ede, this was a very nice event with many good talks and lots of interested and interesting people. Additionally, the ELC-E Embedded Linux Conference Europe was held simultaneously, which provided for even more interesting talks. Unfortunately I could not stay for the second day of ELC-E talks, because I had to take care of returning home in time for the weekend.

The papers are already up on the conference website, I assume that the slides will follow soon, too.