<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>(...)</title>
    <link>http://www.stderr.nl/</link>
    <description>"In het verleden behaalde resultaten bieden geen garanties voor de toekomst"</description>
    <language>en</language>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>blosxom/2.1.2+dev</generator>

  <item>
    <title>New website for &quot;Matthijs Kooijman IT&quot;</title>
    <pubDate>Thu, 23 Feb 2012 15:27:00 +0100</pubDate>
    <link>http://www.stderr.nl/2012/02/23#MKIT</link>
    <category>/Blog/Personal</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Personal/MKIT</guid>
    <description>&lt;p&gt;&lt;a href=&quot;http://www.mkit.nl&quot;&gt;&lt;img src=&quot;/static//images/Personal/MKIT%20Website.png&quot; alt=&quot;Matthijs Kooijman IT&quot; style=&quot;float: right&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since 2010, I&apos;ve been working as a Freelancer (&lt;a href=&quot;http://nl.wikipedia.org/wiki/Zelfstandige_zonder_personeel&quot;&gt;ZZP&apos;er&lt;/a&gt;). Of course I
registered a domain name right away, but until now, I didn&apos;t get around
to actually putting a website on there (just as single page with boring
markup and some contact information).&lt;/p&gt;

&lt;p&gt;Last week, I created an actual website. It&apos;s still not spectacular, but
at least it has some actual content and a few pages etc. So, with a
modest amount of pride, I present: &lt;a href=&quot;http://www.mkit.nl&quot;&gt;the website of Matthijs Kooijman
IT&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For anyone wondering: I didn&apos;t put up some bloated CMS, running on a
database, but I store my content in a handful of text files (using
Markdown markup) and using &lt;a href=&quot;http://bitbucket.org/obensonne/poole&quot;&gt;poole&lt;/a&gt; to translate those to (static)
HTML files. I keep the files in git and set up a git post-update hook to
generate the HTML to make things extra convenient.&lt;/em&gt;&lt;/p&gt;
</description>
  </item>
  <item>
    <title>dconf-editor is the new gconf-editor</title>
    <pubDate>Wed, 11 Jan 2012 12:17:00 +0100</pubDate>
    <link>http://www.stderr.nl/2012/01/11#Gnome3-gconf-editor</link>
    <category>/Blog/Software/Gnome</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Gnome/Gnome3-gconf-editor</guid>
    <description>&lt;p&gt;&lt;img src=&quot;/static//images/Software/Gnome/GnomeSmall.png&quot; alt=&quot;Gnome&quot; style=&quot;float: left&quot; title=&quot;Gnome logo. Image licensed under GNU GPL2.1+, taken from http://en.wikipedia.org/wiki/File:Gnomelogo.svg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A I &lt;a href=&quot;http://www.stderr.nl/Blog/Software/Gnome/Gnome3-Gdm3-Background.rss&quot;&gt;previously mentioned&lt;/a&gt;, &lt;a href=&quot;http://www.gnome.org/gnome-3/&quot;&gt;Gnome3&lt;/a&gt; is migrating away from the
&lt;a href=&quot;http://en.wikipedia.org/wiki/GConf&quot;&gt;gconf&lt;/a&gt; settings storage to the to &lt;a href=&quot;http://live.gnome.org/GnomeGoals/GSettingsMigration&quot;&gt;GSettings&lt;/a&gt; settings API (along
with the default &lt;a href=&quot;http://live.gnome.org/dconf&quot;&gt;dconf&lt;/a&gt; settings storage backend).&lt;/p&gt;

&lt;p&gt;So where you previously used the &lt;code&gt;gconf-editor&lt;/code&gt; program to browse and
edit &lt;a href=&quot;http://www.gnome.org/&quot;&gt;Gnome&lt;/a&gt; settings, you can now use &lt;code&gt;dconf-editor&lt;/code&gt; to browse and
edit settings.&lt;/p&gt;

&lt;p&gt;I do wonder if the name actually implies that &lt;code&gt;dconf-editor&lt;/code&gt; is editing
the dconf storage directly, instead of using the fancy new GSettings
API? :-S&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Changing the gdm3 (login screen) background in Gnome3</title>
    <pubDate>Wed, 04 Jan 2012 16:31:00 +0100</pubDate>
    <link>http://www.stderr.nl/2012/01/04#Gnome3-Gdm3-Background</link>
    <category>/Blog/Software/Gnome</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Gnome/Gnome3-Gdm3-Background</guid>
    <description>&lt;p&gt;&lt;img src=&quot;/static//images/Software/Gnome/Gnome.png&quot; alt=&quot;Gnome&quot; style=&quot;float: right&quot; title=&quot;Gnome logo. Image licensed under GNU GPL2.1+, taken from http://en.wikipedia.org/wiki/File:Gnomelogo.svg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I upgraded to &lt;a href=&quot;http://www.gnome.org/gnome-3/&quot;&gt;Gnome3&lt;/a&gt; this week, and after half a day of debugging I got
