posted on 07:53 AM on Tuesday 21 October 2014
Pauline was complaining of internet connectivity issues at home which was rather random and prolonged. Each time, connectivity would drop for an hour or 2 and then it would suddenly work without intervention. This is really strange and has happened in the past but it was not common. It appears to be more frequent recently or it could be that Pauline is at home more often and notices it. So I wrote a small naive Python script to ping Google and placed that in the crontab to run every five minutes. The following is the script if it helps anyone.
#!/usr/bin/env python
import urllib2
import datetime
try:
r = urllib2.urlopen("http://www.google.com")
outfile = open("/home/bernett/google_ping.txt", "a")
outfile.write("%s - HTTP code %s\n" % (datetime.datetime.now().strftime("%Y%m%d %H:%M:%S"), r.getcode()))
outfile.close()
except:
outfile = open("/home/bernett/google_ping.txt", "a")
outfile.write("%s - %s\n" % (datetime.datetime.now().strftime("%Y%m%d %H:%M:%S"), "ERROR - failed to connect to Google"))
outfile.close()
Kids on the Vespa again (02:23 PM on Wednesday 22 October 2014)
Esther's weird fish ball cracker (11:30 AM on Sunday 19 October 2014)
Asus router QoS (08:18 PM on Monday 27 October 2014)
Migrated to MySQL (09:01 PM on Saturday 07 December 2019)
Multiple connection command line downloader (10:38 PM on Thursday 12 December 2013)
SSL on the web server (update) (12:00 PM on Friday 29 August 2008)
ASF streaming audio on the macs (07:41 PM on Friday 09 November 2007)