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’ »

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’ »