my (quite non-standard) setup working completely again. One of the
things that got broken was my custom wallpaper on the gdm3 login screen.
This used to be configured in &lt;code&gt;/etc/gdm3/greeter.gconf.defaults&lt;/code&gt;, but
apparently Gnome3 replaced gconf by this new &quot;gsettings&quot; thingy.&lt;/p&gt;

&lt;p&gt;Anyway, to change the desktop background in gdm, add the following lines
to &lt;code&gt;/etc/gdm3/greeter.gsettings&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[org.gnome.desktop.background]
picture-uri=&apos;file:///etc/gdm3/thinkpad.jpg&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For reference, &lt;a href=&quot;http://www.webupd8.org/2011/07/change-gnome-3-login-screen-gdm3.html&quot;&gt;I also found some other method&lt;/a&gt;, which looks a lot
more complicated. I suspect it also doesn&apos;t work in Debian, which runs
gdm as root, not as a separate &quot;&lt;code&gt;gdm&lt;/code&gt;&quot; user. Systems that do use such a
user might need the more complicated method, I guess (which probably
ends up storing the settings somewhere in the homedir of the &lt;code&gt;gdm&lt;/code&gt;
user...).&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Thinkpad X201 mute button breaking speaker output</title>
    <pubDate>Fri, 25 Nov 2011 00:13:00 +0100</pubDate>
    <link>http://www.stderr.nl/2011/11/25#WeirdMuteButtonBehaviour</link>
    <category>/Blog/Hardware/Thinkpad</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Hardware/Thinkpad/WeirdMuteButtonBehaviour</guid>
    <description>&lt;p&gt;&lt;img src=&quot;/static//images/Hardware/X201/Thinkpad.png&quot; alt=&quot;Thinkpad&quot; style=&quot;float: right&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Recently, I was having some problems with the internal speakers on my
&lt;a href=&quot;http://www.thinkwiki.org/wiki/Category:X201&quot;&gt;Lenovo Thinkpad X201&lt;/a&gt;. Three times now, the internal speakers just
stopped producing sound. The headphone jack worked, it&apos;s just the
speakers which were silent. Nothing helped: fiddling with volume
controls, reloading alsa modules, rebooting my laptop, nothing fixed the
sound...&lt;/p&gt;

&lt;p&gt;When trying to see if the speakers weren&apos;t physically broken, I
discovered that booting into Windows actually fixed the problem and
restored the sound from the speakers. It&apos;s of course a bit of a defeat
to accept Windows a fix for my problem, but I was busy with other
things, so it sufficed for a while.&lt;/p&gt;

&lt;p&gt;When migrating my laptop to my new &lt;a href=&quot;http://www.intel.com/content/www/us/en/solid-state-drives/solid-state-drives-320-series.html&quot;&gt;Intel SSD&lt;/a&gt;, I broke my Windows
installation, so when the problem occured again, I had no choice but to
actualy investigate it.&lt;/p&gt;

&lt;p&gt;I&apos;ll skip right to the conclusion here: I had broken my sound by
pressing the mute button on my keyboard... Now, before you think I&apos;m
stupid, I had of course checked my volume controls and the device really
was unmuted! But it turns out the mute button in Thinkpads combined with
Linux is a bit weird...&lt;/p&gt;

&lt;p&gt;This is how you would expect a mute button to be implemented: You press
the mute button, it sends a keypress to the operating system, which then
tells the audio driver to mute.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/static//images/Hardware/X201/X201%20Mute.png&quot; alt=&quot;X201 volume buttons&quot; style=&quot;float: left&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is how it works on my Thinkpad: You press the mute button, causing
the EC (embedded controller) in the thinkpad to directly mute the
speakers. This is not visible from the normal volume
controls in the software, since it happens on a very low level (though
&lt;a href=&quot;http://ibm-acpi.sourceforge.net/README&quot;&gt;the &lt;code&gt;thinkpad_acpi&lt;/code&gt; kernel module&lt;/a&gt; can be used to expose this special
mute state through a &lt;code&gt;/proc&lt;/code&gt; interface and special audio device).&lt;/p&gt;

