Scripts

“Spending 2 hours to accomplish in 2 seconds what could otherwise be done in 2 minutes.”

Encrypt email if possible

One feature I really wanted with the mutt mail reader was to automatically encrypt email to anyone I have an OpenPGP public key for. This simple script accomplishes just that, and can be easily included in any mutt configuration.

Gather flagged email

I store my email in Maildir format, in a variety of folders, and read it using the mutt mail reader. This setup worked well for me, except that there was no way for me to easily see all flagged messages regardless of folder. The script enables this by creating a dynamic folder with links to all flagged email.

File non-personal email

I find it useful to keep personal email separate from everything else I receive. This is a simple procmail rule which moves email from anyone not in my personal alias file into a different folder. This could be done more neatly with awk, but it has always worked perfectly so I’m leaving it be.

Readability is a program which decides which parts of a web page make up the core text, and rewrites the page to remove anything else. Unfortunately it was designed as a ‘bookmarklet,’ meaning that one must rely on external servers for its operation, with the speed, connectivity and privacy implications which that entails. I lightly reworked the code to remove some unnecessary functionality and ensure it can be easily used locally.

I also created a simple companion script which removes all links from a page. I used these in uzbl, with the command: chain 'script @scripts_dir/readability/js/readability.js' 'script @scripts_dir/remove-links.js'

This has been superceded by simplyread.

osCommerce Easy SEO URLs

osCommerce doesn’t have a robust plugin system, so it’s particularly important to me that any modifications I make to osCommerce installations are as simple and maintainable as possible. I found this contribution to rewrite urls, which nearly did what I needed. I fixed some serious bugs, added a few little features, and generally made it a little more robust. I am currently maintaining the releases, and (time-permitting) handling bug and feature requests.

Democracy Now! fetcher

The wonderful news programme Democracy Now! provide FLAC, Ogg Vorbis and MP3 files of all of their episodes, but only a RSS feed for the MP3s. This script downloads the latest episode, in FLAC, Ogg Vorbis or MP3 format. I use this from a cron job to automatically fetch new episodes in my prefered format.


Last updated: 2020-01-01