Archives for: May 2005

05/30/05

One down, five to go

This morning, I finally did my first exam. Finally. Finally I'm coming in the right rhythm for examinations. My first one was computer graphics, a very easy one. The syllabus was that small I can express my study time in hours instead of days :-D That way, it was very difficult to start studying instead of taking vacations. So I think it 'll be OK, I answered all questions, so let's hope they're right B-)

Now, right after an exam, I can't motivate myself to study the next one, so I did some other stuff, like reading the newspaper and so on. I also prepared a statement text that I'll use on the next meeting of the computercommission of our university. If you're interested and you understand Dutch, you can read it here. Now the rest of our board has to approve it and then I can defend it on the meeting next friday, right after my next exam. And that one isn't that easy. It's also one of the most boring courses in our course list: Queueing Theory. Let's hope it'll be allright.

So now I think my break was long enough, let's eat and then study!

Permalink . Peter . 18:11:27 . 198 Words . Studies . Email . No views

It's been quite a while since I posted here. So here's a little update. I'm preparing for my exams, the first one is friday. I can feel the exam stress already, which is good, because I need some stress to study. (if there is no stess, I waste my time with surfing and gaming) I've got 5 exams this semester, 3 difficult ones, and 2 easy ones (surprisingly, the easy ones are computer-related ;-) ). The 3 difficult ones come first, so after those, the worst part is over and the fun begins. :-p

Now, about that weird word 'Sauerbraten' in the title. Sauerbraten is 'Cube 2'. (I have posted about Cube before.) The first 'relatively mature' release is availiable for download here. Saurebraten runs on linux and windows. If you want to try Saurerbraten out, you should extract the .zip file somewhere on your harddrive. Linux users should go to sauerbraten/sauerbraten and run 'sauerbraten_unix'. (you might have to change the permissions of sauerbraten/sauerbraten/sauerbraten_unix and sauerbraten/sauerbraten/bin_unix/linux_client to make sure they are executable) Windows users should execute sauerbraten\sauerbraten\sauerbraten.bat. Remember that this is an early release, so many things might still change. I think the looks have improved a lot, but some features still annoy me: I hate those stupid ogre models and the other monsters. They just don't fit in a FPS game.

Oops, my break is over. Back 2 the books. >:( Cya!

Permalink . RealNitro . 15:03:42 . 280 Words . Gaming, CUBE, Life . Email . 757 views

05/29/05

OPluginManager

I've been working on my OPluginManager lately (not too much, got to study too, and watched the Queen Elisabeth concours of course ;-)).

This is what I got now (it's my first GTK code ever, so I'm quite happy with it):

This is the "plugin" code:

#include "plugins/o-plugin-manager-plugin.h"
#include "plugins/o-plugin-manager-plugin-data.h"

#define TEST_PLUGIN_MSG "[test-plugin] "

static gpointer plugin_init(gpointer d, GError **e) {
        g_debug("" TEST_PLUGIN_MSG "Init");
        return (gpointer) g_strdup("Test plugin data");
}

static void free_data(gpointer d) {
        g_debug("" TEST_PLUGIN_MSG "Freeing data \"%s\"", (gchar *) d);

        g_free(d);
}

static OPluginManagerPluginAuthorData author = {
        O_PLUGIN_MANAGER_PLUGIN_DATA_AUTHOR_MAGIC,
        "ikke",
        "eikke eikke com"
};

static OPluginManagerPluginData plugininfo = {
        O_PLUGIN_MANAGER_PLUGIN_DATA_MAGIC,
        "test-plugin",
        "A simple test plugin",
        "This is a sample test plugin, to test the OPluginManager functionality",
        "0.1",
        "http://www.eikke.com",
        &author,

        NULL,
        plugin_init,
        free_data
};

O_PLUGIN_MANAGER_PLUGIN_REGISTER(plugininfo);

As you can see it's braindead easy to write a plugin :-)

The code is quite a mess at the moment, the UI is just plain ugly and inaccessible, there's no I18N support, but well, as you can see, one day it might work :-)

Lots of guys I know are in Stuttgart right now, visiting GUADEC. I wish I could be there too :-( Have a great time!!!

Permalink . Ikke . 08:33:36 pm . 221 Words . Technology, Linux, Desktop, Coding Corner . . 291 views . Leave a comment
GVim

Just had a little chat with Ruben on Vim, where he suggested me to put my .vimrc etc online.

So I did, this is my current GVim setup:


(Thumbnail is link to original image)

And here's my current .vimrc. If you know any other fancy tricks I could use, please let me know :-)

A lot of useful information on configuring your Vim is available here.

Permalink . Ikke . 01:33:19 pm . 95 Words . Technology, Desktop . . 373 views . Leave a comment

05/27/05

Printing in Linux

Printing in Linux: it doesn't go automatic. Ok, one can say you just have to follow the Gentoo Printing Guide wich is very clear and makes installing a printer very, very easy (just a few commands), but I think we could expect more, especially more automated and integrated in gnome.

First off all, when you have a plain linux installation, gnome and all stuff you need, with no printing devices configured: printing works. You can just print a file without configuring a printer. The big problem is that the printed document doesn't look very good. A plain color is made of textures for example, looks like printing with the first color printers or with kind of colored-grayscales. Off course I want better, so I followed the gentoo guide.

What is it all about? First of all you need to have cups and foomatic installed. No problem, cups should be installed as dependency of gnome and you still can install foomatic if you need it. Maybe CUPS/Gnome could advice you to install foomatic when configuring a printer that has some benefits when having foomatic installed. If you have an HP Deskjet printer, you also need to install the HPIJS driver wich acts like a postscript interpreter between the postscript output and the printer device. Also this one could be recommened when configuring a HP device in CUPS/Gnome. That's all for software requirements. The configuration could be automated more. Normally, you have to create a PPD-file for your printer by hand (just give the model and hardware number to foomatic) or download the right one from linuxprinting.org and place it in the cups directory. I think it must be possible to grep the required information when attaching a printer device with USB. When connecting, gnome should detect the right model, generate the appropriate ppd file and install the printer in cups. Maybe a dialog box should appear informing the user that the printer is added to cups and asking if he/she wants to review the configuration or sharing properties. This would be a real integrated desktop experience.

Permalink . Peter . 02:57:42 . 349 Words . Linux, My Gentoo . Email . No views

05/25/05

Three down, one more to go; internship news

I'm almost finished with my project work. Today I wrote the report of my project in information security. We had to develop a system to make online train ticket purchasement possible with the necessary fraud protection. The train speculator has to be able to verify the ticket in very less time without consulting a database containing the online transactions. We developed a system based on encrypted information printed on the ticket as barcode.

For the last project we just have to work a little bit on the report. It was about testing an algoritm for on the fly pitch extraction of recorded speech. This information is needed to compress digital speech as good as possible.

I also have some news about my internship. As I told you before, I've chosen a thesis where I have to work on development and testing of a fast handover system for wireless connections on trains. I also told you I had a meeting to arrange an internship with Siemens on the same subject. Now, the prof has sent me a e-mail with the good news he has contact with Siemens and they're interested in such kind of internship. If everything goes well, I can do some work on their Chantry technology. It should cover a few days/weeks working in Herentals and do some tests with the equipment in Ghent. Normally there'll be a meeting around the 17th of July or afther the examinations. Let's hope everything goes well :-D

Permalink . Peter . 23:18:51 . 246 Words . Studies, Siemens . Email . No views
Nokia

Ok, I admit, I also want one. Just check Planet Gnome if you don't know what I'm talking about.

Permalink . Ikke . 08:27:45 pm . 33 Words . Technology . . 305 views . 4 comments

05/24/05

Gnome stuff

Some new Topaz mockups were created, showing another (more radical IMHO) view on what Gnome3 should become, like these before. If you want to comment on them, desktop-devel is the place to be.

Since today, I got write access to Gnome CVS, mostly thanks to Philip and Ronald. Thank you guys! Just got the documentation building of asyncworker working (I hope at least ;-)), patch submitted (edit: and committed. My first one :-)). I'll import my first work on OPluginManager somewhere later this week.

And I may not forget to send out some emails to find some holiday job. As I'm a lazy bum, I still didn't send them :oops:

Permalink . Ikke . 09:28:48 pm . 161 Words . Life, Technology, Linux, Desktop, Coding Corner . . 488 views . 4 comments
OModuleLoader

It looks like I have to release the current code I got for OModuleLoader/OPluginManager. Well, here it is. Still needs a lot of love, but hey ;-)

Permalink . Ikke . 03:09:36 pm . 37 Words . Technology, Coding Corner . . 266 views . Leave a comment
Projecten en surfen

Mijn project is blijkbaar toch nog niet af. Ik dacht dat ik klaar was, alle scriptjes nog een laatste maal getest, wat esthetische veranderingen aangebracht en de boel doorgestuurd. Ik werk nog wat aan het verslag en bedenk dat het wel handig zou zijn mocht ik die figuur ter beschikking hebben. Zodus, ik laat mijn matlab-script nog eens lopen, doch komt daar ineens een totaal andere figuur uit. Ja, debuggen dan maar...

