Oh rejoice!
I just found out today (December 2009), that my patch from 2005 actually got included in the main Linux kernel back in Oct. 2007.
http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg22779.html
This is great news and quite fun too.. Look ma’, my initials are in the kernel!

Its pretty cool to see my ~150 lines of codes inside the official Linux Kernel. What is also really cool to see, is that someone (Jeff Garzik) actually read and checked all my work, and even fixed up comments and some code standard issues. This just showed that all the FUD about “any one can stick code into the kernel” and “4 geeks in a basement dont have time to check everything” is definently disproved.
A few examples:
Original: /*We have a copper wire (or a couple of copperwires at least…. hopefully)*/
Changed to: /* We have copper */
Original: /*we have optical thingie-majiggy*/
Changed to: /* we have optical interface */
Common for both theese examples is, that my blatant attempt to sneak in comment-humor, is gunned down :). Also notice that a space is added after /* and before */, which is the coding standard (which i apparently didnt read well enough).
Also my highly advanced “ternary-in-ternary” statement:
cmd->speed = (
((cfg / CFG_SPDSTS0) & 3) >= 2 ? SPEED_1000 :
(((cfg / CFG_SPDSTS0) & 3) == 1 ? SPEED_100 : SPEED_10 )
);
is replaced with the simple equivalent:
switch (cfg / CFG_SPDSTS0 & 3) {
case 2:
cmd->speed = SPEED_1000;
break;
case 1:
cmd->speed = SPEED_100;
break;
default:
cmd->speed = SPEED_10;
break;
}
So ive learned that Linux-Kernel coders do not appreciate unreadable one-liners as much as the perl community. (and i was just getting good at unreadable one-liners).
- Dan
I have an encrypted home dir, which is automatically decrypted upon login. (Linux, if you were in doubt). I want to mount a large truecrypt partition automatically when i log in.

I wrote a small script that mounts the truecrypt drive. I added to .bashrc (you could also use .profile i guess) that this script automount script is mounted upon login.
Heres the initial script
truecrypt -t -k "" --auto-mount=devices -p 'MySuperSecretPassword'
Storing the password inside the script isnt the problem (remember that homedir is already encrypted). The problem is, when doing “ps ax”, the password shows up in the list, as such:
3471 ? Ssl 0:00 truecrypt -t -k --auto-mount=devices -p MySuperSecretPassword
Bad idea.. I want to mount using a password and not a “keyfile”, but truecrypt doesn’t provide any other way of supplying a password.
However the solution was pretty simple, once i found it.
echo "MySuperSecretPassword" | truecrypt -t -k "" --auto-mount=devices -p ''
Its really a coincidence that this works. Truecrypt tries to mount using a blank password.. Once this fails, it will prompt for a password.. The prompt will be filled from the pipe.. And now password is gone from ps ax and im a happy camper.
- Dan
We’re back from HAR2009.. It was a blast :)..
You can see all our photos on our danish blog camp.hacker.dk
- Dan
Holland beware. Several thousand hackers & nerds from all over the world are marching towards your country.

At last, at last. Time to crawl outside our dungeons,
defy the Evil Daystar (even though it is trying to kill us) and make our way towards the “Hacking-At-Random” camp in Holland.
Its almost here!.. August 13-16.
We have moved all “camp” related stuff to our new blog on http://camp.hacker.dk. If you wish to follow our exploits (so-to-speak) while we’re there, camp.hacker.dk is the place to look. It will most likely be in Danish, but there will be photos (and cake!) so come on over anyway.
- Dan

After upgrading my subversion on my server to version 1.5.1, I started getting the following error for all newly created repositories (on commit):
svn: Can’t open activity db: APR does not understand this error code
Oddly, all my existing repositories worked fine. Googling didnt help me, though it did point to the direction that it was Apache not having enough rights. chmodding 770 didnt help. Chowning to www-data didnt help (both was the recomended solution everywhere i looked). Finally figured out that a folder was missing in the new project directory. This solved the problem for me:
$ cd /path/to/your/repository
$ mkdir dav
$ chown www-data: dav
So i thought id stick it online here, to help anyone else not finding the right solution on the web.
- Dan
Mortal Combat vs. DC Univese is just SO much brainless fun! :)