&lt;p&gt;In addition to muting the speakers, it also sends a &lt;code&gt;MUTE&lt;/code&gt; acpi keypress
to the operating system. This keypress then causes the audio driver to
mute the audio stream (actually, it&apos;s &lt;a href=&quot;http://www.pulseaudio.org/&quot;&gt;pulseaudio&lt;/a&gt; that does that).&lt;/p&gt;

&lt;p&gt;Now, here&apos;s the fun part: If you now unmute the audio stream through the
software volume controls, everything looks like it should work, but the
hardware is still muted! It never occured to me to press the mute button
again, since the volume wasn&apos;t muted (or at least didn&apos;t look like
it).&lt;/p&gt;

&lt;p&gt;I originally thought that the mute button handling was even more
complex, when I &lt;a href=&quot;http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/platform/x86/thinkpad_acpi.c;hb=v3.1#l2483&quot;&gt;found some register polling code&lt;/a&gt; that faked
keypresses, but it seems that&apos;s only for older Thinkpads (phew!).&lt;/p&gt;

&lt;p&gt;In any case, the bottom line is: If you have a Thinkpad whose speakers
suddely stop working, try pressing the mute button!&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Debian Squeeze on an emulated MIPS machine</title>
    <pubDate>Fri, 05 Aug 2011 11:25:00 +0200</pubDate>
    <link>http://www.stderr.nl/2011/08/05#SqueezeOnMips</link>
    <category>/Blog/Software/Debian</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Debian/SqueezeOnMips</guid>
    <description>&lt;p&gt;In my work as a &lt;a href=&quot;http://www.debian.org&quot;&gt;Debian&lt;/a&gt; &lt;a href=&quot;http://qa.debian.org/developer.php?login=matthijs%40stdin.nl&amp;amp;comaint=yes&quot;&gt;Maintainer for the OpenTTD and related
packages&lt;/a&gt;, I occasionally come across platform-specific problems.
That is, compiling and running &lt;a href=&quot;http://www.openttd.org&quot;&gt;OpenTTD&lt;/a&gt; works fine on my own x86 and
amd64 systems, but when I my packages to Debian, it turns out there is
some problem that only occurs on more obscure platforms like MIPS, S390
or GNU Hurd.&lt;/p&gt;

&lt;p&gt;This morning, I saw that my new &lt;a href=&quot;http://packages.qa.debian.org/g/grfcodec.html&quot;&gt;grfcodec&lt;/a&gt; package is not working on
a bunch of architectures (it seems all of the failing architectures are
big endian). To find out what&apos;s wrong, I&apos;ll need to have a machine
running one of those architectures so I can debug.&lt;/p&gt;

&lt;p&gt;In the past, I&apos;ve requested access to Debian&apos;s &quot;porter&quot; machines, which
are intended for these kinds of things. But that&apos;s always a hassle,
which requires other people&apos;s time to set up, so I&apos;m using &lt;a href=&quot;http://qemu.org/&quot;&gt;QEMU&lt;/a&gt; to set
up a virtual machine running the MIPS architecture now.&lt;/p&gt;

&lt;p&gt;What follows is essentially an update for &lt;a href=&quot;http://www.aurel32.net/info/debian_mips_qemu.php&quot;&gt;this excellent tutorial about
running Debian Etch on QEMU/MIPS(EL)&lt;/a&gt; by &lt;a href=&quot;http://www.aurel32.net/&quot;&gt;Aurélien Jarno&lt;/a&gt; I found. It&apos;s
probably best to read that tutorial as well, I&apos;ll only give the
short version, updated for Squeeze. I&apos;ve also looked at &lt;a href=&quot;http://www.hermann-uwe.de/blog/testing-stuff-with-qemu-part-4-debian-gnu-linux-on-powerpc&quot;&gt;this tutorial
on running Squeeze on QEMU/PowerPC&lt;/a&gt; by &lt;a href=&quot;http://www.hermann-uwe.de/&quot;&gt;Uwe Hermann&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, note that Aurélien also has &lt;a href=&quot;http://people.debian.org/~aurel32/qemu/&quot;&gt;pre-built images available for
download, for a whole bunch of platforms&lt;/a&gt;, including Squeeze on MIPS.
I only noticed this after writing this tutorial, might have saved me a
bunch of work ;-p&lt;/p&gt;

&lt;h2&gt;Preparations&lt;/h2&gt;

&lt;p&gt;You&apos;ll need qemu. The version in Debian Squeeze is sufficient, so
just install the &lt;code&gt;qemu&lt;/code&gt; package:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036; aptitude install qemu
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You&apos;ll need a virtual disk to install Debian Squeeze on:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036; qemu-img create -f qcow2 debian_mips.qcow2 2G
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You&apos;ll need a debian-installer kernel and initrd to boot from:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036; wget http://ftp.de.debian.org/debian/dists/squeeze/main/installer-mips/current/images/malta/netboot/initrd.gz
&amp;#036; wget http://ftp.de.debian.org/debian/dists/squeeze/main/installer-mips/current/images/malta/netboot/vmlinux-2.6.32-5-4kc-malta
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that in &lt;a href=&quot;http://www.aurel32.net/info/debian_mips_qemu.php&quot;&gt;Aurélien&apos;s tutorial&lt;/a&gt;, he used a &quot;&lt;code&gt;qemu&lt;/code&gt;&quot; flavoured
installer. It seems this is not longer available in Squeeze, just a few
others (&lt;code&gt;malta&lt;/code&gt;, &lt;code&gt;r4k-ip22&lt;/code&gt;, &lt;code&gt;r5k-ip32&lt;/code&gt;, &lt;code&gt;sb1-bcm91250a&lt;/code&gt;). I just picked
the first one and apparently that one works on QEMU.&lt;/p&gt;

&lt;p&gt;Also, note that [Uwe&apos;s PowerPC tutorial] suggests downloading a iso cd
image and booting from that. I tried that, but &lt;a href=&quot;http://www.linux-mips.org/wiki/Qemu#MIPS_BIOS_not_found_on_startup&quot;&gt;QEMU has no BIOS
available for MIPS&lt;/a&gt;, so this approach didn&apos;t work. Instead, you should
tell QEMU about the kernel and initrd and let it load them directly.&lt;/p&gt;

&lt;h2&gt;Booting the installer&lt;/h2&gt;

&lt;p&gt;You just run QEMU, pointing it at the installer kernel and initrd and
passing some extra kernel options to keep it in text mode:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036; qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz -append &quot;root=/dev/ram console=ttyS0&quot; -nographic
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, you get a Debian installer, which you should complete normally.&lt;/p&gt;

&lt;p&gt;As &lt;a href=&quot;http://www.aurel32.net/info/debian_mips_qemu.php&quot;&gt;Aurélien also noted&lt;/a&gt;, you can ignore the error about a missing
boot loader, since QEMU will be directly loading the kernel anyway.&lt;/p&gt;

&lt;p&gt;After installation is completed and the virtual system is rebooting,
terminate QEMU:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036;  killall qemu-system-mips
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(I haven&apos;t found another way of terminating a -nographic QEMU...)&lt;/p&gt;

&lt;h2&gt;Booting the system&lt;/h2&gt;

&lt;p&gt;Booting the system is very similar to booting the installer, but we
leave out the initrd and point the kernel to the real root filesystem
instead.&lt;/p&gt;

&lt;p&gt;Note that this boots using the installer kernel. If you later upgrade
the kernel inside the system, you&apos;ll need to copy the kernel out from
/boot in the virtual system into the host system and use that to boot.
QEMU will not look inside the virtual disk for a kernel to boot
automagically.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;#036; qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-2.6.32-5-4kc-malta -append &quot;root=/dev/sda1 console=ttyS0&quot; -nographic
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;More features&lt;/h2&gt;

&lt;p&gt;Be sure to check &lt;a href=&quot;http://www.aurel32.net/info/debian_mips_qemu.php&quot;&gt;Aurélien&apos;s tutorial&lt;/a&gt; for some more features,
options and details.&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Debian Squeeze, Gnome, Pulseaudio and volume hotkeys</title>
    <pubDate>Fri, 18 Feb 2011 01:17:00 +0100</pubDate>
    <link>http://www.stderr.nl/2011/02/18#SqueezeVolumePulse</link>
    <category>/Blog/Software/Debian</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Debian/SqueezeVolumePulse</guid>
    <description>&lt;p&gt;&lt;img src=&quot;/static//images/Software/Gnome.png&quot; alt=&quot;Gnome&quot; style=&quot;float: right&quot; title=&quot;Gnome logo. Image licensed under GNU GPL2.1+, taken from http://en.wikipedia.org/wiki/File:Gnomelogo.svg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve been configuring my new laptop (more on that later) and this time
I&apos;ve tried to get the volume hotkeys working properly with
&lt;a href=&quot;http://www.pulseaudio.org/&quot;&gt;Pulseaudio&lt;/a&gt;. On a default &lt;a href=&quot;http://www.debian.org&quot;&gt;Debian&lt;/a&gt; Squeeze installation, the volume
hotkeys are processed by (the media-keys plugin of)
gnome-settings-daemon &lt;a href=&quot;#note1&quot;&gt;(1)&lt;/a&gt;. The good news is that Gnome has switched over to
using pulseaudio by default (and even removed support for plain ALSA).
However, Debian does not want to force users to use pulseaudio. So
the bad news is that Debian has disabled this pulseaudio support in
gnome-settings-daemon and &lt;a href=&quot;http://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/patches/20_gstreamer.patch?view=markup&quot;&gt;has a patch&lt;/a&gt; to use the &lt;a href=&quot;http://www.alsa-project.org&quot;&gt;ALSA&lt;/a&gt; mixer (via
&lt;a href=&quot;http://gstreamer.freedesktop.org/&quot;&gt;GStreamer&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Normally, it shouldn&apos;t matter much which mixer you use, as long as they
work. However, I&apos;m using two different sound cards on my laptop: The
builtin one for on the road and an external USB sound card when I&apos;m at
home (to get a S/PDIF output). So I need pulseaudio to route my audio to
the right place, and I want my volume controls to control the same card
as well. Note that &lt;code&gt;gnome-volume-control&lt;/code&gt;, the GUI to control your
volums is installed in two flavours by Debian (Pulseaudio and
GStreamer), and the right one is started by a wrapper script depending
on whether Pulse is running.&lt;/p&gt;

&lt;p&gt;Fortunately, the Debian patch is somewhat configurable: You can select a
different mixer device through gconf. To get at that configuration, use
&lt;code&gt;gconf-editor&lt;/code&gt; and browse to &lt;code&gt;/desktop/gnome/sound/default_mixer_device&lt;/code&gt;.
Set this value in the form of &quot;&lt;code&gt;element:device&lt;/code&gt;&quot;, where &lt;code&gt;element&lt;/code&gt;
selects the gstreamer plugin to use, and &lt;code&gt;device&lt;/code&gt; sets its &quot;device&quot;
property. I initially tried using the &quot;&lt;code&gt;pulsemixer&lt;/code&gt;&quot; element (in the
form
&quot;&lt;code&gt;pulsemixer:alsa_output.usb-0ccd_USB_Audio-00-Aureon51MkII.analog-stereo&lt;/code&gt;&quot;),
but that only allowed me to specify a specific Pulseaudio sink, not
&quot;whatever-is-default&quot;).&lt;/p&gt;