Het probleem met die scriptjes is dat die heel lang duren om uit te voeren tussen twee veranderingen door. En wat doe je ondertussen? Juist ja, wat rondsurfen. Heb op die manier een tof blogje gevonden, Yet Another Blog. Ergens op LVB.net stond een comment of trackback met een link ernaar, beetje beginnen lezen en best wel fijn :-) Blijkbaar eigendom van een Leuvense jongedame die wonder-boven-wonder ook jabbergebruiker is en een van de weinige vrouwen was die je tegen het lijf kon lopen op FOSDEM. Een zeldzaamheid dus :-) Doch, mocht je dit lezen, neem dan zeker hier eens een kijkje voor wat meer open source feminisme ;-) Een van mijn favoriete sites trouwens, die laatste.

Best wel leuk om zo eens een blogje te lezen van iemand die denkt dat geen kat haar pennetrekjes leest. Altijd fijn om eens te volgen hoe het er in iemands leven aan toe gaat, zeker als het over de bedgeheimen gaat... Er zit een stukje voyeur in elk van ons ;-)

Anyway, mocht je dit lezen, blijven gaan met die gele banaan B-)

Permalink . Peter . 04:54:58 . 250 Words . Studies, Internet & Blogs . Email . No views

05/23/05

Op naar een LUG in Oost-Vlaanderen

Op de nieuwsgroep be.comp.os.linux, of kortweg bcol, loopt al enkele dagen een thread over het oprichten van een Oost-Vlaamse Linux User Group. Er is ook een forum en een irc-kanaal #lugov op irc.freenode.net gestart.

Nadat de naam lugov.be geregistreerd was door een zeker bedrijf en men die naam niet wou vrijgeven, zijn we eindelijk zo ver gekomen om zelf een nieuwe naam voor te stellen zodat we met de oprichting van start kunnen gaan. Een van de meest gehoorde voorstellen is GNAL, wat staat voor "GNAL's Not A Lug" als subtiele verwijzing naar GNU ;-) Andere voorstellen zijn te vinden hier in de thread of op het forum. GNAL is niet echt mijn favoriete naam, maar er zijn nog andere namen in de running en er kunnen nog mogelijkheden toegevoegd worden. Kijk daarvoor even op bcol of op het forum.

We zijn nu nog op zoek naar een of meerdere lokalen waar we eens in de maand kunnen samenkomen. Een lopende denkpiste is contact op te nemen met enkele scholen in de buurt en een voorstel te doen waarbij de LUG zorgt voor ondersteuning in ruil voor de maandelijkse beschikbaarheid van een lokaal met internetaansluiting.

Zin om mee te helpen? Tips voor de locatie? Heb je een voorstel voor een betere naam? Voel je vrij om een post op bcol te gooien of hier een berichtje achter te laten. ;-)

Permalink . Peter . 14:44:49 . 234 Words . Free Software . Email . No views

05/22/05

C preprocessor magic

Did you ever run in this situation where you need to #define some string, and use it both as a function name and as a string? As you might have discovered it is not easily possible to do this.

I ran into this problem today, and found out you got to solve it using 2 extra macro's (thanks to this page):

#include <stdio.h>

#define xstr(s) str(s)
#define str(s) #s

#define FOO foobar

void FOO() {
        printf("In %s\n" xstr(FOO));
}

int main() {
        /* This won't work because FOO is no string */
        /* printf("FOO is \"%s\"\n", FOO); */
        printf("FOO is \"%s\"\n", xstr(FOO));
        FOO();
        return 0;
}

which gives the desired result:

FOO is "foobar"
In foobar

and inspecting the output of nm, the function is correctly called "foobar", not "FOO". Jay!

[edit] Once more I just got blown away by what glib offers you. G_STRINGIFY is defined by default when you include glib.h (in glib/gmacros.h more precisely).

Permalink . Ikke . 06:08:15 pm . 176 Words . Coding Corner . . 949 views . Leave a comment

Kleren politie-stripact in beslag genomen

HERENT- Bij de controle van een voertuig trof de politie van Herent zaterdag twee inzittenden aan die volledig gekleed waren in een politie-uniform. De nep-agenten wilden in een caf

Permalink . Peter . 14:45:32 . 106 Words . Life & Fun . Email . No views

05/21/05

GModuleLoader

After Philip was talking about his GQueueThread/ASyncWorker on #gnome-nl, I was tempted to write some Glib-extension too, and so I did.

You might remember the extra exercise in my article on GModules and vtables, about loading all modules in the current directory and use them. Well, I created a generic object to handle this, because it's a functionality needed quite frequently in plugin-based programs.

I called this "GModuleLoader" ;-)

Here's a sample client application, loading 2 modules:

#include <glib.h>
#include <gmodule.h>

#include "g-module-loader.h"
#include "g-module-loader-module.h"

gint main(gint argc, gchar *argv[]) {
        GModuleLoader *l = NULL;
        guint cnt = 0;
        GPtrArray *modules = NULL;

        g_type_init();

        /* Create a new GModuleLoader */
        l = (GModuleLoader *) g_module_loader_new();
        g_assert(l != NULL);

        /* Load all modules in ".libs", with "simple-test" as data.
         * We do not want any error reporting (yet) */
        g_module_loader_load(l, ".libs", "simple-test", NULL);

        g_print("\n\nLooping through all loaded modules, printing the data\n");
        /* Get the list of all modules */
        modules = g_module_loader_get_modules(l);
        if(modules == NULL) {
                g_object_unref(l);
                g_error("No modules in list, aborting");
                return 1;
        }
        
        /* Loop */
        for(cnt = 0; cnt < modules->len; cnt++) {
                GModuleLoaderModule *m = NULL;
                gchar *data = NULL;
                GModule *mod = NULL;

                /* Get the GModuleLoaderModule */
                m = (GModuleLoaderModule *) g_ptr_array_index(modules, cnt);
                /* Normally we don't ever need the real GModule,
                 * because we use a vtable with all tables we need as returned
                 * data from the init function */
                mod = g_module_loader_module_get_module(m);
                if(m == NULL) {
                        g_error("Module in a GModuleLoaderModule should never be null");
                        return 1;
                }
                /* This is the data returned by the module init function.
                 * Most times this will be a vtable/struct */
                data = g_module_loader_module_get_module_data(m);

                g_print("%s:\t%s\n", g_module_name(mod), data);
        }
        g_print("\n");
        
        /* Clean up */
        g_object_unref(l);
        
        return 0;
}

I hope this is understandable :-)

Here's the code for "module1.c", the source for libmodule1.so. "module2.c" is almost the same: s/M1/M2 and s/module1/module2:

#include <glib.h>
#include <gmodule.h>

/* This is a fixed name, the module init function
 * It takes a pointer (given by the client code)
 * and can return some data (most of the time a vtable/struct, we keep it 
 * simple here) */
G_MODULE_EXPORT gpointer module_get_data(gpointer data) {
        gchar *s = NULL;
        
        s = (gchar *) data;
        if(s != NULL) {
                g_print("\n[M1] Module1 loaded with data \"%s\"\n\n", s);
        }

        return g_strdup("[M1] module1data");
}

/* Same thing, fixed name.
 * This function takes a pointer to the data given by module_get_data
 * and is called when this data should be freed */
G_MODULE_EXPORT void module_free_data(gpointer data) {
        gchar *s = NULL;
        
        s = (gchar *) data;
        if(s != NULL) {
                g_print("\n[M1] Freeing module1 data \"%s\"\n\n", s);
                g_free(data);
        }

        return;
}

As you can see I'm using fixed names in the plugins, I don't think there's any other way to do this kind of things. None of these 2 functions are required though.

Here's the output of the test application:

# ./simple-test
** (process:24094): DEBUG: Loading all modules in .libs, suffix is so
** (process:24094): DEBUG: Suffix for .libs/libmodule1.so is so, loading module
** (process:24094): DEBUG: Loading data for .libs/libmodule1.so

[M1] Module1 loaded with data "simple-test"

** (process:24094): DEBUG: Module .libs/libmodule1.so is valid, adding
** (process:24094): DEBUG: Suffix for .libs/libmodule2.so is so, loading module
** (process:24094): DEBUG: Loading data for .libs/libmodule2.so

[M2] Module2 loaded with data "simple-test"

** (process:24094): DEBUG: Module .libs/libmodule2.so is valid, adding


Looping through all loaded modules, printing the data
.libs/libmodule1.so:    [M1] module1data
.libs/libmodule2.so:    [M2] module2data

** (process:24094): DEBUG: Deleting 2 modules
** (process:24094): DEBUG: Freeing data for .libs/libmodule1.so

[M1] Freeing module1 data "[M1] module1data"

** (process:24094): DEBUG: Closing module .libs/libmodule1.so
** (process:24094): DEBUG: Freeing data for .libs/libmodule2.so

[M2] Freeing module2 data "[M2] module2data"

** (process:24094): DEBUG: Closing module .libs/libmodule2.so

It should be fairly easy to follow all steps, find out the module_get_data and module_free_data calls, etc.

