Archive for the ‘Python’ Category.

True is False

Usually I prefer to rant about the oddities of ruby but this time it's python.
Continue reading 'True is False' »

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 'Constantize in Python' »

Avoiding Shell Injection in Ruby, Python and PHP.

I recently found a shell injection bug in some Ruby-gem I use.

Shell injections scare me since 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).

Continue reading 'Avoiding Shell Injection in Ruby, Python and PHP.' »

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 'Automatic encryption of home directories using TrueCrypt' »