2008-03-01

IT Underground 2008

I have again attended the IT Underground conference in Prague, where I gave a short lecture about PKI in practice. Soon I shall also upload the slides from the talk.

2008-02-23

MIPS CPU

Things have been pretty hectic here, so I haven't had much time to post anything. Recently, I've begun a new personal project: writing a simulator for the MIPS I CPU arhcitecture. I chose this particular CPU because it's the simplest architecture for which gcc can generate code. There are many other MIPS CPU simulators out there, but all of them do more than I need, so I decided to write my own as simple as possible. The ELF loader and symbol lookup are finished, and now I'm working on developing test vectors for the simulator (a very boring part).

As for why I'm doing this - the answer will hopefully be clear soon :-)

2008-01-27

Java leaks memory

Now, this is something to laugh at: when first launching Java, Sun boasted about garbage collector and that programmers will never again have to cope with memory-management problems. Fast-forward to 2008. to read Sun's presentation on avoiding memory leaks.

2008-01-10

Some regexps

I have started to develop some CRM114 scripts to classify Usenet articles. Internally, it uses the TRE regexp engine and I needed a regexp splits article into headers and body; the separation happens at the first empty line. So here's the regexp; it seems to work :)

/((?:(?n:.+):*:_nl:)+):*:_nl:(.+)/

Some peculiarities: the :*:_nl: is CRM114 literal for newline, and the ?n: is a TRE flag to tell it that dot (.) should not match the newline character (by default it does, and this makes TRE different from PCRE regexp). The headers will end up in the 1st matching group, and the article body in the 2nd.

2007-12-19

OpenSUSE install and some luck

Last weekend I  installed OpenSUSE 10.3. It was a bumpy installation, since I was without any CD I could burn. So I downloaded the ISO image to FAT32 partition, two additional files (kernel + initrd) and started install. I added another (non-free software) CD image to the list of repositories, but the install had failed afted being done with the 1st CD (Because the CD image was on the partition that was about to be added to /etc/fstab, with no formatting or anything destructive. But that was enough to confuse the installer and make it exit with an error.). So I tried to boot into the installed OS and.. the boot failed. So I was only left with a GRUB command line (because the menu.lst file had not been created) and a WinXP partition which I had to figure out how to boot from.

GRUB built-in help is the most useless help ever.

I  needed the chainloader command, ok, but that command wants "blocklist or file name". However, the blocklist syntax is nowhere to be found in the GRUB help. I was just about to go to work and burn the installation CD, when I saw another command (blocklist) which, given filename, prints out a list of blocks. I knew the kernel image filename on the root partition, so I finally got to see how the blocklist syntax is supposed to look like (ie. 0+1 = 1 sector starting from 0th). That enabled me to boot into XP, move stuff to unused partition and successfully install SUSE.

HOWEVER... I had a critical password stored on the root partition which got mkfs'd and overwritten several times.. and it was filled up to 60%, like never before. I thought that I had lost the password, but I tried my luck and used dd to make an image of the root partition into a file. Then I used the strings program to dump all printable strings in the partition image and, unbelievably enough, the password was there, not overwritten by the new data! WOW :) I had more luck than brains this time :)

As for SUSE, I'm running KDE now, and.. it's OK. Livable. Not bad. Portage broke down on my old gentoo installation and I finally got sick of it. Time to spend as little time managing my computer as possible.