Monthly Archives: April 2007

re.escape(): Python’s equivalent of PHP’s addslashes()

PHP has a very handy function addslashes which escapes, by prefixing backslashes, characters that can cause undesired effects in SQL queries (read SQL injection). Coding a login page in Python had me hard pressed to find something similar in Python to escape characters retrieved from login forms. I won’t say I searched across [...]

Python Classes: Old-style vs New-style

I ran into a bit of a problem, trying to use the new-style class syntax while calling a class that apparently only supports the old-class style syntax (thanks due to Brend on #python at irc.freenode.net for pointing that out). Look closely at the call to super() in the following code:
#!/usr/bin/python
# -*- set tabstop=4 -*-
import [...]

Backdoor PHP Shells and a small script to upload files.

Backdoor PHP shells are receiving a lot of attention from script kiddies. Unless you know what PHP backdoor shells do, they provide a web-based interface to execute shell commands on systems on which they have been maliciously setup.
A friend once asked me to write him a script to upload files from a server [...]

aterm, xterm, Eterm, rxvt, Konsole, oh my!

“Konsole” supports transparency, but it is slow (and most importantly for me, does not have the “fixed” fonts that xterm uses). “xterm” is cool, but I want transparency which it doesn’t have. “Eterm” is, again, slower than “xterm”, and though it does support backgrounds, you cannot, as far as I have explored it, [...]

Abstinence (Random Musings #21)

I have an overly sensitive stomach and digestive system. I really should refrain from eating most things that aren’t cooked at home. I know what happens when I do it, yet I persist, and wake up the next morning with an upset stomach and a foul mood. Sigh.

FreeBSD Hypertext Man Pages

This is a pretty nice HTML interface to man pages. I needn’t say more.