It's working fairly well now, I'll try to enhance it some more, test it better and document it, then maybe I'll send some email to the Glib list ;-)

Permalink . Ikke . 07:05:58 pm . 741 Words . Technology, Linux, Coding Corner . . 318 views . Leave a comment
Exams are coming, still some projectwork, todo-list

The exams are coming and I still have a lot of projectwork to do. Today, I should have had my last class this year, but the prof sent an e-mail announcing the lesson was cancelled. So, within one week, at the 30th of may, I'll have my first exam. Five to go, from may the 30th till july the first. Well spred in time, so it should be not that heavy, but it's a very long time where I'll see my girlfriend very less :-( I'll miss her :|

But a remaining problem is the amount of projectwork that still has to be done. Today, I finally finished my work for computer graphics. I still have to do some work for Information Theory (very boring statistics), Speech Processing (wich isn't that easy too) and Information Security (wich can be complete soon). So let's hope it doesn't take that much time. We'll see. I hope I can finish information theory and information security tomorrow.

I also have a kind of todo-list with things I want to do with my gentoo when I take a break, after one exam or just after the whole period:

  • Choose a new Gnome-theme
  • Check how I can make wpa_supplicant requesting a new IP when I move from one wlan to another one. Also following point should be taken into account.
  • Write some script for my VPN-tunneling: it should always be started except when I'm registered at the VTK-hotspot, but when I'm not at the students home or at a university hotspot, I only want to get traffic for news.ugent.be and smtp.ugent.be and maybe some internal UGent-websites go through the tunnel. Just a routing script thus.
  • I want to search for a system to detect when my VPN-connection is down. It should be easy if the tunneling device went down too, but that isn't. The only method I know for now, is sending pings to some server and inspect the packet loss. There has to be a better, quicker and less consuming method. I'm using vpnc, so if you know a sollution, you're very welcome to leave a message ;-)
  • Find out why my x-server crashes when I'm using my two synaptics-things at the same time. I have a touchpad and some little thing between the g and h button to move my cursor. When I'm using the two together, sometimes my X crashes.
  • I want to find out why my USB-mouse doesn't work when X is allready running while I attach the device. Now I always have to restart X. Must be some simple problem.
  • Now I have the weather-applet in my panel, giving me the current weather situation, but I also want a forecast.
  • I want to get the internal smart-card reader working. I have such a thing built into my computer (Dell D810) and want to experiment a little with the new Belgian electronic identity card aka eID. I also want to test some bank-functions like reloading my proton and so on. I just want to play with it :-)
  • Make software suspend and hibernate working. Ubuntu Linux configures this automaticly, see this installation report. That last one is also an interesting one for D810 users who want to install linux on their machine ;-) It seems more people are buying a D810 or D800 so the counter of installation reports increases.
  • Follow the Gentoo on Laptops Guide

I'm sure the above list is far from complete. Suggestions can always be made ;-)

a Belgian eID card
A Belgian eID card

Oh, before I forget. Yesterday, I registered the domain peterdedecker.net to create a personal homepage where I can give some information about myself, put my CV online, maybe move this blog to, place some documents about student representation, learn some webdesign,... Again, suggestions are very welcome. If it's a page about me, I'ld like to have this blog there. Not that I dislike this place, au contraire, but on a personal website, the minimum requirement today is a weblog. I don't know wich engine to use: I like b2evolution and its good spam-protection a lot, but as Ikke allready told, development is like stalled. It seems WordPress and Nucleus are very nice ones. It's also a little bit easier because I don't have to worry about multiple blogs hosting, but I sure want to convert this blog to the new engine (if so). If you have some experiences in moving blogs or using other engines, feel free to comment.

Goodnight!

Permalink . Peter . 01:46:29 . 744 Words . Life & Fun, My Gentoo, Studies, Internet & Blogs . Email . No views

Geplukt uit een interview met Yves Leterme in De Standaard:

Hebt u nooit een coalitiewissel overwogen, bijvoorbeeld door de VLD in te ruilen voor de groenen?

,,Ik zie niet in wat dat zou oplossen. Daarbij, Groen! is een partij met vakantie. Mieke Vogels heeft zelf gezegd dat dit een sabbatjaar is. Ik weet niet of er buiten de politiek veel mensen zijn die een sabbatjaar kunnen nemen en bijna 4.000 euro per maand opstrijken.''

Zulke uithalen zijn we van u niet gewoon.
,,Ik ben scherp omdat Jos Stassen, de fractieleider van Groen!, mij in het Vlaams parlement verweet dat ik mijn verantwoordelijkheid niet opneem. Tijdens mijn gesprek met de voorzitter, Vera Dua, bij de vorming van de Vlaamse regering, was het eerste en het laatste wat ze zei: 'Wij willen geen verantwoordelijkheid nemen.' Nu roepen ze dat Leterme zijn verantwoordelijkheid niet neemt. Dat gaat er bij mij niet in.''

Het volledige interview is hier te vinden. Mogelijks is registratie vereist.

Permalink . Peter . 00:24:38 . 159 Words . Politics . Email . No views

05/19/05

De techsite Anandtech deed op de E3-beurs in Los Angeles een toch wel h

Permalink . Peter . 17:48:14 . 60 Words . Life & Fun . Email . No views

Op straat spreekt een zwerver je aan. 'Ik ben van de Postbank', zegt hij beleefd. 'Onze computer is gecrasht, en ik kom controleren of uw pincode nog wel klopt. Kunt u hem even aan mij vertellen?'

Dom voorbeeld? Op internet vallen mensen massaal voor exact hetzelfde trucje. Zes procent van de ontvangers van zogenaamde phishing-mails klikt ten minste op de link in het bericht, zo blijkt uit cijfers van VeriSign. Daarna zijn zij nog maar

Permalink . Peter . 17:43:25 . 222 Words . Internet & Blogs . Email . No views
GModules and vtables

After the article I posted yesterday on GModules, I just wrote some sample code using a vtable to look up functions, which makes module handling much easier.

I guess we better go straight to the code:

First we need to define some structure that represents our vtable. I did this in a common header file, vtable-common.h:

#ifndef _VTABLE_COMMON_H
#define _VTABLE_COMMON_H

#include <glib.h>

typedef void (* voidvoidfunc) (void);
typedef gint (* intvoidfunc) (void);
typedef void (* voidstringfunc) (gchar *s);
typedef gboolean (* boolpstringfunc) (gchar **ps);
/* This function will demonstrate NULL function pointers */
typedef void (* foofunc) (void);

typedef struct VtableTest {
        voidvoidfunc funcone;
        intvoidfunc functwo;
        voidstringfunc functhree;
        boolpstringfunc funcfour;
        foofunc funcfive;
} VtableTest;

/* Module init function */
typedef VtableTest * (* VtableTestInit) (void);

#endif

First we define typedefs for all function prototypes we want in our vtable, then we define the prototype of a module init function.

This may look a bit strange, let's take a look at the module code (in vtable-module.c) to see what we can do with this:

#include <glib.h>
#include <gmodule.h>

#include "vtable-common.h"

/* Our vtable function implementations */
static void one() {
        g_print("[M] Function 1\n");
}

static gint two() {
        g_print("[M] Function 2\n");
        return 2;
}

static void three(gchar *s) {
        g_print("[M] Function 3: %s\n", s);
}

static gboolean four(gchar **s) {
        g_print("[M] Function 4\n");
        *s = g_strdup("four");
        return TRUE;
}

/* Our function table.
 * As you can see, we put functions in there as if they're normal variables */
static VtableTest table = {
        one,
        two,
        three,
        four,
        /* This module does not implement funcfive */
        NULL
};

/* This is the module init function.
 * It's a "VtableTestInit" function, as defined in vtable-common.h */
G_MODULE_EXPORT VtableTest * vtable_module_init() {
        g_debug("[M] Initializing module");
        /* Of course you can do a lot in this function,
         * we don't need to do anything in this sample */
        /* Return a reference to the function table */
        return &table;
}

The comments in the code should explain every step pretty well.
As you can see we only export one function, vtable_module_init. This function got a fixed name (so we should define this name in our API). It returns a pointer to a vtable of type VtableTest, which includes pointers to all function implementations.

Last but not least is the main code, in vtable-main.c:

#include <glib.h>
#include <gmodule.h>

#include "vtable-common.h"