&lt;p&gt;So, instead, I settled for using the &quot;&lt;code&gt;alsamixer&lt;/code&gt;&quot; gstreamer plugin,
together with the Pulseaudio ALSA plugin (the same one you use to
redirect ALSA applications to Pulseaudio). For this to work, it&apos;s
important that you redirect ALSA applications to pulse using the
following in your &lt;code&gt;/etc/asound.conf&lt;/code&gt; or your &lt;code&gt;~/.asoundrc&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pcm.!default.type pulse
ctl.!default.type pulse
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This makes sure that not just audio streams (&lt;code&gt;pcm&lt;/code&gt;) but also mixer
controls (&lt;code&gt;ctl&lt;/code&gt;) are redirected to Pulseaudio. Now, set the
&lt;code&gt;/desktop/gnome/sound/default_mixer_device&lt;/code&gt; gconf value to the
following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;alsamixer:default
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This should make sure that your volume keys work with the device
selected as default in Pulseaudio (through &lt;code&gt;pavucontrol&lt;/code&gt; or
&lt;code&gt;gnome-volume-control&lt;/code&gt; for example). It seems this behaviour relies on
the fact that gnome-settings-daemon only keeps the mixer controls open
for a few seconds, allowing the Pulseaudio ALSA plugin to select the
right pulseaudio sink to control everytime the mixer is reopened (so it
needs a few seconds of not pressing the volume hotkeys after changing
the default device).&lt;/p&gt;

