Dienstag, 30. Dezember 2008

jexec is evil

For the last week I had a number of really, really annoying problems with openSUSE 11.1 - ones which had me wondering why there weren't more bug reports, blog postings, rants etc. The most prominent of these problems were:
  • jexec service causing boot process to hang every so often
  • NetworkManager not started automatically - rcnetwork start necessary
  • not possible to mount usb sticks (even mount hangs indefinitely)
  • unmounting fuse during shutdown takes way too long
After some reading on the issue, I stumbled on this post in the openSUSE forum. After a lot of talk about HAL rules etc, the suggestion was made to disable jexec in the YaST runlevel editor. Once I disabled jexec and java.binfmt_misc and rebooted the system, all of the above problems disappeared.

For anyone wondering what it is about jexec that makes it such a fundamental system component, check out this issue on Sun's website. I can definitely do without it.

Freitag, 19. Dezember 2008

Freitag, 12. Dezember 2008

openSUSE 11.1 coming on December 18th



Get ready for it! Click on the image above to go straight to the openSUSE 11.1 landing page and learn about the cool new features.

My favourite feature? I don't know if you can call it a single feature, but a properly working KDE4 desktop is definitely a big plus for openSUSE 11.1. Working with KDE4 is really easy and quite natural.

Now, I am by no means a big fan of OpenOffice, but the version being delivered with openSUSE 11.1 is easier to use than any of the predecessors.

So point your browser to http://download.opensuse.org on the 18th and get your copy from your local mirror. Or, splash out and buy the box.

Montag, 8. Dezember 2008

Change the file browser in firefox

I didn't realise that so many people did not know how to change the default file browser in firefox. Admittedly, I had to do an amount of searching to find out how to do it as well. To prevent me from forgetting how to do it, I'm going to post it here.

  1. enter about:config in the URL bar
  2. enter platform in the search bar of the about:config page
  3. The only available result should be ui.allow_platform_file_picker
  4. Change the value of ui.allow_platform_file_picker to False
  5. Enjoy KDE file browsing if you are on KDE. No more sucky Gnome file picker
Update: on openSUSE 11.3 I just tried this and I found that the value for ui.allow_platform_file_picker was already False. Firefox was also using its own sucky file browser (or Gnome's). So what I did was change the value to True and it worked - I now have KDE's file browser. So just toggle the value and see if it works for you...

    Donnerstag, 4. Dezember 2008

    HTMLCalendar and HTMLTemplates fresh off the openSUSE Build Service

    Have you ever wanted to display a calendar on your webpage and seen how complicated this can be? Well, you probably missed HTMLCalendar, then. HTMLCalendar makes it extremely easy to just roll a simple HTML calendar without any overhead. You can even add events on certain days and link these to other pages.

    With this in mind, I decided to build packages for openSUSE to make it even easier to install the package. So, if you're on openSUSE, (make sure you have the devel:languages:python repository registered with zypper - but this goes without saying), just run a:
    zypper in python-htmlcalendar

    and you should be good to go.

    Once you've got the packages installed (python-htmlcalendar automatically pulls in python-htmltemplate which is required), try writing a small python script. Mine's called testcal.py:

    #!/usr/bin/python
    import HTMLCalendar

    month = 12
    year = 2008
    links = {1:'#day1', 2:'#day2', 3:'#day3', 12:'#day12', 27:'#day27'}

    print HTMLCalendar.MonthCal().render(year, month, links)


    Then call the script like this:
    python testcal.py > calendar.html

    Once you're done, call up calendar.html with your browser of choice and voila - there's your calendar. Now I have to go and read the documentation to see what cool options are supported. I'm thinking along the lines of CSS formatting, colours etc.

    Maybe it's even possible to combine some images with the outputted HTML so as to create a 12 month calendar with a picture for every month. This could then by exported to PDF for printing.

    Samstag, 4. Oktober 2008

    Getting rpm header information with python

    Once you have rpm-python installed (a quick zypper -i rpm-python does the trick on openSUSE), fire up a python console. The assumption is, that there is a rpm file in /tmp/mypackage.rpm. Import the module:
    import rpm
    Now try this:

    ts = rpm.ts()
    fdno = os.open("/tmp/mypackage.rpm", os.O_RDONLY)
    hdr = ts.hdrFromFdno(fdno)
    hdr is a dictionary containing all the header information in the rpm. Some typical values which you might want to get might be:
    print hdr['name'], hdr['version'], hdr['license']

    If these header values exist, you would get something like:
    mypackage 0.1 GPLv2 or later
    One thing which might jump up to bite is if the gpg key with which the rpm was signed is not available. Now, I'm ususally unterwegs with openSUSE, so obviously I have the SUSE Linux Products GmbH key installed. If you need to query rpms from another system, you might have to import the key (once you've downloaded it) with something like rpm --import key.txt. Otherwise you might get an error like:

    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
    public key not available
    Error with rpm : public key not available