gint main(gint argc, gchar *argv[]) {
        /* Same handles as yesterday */
        GModule *module = NULL;
        VtableTest *moduletable = NULL;
        gchar *modulepath = NULL, *dir = NULL;
        VtableTestInit moduleinitfunc = NULL;
        /* Function value */
        gint two = 0;
        gboolean fourb = FALSE;
        gchar *fours = NULL;
        
        /* Same stuff as yesterday */
        if(g_module_supported() == FALSE)
                g_error("No module support");

        dir = g_get_current_dir();
        modulepath = g_module_build_path((const gchar *) dir, "vtabletestmodule");
        g_debug("Module path: %s", modulepath);
        module = g_module_open(modulepath, G_MODULE_BIND_LAZY);
        g_free(dir);
        g_free(modulepath);
        if(module == NULL)
                g_error("Unable to load module");

        /* We need to lookup one function, which inits our vtable */
        if(g_module_symbol(module, "vtable_module_init", (gpointer *) &moduleinitfunc) == FALSE) {
                g_error("Unable to get reference to the module init function: %s", g_module_error());
        }

        /* Get a reference to the module function table */
        moduletable = moduleinitfunc();

        /* Run all our functions, providing parameters or fetching return
         * values where necessary */
        if(moduletable->funcone != NULL) {
                g_debug("Running module funcone");
                moduletable->funcone();
        }
        else {
                g_warning("Funcone is NULL");
        }

        if(moduletable->functwo != NULL) {
                g_debug("Running module functwo");
                two = moduletable->functwo();
                g_debug("functwo returned %d", two);
        }
        else {
                g_warning("Functwo is NULL");
        }

        if(moduletable->functhree != NULL) {
                g_debug("Running module functhree");
                moduletable->functhree("vtable-module-test");
        }
        else {
                g_warning("Functhree is NULL");
        }

        if(moduletable->funcfour != NULL) {
                g_debug("Running module funcfour");
                fourb = moduletable->funcfour(&fours);
                g_debug("funcfour returned \"%s\", string value is \"%s\"", fourb == TRUE? "true" : "false", fours);
        }
        else {
                g_warning("Funcfour is NULL");
        }

        if(moduletable->funcfive != NULL) {
                g_debug("Running module funcfive");
                moduletable->funcfive();
        }
        else {
                g_warning("Funcfive is NULL");
        }

        /* As yesterday, close the module */
        if(g_module_close(module) == FALSE) {
                g_error("Unable to close module: %s", g_module_error());
        }

        return 0;
}

These are the steps we take:

  • Load the module (see the previous article for more information on this)
  • Look up one symbol, "vtable_init_module". As mentioned before, this is the fixed name symbol that should be exported from our module.
  • run "vtable_module_init", so we get a reference to the module's vtable
  • Now we can use all functions refered to in the vtable. Make sure you always check for NULL pointers, or your application will crash. Even if your API/documentation states a module author must implement all vtable functions, checks don't hurt :-) Notice we call the functions using moduletable->foofunc(), so the vtable members are really normal function pointers, nothing fancy here.
  • We clean up by closing the module

You can compile everything with this simple Makefile (yes I know it's a bad one):

default: main libvtabletestmodule.so
all: default

main: vtable-main.c vtable-common.h
	gcc -o main -g `pkg-config --cflags --libs glib-2.0 gmodule-2.0` vtable-main.c

libvtabletestmodule.so: vtable-module.c vtable-common.h
	gcc -o libvtabletestmodule.so -g -shared `pkg-config --cflags --libs glib-2.0 gmodule-2.0` vtable-module.c

or execute the commands by hand, of course.

Here's the output:

** (process:16338): DEBUG: Module path: /home/foo/bar/vtable/libvtabletestmodule.so
** (process:16338): DEBUG: [M] Initializing module
** (process:16338): DEBUG: Running module funcone
[M] Function 1
** (process:16338): DEBUG: Running module functwo
[M] Function 2
** (process:16338): DEBUG: functwo returned 2
** (process:16338): DEBUG: Running module functhree
[M] Function 3: vtable-module-test
** (process:16338): DEBUG: Running module funcfour
[M] Function 4
** (process:16338): DEBUG: funcfour returned "true", string value is "four"

** (process:16338): WARNING **: Funcfive is NULL

As you can see, all this is quite logical and easy to write once you figure out how to. The provided functionality can be very useful though.
Notice thanks to glib, the code presented here should compile and run under Linux, Solaris and all other supported platforms (yes, even on Windows using DLL's) without any code change.

A little exercise for the reader: currently we got the module name "vtabletestmodule" hardcoded in vtable-main.c. What to do if we have several VtableTest implementations, e.g. vtabletestmodule1 and vtabletestmodule2? We could loop through all files in ".", find out whether they're a valid module (ie try to load them), if they're a valid module, try to figure out whether it exports "vtable_module_init", if that's the case, get a reference to the module's vtable, and use it. This is eg the way Gaim loads all it's plugins (although the module files aren't stored in "." of course). It's not too difficult to implement this, but the result is quite impressive too, so give it a try :-)

Permalink . Ikke . 01:41:02 pm . 1116 Words . Technology, Linux, Coding Corner . . 388 views . Leave a comment

05/18/05

GModules are fun

Glib's GModules are fun :-) These functions provide a braindead interface to modular (think "plug-in based") programming. I wrote some testing code today (read the API a year ago or so but never played with it), here's a short introduction.

When writing module based applications there are mainly 2 parts: the modules, and the application using them. So we'll have to write these 2 things.

Getting started with the module is the easiest part:

#include <glib.h>
#include <gmodule.h>

G_MODULE_EXPORT void m_helloworld() {
        g_print("Hello modular world!\n");
}

This code is pretty straight-forward. The only "strange" thing is G_MODULE_EXPORT, a platform-independent macro telling the compiler/linker to export the function.

Then comes the "client" application, a little more difficult. Comments inline:

#include <glib.h>
#include <gmodule.h>

/* A prototype of the function pointer we'll use */
/* void function(void) */
typedef void (*HelloWorldFunc) (void);

gint main(gint argc, gchar *argv[]) {
        /* We need:
         * - A handle to our module
         * - A pointer to the function we'll import
         * - Some helper strings */
        GModule *module = NULL;
        HelloWorldFunc hello = NULL;
        gchar *module_path = NULL, *curr = NULL;

        /* Check whether glib is compiled with module support */
        if(g_module_supported() == FALSE) {
                g_error("Modules not supported :(");
                return 1;
        }
        
        /* We need to figure out the path to our module. In our test case, this
         * is ".", so we want the current dir. */
        curr = g_get_current_dir();
        /* Create the path to the module. This function does quite a lot of
         * of things, check the GModule API. */
        module_path = g_module_build_path((const gchar *) curr, "module");
        /* Don't we love debugging? */
        g_debug("Module path: %s", module_path);

        /* Finally we're able to open the module. We want lazy symbol resolving.
         * This means we only want a symbol to be resolved if we request it.
         * Once more, see the API for more information. */
        module = g_module_open(module_path, G_MODULE_BIND_LAZY);

        /* Get rid of those helper strings */
        g_free(module_path);
        g_free(curr);

        /* Check whether the module was loaded successfully */
        if(module == NULL) {
                g_error("Unable to load module");
                return 1;
        }

        /* Load the symbol and assign it to our function pointer. 
         * Check for errors */
        if(g_module_symbol(module, "m_helloworld", (gpointer *) &hello) == FALSE) {
                g_error("Unable to get function reference: %s", g_module_error());
                return 1;
        }

        /* Now we can call our funtion.
         * As you can see, we can call it as if it's a normal function.
         * Don't we love function pointers? */
        hello();

        /* We're nice citizens and close all references when we leave */
        if(g_module_close(module) == FALSE) {
                g_error("Unable to close module: %s", g_module_error());
                return 1;
        }

        return 0;
}

(this looks like a lot of code (well...) but if you strip all comments and debugging stuff/checks, you'll only have 10 lines or so)

Should be quite easy to understand too.

Now it's compile time. Of course, in a real-world situation, we'd use autotools to compile our libraries, we'd have a libtoolized library etc etc etc. Here we'll do it in the quick-and-dirty way:

# gcc -o libmodule.so -shared `pkg-config --libs --cflags glib-2.0 gmodule-2.0` module.c
# gcc -o main `pkg-config --libs --cflags glib-2.0 gmodule-2.0` main.c
# ls
libmodule.so  main  main.c  module.c
# ./main
** (process:26533): DEBUG: Module path: /home/foo/bar/libmodule.so
Hello modular world!

Loading all these symbols by hand is a boring task, so most of the time you'll create some API using vtables to make your life easier. More on this later (got to study now ;-) :|)

Permalink . Ikke . 04:02:11 pm . 600 Words . Technology, Linux, Desktop, Coding Corner . . 989 views . 3 comments
Portage on Windows

Maybe one day we'll be able to get lots of *nix software running under Windows using Gentoo's Portage. Read this.

Permalink . Ikke . 01:34:49 pm . 37 Words . Life . . 272 views . 7 comments
cannot map sys bios

Yesterday, I placed gnome and all dependencies in my packages.keywords (with the ~x86 keyword of course) so I could install gnome 2.10. Worked fine, but when I booted a few hours later, my X-server couldn't start. Normally there should be no correlation between these two facts, but it's the only thing that changed between a working and a non-workig X. This is the error I recieve:
(EE) RADEON(0): Cannot map SYS BIOS

Ikke was here yesterday night, but he couldn't fix it too. He tried with vesa, some modules and xorg.conf from a working ubuntu liveCD, but all without any effect. We also recompiled xorg, but this also wasn't the solution.

If you know any, please let me know! If I find it, I'll sure post the solution here.

You can find a more detailed error log here and my xorg.conf file here. Yesterday I worked graphical till 18 hours (I don't know when I restarted my X then), but it didn't work after I booted up at 0.30 am this morning. The packages I emerged yesterday can be found in my genlop log.

Permalink . Peter . 09:19:55 . 184 Words . My Gentoo . Email . No views

05/17/05

Sysstats.sh

I wrote a little Bash script this morning, which gives a quick overview of your system.
As mentioned in the help text, this can be very usefull for server administrators, eg allowing you to let an overview be sent to your mailbox every 24h using a cronjob.

This is a sample of the current output:

================================================================
* System statistics for:        foo.baar.be
* Generated on:                 Tue May 17 15:00:49 CEST 2005
* Running as:                   root

=================== Uptime =====================================
* Uptime:                       4 days, 04:37:29
* High score:                   151 days, 19:15:18
* Load average:                 0.32 0.24 0.22

=================== Users ======================================
* Active users:                 2
* User information
        USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
        someone pts/0     12:15    2.00s  0.62s  0.05s sshd: ntrangez [priv]
        someone pts/1     13:30    5:19   1.17s  0.05s sshd: ntrangez [priv]

=================== Tasks ======================================
* Number of running tasks:      62
* Running programs:
agetty          events/0        kjournald       lockd           portmap         sh
aio/0           fcron           kseriod         mysqld          ps              sshd
apache2         init            ksoftirqd/0     mysqld_safe     rpc.mountd      su
bash            kblockd/0       kswapd0         nfsd            rpc.statd       syslog-ng
boa             khelper         kthread         pdflush         rpciod/0        uptimed

* CPU load:                     2%
* Process state:
        Running:                1
        Sleeping:               60
        Zombie:                 0
        Stopped:                0

=================== Networking ================================
* Routing table:
        Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
        192.168.2.0     wifi.vtk.ugent. 255.255.255.0   UG    0      0        0 eth0
        192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
        loopback        webvtk.vtk.ugen 255.0.0.0       UG    0      0        0 lo
        default         fire.vtk.ugent. 0.0.0.0         UG    0      0        0 eth0

=================== Hard Disc =================================
* Disk Information:
        Filesystem            Size  Used Avail Use% Mounted on
        /dev/hdc4             4.5G  3.2G  1.1G  75% /
        /dev/hdc5              14G   11G  2.4G  82% /var/www

* Mounts:
        /dev/hdc4 on / type ext3 (rw,noatime)
        none on /proc type proc (rw)
        none on /sys type sysfs (rw)
        none on /dev type ramfs (rw)
        none on /dev/pts type devpts (rw)
        /dev/hdc5 on /var/www type ext3 (rw,noexec,nosuid,nodev,noatime,acl)
        none on /dev/shm type tmpfs (rw)
        nfsd on /proc/fs/nfs type nfsd (rw)

=================== MD5Sum Check ==============================
* Checking MD5 Sums
        /etc/passwd:                            [OK]
        /etc/shadow:                            [OK]
        /etc/group:                             [OK]

===============================================================
* Brought to you by Ikke - http://www.eikke.com

A TODO is included in the script source.

I made the script available here (enscript version here). If you use it, please let me know something :-) Or even better, if you add more support, please send me a patch so everyone can make use of it :-)

It has no special dependencies, next to Bash and some standard utilities like wc, bc, tail, md5sum, awk and grep.
The "record uptime" is only displayed if you got uprecords (/usr/bin/uprecords) installed.
Make sure you check the md5sum part, can be very usefull :-)