&lt;p&gt;By the way, it seems that in the next version of Gnome (and/or Debian) this
problem wil probably be fixed out of the box, since the 2.93 packages in
Debian experimental &lt;a href=&quot;http://anonscm.debian.org/viewvc/pkg-gnome?view=revision&amp;amp;revision=26050&quot;&gt;have Pulseaudio support enabled&lt;/a&gt; (haven&apos;t tested
them, though).&lt;/p&gt;

&lt;p&gt;Hopefully this helps someone else out there struggling with the same
problem...&lt;/p&gt;

&lt;p&gt;&lt;a id=&quot;note1&quot;/&gt;&lt;/p&gt;

&lt;p&gt;(1): You might have noticed that I&apos;m talking about Gnome here. I case
you wondered, I&apos;ve actually started to use parts of Gnome for daily use
on my laptop. I&apos;m still using &lt;a href=&quot;http://awesome.naquadah.org/&quot;&gt;Awesome&lt;/a&gt; as my primary window manager
and I&apos;m not using &lt;code&gt;gnome-panel&lt;/code&gt;, so I haven&apos;t suddenly become a GUI addict
all of the sudden ;-)&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Getting Screen and X (and dbus and ssh-agent and ...) to play well</title>
    <pubDate>Thu, 17 Feb 2011 22:30:00 +0100</pubDate>
    <link>http://www.stderr.nl/2011/02/17#ScreenAndX</link>
    <category>/Blog/Software/Linux</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Linux/ScreenAndX</guid>
    <description>&lt;p&gt;When you use &lt;a href=&quot;http://www.gnu.org/software/screen/&quot;&gt;Screen&lt;/a&gt; together with &lt;a href=&quot;http://x.org&quot;&gt;Xorg&lt;/a&gt;, you&apos;ll recognize this: You
log in to an X session, start screen and use the terminals within screen
to start programs every now and then. Everything works fine so far.
Then, you logout and log in again (or X crashes, or whatever). You
happily re-attach the still running screen, which allows you to continue
whatever you were doing.&lt;/p&gt;

&lt;p&gt;But now, whenever you want to start a GUI program, things get wonky.
You&apos;ll get errors about not being able to find configuration data,
connect to gconf or DBUS, or your programs will not start at all, with
the ever-informative error message &quot;No protocol specified&quot;. You&apos;ll also
recognize your ssh-agent and gpg-agent to stop working within the screen
session...&lt;/p&gt;

