Spammers apparently love Trac. After trying to fight spam tickets and later installing the SpamFilter plugin, I’ve managed to control spam tickets in the Open Yahtzee Trac site. But now spammers have started spamming the ticket comments. The bad news is that Trac (at least in version 0.11) doesn’t have built-in facilities to completely remove ticket comments.
Month: May 2010
Audio-Based True Random Number Generator POC
A few days ago, I came up with an idea to create a true random number generator based on noise gathered from a cheap microphone attached to my computer. Tests showed that when sampling the microphone, the least significant bit behaves pretty randomly. This led me to think it might be a good source for gathering entropy for a true random number generator.
Continue reading Audio-Based True Random Number Generator POC
Python’s base64 Module Fails to Decode Unicode Strings
If you’ve got a base64 string as a unicode object and you try to use Python’s base64 module with altchars set, it fails with the following error:
TypeError: character mapping must return integer, None or unicode
This is a pretty unhelpful error message. It also occurs if you try any method that indirectly uses altchars. For example:
base64.urlsafe_b64decode(unicode('aass'))
base64.b64decode(unicode('aass'),'-_')
Both fail, while the following works:
base64.urlsafe_b64decode('aass')
base64.b64decode(unicode('aass'))
While it’s not complicated to fix (just convert any unicode string to an ascii string), it’s still annoying.
