February, 2008

Fosdem 2008: great edition!

What can
say
more than these guys? :-)

FOSDEM 2008 has been a great edition,
for me too. I spent most of my time at the BSD+PostgreSQL
Developer Room
. One nice thing I found out is that EnterpriseDB has a development centre
in Islamabad at only a few kilometres from our
office
and, apparently, we’re both member of the industry advisory board
of NUST. Nice meeting you,
guys!

It must be said though: the ULB is not the
best location for FOSDEM. At least not any
more. For several talks, I had to sit on the floor or stand up against the
wall at the back of the auditorium. The Mozilla dev room was a named
sauna.fosdem.org. The hallway with the project booths was so crowded, it was
nearly impossible to take your time to visit the individual projects. I know
Brussels has a nice international aura hanging around it, but if you would
just turn Leuven into “Brussels East” or something, I’m sure you won’t see
the difference in the amount of people showing up. But, dear FOSDEM
organisers, at Campus Arenberg
III
of the K.U.Leuven, I’m sure you
can provide all of us a nicer geek experience.

And, oh yes, FOSDEM is not free. I spent over € 100 this
weekend on donations only! ;-)

Posted in Business, Life, the Universe, and Everything, Open Source Adventures   No Comments »

MyOwnDB selected for Plugg!

Whoa! Got some really good news yesterday: MyOWnDB made it
into the second round of the first edition Plugg
! Out of 66
submissions from start-ups out of no less than 18 European countries
, we made it into the top 20.

This means that now we will get a 2 minute speaker slot to present our wares
to a public of internet specialists, investors and general geeks. 20 times two
minutes plus some delay, means one full hour of presentations. Having only two
minutes to stand out from the crowd will be no easy task. I guess I’ll have to
sing, or wear a pink suit or something… :-)

Anyway, I hope to meet a lot of interesting people at Plugg. We’re very excited about this opportunity,
and would like to thank the organisers for providing us, European Web 2.0
start-ups, a chance like this to expand our business opportunities.

See you in Brussels on the 19th of March!

plugg

Posted in Business   No Comments »

[t]csh prompt magic

I refer to Jan’s
smiley system
. I like the idea, and tried to implement something similar
in [t]csh… with only limited success.

First of all, I needed an equivalent of that bash function inspecting the
return value of the previous command and printing a corresponding smiley.
[t]csh doesn’t support functions, so I needed an alias. But in aliases, you
can’t use if-then-else. Or so I thought.
But this works:

