January, 2009


30
Jan 09

Bill 0.1-2 released

I have just relased version 0.1-2 of Bill, your favourite accompaniment for your shell-code meals. Albeit I have plans for an upcoming 0.2 which will break some backwards compatibility, this is a just a mainteinance release which introduces some bugfixes. Quick summary follows:

  • Better test suite and fixes for the data/hash module
  • Fix bug which prevented serving content from a non-default Billet
  • Allow for manually setting the server name in billetd
  • New config_ini_get_chained function in module text/config
  • The butt utility now accepts file names as arguments, so you can choose which unit tests to run, instead of waiting for the full lot to finish
  • Speed improvements when decoding MIME data in module text/mime

Last, but not least, some polish was applied to the documentation and code style, and autogenerated files (i.e. HTML documentation) was removed from the GIT repository.

And now, go and get some packages ;)

Enjoy!


30
Jan 09

Reminder: Pushing GIT tags

Just a quick reminder for myself and for my fellow colleagues which also do use GIT: use --tags when pusing for sending information about tagged revisions when pushing. So, for example, if I tag a new Bill release, like I am doing right now, I have to push data to Gitorious this way in order for the tag to appear:

  git tag v0.1-2
  git push gitorious master:master --tags

(Just in case you are wondering: I like to be explicit about which branch to push and its destination ;-) )


13
Jan 09

The story of linux-{gate,vdso}.so

If you have used ldd on a dynamic binary with a Linux 2.6 kernel you may have wondered what the heck is the linux-gate.so library, because it is not present in the filesystem. Depending on kernel versions, it may appear as linux-vdso.so. Well, here is an in-depth explanation, but in short it is a virtual ELF library which is contained in the kernel itself (that is why there is no file on disk) that gets mapped into the address space of every process. It contains some functions used by the C library to enter kernel space on system calls, and the contents of the library change depending on what method is faster for syscall invocation on your CPU.

Even short explanation: it is a trick the kernel does to make programs work faster, and Linus is proud of it, even being a disgusting pig ;-)


8
Jan 09

Get Marked

If you are a Vim user (like me) you may be surprised to know (as I was today) that you can add jump marks to save positions in files and then go back to the marked positions used simple keystrokes:

  • With mX, where X is a letter, a mark will be set.
  • With 'X, Vim will take you to the line marked with mark X.

Easy, isn’t it? If you are curious, you can read more on this Linux.com article. And do not forget to configure a viminfo file to save marks between edit sessions and you will get the full mark-on-the-go feature pack :-D


6
Jan 09

Using boolean variables in Bash

Today I stumbled upon a weblog post by Mark Dominus on a “novel” way of using flag variables in shell code, mainly because I have been using that technique since my early days of shell programming. Let me introduce the syntax:

the_world_is_flat=true
# ...do something interesting...
if $the_world_is_flat ; then
  echo 'Be carefule not to fall off!'
fi

This example may look familiar to some of my readers, because in fact it is taken from the Bill tutorial. Some modules included in Bill use this kind of syntax extensively. Some care must be taken, because we are directly executing the contents of a variable in the if clause, so you would not better use this with values entered by the user, but I find very convenient to directly expand and evaluate true and false from variables when they come from “trusted” code.

I learned this trick several years ago from my friend Andrés when we were working together. I do not know when did he learn this syntax, but I am sure that the thing is not as new as it sounds.

Oops, almost forgot: have a nice 2009!