Manage your inbox with imapfilter

I’ve been looking for something to manage my inbox, I already use procmail to file mails into folders as they arrive, but I end up with a lot of emails that need tidying up later. For example, I receive the weekly BBC 4 progamme guide email – after a week the programmes have been shown and the email is useless. Similarly eBay search alerts.

I was going to write my own mail filter in python, but then discovered imapfilter which is in the EPEL repositories for Centos/RHEL. It’s fantastic – you write your rules in lua (which is very straightforward, certainly more so than procmail’s custom language), set it to run in cron and off it goes. An example config file is below:


myaccount = IMAP {
server = 'localhost',
username = 'jp',
password = 'N0tmyrealpw',
ssl = 'tls12'
}
-- get seen messages from inbox older than 10 days
inboxmsgs = myaccount.INBOX:is_seen()
oldmsgs = inboxmsgs:is_older(10)
-- further filter from these senders
delmsgs = oldmsgs:match_from('.*(bbcfournewsletter|humblebundle|googlealerts|Transport_for_London|sourceforge).*')
delmsgs:delete_messages()
-- get old messages from shopping, ebay & cron folders
shopmsgs = myaccount['saved/shopping']:is_older(14) + myaccount['saved/ebaysearch']:is_older(3) +
myaccount['saved/cron']:is_older(14)
shopmsgs:delete_messages()

scp too slow? try bbcp

bbcp is an alternative to scp that for me was 6x faster – it uses ssh as a transport but uses parallel streams. You may need to open up some firewall ports. Do not use if you don’t want your network bandwidth saturated!

Example usage specifying an open port range on the remote server:

bbcp -z -Z 9160:9200 remoteserver.com:/remotefilename .

bbcp.

Fix your statusbar in Firefox 29+

Adds back the addon bar for Firefox with the Australis theme Firefox 29 and up.It aims to be a lightweight, yet fully functional replacement for the old Addon Bar.Great for power users who have many addons installed, and especially for long toolbar items.This also restores the status-bar area, so it works with extensions such as Status-bar Scientific Calculator and Version in Add-on bar. Plus, it adds a new feature that lets you move the status-bar around!

via The Addon Bar restored :: Add-ons for Firefox.

Tabs, Whitespaces, and Highlighting in Emacs – for the Python Programmer

If you’re a python programmer, you probably know all about the troubles mixing tabs and spaces can cause. I have searched far and wide, and have collected some really useful configurations for setting up the perfect Emacs configuration for Python.

What it does:

Insert spaces instead of tabs when indenting

Sets indent to 4 spaces when in python mode & SGML (superset of HTML) mode. This is useful for the web developers out there.

Highlight tabs and trailing whitespace (thanks to http://www.emacswiki.org/emacs/highlight-chars.el)

via Tabs, Whitespaces, and Highlighting in Emacs – for the Python Programmer.

Use browser forward / back keys to switch emacs buffers and frames

Put the below in your ~/.emacs:

;; make thinkpad browser keys navigate buffers
(setq w32-pass-multimedia-buttons-to-system nil)
(global-set-key (kbd "") 'next-buffer)
(global-set-key (kbd "") 'previous-buffer)
(global-set-key [C-XF86Forward] 'next-multiframe-window)
(global-set-key [C-XF86Back] 'previous-multiframe-window)

On my x220 this allows the browser forward & back keys (above right & left cursor keys) to be used to switch buffer and combined with ctrl to switch frame / window.