This is the archive for August 2005. Recent posts can be found at the main blog page.
Tuesday, August 30, 2005 ★ 23:56 ★ Category Gnome ★ Permanent url
Most people using jhbuild to run the latest bleeding edge GNOME development versions simply skip the D-Bus and HAL stuff because they won’t work by default.
Having exec jhbuild run gnome-session in ~/.xinitrc is usually enough to run a jhbuilt GNOME. The problem with D-Bus and HAL is that these daemons also come with your distribution and are likely to be already running when the GDM greeter shows up. My solution is to put the following lines in my ~/.xinitrc:
sudo /etc/init.d/dbus-1 stop jhbuild run sudo /opt/gnome/bin/dbus-daemon --system jhbuild run sudo /opt/gnome/sbin/hald --daemon=yes --retain-privileges jhbuild run dbus-launch gnome-session sudo /etc/init.d/dbus-1 start
I’m running Debian GNU/Linux but the changes for other distributions should be trivial. Don’t forget to point to the correct paths either!
Because you need to shutdown system daemons, you will need root privileges which I obtain through sudo. Note that you need to configure sudo so that it won’t ask for a password. Run visudo as root and enter (don’t forget to change your username and the paths):
uws ALL=NOPASSWD: /opt/gnome/sbin/hald, /opt/gnome/bin/dbus-daemon, /etc/init.d/dbus-1
That’s all! Now you can happily insert a blank cd into your cd-writer and enjoy the popup asking you what to do, thanks to gnome-volume-manager. Oh, and don’t forget to file bugs if you find them!
Update: If you’re on a Debian system you should ./configure hal to use the correct user. Add these lines to your ~/.jhbuildrc:
module_autogenargs['hal'] = '--with-hal-user=hal --with-hal-group=hal'
Update 2: Symlink $prefix/var/run/dbus to your system-wide dbus directory to prevent some errors:
cd /opt/gnome/var/run rmdir dbus ln -s /var/run/dbus
Update 3: Starting with the dbus 0.6 packages in Debian, /etc/init.d/dbus-1 is called /etc/init.d/dbus. Change the ~/.xinitrc script above and remove the -1 parts if you want this setup to work with newer dbus versions.
Tuesday, August 30, 2005 ★ 00:46 ★ Category Music ★ Permanent url
Last weekend I visited the yearly Uitmarkt cultural open air festival in Amsterdam.

Jazzanova playing some jazzy dj stuff.

Orkest van het oosten, covering some well-known Queen songs.
It was fun, although I liked the music at Lowlands a lot more.
Saturday, August 27, 2005 ★ 13:06 ★ Category Gnome ★ Permanent url
The GNOME 2.12 splash screen contest has started! Lots of really ugly submissions has been done so far, but there’s also a couple of really cool ones. Check it out for yourself.

