Disabling upnp for specific hosts in dd-wrt / openwrt routers

The DCS-932LB1 webcam from D-Link is a very naughty webcam that pretends it has turned off upnp when it hasn’t. This is a security hole, opening up your webcam to the world and D-Link don’t seem to care. The best thing to do is disable upnp completely in your router, however you might need it. …

Continue reading ‘Disabling upnp for specific hosts in dd-wrt / openwrt routers’ »

emacs tip of the week #3: ido-switch-buffer

Hopefully you are already using ido or something similar to enhance emacs tab completion. I only use ido-switch-buffer ((ido-mode ‘buffer) in .emacs) as I dislike ido-find-file. What I don’t like is accidentally typing \C-x\C-b for buffer-menu-other-window (or whatever it is) when I meant \C-x b. So I put this in .emacs: (global-set-key “\C-x\C-b” ‘ido-switch-buffer)  

simple is better

Keeping things simple (and independent) is very important in my opinion. But since it is often faster (at the beginning), and especially needs much less thinking and experience to make things unnecessarily complex, that’s unfortunately what most people do… So, the purpose of this site is to show some “simple alternatives”β€”or at least some “things”, …

Continue reading ‘simple is better’ »

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.  

Monitoring packet loss on your home internet connection

Get a raspberry pi, install raspbian on it and put it on your home network Install smokeping (apt-get install smokeping) Configure smokeping (edit /etc/smokeping/config.d/Targets) so that at least one of the targets is a stable internet host (eg Google DNS 8.8.8.8). Restart View http://rasp-pi-ip/smokeping/smokeping.cgi Get sad results like the below πŸ™

Simple example of using the threading Timer class in python

[cc lang=”python”] #!/usr/bin/env python # simple example of threading.Timer in python import time, threading class Counter(object): def __init__(self, initial = 0, update_interval = 5): self.counter = initial self.update_interval = update_interval def inc(self): self.counter += 1 # Timer only runs once so call recursively in inc() threading.Timer(self.update_interval, self.inc).start() a = Counter() b = Counter(50, 10) c …

Continue reading ‘Simple example of using the threading Timer class in python’ »