Permalink . Ikke . 02:23:23 pm . 412 Words . Technology, Networks, Coding Corner . . 716 views . 6 comments

05/16/05

Anjuta 2

A 2.x alpha release of Anjuta, the GTK/Gnome-oriented IDE, has been released.
I must admit the screenshots and features look nice: integrated debugger (GDB based), glade3 support, GObject class building wizard, member completion,...

Maybe time to give it another test drive. Although I doubt it can beat gVim :-) What do you think, Realnitro?

Permalink . Ikke . 06:19:09 pm . 89 Words . Technology, Linux, Desktop, Coding Corner . . 278 views . 4 comments

05/15/05

ContactFS working


(Thumbnail is link to original image)

Needs no comment I guess :-)

Still some problems left:

  • Files with spaces in the filename (ie almost every file in this case) don't work :-( This shouldn't be too hard to solve though (edit: fixed)
  • Read-only
  • No VCard as output. This can be easily solved though (edit: fixed)
  • The init func creating a Node tree from your contacts is blocking, which is bad
  • The Icon issue. Looks like vcards can contain picture information, so I could just write a vcard-thumbnailer and add it to Nautilus.

Now guess what the problem was... Not my code, but the fact I use autotools to compile the thing. Autotools seems to add some fancy compiler flags which made the module crashy as hell, just using "gcc -Wall $(pkg-config --cflags --libs gnome-vfs-module-2.0 libebook-1.2) -shared -fPIC ContactFS.c -o libContactFS.so" worked fine. Guess I'll have to tweak my Makefile.am somehow. (edit: this wasn't autotools fault, but (of course) mine. I added some flags to Makefile.am I got from an official GnomeVFS module's Makefile.am, looks like those weren't nice)

Huge thanks to "gicmo" for all the help.

Oh, and XNest rocks :-)

[update]

Permalink . Ikke . 06:22:12 pm . 194 Words . Technology, Linux, Desktop, Coding Corner . . 391 views . 2 comments
Networking troubles

Never buy D-Link, it sucks ;-) Configuring is hell and when you backup the configuration and want to restore it after a firmware upgrade, it won't work. Stupid thing. And now suddenly, linux clients can't connect to the wireless D-Link AP. Big trouble, spent few hours to find out. When I tried to connect, the init-script tells me it's connected to the AP, but can't recieve an IP from DHCP. Now I fixed the whole bitch and upgraded security from WEP to WPA.

First of all: despite of the positive comment of Rohan, ifplugd didn't work for me on the wired interface. When I plugged in the network cable, the deamon did nothing. When I manually brought up the interface, ifplugd took it down. Stopping ifplugd and bringing up the interface again worked of course. Rohan, did you have good experiences with ifplugd? Maybe my configuration of ifup/ifdown is wrong, but I don't think so. If you have some ideas, please leave a comment.

As I previously told, I gave wpa_supplicant a try today. There's no much online documentation available for it, but everything is explained very well in the example configuration file. Seems that piece of software has very much capabilities! I configured the AP to use WPA-PSK and modified my wpa_supplicant.conf to that. This is the configuration:
network={
ssid="my_essid"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk="my very secure password"
priority=2
}

Don't forget, if you have an Intel Pro WLAN card (IPW 2100 or 2200) to uncomment the line ARGS_eth1="-Dipw" in your /etc/conf.d/wpa_supplicant file or modify it to the driver you use. I also commented everything out in /etc/conf.d/wireless. Don't forget this step, because /etc/init.d/net.eth1 (or your other interface) and /etc/init.d/wpa_supplicant would fight :-) After stopping all network stuff and starting wpa_supplicant, it seemed wpa_supplicant found the wlan but didn't request an IP. After a dhcpcd, everything worked just fine. Of course, first I had to find out some things, like I had to use the group-option and so on, before it worked. Now I just have to find a way to make wpa_supplicant or some other script requesting an IP when I bring up the device or when I start the service.

Conclusion: wpa_supplicant seems to be a very nice piece of software. I think its functionality or the use of it should be integrated in the gnome network configuration tool to make linux more user friendly for mobile users. I don't know why it isn't now. It's not fine for starting users to read the whole sample configuration and all that technical stuff: they just want to fill in some WEP-key or WPA-password (or eventually a username/password or so on).

Permalink . Peter . 16:58:12 . 475 Words . My Gentoo . Email . No views
ContactFS progress

Screenshot shows some progress I made with ContactFS. If I "browse" to contact:/, I get 2 "directories", Personal and Test, which are my 2 Evolution address books. I can "cd" into "Test", "ls" all "files" (contacts) in there, and if I try to "cat" one of them, I get some information on that contact (just plaintext for now, this should become a FOAF or VCard formatted string).

In GnomeVFS' test-shell application the module works fine, but if I try to open contact: in Nautilus, it crashes. Maybe I should send an email to Alex to beg for a little help here ;-)
I'll also need his help on how to set file thumbnails once it works in Nautilus (the actual file is just plain text, but I'd like to have the contact's picture as icon in Nautilus, or if no picture is set, /usr/share/pixmaps/nobody.png).

Moving "files" between "directories" would be nice too, but I don't know whether EDS allows writing, need to figure that out.

Permalink . Ikke . 02:06:56 pm . 166 Words . Technology, Linux, Desktop, Coding Corner . . 255 views . Leave a comment

05/13/05

Gevonden in De Standaard:

