Recently, I was trying to move some stuff from RCS to mercurial. There does not seem to exist a converter and since it was only a few revisions, I decided to do it by hand. The problem arose how to set the commit date manually and google yielded a nice blog post that answered my question (refering to the formidable but less searchable hgbook).
Continue reading
Category: English
Posts that contain some English.
Makefiles for LaTeX
This entry was originally submitted to Debian Package of the day, but rejected because make is well known.
Figure 1:The file
In
is used to produce InterM
that is itselfused to produce
Out
. Therefore Out
depends directly on InterM
and indirectly on In
.I agree that most programmers and administrators know GNU make. Sadly, it is ignored by most others. GNU make
solves a very common problem that everyone faces when processing more than one file with more than one programm. It keeps track which file has been changed and which files have to be regenerated.
Constantize in Python
Rails offers a nice function called constantize
. It is easy to rebuild this (to some extend) in python. But the price is too high.
Continue reading
Automatic encryption of home directories using TrueCrypt 6.0a
This post describes how to encrypt the home directory of your users on GNU Linux with the help of TrueCrypt and PAM using the login-password as encryption key.
I wrote about Automatic encryption of home directories using TrueCrypt before. This time we’ll use TrueCrypt 6.0a which is a bit different from 4.3a used last time. Futhermore we’ll use Ubuntu 8.04 Hardy Heron instead of Debian Etch. For convenience this post will be selfcontained (ie. I copy redundant parts from the old one).
Continue reading
Constantize with Care
The String#constantize
method is a feature that makes rails fun to code with. This method converts a string to the constant that the string contains (or throws a NameError
if there is no such constant). It makes it easy to store class-types in databases as strings and to code controllers that work with classes of the same duck type.
Most people know that eval
on user data is dangerous, but noboddy seems to care about constantize
. Beware, it is also dangerous and you should constantize with care!
Continue reading
Avoiding Shell Injection in Ruby, Python and PHP.
I recently found a shell injection bug in some Ruby-gem I use.
Shell injections have scared me for a long time and I usually prefer to whitelist certain characters/patterns rather than to blacklist. This means that the system fails to the save side. Unfortunally it usually does fail – my whitelisting is to rigorous and data that would not cause any problems gets rejected. So I decided to take the opportunity to investigate how to prevent shell injection in my favorite scripting language (Python), the language I found the problem in and finally the language that I can not avoid (PHP).
Mysql::Error: Deadlock found when trying to get lock
In one of my rails-projects we had problems with deadlocks during transactions:
"A ActiveRecord::StatementInvalid occurred in ...: Mysql::Error: Deadlock found when trying to get lock "
Automatic encryption of home directories using TrueCrypt
Having your private data on a laptop is dangerous, since it might be stolen. The only way to protect your data is to encrypt it. This post describes how to encrypt the home directory of your users on GNU Linux with the help of TrueCrypt and PAM. For convenience the login-password is used as encryption key. Continue reading
NoArchive-Tag for Robots-Meta
I tweaked the robots-meta plugin by Joost de Valk for WordPress to support the noarchive tag. This prevents google and archive.org from providing cached versions of your blog.
I’ve put up a mercurial repo with my version at http://www.littleimpact.de/hg/robots-meta-hg/.