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 now has it's own homepage at http://imapclient.freshfoo.com/.


disqus-import.py

A quick hack to import [http://pyblosxom.sourceforge.net/ PyBlosxom] comments into the [http://disqus.com/overview/ Disqus Comments] API.

See the instructions and parameters at the top of file.

Download: [http:/downloads/disqus-import.py disqus-import.py]


rst_break - PyBlosxom plugin

This plugin allows the rst (reStructured Text) and readmore plugins to work together. It defines a reST "break" directive which will trigger the readmore plugin's breakpoint functionality. See the documentation at the top of the file for more information.

Download: [http:/hg/pyblosxom-plugins/trunk/raw-file/9afdcd2bf738/rst_break/rst_break.py rst_break.py] (version 0.1)

The Mercurial repo can be found at http://freshfoo.com/repos/pyblosxom-plugins/trunk/ (also web [http://freshfoo.com/hg/pyblosxom-plugins/trunk/ browseable]).


draftsdir - PyBlosxom plugin

This simple plugin allows you to define a directory under your datadir that contains draft blog entries. Draft entries will not be displayed on the blog by default. To display drafts add a 'drafts' query parameter to the end of the page URL. For example:

    http://my.site.com/blog/?drafts
    http://my.site.com/blog/?other=arg&drafts

Installation and configuration information is at the top of draftsdir.py.

Download: [http:/downloads/draftsdir.py draftsdir.py] (version 0.1)

The Mercurial repo can be found at http://freshfoo.com/repos/pyblosxom-plugins/trunk/ (also web [http://freshfoo.com/hg/pyblosxom-plugins/trunk/ browseable]).


spamquestion - PyBlosxom plugin

spamquestion is a simple [http://pyblosxom.sourceforge.net/ 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 [http://en.wikipedia.org/wiki/Captcha CAPTCHA] based anti-spam systems, this approach does not disadvantage visually impaired users and works even in text only browsers.

Download: [http:/downloads/spamquestion.py spamquestion.py] (version 0.2)

The Mercurial repo can be found at http://freshfoo.com/repos/pyblosxom-plugins/trunk/ (also web [http://freshfoo.com/hg/pyblosxom-plugins/trunk/ browseable]).


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: [http:/projects/ssh-agent-applet/ssh-agent-applet-0.1.tar.bz2 tar.bz2] [http:/projects/ssh-agent-applet/ssh-agent-applet-0.1-1.src.rpm SRPM] [http:/projects/ssh-agent-applet/ssh-agent-applet-0.1-1.noarch.rpm RPM (built on Fedora Core 5)]

The Mercurial trunk is http://freshfoo.com/repos/ssh-agent-applet/trunk/. Branches are browseable at http://freshfoo.com/hg/ssh-agent-applet/.


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: [http:/downloads/trackmix.py 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 [http://www.feedparser.org Univeral Feed Parser], [http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup] and [http://www.dalkescientific.com/Python/PyRSS2Gen.html 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 [http://nvd.nist.gov/download.cfm RSS and XML feeds].

Download: [http:/downloads/cert2rss.py cert2rss.py]

CodeIndex (last edited 2010-01-30 15:11:52 by MennoSmits)