God roept Vladimir Poetin, George Bush en Guy Verhofstadt bij zich. Het is tijd voor de Apocalyps. De drie zijn uitverkoren om de mensheid in te lichten. Terug op aarde brengt Poetin de Doema dubbel slecht nieuws: god bestaat en de wereld vergaat. Bush beschouwt voor het Congres de goddelijke existentie als een opsteker. Alleen jammer van die Apocalyps. Verhofstadt ten slotte roept de media bijeen voor tweevoudig heuglijk nieuws: ,,Ik mocht bij God op visite. En ik blijf eerste minister, tot het einde der tijden.''

Illustreert jammergenoeg verbazend goed hoe hij over de BHV-saga dacht, met de uiterst pijlijke en beschamende afloop tot gevolg.

Permalink . Peter . 22:59:01 . 109 Words . Life & Fun, Politics . Email . No views
ContactFS

I got the insane (well, not really ;-)) idea today to write a GnomeVFS module that allows you to browse your Evolution EDS contacts using any GnomeVFS-capable application, like Nautilus, as a Proof Of Concept. This is the first GnomeVFS module I write.

Started working on it, and I got a basic module working. It does not get any information from EDS yet, only contains one "file" named JohnDoe, can be very instable,... but well ;-)

Here's a little screenshot:

Currently the "contact files" only have "test" as content, this should become a VCard string, or maybe a FOAF document.

Other things to do:

  • assign a proper MIME type, so I can take advantage of Evo's "Picture" contact-property (so you see the picture as "icon" of the "file", if this is possible at all).
  • assign a proper handler to the "open" action (e.g. open a Mailto: window)
  • Fetch real information from Evo, of course
  • Make it stable (the current tree contains dead pointers, I need to learn using GNode's) and thread-safe
  • ...

Maybe this won't be really usefull, but someone suggested to have some VFS module for Soylent too, so I'm gaining some experience here :-)

Permalink . Ikke . 09:21:53 pm . 208 Words . Technology, Desktop, Coding Corner . . 240 views . Leave a comment
Regarding Microsoft

Although I'm hardly using any Microsoft software anymore, I still admit they got some great things, like their .Net framework and the corresponding IDE, VS.Net (don't hate me now).
This could be some great proof of concept/research technology too.

On the other hand: what did they smoke?

Permalink . Ikke . 08:37:40 am . 67 Words . Technology . . 260 views . 5 comments

05/12/05

FeedMerge mostly done

JAY!!!! :-D

As I blogged before I've been working on a PlanetPlanet implementation in C. I got a basic RSS2 parser working before, but that code was plain ugly.

Now I refactored all code using GObjects (learnt a lot whilst doing this), and it works :-D
Currently it can parse RSS2 feeds (as many as your memory allows you to ;-)) and combine them into one RSS2 feed. Adding more feed types should be fairly easy.

This is a sample result, and here you can see a FeedValidator validation result. Never mind the encoding issue, that's related to the server settings of the machine I'm hosted on (and I'm no administrator :-().

This is the code I used to generate the feed:

#include <glib.h>
#include <libxml/tree.h>

#include "src/feedmerge-feed.h"
#include "src/feedmerge-merge.h"

gint main(gint argc, gchar *argv[]) {
        FeedMergeFeed *feed1 = NULL, *feed2 = NULL;
        GSList *feeds = NULL;
        xmlDoc *doc = NULL;

        g_type_init();

        feed1 = (FeedMergeFeed *) feedmerge_feed_new();
        feed2 = (FeedMergeFeed *) feedmerge_feed_new();

        feedmerge_feed_fetch_feed(feed1, "http://blog.eikke.com/xmlsrv/rss2.php?blog=1");
        feedmerge_feed_fetch_feed(feed2, "http://blog.eikke.com/xmlsrv/rss2.php?blog=7");

        feedmerge_feed_parse_document(feed1);
        feedmerge_feed_parse_document(feed2);

        /* feedmerge_feed_dump(feed2); */
        feeds = g_slist_append(feeds, feed1);
        feeds = g_slist_append(feeds, feed2);

        /* output type, GSList containing the feeds, feed title, URI and description */
        doc = feedmerge_merge_merge(FEEDMERGE_FEED_TYPE_RSS_200, feeds,
            "Test feed", "http://blog.eikke.com/ikke", "This is a test merged feed");

        g_assert(doc != NULL);

        /* output to stdout */
        xmlSaveFormatFileEnc("-", doc, "UTF-8", 1);

        xmlFreeDoc(doc);

        g_object_unref(feed1);
        g_object_unref(feed2);
        g_slist_free(feeds);
}

Using gob2 again to write my objects, it's just a pleasure to play with :-) Strong type checking is automagically added etc, just great. I'm eager to see some GObject introspection samples.

Of course what I got now can be further abstracted to something like this:

xmlDoc *doc = feedmerge_vamerge("http://a.b/feed1.xml", "file:///tmp/feed2.xml",
    "scp://somehost:/test.xml", "Title", "http://www.eikke.com", "This is a nifty combined feed");

i.e. using varargs.

Thanks to GnomeVFS I don't have to care where the feed comes from, which is just great.

I had to handle some nasty and stupid bugs while coding this (in my own code, of course) and propably I leak memory at several places too, but well... ;-) We got valgrind :-) And thanks to the GCC people for blessing us with the "-Werror" flag, I love that feature.
I won't publish the code yet, but maybe it'll get into Soylent (who knows?) so then it'll be in some CVS/SVN/whatever repository.

Regarding Soylent: we're looking for a new name. Please help us out, I can't wait to start doing some real work.

That's it for now.

Permalink . Ikke . 10:20:37 pm . 524 Words . Technology, Linux, Desktop, Coding Corner . . 292 views . Leave a comment

05/09/05

Delay between jabber.belnet.be and amessage, back in full force

Seems there's some delay when sending messages from a jabber.belnet.be JID to someone at one of the amessage-servers (or in the other direction but not in both). Very annoying. I emailed a belnet-admin, who replied with the message they know about it and are looking for a solution together with the amessage and jabber.org admins. Let's hope they fix it soon. After a previous problem with the server2server connections of amessage, there seems to be some work to do on it.

My gentoo is kind of complete now B-) Today, I connected the harddisk of my previous computer to my laptop with a IDE-to-USB2.0 connector cable I borrowed from our faculty-admin Jeroen. Very fast :-) Now I have everything to work back in full force. Maybe just some little tweaking on gnome or gentoo will be necessary. So I should search how I can make my system detect if there's a cable connected at boot time of if there's a registered WAP in the environment to connect to. This may not take a very long time, so I don't think in terms of dhcp-timeouts. If you use windows and plug out your networkcable, there pops up a message your cable is detached, all without dhcp- or ping delays. If you know a good solution, please be my guest.

My girlfriends final year thesis is finaly complete. She wrote the last things today. Tomorrow she has an appointment with her mentor for some final touches.

Permalink . Peter . 22:57:30 . 247 Words . Life & Fun, My Gentoo, Jabber . Email . No views

05/07/05

Why didn't I hear about this any earlier, and why isn't it integrated into Gaim?

Oh, for Soylent, I started working on blog feed reading. Currently I got some code that can read an XML feed from any GnomeVFS source, and create a libxml2 xmlDoc out of it. Although maybe I should use SAX to merge different feeds...
Using an XSLT sheet to merge feeds would be really cool and clean, but I think it's the hardest way too ;-)
I tried to document the code well again, it's available here. Can be a nice introduction to GnomeVFS coding :-) (this was my first code using it too ;-))

TODO: add a check to see whether what we pull in is an RSS feed, before loading the whole document, to save bandwidth and memory.

Permalink . Ikke . 07:08:46 pm . 185 Words . Technology, Linux, Desktop, Coding Corner . . 567 views . 43 comments

05/06/05

I started looking into evolution-data-server today, to look what we could use in Project Soylent (actually, I shouldn't blog on it because we don't want any noise on it yet :-)). The result is some code that can dump all your address books, or only dump some of the contacts using a filter string.

Because libebook is very poor documented (unfortunately, even the API docs aren't complete) I tried to document the code as good as possible. Please review it, let me know when some things are not well documented, or I just make dumb mistakes in the code :-D
The last version I made is here.

Compile it using
gcc -o evo-addressbooks-test2 `pkg-config --cflags --libs libbonobo-2.0 libebook-1.2` evo-addressbooks-test2.c
Dump your address books using
./evo-addressbook-test2
or use a filter string as first argument. Beware: you should Bash-escape the argument!!!
A sample of this:
./evo-addressbooks-test2 "(contains \"full_name\" \"John Doe\")"
will list some properties of the entry which has "John Doe" as it's full name.

I hope I'll be able to hack on this some more, and also hope we'll get a good view of what Soylent should become soon :-)
It'll be a great oportunity to learn some more aspects of Gnome coding, like GTK/Glade, Bonobo (|-|) and others.

Permalink . Ikke . 11:11:56 pm . 252 Words . Linux, Desktop, Coding Corner . . 282 views . 1 comment
New blog engine and Soylent

As I mentioned before, I'd like to start using another blogging engine as soon as possible. Plog looked nice, but after giving it a test drive I got into some little annoying problems.
Now the b2evolution guys seem to prepare a maintainance version, so development hasn't completely stalled.

