Stavros' Stuff

On programming and other things.

ContentTypes and unit testing problems in Django

I’m working on a new Django project at the moment, and it uses the ContentTypes framework to refer to any model in the project. The problem with doing this is that the ContentType objects that are created have random IDs, so if you dump your database objects into a fixture, the ContentType objects those refer to will not be what you initially expected.

After a few days of searching and finding no

Continue reading…

Supported by Ninjas

These past few days I have been working hard setting up a new business venture, and it is almost complete. Without further ado, I present to you…

Ninja Support!

If you need stuff supported, Ninjas can do it. Small servers, big servers, backups, maintenance, setup, you name it, we handle it all. Give us a try, I am su

Continue reading…

PyCuda and Windows

These last few days I have been busy trying to install PyCuda for Windows, but Windows sucks a bit in these things, so it took quite a bit of time. This is a post documenting my Odyssey.

First of all, I had no luck at all with Python 2.6. After two days I got it to compile, but it couldn’t load the module, so I installed 2.5 again. You absolutely need Visual Studio 2003 because I couldn’t get eit

Continue reading…

King for a day

Today I learnt that my sister’s house had gotten burglarized (laptop, camera and my two original gameboys with 30ish cartridges gone), who the hell would rob a student’s house?), so I needed a distraction to get my mind off it. Since I like playing 7 Cities on the iPhone, I started a game, and the online high score submission intrigued me, so I thought if I could somehow hack it to put myself in

Continue reading…

Mounting ddrescue images under Windows.

Today I needed to rescue the data on a hard disk brought to me, so I used GNU ddrescue (what else?) to create an image of the disk. As soon as the image was done, I discovered that the disk contained a FAT32 partition, which I wanted to mount. Mounting it under Linux was easy enough with the loopback devices, but Windows has no support for mounting disks as images.

I soon remembered [VDK](http://

Continue reading…

Spammers

As some of you might have noticed, we had some downtime yesterday. This is due to some gentlemanly folk who decided to use the server to send out spam. I thought I had configured the mail server well, but apparently some things can go wrong. For example, the fact that the root account doesn’t have a password set doesn’t mean that people can’t log in. Apparently my SASL service thought that by “no

Continue reading…

Dead Man's Switch

After the amazingly successful omnisync, it is once again time to present you of another creation of the inimitable Poromenos Studios.

This time, it’s Dead Man’s Switch. As you’re probably aware, everyone carries valuable information in their heads. It might be about their work, financial information, etc. If anything were to happen to them, this information would

Continue reading…

File synchronisation

It is once again time to shake the world from its very foundations with my latest creation. I present to you… omnisync.

omnisync is a file synchroniser (something like rsync), only it’s not built to synchronise just files, but also anything else. It’s extensible through a simple plugin architecture, and you can have it synchronise anything to anything within a few hours.

Continue reading…

Properly name TV episode files

I just encoded my Futurama DVDs to put on my iPod, but it’s a real hassle adding tags to every single file separely, so I created a script to do it for me. I had actually written this before, but I forgot it at home, so I had no option but to rewrite it.

The script (written in Python) will search the filenames for “sXXeXX” and look up the episode name on IMDB, and then will rename the file as “Sh

Continue reading…

Printing "Hello world!" using curve fitting techniques (or: The "Hello world!" function)

Well, I have a computer architecture exam in six hours and can’t be bothered, so I figured I would realize a lifelong dream of mine, and make a program that prints “Hello world!” using curve fitting techniques. Enlisting the help of a good friend with numerous mathematical papers under his belt (ostensibly because he could not afford a tighter belt), MATLAB and a longing for procrastination, we em

Continue reading…