&lt;p&gt;What is happening here, is that all those programs are using
&quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/Environment_variable&quot;&gt;environment variables&lt;/a&gt;&quot; to communicate. In particular, when you log
in, various &lt;a href=&quot;http://en.wikipedia.org/wiki/Daemon_(computer_software)&quot;&gt;daemons&lt;/a&gt; get started (like the DBUS daemon and your
ssh-agent). To allow other programs to connect to these daemons, they
put their contact info in an environment variable in the login process.
Whenever a process starts another process, these environment variables
get transfered from the parent process to the child process. Sine these
environment variables are set in the X sesssion startup process, which
starts everything else, all programs should have access to them.&lt;/p&gt;

&lt;p&gt;However, you&apos;ll notice that, after logging in a second time, the screen
you re-attach to was not started by the current X session. So that means
its environment variables still point to the old (no longer runnig)
daemons from the previous X session. This includes any shells already
running in the screen as well as new shells started within the screen
(since the latter inherit the environment variables from the screen
process itself).&lt;/p&gt;

&lt;p&gt;To fix this, we would like to somehow update the environment of all
processes that are already running when we login, to update them with
the addresses of the new daemons. Unfortunately, we can&apos;t change the
environment of other processes (&lt;a href=&quot;http://stackoverflow.com/questions/205064/is-there-a-way-to-change-another-processs-environment-variables#answer-211064&quot;&gt;unless we resort to scary stuff&lt;/a&gt;
like using &lt;code&gt;gdb&lt;/code&gt; or poking around in &lt;code&gt;/dev/mem&lt;/code&gt;...). So, we&apos;ll have to
convice those shells to actually update their own environments.&lt;/p&gt;

&lt;p&gt;So, this solution has two parts: First, after login, saving the relevant
variables from the environment into a file. Then, we&apos;ll need to get our
shell to load those variables.&lt;/p&gt;