Currently, the blogs (mine and the others I host) run fine I think, and migrating would be quite a lot of work (existing users and posts, not to mention changes of URI's towards aggregators), so I guess I'll wait some longer, unless someone knows a very good engine I could start using, actively maintained.
The main "issue" I got is the fact I host multiple blogs. Most engines don't support this...

Project Soylent is getting started, jay :-) Just read something on using Evolution's libebook API and FOAF, this will be some fun project to work on B-)

Oh, and please everyone vote for davyvandenbremt.be on may1reboot.com.

Permalink . Ikke . 04:06:11 pm . 193 Words . Technology, Desktop . . 533 views . 4 comments
Process sendmail spool by postfix

This week, we had big troubles on our mailserver at VTK. The big ugly devil was sendmail. He stopped delivering mails to local users. After trying to fix it, wich didn't make it work, Lennert and Ikke installed postfix on the machine. Everything is working now, but there's one big issue: sendmail still had 240 messages in /var/spool/mqueue, wich he had to deliver but never did. Now, I want postfix to deliver these. I already did some research, but all I found was "put the files in /var/spool/mqueue.in" wich is a Q for postfix on some configurations. We don't have such a configuration. We have /var/spool/postfix/incoming (and so on) with lots of folders (1,2,3...,A,B,...) in it with the same kind of subfolders in. I don't know where to put those files in now.

If someone nows how to make postfix handle these messages, or how to make sendmail just send these messages to some smtp-server (but not handle the incoming ones), please let me know. Thanks.

Permalink . Peter . 12:02:57 . 174 Words . VTK . Email . No views
More errors

