Code
This page lists my software projects and smaller pieces of code that might be of use.
Any questions or feedback to <menno@freshfoo.com>.
IMAPClient
IMAPClient aims to be a easy-to-use, Pythonic and complete IMAP client library with no dependencies outside the Python standard library.
Features:
- Arguments and return values are natural Python types.
- IMAP server responses are fully parsed and readily usable.
- IMAP unique message IDs (UIDs) are handled transparently. There is no need to call different methods to use UIDs.
- Convenience methods are provided for commonly used functionality.
- Exceptions are raised when errors occur.
IMAPClient is currently at version 0.4.
To install from PyPI using EasyInstall:
easy_install IMAPClient
Alternatively download one of the source archives below and follow the directions in README.
spamquestion - PyBlosxom plugin
spamquestion is a simple PyBlosxom plugin that helps to prevent comment spam.
A randomly selected question is shown on the comment form for a blog entry. The user must answer the question correctly in order to submit a comment. The approach works because each blog will use it's own set of unique questions that are easy for a human to deal with but are virtually impossible for a computer to answer unaided. This prevents makes automated spambots ineffective.
Unlike CAPTCHA based anti-spam systems, this approach does not disadvantage visually impaired users and works even in text only browsers.
The spamquestion plugin is at version 0.2.
Download: spamquestion.py
ssh-agent-applet
ssh-agent-applet is a Gnome applet that allows you to conveniently keep your ssh key(s) on external media. This means that if your computer is cracked or stolen, the attacker will not have a copy of private ssh key(s).
Using ssh-agent-applet, your keys are loaded into ssh-agent as soon as you insert your "key drive" into a USB port. The drive is automatically unmounted once the key loaded so you can remove it from the USB port immediately.
For developers, ssh-agent-applet is an example of how to write Gnome applets in Python and how to interface with HAL from Python using DBUS.
ssh-agent-applet is currently at version 0.1.
Download: tar.bz2 SRPM RPM (built on Fedora Core 5)
trackmix.py
An example of how to mix 2 arbitrary audio files over the top of each other in real time. This isn't terribly useful by itself but should help people out who are struggling with the lack of GStreamer documentation out there. It demonstrates how to load arbitrary audio files and perform mixing of multiple audio sources.
Download: trackmix.py
cert2rss.py
cert2rss.py is a Python hack that converts the US-CERT Security Bulletin summaries feed into a feed were each entry in the summary is it's own RSS entry. This makes the feed far more useful (albeit somewhat larger). Requires Univeral Feed Parser, Beautiful Soup and PyRSS2Gen.
This script no longer works and is deprecated. The HTML that the script was scraping has changed and is now so bad that it is very difficult to pull useful data out of. I have no intention of maintaining this script any further but it will remain available for download.
The instance of the feed hosted here has been disabled.
For alternate sources of similar information see the National Vulnerability Database RSS and XML feeds.
Download: cert2rss.py