set echo_style = both
alias smiley 'eval "if (\$?) then \\
echo -n \\e[1m\\e[31m- $?\\e[m" " \\
else \\
echo -n \\e[1m\\e[32m+\\e[m" " \\
endif"'

Watch your quoting; remember that the shell strips off one level of quoting
when you set the alias and another during the first pass of the eval. The
echo_style could also be just ``sysv'', but not ``none'' or ``bsd'' if you
want some colour instead of a scrambled shell. And, oh yes. Smileys won't
work, as there is no way I could make this statement not
evaluate ('s or )'s correctly (unless maybe I try it with makealias or
quote
one day), so I opted for the +
and - signs
instead.

Now after figuring this out, I needed a way to get an alias call into my
$prompt variable. Bummer. No support for this in [t]csh. Yikes!

So now what? Well, you could just set the printexitvalue shell variable to
print the exit status of commands which exit with a status other than zero,
which is supported by default by [t]csh.

So, the same functionality can be gotten (even far simpler than in bash), but
not the same coolness factor. Too bad for those [t]csh users out there. :-)

Posted in Open Source Adventures   No Comments »

dd to the rescue!

How to rescue a remote, headless FreeBSD system from a Linux rescue image
which cannot mount ufs2 read-write? Impossible, you think? I just did it. :-)

We’re running (amongst others) a FreeBSD 7.0-RC1 installation as a web and mail
server. On a sad sad day, I rebooted the machine and ping told me it came up
just fine, but nmap told me that there was no way in any more. Hmm..

Our hosting provider has this service which
allows us to reboot our servers into a debian rescue image by sending an
properly formatted email to a special email address. Of course, from that
image, I couldn’t do much to fix the FreeBSD installation on the disk. This is
what I did:

  1. make an image of the first 100MB of the primary master hard
    disk
  2. copy that image to another server, or your local computer
  3. now place a FreeBSD image on the first 100MB of that hard disk (I
    prepared one with
    The Depenguinator, version 2.0
    )
  4. reboot
  5. log in to the FreeBSD image, which is loaded into memory
  6. get back those 100MB you just copied over to a safe place and cat
    them onto the same hard disk (different device name now of
    course)
  7. mount your FreeBSD installation’s file system hierarchy and try to
    fix stuff
  8. reboot
  9. repeat if necessary…

I must say I was a bit nervous and had to concentrate not to accidentally
mistype anything or cat or dd stuff onto the wrong place. But hey! It worked
out just fine in the end.

I’ve got my BSD machine back. /me happy!

Posted in Open Source Adventures   No Comments »

Getting to know /var

Today I found out the best way to find out what /var really means on
a Gentoo system: I removed it.

Something strange happened. There was a shortage of disk space on the
/ partition, which also housed /var, so I created
/home/var on a different partition, did

tar -c --atime-preserve /var/* | tar -x -C /home

, added

/var /home/var auto bind 0 0

to /etc/fstab and rebooted into single user mode. There, umounted
/var to get back to the original partition (of course, the new
fstab-rule as followed already), and rm -rf‘d /var.

So far, so good.

Reboot…

Empty /var!

This means that almost no services can start up (no ssh, no syslog, no
portmap, no nothing…) as things like /var/spool, /var/log,
/var/run and /var/lock are gone an away…

But what’s worse: /var/www is bye-bye (luckily it contained only
localhost-websites) and /var/lib/portage/world as well. Now, portage
thinks nothing is installed and wants to re-emerge every tiny little dependency
out there. regenworld, I hear you think? Won’t work.
/var/log/emerge.log is gone, remember?

Posted in Open Source Adventures   No Comments »

“Me too!”

Yup, me too:
going-to-fosdem
I wont be there on Saturday though, but you can expect me at the
pre-FOSDEM-social-event and on Sunday!

And you know what’s so cool? I can categorise this post in “Business”,
“Open Source Adventures” ánd “Life, the Universe, and Everything”.
Man, do I love my job! :-)

Posted in Business, Life, the Universe, and Everything, Open Source Adventures   No Comments »

MyOwnDB applied at Plugg!

Today, I filed an application at Plugg for our
new baby: MyOwnDB. For those who don’t know
yet, Raphaël Bauduin and Zeropoint.IT decided October 2007 to partner in
the development and promotion of the best Web
based DBMS in the world
. Raphaël started with MyOwnDB in the beginning of 2006, but ceased
development early 2007. Our partnership will form a company behind MyOwnDB and has gotten the development back up
to speed already. Expect a release of the core engine (called
δεδομένων) under a Free Software
License
soon!

And because they asked for it:
plugg

:-)

Posted in Business   No Comments »

[sysadmin] vhostlist

On our public web server, we are hosting a
lot of stuff. Currently, we have over one hundred virtual hosts defined in
Apache.

One day, I realised that I didn’t have an overview any more of all these
deployments. That’s when I decided to write a simple script to produce me a
list of all virtual hosts (and aliases) in HTML. As it’s all about file
parsing, and I got a bit bored of Perl, I decided to write it in AWK and wrap
it in sh so it can be installed as a CGI script on the same web server.


#!/bin/sh

echo 'Content-Type: text/html; charset=iso-8859-1'
echo 'Cache-Control: no-cache'
echo 'Cache-Control: no-store'
echo 'Pragma: no-cache'
echo 'Expires: Thu, 01 Dec 1994 16:00:00 GMT'
echo

echo '< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">'
awk 'BEGIN {print "

Virtual Hosts configured on mars

    "} /^[ \t]*Server(Name|Alias)/ { $1=""; split($0, domains); for (i=0; i%s

    \n", domains[i+1], domains[i+1])}} END { print "

"}' /etc/apache2/vhosts.d/*

It’s still really basic, but it serves it’s purpose. Wished feature is to show
a difference between ServerName’s and ServerAlias’es. This is left as an
exercise to the reader.

Posted in scripting   No Comments »

Geekdinner Leuven

Just got back from another nice Geekdinner, in Leuven this time. It was
especially pleased to see two of my fellow students again (hello Jan and
Koen!). I also got the chance to try one of these things much beloved in the
geek community these days: a “plooifiets”. Not sure if it’s something for me
though.

Anyway, Wouter convinced me to subscribe
to Planet Grep with my still freshly
smelling weblog. I guess that’s an honour, so… here we go!

One of the things he said was that “having an audience” might help keeping
up the blogging. I don’t really believe this. Although “having an audience”
might spur some short-term enthusiasm, I really believe that blogging is
something you need to do for yourself. Because you want to do it yourself.
Has something to do with internal and external motivators.

Anyway, maybe I should tell “my audience” something now: I don’t allow
comments or messages on my blog. It’s my blog after all,
isn’t it. If you really feel like reacting, please do! But use your own blog
for that and link back to my post’s permalink when doing so. I feel that if
it’s too easy to react to my writings on my own space, I will (1) loose too much
time keeping up with the comments and probably cleaning up spam and other
unwanted things, and (2) more importantly, I guess I’d feel restricted from
writing exactly what I want to write. Now, there’s absolutely no reason for me
to stay (politically or otherwise) correct!

One last thing. I’ll probably always blog in English, but the odd Dutch or
French word might pop up once in a while.

Posted in Business, Open Source Adventures   No Comments »

When your server should not crash

Had a server crash yesterday. Don’t know if it was due to faulty hardware or
something with the OS, but it came at
the exact wrong moment.

I was installing OpenBSD 4.2 on a remote
system to which I have absolutely no physical access. I created a 64 bit image
with qemu on my laptop, installed OpenBSD in it, and deployed it on the remote
system. After that, I partitioned and labelled the remote hard disk and
started moving /home, /usr and /var from the initial image to their brand new
filesystems/partitions.


mount /dev/wd0e /mnt
cd /usr; dump 0f - . | (cd /mnt; restore -rf - )
cd /mnt/usr
mv * ..
cd ..
rmdir usr
cd /
umount /mnt
mv usr usr.old
mkdir usr
mount /dev/dw0e /usr

I fired up $EDITOR to add my new /usr to /etc/fstab and at that exact moment
the machine crashed and kicked me out…

No problem you’d say. Just reboot it and continue from there. Think again.

Where does sshd live?

Posted in Open Source Adventures   No Comments »