While emerging media-video/ffmpeg-0.4.9_p20050226-r3, needed for Amarok wich is highly promoted by Ikke, I recieved following errors:
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -O2 -march=pentium-m -mtune=pentium- m -pipe -fomit-frame-pointer -ftracer -mfpmath=sse,387 -msse2 -mmmx -fPIC -DHAVE _AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/idct_mmx.o i386/idct_mmx.c
i386/dsputil_mmx.c: In function `dsputil_init_mmx':
i386/dsputil_mmx.c:3076: warning: assignment from incompatible pointer type
i386/dsputil_mmx.c:3077: warning: assignment from incompatible pointer type
i386/dsputil_mmx_avg.h: In function `put_pixels4_l2_3dnow':
i386/dsputil_mmx_avg.h:58: error: can't find a register in class `BREG' while re loading `asm'
i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -O2 -march=pentium-m -mtune=pentium- m -pipe -fomit-frame-pointer -ftracer -mfpmath=sse,387 -msse2 -mmmx -fPIC -DHAVE _AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o i386/motion_est_mmx.o i386/motion_est_mmx.c
i386/dsputil_mmx.c: At top level:
i386/dsputil_mmx_rnd.h:59: warning: 'put_no_rnd_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_no_rnd_pixels16_l2_mmx' defined but no t used
i386/dsputil_mmx_rnd.h:300: warning: 'avg_no_rnd_pixels4_mmx' defined but not us ed
i386/dsputil_mmx_rnd.h:59: warning: 'put_pixels8_l2_mmx' defined but not used
i386/dsputil_mmx_rnd.h:155: warning: 'put_pixels16_l2_mmx' defined but not used
make[1]: *** [i386/dsputil_mmx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/ffmpeg-0.4.9_p20050226-r3/work/ffmp eg-0.4.9-p20050226-shared/libavcodec'
make: *** [lib] Error 2

Very less information...

Let's find out!

There are also some more troubles with my machine: I have very regularly X-crashes. In the output, I see much errors of Synaptics who're not fatal, but sometimes, one is fatal. I'll post more information here soon.

I added my make.conf file to this post. You can find it here.

Permalink . Peter . 11:53:09 . 336 Words . My Gentoo . Email . No views
Will be continued

Yesterday, Havoc Pennington announced that the Fedora Stateless project will be continued. So, there'll be a RedHat team working on it, as he previously told. This is very good news because now the maintainability of our project is assured.

Permalink . Peter . 11:45:41 . 39 Words . General . Email . No views

05/05/05

Problems fixed

Ikke has done some great work fixing my installation. As we tried different things, including genkernel, it didn't work. Now he has configured the kernel manually, did some research on it, and now it works. My system boots! I don't know what the problem was, it sure had something to deal with my SATA. Ikke, if you remember the solution, please post it here as Christophe was interested in running Linux on his system.

Now everything seems to work fine, except the error I recieve when compiling gnome-extra/evolution-webcal-2.0.1:
checking for gtk+-2.0 >= 2.4 libgnomeui-2.0 libecal-1.0 >= 0.0.91 libsoup-2.2 >= 2.1.8... Package libecal-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libecal-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libecal-1.0' found

configure: error: Library requirements (gtk+-2.0 >= 2.4 libgnomeui-2.0 libecal-1.0 >= 0.0.91 libsoup-2.2 >= 2.1.8) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

The package libecal doesn't exist, so I'll take a look at it in gentoo bugs and forums. If you know the solution, please let me know.

Permalink . Peter . 14:57:21 . 182 Words . My Gentoo . Email . No views

05/04/05


Do what others do

Maybe I should just use this as my hackergotchi, I'd scare people by using a "real" one ;-)
(PNG version now :-))

Permalink . Ikke . 08:35:12 am . 52 Words . Life . . 283 views . 4 comments
System doesn't boot

Installing the Gentoo Base System

Humm, so not everything in my previous post did work as good as I told you. First of all, emerge, ctrl+c, modify cflags,... did not work the first time. When I stopped the proces and added gcc in my packages.keywords, the bootstrap proces wanted to continu installing gcc-3.3.5, even while "emerge -pv gcc" told me gcc-3.4 should be installed. Ikke came for help and looked into the bootstrap-script, deleted a process-file so the whole bootstrap process restarted instead of recovering. Everything went fine then.

So, if you want to install gentoo with gcc-3.4, make sure gcc is in your package.keywords file before you run the bootstrap-script.

Progression from Stage2 to Stage3 went fine.

Configuring the Kernel

This part is fatal for now. When Ikke and I manually configured the kernel, he won't boot. In the liveCD-environment, my hard disk is /dev/sda, but when we put that in grub.conf, it doesn't work. My / partition isn't found while booting. When we use genkernel, the system tells me he found the Toshiba controller, but booting the kernel (genkernel or the other one) keeps resulting in a kernel panic pointing me at the fact /dev/sda2 or /dev/hda2 doesn't exist. Seems there are some problems with the combination of IDE and SATA support. Disabling IDE support in the kernel didn't help. Searching google and forums.gentoo.org also didn't result in a solution. Ikke can't accept he can't install gentoo on my machine, so this night he'll look up everything he can find about my type of machine and running linux on it. Let's hope he finds some solution. If you know anything to help me further, please be my guest.

Permalink . Peter . 02:12:17 . 297 Words . My Gentoo . Email . No views

05/03/05

Stateless Linux -> Debian

Please read this message and following. Seems someone created an sf.net-project to develop Stateless Linux under Debian.

Now, the reactions on that post are just flamewars at Debian, but it really seems to be a nice project to follow up. If you're interested in contributing and development, go ahead ;-)

Permalink . Peter . 16:38:13 . 68 Words . General . Email . No views
Bootstrapping the system

So yesterday, I configured my network. Because I had to go to a little birthday party, I couldn't work further on it.

Preparing the disks

I have a 80GB harddisk, so this is my partition sheme:
/dev/sda1 64MB /boot
/dev/sda2 512MB /
/dev/sda3 the rest -> LVM

So I made one LVM-cluster and made these logical partitions in it: /var /tmp /home swap /usr and /opt, each one 1GB big (swap is 512MB). All filesystems are XFS, /boot is ext3.

Installing the Gentoo Installation Files

I've chosen to download the latest stage1-tarball and portage-snapshot from the (Belnet-mirror. CHOST and CFLAGS were a bit difficult. Because of gcc3.3 doesn't recognize "march=pentium-m", wich my processor is, I had to bootstrap with "pentium4" until gcc. After gcc3.4 was installed (wich is in my package.keywords, ~x86), I could adapt the new pentium-m setting. Normally, I should use "-O3" for faster operation, but Ikke told me that's useless because the filesize makes it run slower so there's no netto-effect.

Installing the Gentoo Base System

My profile is the default one, I'll post my use-flags later, when my installation is complete and I can just copy-past ;-) I didn't touch locales, it also isn't in my use-flags, so now I'm bootstrapping and taking a nap :-D

Permalink . Peter . 10:29:36 . 213 Words . My Gentoo . Email . No views

05/02/05

Karel, why oh why did you this? People seem not to understand I'm not intending to run MSN7 as my default Messenger at all, just trying to solve some little annoyance? Do they actually read what I wrote?

Just tried amsn-cvs. It crashed when I tried to start a normal conversation with someone, then worked fine. I did not try videochat support yet though, none of my contacts owning a webcam came online untill now.

Permalink . Ikke . 05:45:23 pm . 100 Words . Technology, Linux, Networks, Desktop . . 313 views . 3 comments
Dell arrived -> prepared network for stage1 installation

My new Dell notebook is finally arrived. So now, I am installing Gentoo Linux from stage1.

Booting the minimal liveCD went fine. Even the art in this LiveCD is very nice! I booted "gentoo -nodhcp" while dhcp should only take time because I have no wired connection and the wlan needs encryption. After booting, my wireless card didn't work. In dmesg I found the messages "ipw-2.2-boot.fw load failed: Reason: -2", "Unable to load firmware: 0xFFFFFFFE" and some other messages indicating that starting my wlan card failed. After an "rmmod ipw2200" and "modprobe ipw2200", there were no errors in dmesg so I could start using iwconfig to prepare my wireless connection.

I live at a student home from Ghent University so I need VPN to access the internet. Fortunately, my girlfriend has some windows-pc standing here and doing nothing, so I configured VPN on that machine and shared the internet connection, so I can start a stage1 install.

I'll post all my experiences here, as asked by Christoph.

Permalink . Peter . 17:13:32 . 168 Words . My Gentoo . Email . No views

05/01/05

MSN7 under Linux


(thumbnail is link to full size screenshot)

I want MSN Video Chat (receipt) working. Under Linux. As soon as possible. So I tried getting MSN Messenger working under Wine.

As you can see, it works. But only a little. This is the bloated version 7 of the official client, and Wine seems to be unable to handle it properly. It's using non-standard windows (actually, it are clipped standard windows) etc. I did not try the webcam feature either.

Has anyone got an installer for MSN Messenger 6.x for Windows 98/Me? I'd like to try that one too, but only "beta" version 7 is available on the official website. A commercial software vendor only offering beta versions of it's software to the users... :roll:

Maybe I should just run a stripped Windows session under that great version 5 of VMWare Workstation as RubenV just suggested, and take the easy way ;-) Or try aMsn which should get videochat support soon (it's already in CVS I heard, Scapor?), but I hate that Tcl/Tk interface :-(

Permalink . Ikke . 10:55:44 pm . 199 Words . Technology, Linux, Networks, Desktop . . 931 views . 14 comments
jabber.belnet.be seems to work

As I mentoined some time ago, there were problems with the server-to-server connection between jabber.belnet.be and amessage.be. This week, I added Ward to my roster. Ward is at the Belnet-server and everything went fine, so I thought the problems are finally fixed. The message on jabber.belnet.be is also removed from the site. So now, I think I'll move my whole roster to jabber.belnet.be instead of amessage.be.

Permalink . Peter . 15:01:37 . 74 Words . Jabber . Email . No views
Trefdag Jong N-VA

Bij deze mijn eerste nederlandstalige post op deze blog. Aangezien het om materie gaat op lokaal vlak en mijn kennis over politieke termen in het Engels niet al te best is, lijkt het mij opportuun om een geen Engels te gebruiken.

Ik begin meer en meer gebeten te worden door politiek. Mijn post deze week, over mijn bezoek met de Oost-Vlaamse N-VA jongeren aan het Vlaams Parlement, was al een begin, doch vandaag is het verdergegaan met mijn deelname aan de trefdag van Ronduit N-VA, tot voor kort de naam van de N-VA jongeren.

Het logo van Ronduit N-VA!
Het (oude) logo van Ronduit N-VA!

Het was een uiterst boeiende dag, beginnende met het gesprek met Brigitte Grouwels (CD&V), staatssecretaris in de regering van het Brussels Hoofdstedelijk Gewest. Het was een uiterst boeiend gesprek, over de sociale uitdagingen van Brussel met de grote mix aan culturen, en de typische institutionele problemen met de 19 afzonderlijke gemeenten in het gewest. Ik was aangenaam verrast met haar boodschap dat het Nederlands een veel belangrijker rol begint in te nemen in onze hoofdstad. Onze Vlaamse hoofdstad en haar inwoners zijn in de loop der jaren immers danig verfranst, dat je bijzonder weinig kans hebt op straat iemand in het Nederlands te kunnen aanspreken aldaar. Vooral door de sterke politiek in Vlaanderen, met zaken zoals de zorgverzekering bijvoorbeeld, begint men te beseffen dat men het Nederlands best niet links laat liggen. Zowieso mag je je kansen op een job in Brussel of Vlaanderen volledig vergeten als je het Nederlands (evt naast het Frans) niet machtig bent. Dat heeft ouders, ook van franstalige gezinnen, ertoe aangezet hun kinderen in te schrijven in de scholen van de Vlaamse Gemeenschap, alwaar het onderwijs van hoge kwaliteit is en de kinderen meteen ondergedompeld worden in het Nederlands. Uiteraard stelt dit ook grote problemen, tekort aan plaatsen, en is het bijzonder moeilijk les te geven aan een groep waarvan 75% het Nederlands niet als moedertaal heeft. Men heeft de boodschap blijkbaar ook begrepen bij de franstalige gemeenschap, alwaar men in Brussel (en de Vlaamse rand) scholen opricht volgens het principe van onderdompelonderwijs: bepaalde lessen worden er in het Nederlands gegeven, zodat de kinderen er als tweetaligen afzwaaien. Dit kan hen in hun latere loopbaan alleen maar ten goede komen!

Wat zo mogelijks nog boeiender was, was het daaropvolgende debat tussen Mark Demesmaeker (N-VA) en Christian Van Eycken (UF). Christian is eigenlijk van oorsprong een Vlaming, met een Vlaamse naam, doch in de loop der tijden is de familie verfranst. Hij is de enige franstalige verkozen op de kartellijst UF (PS + MR + CDh) in het Vlaams Parlement. Op zich getuigt het al van veel moed om zich zo letterlijk in het hol van de leeuw te wagen en zelfs te vragen om met Mark in debat te gaan, iets waar ik bijzonder veel respect voor heb. Beide sprekers bleven het hele debat vrij rustig, zonder persoonlijke aanvallen ed. Het was een uiterst boeiend en geanimeerd debat. Op bepaalde vlakken kwamen beide standpunten zelfs goed overeen, zoals rond de actie S.O.S. MUG bijvoorbeeld, doch op andere vlakken stonden beiden zoals verwacht lijnrecht tegenover elkaar, zoals in het dossier Brussel-Halle-Vilvoorde. Op dit laatste punt kon Christian zich niet echt verdedigen, wat natuurlijk te verwacht voor deze terechte Vlaamse eis. Zijn argumentatie kwam eigenlijk neer op het feit dat hij de situatie in BHV als het laatste stukje federalisme ziet en dat wil bewaren, terwijl dit lijnrecht indruist tegen de territoriale integriteit van Vlaanderen zoals vastgelegd samen met de taalgrens.

banner sosmug
Teken de petitie en lees de meldingen aub.

Naast de debatten en gesprekken was er ook nog een laatste deeltje voorzien. Aangezien de naam "Ronduit" niet altijd de lading dekt en deze naam ook constant verklaard moet worden bij persmededelingen ed, heeft men ervoor gekozen om een nieuwe naam te gebruiken, namelijk Jong N-VA. Heel eenvoudig dus. Het nieuwe logo mag er trouwens ook wezen. Van zodra het ergens online zet, zal ik deze post aanpassen en het hieronder plaatsen.

Wat me echter enorm aangegrepen heeft tijdens het slot, was de speech van Mark. Tot voor kort kende ik zo goed als niets van hem, en had hij voor mij nog wat te veel rondom zich van bij zijn vorige job bij VTM, een zender die voor mij van een bijzonder laag niveau is. Mark heeft me echter verrast: zijn dossiers zien er zeer degelijk uit, maar tijdens zijn speech heeft hij verteld over zijn politieke bezigheden tijdens zijn jeugd, bij de VUJO, de VolksUnie Jongeren, de voorloper van Jong N-VA. Zijn gedrevenheid in die zaken, de manier waarop hij met heimwee naar die tijd terugkeek en zijn oproep om met Jong N-VA die wind opnieuw aan te wakkeren, hebben hem enorm in mijn achting doen stijgen. Ik kreeg de kriebels om er zelf ook in te vliegen en mee te bouwen aan een goede jongerenwerking. Tot nu toe heb ik dergelijke vragen steeds afgewezen wegens tijdsgebrek door mijn bezigheden in VTK en de studentenvertegenwoordiging, doch indien mijn agenda het volgend jaar zou toelaten, zal ik zeker hier en daar een steentje proberen bijdragen. Mijn schatje zal 't niet graag horen, maar de politieke kriebel laat zich alsmaar harder voelen. Nu ja, we zullen wel zien wat ervan komt. Voor volgend jaar liggen mijn prioriteiten alvast op mijn thesis, de GSR (ik ga mijn kans wagen om ondervoorzitter te worden) en mijn vriendin die zich wat te veel verwaarloosd voelt de laatste tijd. Nu ja, ze voelt zich eigenlijk altijd verwaarloosd vanaf ik weg ben ;-)

Geen 200 jaar Belgi			</div>
         <div class= Permalink . Peter . 03:09:39 . 919 Words . Politics, N-VA . Email . No views