This is the splashscreen I use since 2.8 (author unknown)
Monday, August 22, 2005 ★ 00:37 ★ Category Music ★ Permanent url
This will hurt my girlfriend: I’m falling in love with Heather Nova. Or maybe I’m just enchanted by the voice of this siren…
Update: The enchantment is broken.
Saturday, August 20, 2005 ★ 19:05 ★ Category Music ★ Permanent url
At the moment I’m at Lowlands enjoying a variété of cool music. Best shows ‘til now are The Polyphonic Spree (the sun wants to shine, hallelujah! the music is not religious however) and Zita Swoon.
Kris, Berend and Tijmen (amongst others in our group) are really enjoying the weekend.
Wednesday, August 17, 2005 ★ 11:07 ★ Categories Programming, Linux ★ Permanent url
I’m a die-hard Vim user. I use my beloved editor for all my text tasks, including:
Over the past few years, I’ve developed a rather extensive Vim setup with a lot of (mostly file-type specific) settings, abbreviations and keyboard mappings. Having your editor configured conveniently helps you concentrate on what you’re doing instead of how to do it.
If you want me to post more tips, please let me know.
Put these examples in your ~/.vimrc if you want to use them.
" adds different types of quotes around the current word nnoremap ,` mxbi`<Esc>ea`<Esc>`xl nnoremap ,' mxbi'<Esc>ea'<Esc>`xl nnoremap ," mxbi"<Esc>ea"<Esc>`xl
To delete eveything between (but not including) parentheses, hit di(. To delete a paragraph, hit dap. The following mappings make this feature work for quoted strings too, so that ci" lets you replace a quoted string with a new one.
" Quote motions for operators: da" will delete a quoted string. omap i" :normal vT"ot"<CR> omap a" :normal vF"of"<CR> omap i' :normal vT'ot'<CR> omap a' :normal vF'of'<CR> omap i` :normal vT`ot`<CR> omap a` :normal vF`of`<CR>
Put this in ~/.vim/ftplugin/mail.vim and make sure you have filetype on and filetype plugin on in your ~/.vimrc.
" delete empty quotes lines map <buffer> ,> mx:g/^\\(>\\s*\\)\\+\\s*$/d<CR>`x
Monday, August 15, 2005 ★ 18:32 ★ Category Programming ★ Permanent url
A spectacular break-through in computer science! The famous hello world program in just two bytes:
$ cd /tmp $ mkdir hello $ cd hello $ echo -n "ls" > 'Hello, world!' $ chmod +x 'Hello, world!'
Now execute this wonderful piece of programming:
$ ./'Hello, world!' Hello, world!
Wednesday, August 10, 2005 ★ 17:29 ★ Category Programming ★ Permanent url
If you’re a web developer using XHTML, you have to make sure your pages are valid XHTML (that implies well-formed XML). This is easy to do using the command-line utility xmllint:
$ xmllint --valid --noout somefile.html
This works fine for all static content. However, if you use server-side scripts to create dynamic pages, you won’t have any real files for xmllint to check. Once again, xmllint to the rescue:
$ xmllint --valid --noout http://example.com/dynamic/page
This one works fine if you want to check just one page. Since xmllint is just an XML validator and not a web crawler, it doesn’t interpret HTML and is not able to follow links and recursively retrieve pages.
That’s where wget comes in. This nifty command-line download utility has a -r flag to recursively grab a site off the net. Be careful what you’re doing, because wget can quickly generate a lot of network traffic and can dramatically increase your server load. Oh, I don’t think I need to tell you that you shouldn’t try this on other people’s websites.
To automate the task of recursively retrieving pages from a server and having xmlllint check those pages for validaty, I wrote a small script. This script will grab all pages from a website and runs xmllint on the retrieved data. All errors will be displayed on your screen.
The script, named check-valid-xhtml, should be called with the top URL you want to check as its first and only parameter. So, if you specify http://example.com/subdir/ it will only check for url’s in and below that subdirectory.
#!/bin/sh DUMPDIR=$(mktemp -d) echo "Using $DUMPDIR to store files" cd $DUMPDIR echo "Downloading files..." wget -r -np -nH -nv -E --header="Accept: text/xml,application/xml,application/xhtml+xml,text/html" $1 echo "All files downloaded" echo "Checking files..." find . -type f -name '*.html' -print0 |xargs -0 -r -n1 xmllint --valid --noout echo "All files checked." read -n1 -p "Clean up? (y/n) " CLEAN_UP echo if [ $CLEAN_UP == "y" ] ; then echo -n "Cleaning up $DUMPDIR... " rm -r $DUMPDIR echo "done" else echo "$DUMPDIR not cleaned." fi
Happy fixing! I didn’t need to, because all sites I tried this script on produced perfectly valid XHTML. Yay for me!
Monday, August 8, 2005 ★ 23:11 ★ Category Programming ★ Permanent url
As a semi-professional web hacker I’ve developed my own set of libraries to be used to create web sites and web applications. Part of this code is written in my spare time, part of it is written while getting paid by my boss. After a quick discussion we’ve decided to license the set of libraries under the LGPL, which means they can be used by anyone willing to respect the license.
Most of you will now probably think ‘oh no not yet another web framework’. Well, my code is not a framework, it’s a set of libraries. As we all know, web frameworks suck and I fully agree on that. Some of you may wonder what exactly the difference is between frameworks and libraries. Well, frameworks force you into a way of coding which you may not find comfortable, whereas libraries grant you total freedom for your own code, while offering an API to use the library functions. So, with libraries you can write your software the way you want, be it hackish or completely clean. Of course, we all prefer the clean way…
My toolkit is named Anewt, which stands voor Almost No Effort Web Toolkit. I’m busy getting the code into a releasable state (minor code cleanup, some extra testing, patching away all TODO and FIXME comments) so there’s nothing to play with yet. Until that time you’ll have to do with two code snippets that demonstrate the power and ease of use Anewt has to offer.
Example 1. My main blog page
<?php
// This file includes anewt code, connects to the database,
// sets up some defaults or does other things you need.
require_once ‘default.inc.php’;
// my blog classes
require_once ‘uwstopia/blog.lib.php’;
$p = new UwstopiaPage($db); // This page implements my design
$p->set(‘title’, ‘Blog’);
// show posts
$posts = Blog::recent_posts(
null, // all categories
null, // default number of posts
$db); // a database object instance
foreach ($posts as $b) {
$p->append_to(‘body’, $b->to_xhtml());
}
$p->flush();
?>
Example 2. Validating database layer
<?php
$prepared_query = $db->prepare('
SELECT
`name`,
`description`
FROM
`article`
WHERE
`id` = ?int?
');
$result_set = $prepared_query->execute(5);
$row = $result_set->fetch();
print_r($row);
?>
The database layer API is really simple. You have to specify the type of each variable you want to use in the query and it won’t run if you pass the wrong type. No more SQL injection problems, no more addslashes() and strip_slashes() horror, yay for clean database use!
Want to see Anewt in action? You are already looking at a site running Anewt! uwstopia.nl is 100% written using Anewt.
I won’t give you any other deployments because I don’t know if my company’s customers would appreciate it. All I can say is that Anewt runs smoothly in at least 5 production environments.
Friday, August 5, 2005 ★ 22:58 ★ Category Gnome ★ Permanent url
GNOME is… ehm… well… kind of cool in the Netherlands, but it’s not cool enough! So we at GNOME Nederlands decided it’s time for action. 10×10 is a noble goal, but things of course don’t move by itself. GNOME needs promotion!
The GNOME-NL project was originally started to serve as a community for Dutch and Belgian translators. As we all know, GNU Gettext enables internationalization (i18n) of all GNOME components, so that the desktop can be used in the user’s native language.
Now that most of GNOME is available in Dutch and GNOME steadily gains momentum, GNOME-NL decided it was time to expand their activities to marketing and promotion. This includes attending seminars and conferences, giving speeches and, of course, kroegmeetings (wasting time in the pub).
About 6 months ago I made my entrance to the #gnome-nl IRC channel, which serves as an online meeting place for the translator team and for other Dutch-speaking GNOME enthusiasts. Right now #gnome-nl hosts 20—30 people, both from the Netherlands and Belgium.
I’m a GNOME user since GNOME 2.2; before that time my hardware was too slow to run anything but fluxbox… but it was only for the last couple of months that I really got myself a little bit involved in the project. That includes filing and discussing bugs, contributing small (read: trivial) patches and doing some translations.
When some people suggested the active GNOME-NL community members should get themselves business cards, I stepped forward and designed the first versions of the GNOME-NL business cards, which, after a few minor alterations, are now in use. In my opinion the cards are really cool and I’m really looking forward to having these myself.
Last week some GNOME-NL people got together in Utrecht and after a couple of beers I was asked by some fellow community members to redesign the GNOME-NL website. Right now it looks rather dull and is mostly used by translators to check the translation status for the various branches. It really needs a major overhaul to become a friendly welcome for curious Dutch-speaking people.
Since I was in a good mood and since I’m a pretty ‘okayish’ webhacker, I said yes to the loudly cheering GNOME-NL crowd. So, expect a new website anytime soon (or not so soon, depending on how much time I need to spend to keep up with my university activities).
Tuesday, August 2, 2005 ★ 10:46 ★ Categories Photography, Travelling ★ Permanent url
Finally sorted out the photos I made in Prague. Three photos are shown below; the rest is available from the album. Enjoy!
See my other photos in the Prague photo album. Comments are welcome!
Random photo from Prague (July, 2005)
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.