&lt;p&gt;The first part is fairly easy: Just run a script after login that writes
out the values to a file. I have a script called &lt;code&gt;~/bin/save-env&lt;/code&gt; to do
exactly that. It looks like this (&lt;a href=&quot;/static//files/Software/Linux/ScreenAndX/save-env&quot;&gt;full version here&lt;/a&gt;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/sh

# Save a bunch of environment variables. This script should be run just
# after login. The saved variables can then be sourced by every bash
# shell, so long running shells (e.g., in screen) or incoming SSH shells
# can also use these services.

# Save the DBUS sessions address on each login
if [ -n &quot;&amp;#036;DBUS_SESSION_BUS_ADDRESS&quot; ]; then
echo export DBUS_SESSION_BUS_ADDRESS=&quot;&amp;#036;DBUS_SESSION_BUS_ADDRESS&quot; &amp;gt; ~/.env.d/dbus
fi

if [ -n &quot;&amp;#036;SSH_AUTH_SOCK&quot; ]; then
echo export SSH_AGENT_PID=&quot;&amp;#036;SSH_AGENT_PID&quot; &amp;gt; ~/.env.d/ssh
echo export SSH_AUTH_SOCK=&quot;&amp;#036;SSH_AUTH_SOCK&quot; &amp;gt;&amp;gt; ~/.env.d/ssh
fi

# Save other variables here
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This script fills the directory ~/.env.d with files containg environment
variables, separated by application. I could probably have thrown them
all into a single file, but it seemed like a good idea to separate
them. Anyway, these files are created in such a way that they can be
sourced by a running shell to get the new files.&lt;/p&gt;

&lt;p&gt;If you &lt;a href=&quot;/static//files/Software/Linux/ScreenAndX/save-env&quot;&gt;download&lt;/a&gt; and install this script, don&apos;t forget to make it
executable and create the ~/.env.d directory. You&apos;ll need to make sure
it gets run as late as possible after login. I&apos;m running a (stripped
down) &lt;a href=&quot;http://www.gnome.org/&quot;&gt;Gnome&lt;/a&gt; session, so I used &lt;code&gt;gnome-session-properties&lt;/code&gt; to add it
to my list of startup applications. You might call this script from your
.xession, KDE&apos;s startup program list, or whatever.&lt;/p&gt;

&lt;p&gt;For the second part, we need to set our saved variables in all of our
shells. This sounds easy, just run 
&lt;code&gt;for f in ~/.env.d/*; do source &quot;&amp;#036;f&quot;; done&lt;/code&gt; in every shell (Don&apos;t be
tempted to do &lt;code&gt;source ~/.env.d/*&lt;/code&gt;, since that sources just the first
file with the other files as arguments!). But, of course we don&apos;t want
to do this manually, but let every shell do it automatically.&lt;/p&gt;

&lt;p&gt;For this, we&apos;ll use a tool completely unintended, but suitable enough
for this job: &lt;code&gt;&amp;#036;PROMPT_COMMAND&lt;/code&gt;. Whenever &lt;a href=&quot;http://www.gnu.org/software/bash/&quot;&gt;Bash&lt;/a&gt; is about to display a
prompt, it evals whatever is in the variable &lt;code&gt;&amp;#036;PROMPT_COMMAND&lt;/code&gt;. So it
ends up evaluating that command all the time, which makes it a prefect
place to load the saved variables. By setting the &lt;code&gt;&amp;#036;PROMPT_COMMAND&lt;/code&gt;
variable in your &lt;code&gt;~/.bashrc&lt;/code&gt; variable, it will become enabled in every
shell you start (except for login shells, so you might want to source
&lt;code&gt;~/.bashrc&lt;/code&gt; from your &lt;code&gt;~/.bash_profile&lt;/code&gt;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Source some variables at every prompt. This is to make stuff like
# ssh agent, dbus, etc. working in long-running shells (e.g., inside
# screen).
PROMPT_COMMAND=&apos;for f in ~/.env.d/*; do source &quot;&amp;#036;f&quot;; done&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You might need to be careful where to place this line, in case
PROMPT_COMMAND already has some other value, like is default on Debian
for example. &lt;a href=&quot;/static//files/Software/Linux/ScreenAndX/bashrc&quot;&gt;Here&apos;s my full .bashrc file&lt;/a&gt;, note the &lt;code&gt;+=&lt;/code&gt; and
starting &lt;code&gt;;&lt;/code&gt; in the second assignment of &lt;code&gt;&amp;#036;PROMPT_COMMAND&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The astute reader will have noticed that this will only work for
existing shells when a prompt is displayed, meaning you might need to
just press enter at an existing prompt (to force a new one) after
logging in the second time to get the values loaded. But that&apos;s a small
enough burden, right?&lt;/p&gt;

&lt;p&gt;So, with these two components, you&apos;ll be able to optimally use your
long-running screen sessions, even when your X sessions are not so
stable ;-)&lt;/p&gt;

&lt;p&gt;Additionally, this stuff also allows you to use your faithful daemons
when you SSH into the machine. I use this so I can start GUI programs
from another machine (in particular, to open up attachments from my
email client which runs on a server somewhere). &lt;a href=&quot;http://www.stderr.nl/Blog/Software/Mutt/MuttRemoteAttachments.rss&quot;&gt;See my recent blogpost
about setting that up&lt;/a&gt;. However, since running a command through SSH
non-interactively never shows a prompt and thus never evaluates
&lt;code&gt;&amp;#036;PROMPT_COMMAND&lt;/code&gt;, you&apos;ll need to manually source the variables at once
in your .bashrc directly.  I do this &lt;a href=&quot;/static//files/Software/Linux/ScreenAndX/bashrc&quot;&gt;at the top of my ~/.bashrc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Man, I need to learn how to writer shorter posts...&lt;/p&gt;
</description>
  </item>
  <item>
    <title>ENIAC Thesis Award 2010</title>
    <pubDate>Mon, 07 Feb 2011 21:46:00 +0100</pubDate>
    <link>http://www.stderr.nl/2011/02/07#ThesisAward</link>
    <category>/Blog/Uni</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Uni/ThesisAward</guid>
    <description>&lt;p&gt;&lt;a href=&quot;/static//images/Uni/Scriptieprijs_full.png&quot;&gt;&lt;img src=&quot;/static//images/Uni/Scriptieprijs.png&quot; alt=&quot;Matthijs and Christiaan showing their award&quot; style=&quot;float: right&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last week, my Master&apos;s thesis was
&lt;a href=&quot;http://www.utwente.nl/nieuws/eniac-scriptieprijs2010&quot;&gt;awarded with the ENIAC Thesis Award 2010&lt;/a&gt;. This is is &lt;a href=&quot;http://eniacalumni.wordpress.com/diensten/scriptieprijs&quot;&gt;an award&lt;/a&gt;
for the best-written and most scientific Master&apos;s thesis for Computer
Science (and related masters). The prize is awarded by ENIAC, the alumni
club for computer science.&lt;/p&gt;

&lt;p&gt;This award came quite unexpected to me. Apparently my thesis (together
with Christiaan&apos;s thesis, which discussed the same subject) was
nominated by our graduation comittee. I had also not actually expected
to win, so that was quite cool.&lt;/p&gt;

&lt;p&gt;The award consisted of a nice certificate and a cool sculpture by
&lt;a href=&quot;http://www.leihannen.nl/&quot;&gt;Lei Hannen&lt;/a&gt;. As an extra surprise, it turned out there is also a €500 money
prize associated wit this award.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href=&quot;/static//files/Uni/Eniac%20Scriptieprijs%202010%20juryrapport.pdf&quot;&gt;jury rapport&lt;/a&gt;, our thesis were awarded because of the
novelty and the new research area they open up. Additionally, my thesis
was commended for the excellent use of English. Cool :-D&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Replacing Xanthe</title>
    <pubDate>Tue, 18 Jan 2011 22:00:00 +0100</pubDate>
    <link>http://www.stderr.nl/2011/01/18#Goodbye</link>
    <category>/Blog/Hardware/S270</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Hardware/S270/Goodbye</guid>
    <description>&lt;p&gt;&lt;img src=&quot;/static//images/Hardware/S270/notebook.png&quot; alt=&quot;S270 notebook&quot; style=&quot;float: right&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After nearly five years of intensive use, the time has finally come to
replace my trusty S270 laptop, Xanthe. Overall, I&apos;m surprised that she
held out as long as she did. There has been some defects along the way,
but in the end I&apos;ve managed to keep things pretty much working (where the
most recent and most serious fix was to remove the laptop speakers and
soldering the inverter cable, which got partly severed in the screen
hinge).&lt;/p&gt;

&lt;p&gt;However, since a few months, there is one issue that I can&apos;t seem to
fix: The AC adapter plug doesn&apos;t seem to properly connect to the socket,
making the battery switch between charging and not charging all the time
(once per second or so). This had a great number of side effects, like
keys on my keyboard getting stuck or making the keyboard stop working
completely, making my network connection break, making my screen
brightness change eratically and other stuff that makes me utterly and
completely annoyed. &lt;a href=&quot;https://tango.0pointer.de/pipermail/s270-linux/2010-August/000244.html&quot;&gt;I&apos;ve made a detailed post&lt;/a&gt; on the
&lt;a href=&quot;https://tango.0pointer.de/mailman/listinfo/s270-linux&quot;&gt;s270-linux mailing list&lt;/a&gt; about that, if you&apos;re interested.&lt;/p&gt;

&lt;p&gt;So, after a few months of on-and-off annoyance, I&apos;ve finally decided to
get a new laptop. It&apos;s sucky, since apart from this issue, Xanthe is
still serving me well. On the other hand, it&apos;s utterly cool, since I
just ordered myself a &lt;a href=&quot;http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&amp;amp;lndocid=MIGR-75238&quot;&gt;Thinkpad X201&lt;/a&gt;. It&apos;s a very durable and
efficient 12&quot; notebook (over 10 hours of battery life, according to
Lenovo!). More details when I get the package (should be somewhere this
week!).&lt;/p&gt;
</description>
  </item>
  <item>
    <title>Opening attachments on another machine from within mutt</title>
    <pubDate>Fri, 09 Jul 2010 20:10:00 +0200</pubDate>
    <link>http://www.stderr.nl/2010/07/09#MuttRemoteAttachments</link>
    <category>/Blog/Software/Mutt</category>
    <guid isPermaLink="false">http://www.stderr.nl/Blog/Software/Mutt/MuttRemoteAttachments</guid>
    <description>&lt;p&gt;For a fair amount of years now, I&apos;ve been using &lt;a href=&quot;http://www.mutt.org/&quot;&gt;Mutt&lt;/a&gt; as my primary
email client. It&apos;s a very nice text-based email client that is
permanently running on my server (named drsnuggles). This allows me to
connect to my server from anywhere, connect to the running &lt;a href=&quot;http://www.gnu.org/software/screen/&quot;&gt;Screen&lt;/a&gt;
and always get exactly the same, highly customized, mail interface
(some people will say that their webmail interfaces will allow for
exactly the same, but in my experience webmail is always clumsy and slow
compared to a decent, well-customized text-based client when processing
a couple of hundreds of emails per day).&lt;/p&gt;

&lt;h1&gt;Attachment troubles&lt;/h1&gt;

&lt;p&gt;So I like my mutt / screen setup. However, there has been one
particular issue that didn&apos;t work quite as efficient: attachments.
Whenever I wanted to open an email attachment, I needed to save the
attachment within mutt to some place that was shared through HTTP, make
the file world-readable (mutt insists on not making your saved
attachments world-readable), browse to some url on the local machine and
open the attachment. Not quite efficient at all.&lt;/p&gt;

&lt;p&gt;Yesterday evening I was finally fed up with all this stuff and decided
to hack up a fix. It took a bit of fiddling to get it right (and I had
nearly started to spend the day coding a patch for mutt when the folks
in #mutt pointed out an easier, albeit less elegant &quot;solution&quot;), but it
works now: I can select an attachment in mutt, press &quot;x&quot; and it gets
opened on my laptop. Coolness.&lt;/p&gt;

&lt;h1&gt;How does it work?&lt;/h1&gt;

&lt;p&gt;Just in case anyone else is interested in this solution, I&apos;ll document
how it works. The big picture is as follows: When I press &quot;x&quot;, a mutt macro
is invoked that copies the attachment to my laptop and opens the
attachment there. There&apos;s a bunch of different steps involved here,
which I&apos;ll detail below.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.stderr.nl/Blog/Software/Mutt/MuttRemoteAttachments.html?seemore=y&quot; class=&quot;seemore&quot;&gt;See more ...&lt;/a&gt;&lt;/p&gt;

</description>
  </item>
  </channel>
</rss>

