Dynamic DNS updating in python with ipify

I’ve used free Dynamic DNS services to give my home machine a “static” address in the past but they either start charging or have poor performance. As I run my own external nameserver, why not use RFC 2136 to dynamically update the address based on the IP from ipify? So with some python scripting, that’s …

Continue reading ‘Dynamic DNS updating in python with ipify’ »

emacs tip of the week #2: elpy

I used to have a very complex .emacs config for python development, then I discovered elpy. It bundles together various python lisp modules cohesively, supports virtual environments, loading “project” files (via elpy-find-file), refactoring, running tests and so on. I’m not even tempted to use PyCharm much any more.  

VirusAction script for clamsmtp

I’ve recently configured my MTA to drop emails with embedded MS Office Macros (a very popular way of distributing malware). You can get the odd valid macro-enabled Office doc, so I’ve written a script to alert me when emails are dropped, it’s available on GitHub Configure in /etc/clamsmtpd.conf as below:

(other switches available, read …

Continue reading ‘VirusAction script for clamsmtp’ »

Commandline IMAP Mail check & Screen

I wanted a commandline IMAP mailbox checker so I wrote one: imapchkr Normal output for this is as below:

But I decided I wanted to embed it in my GNU screen hardstatus so expanded it to offer a short output option (imapchkr -s). See bottom left corner for output.

Configure your ~/.screenrc like …

Continue reading ‘Commandline IMAP Mail check & Screen’ »

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 …

Continue reading ‘Tabs, Whitespaces, and Highlighting in Emacs – for the Python Programmer’ »

mypy – A New Python Variant with Dynamic and Static Typing

Very interesting python development… drop in static typing. The mypy programming language is an experimental Python variant that aims to combine the benefits of dynamic or “duck” typing and static typing. Our goal is to have the expressive power and convenience of Python combined with compile-time type checking. The long-term goal is to also support …

Continue reading ‘mypy – A New Python Variant with Dynamic and Static Typing’ »