I was looking for a list of the “finishing moves” (those funny/cool moves to when you end a battle) and i found this this link.
http://videogamecentral.com/gamersvoice/index.php/2008/mk-vs-dc-fatality-finishing-moves-list-360-ps3/
However the page is dead (Jul 2 2009). The page displays a default page for a newly bought domain, so i pulled the old page from google’s cache. I copied the moves from the cached page to here to preserve them. Its a bit strangely written, but youre a big boy, so figure it out ;)
Read the rest of this entry »
- Dan
Welp.. I finally surrendered.. I swore id never buy a gaming console and yet ive just bought my first one ever. Since i wanted a console that could play the games i usually play on a PC, i had the choice between the lesser of 2 evils. Sony vs. Microsoft.
After carefully weighing the proof against both companies, i decided that Sony was a bit more evil than MS, so i went with the XBOX 360. :)
One of the things i was looking forward to, was streaming video to the XBOX from my PC. Imagine my disappointment when the XBOX menu told me i needed a Windows PC with Windows Media Player 11.. No way in hell!.
So last night i finally got my Linux Laptop to stream vid to the XBOX. It turns out, that Microsofts mysterious “proprietary protocol” for streaming is (as usual) a standard protocol, just modified enough that standard tools cant use it. Why MS ALWAYS have to do this, boggles my mind. Its called a “standard” for a reason, dammit!.
The protocol in question is nothing more than UPnP.

AFAIK, the only difference from standard UPnP, is that the XBOX requires the UPnP server to identify it self as “Windows Media Connect” and it requires a specific directory layout.
“Fuppes” is a small UPnP server that lets you configure all this and even have guides on how to do it in their Wiki.
So now i have it working, and i have to admit that the XBOX media-player is not half bad (with the newest firmware upgrades). It does quite a decent job. Nothing fancy or cool, but works nicely.
- Dan
OMG im such a nerd. I cant sit down and enjoy a game, without ending up programming something related to it.
The latest thing i couldnt leave alone, was the Computer Terminals in FallOut 3. After understanding the logic behind it, i had to code a script that would calculate the correct word to enter.

After telling my collegues about it, they asked if i could make it webbased and i said yes.
3 weeks of not keeping my promise, here it finally is :)..
http://perl.hacker.dk/cgi-bin/fallout_hack.pl
- Dan
Dropbox (dropbox.com) has been getting a lot of attention in the open source community lately, mainly due to the fact that people think the client is open source.
Before i start, id like to say that i do think Dropbox is pretty neat and i also think close source has its place in the world, though i would always personally choose the open alternative.
Anyway… “Dropbox is not open?!?” you say, “But the source is available on their webpage?”. This is correct and very very wrong at the same time. The Nautilus plugin is open, but contrary to common belief, it is NOT the dropbox client. Once you’ve installed the Nautilus plugin (which is 66k) it will download 35megs of closed souce in the background into the folder ~/.dropbox-dist. Without asking permission.
The Nautilus plugin only does a few things like enabling the dropbox right-click menu, handling the icon-overlay in nautilus and so forth. Basically the Nautilus plugin only handles the “visual stuff”:
All the “real stuff”, network- and filewise, happens in a “small” 7.8meg (closed-source) daemon called “Dropboxd”.
The plugin talks to the daemon through a named pipe (fifo pipe) located in ~/.dropbox/. Dropboxd itself is made in python and compiled into a binary.
It uses a lot of well known libraries like rsync, zlib, the bz2-lib, SDL, libfreetype, openssl, sqllite ect.ect, all downloaded in binary form through the before mentioned background process and saved to ~/.dropbox-dist.I havent checked the licenses of the libs used, but i assume they all allow for closed source distribution.
It doesnt bother me that people make closed source software using open source libraries* (except when Microsoft does it), but what does bother me, is the feeling of being tricked into installing a closed-source app on my open source system.
* when they give a little code back to the community. Imagine how fast open source would move if all proprietery projects gave back 5-10% code.
- Dan
Presenting “sapi2wav”. (name choosen because text2wav was already taken)
Its a simple windows tool that allows you to do Text-To-Speech on command line.
The program will play a text given as argument or read a file and output to a wave file. It also allows you to choose other voices, if eg. you have NeoSpeech voices or AT&T Natural voices.
Its free (unlike any other commandline SAPI program ive found) and its Open Source (GPL).
Commandline processing is a MUST for any form of scripting or automation. I wanted to automaticly transfer daily news-stories to and MP3 player and now i can :)
Usage is as simple as:
sapi2wav.exe c:\out.wav 1 -t “Hello world”
TextAloud has a commandline mode, but its very oddly written, pretty beta and doesnt run under Linux. I wrote to Text Aloud (or NextUp.com) explaining my very insignificant problem and of course they didnt reply. So instead of buying their product, i ended up making an open source alternative :).
So if you install SAPI5 under wine (must be installed in windows ME compatability mode), then you can run this tool under wine as well and do commandline magic :)
Downloads:
Setting up MS-SAPI5 under wine should be as easy as configuring your wine to run in Windows ME mode, then download and run MS’s Sapi5 installer (msi - the Win ME version)
Winehq has an article on how to do this.
The tool SayPad from this page should have sapi5 included in the 95/98/me installer.. Though i havent testet it, i guess if you can install SayPad under wine, youll get the needed api’s.
please send me any changes you might make to this sapi to wav tool.
- Dan