Skip to content

Instantly share code, notes, and snippets.

Andrew Elwell Elwell

Block or report user

Report or block Elwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Elwell
Elwell / transmission-stats.py
Created Jan 27, 2012
Transmission statisics via RPC/json/python
View transmission-stats.py
#!/usr/bin/python
# ideas lifted from bash collectd Plugin to monitor transmission-daemon traffic
# Written by Yarek T, however that was old and didn't play nice :-)
# Andrew Elwell. Jan 2012
from urllib2 import Request, urlopen, URLError, HTTPError
import json
# see https://trac.transmissionbt.com/browser/trunk/extras/rpc-spec.txt
@Elwell
Elwell / mq_apc.py
Created Feb 9, 2012
apcaccess (APCupsd) to MQTT python script
View mq_apc.py
#!/usr/bin/python
# Script to poll the UPS (via apcupsd) and publish interesting facts to
# MQTT.
# Published under GPL3+ by Andrew Elwell <Andrew.Elwell@gmail.com>
import subprocess
# we use mosquitto for the MQTT part
@Elwell
Elwell / apc2pacube.py
Created Feb 24, 2012
apcaccess (APCupsd) to Pachube python script
View apc2pacube.py
#!/usr/bin/python
# Script to poll the UPS (via apcupsd) and publish interesting facts to
# pachube. You'll need to alter FEED_ID and insert your API key
# Published under GPL3+ by Andrew Elwell <Andrew.Elwell@gmail.com>
import subprocess # we scrape apcaccess output
import requests # CBA writing a pachube library
@Elwell
Elwell / tagit.sh
Created Mar 5, 2012
Script to geotag single images from command line
View tagit.sh
#!/bin/sh
#
# Copyright (C) 2010 Alexander Heinlein
# This program is free software blah GNU GPL version 3+ blah.
#
set -e
decimal_to_sexagesimal()
{
@Elwell
Elwell / mqtt_publish.ino
Created Apr 23, 2012
test MQTT flood-publish (wanted as fast as poss sending)
View mqtt_publish.ino
#include <NanodeUNIO.h>
#include <NanodeUIP.h>
#include <NanodeMQTT.h>
NanodeMQTT mqtt(&uip);
struct timer my_timer;
void setup() {
byte macaddr[6];
NanodeUNIO unio(NANODE_MAC_DEVICE);
View gist:3009947
#!/usr/bin/python
# script to parse out the metadata from soma fm and send to mqtt
xmlurl = 'http://api.somafm.com/channels.xml'
from lxml import etree
tree = etree.parse(xmlurl)
interesting = ('title','description','image','twitter','listeners','dj')
View somaxml2mqtt.py
#!/usr/bin/python
# script to parse out the metadata from soma fm and send to mqtt
xmlurl = 'http://api.somafm.com/channels.xml'
mqtt_broker = 'nowplaying.elwell.org.uk'
import mosquitto
import collections
import time
@Elwell
Elwell / get_vk6.py
Last active Dec 14, 2015
Query to get VK6 callsigns from the ACMA
View get_vk6.py
#!/usr/bin/python
# Script to gather callsigns from http://web.acma.gov.au/pls/radcom/register_search.search_dispatcher
import urllib2
import csv
from bs4 import BeautifulSoup
todo = None
base ='http://web.acma.gov.au'
@Elwell
Elwell / gist:5145625
Created Mar 12, 2013
Peering wierdness between AS24904 and AS13030
View gist:5145625
$ traceroute -a zurich.aprs2.net
traceroute to zurich.aprs2.net (213.144.138.93), 64 hops max, 52 byte packets
1 [AS28513] router (192.168.1.1) 1.596 ms 0.908 ms 0.774 ms
2 [AS24904] border1-sgp.kwaoo.net (178.250.215.254) 1.491 ms 1.817 ms 1.612 ms
3 [AS24904] border1-cixp.kwaoo.net (178.250.208.6) 1.733 ms 1.857 ms 1.636 ms
4 [AS513] cixp.init7.net (192.65.185.193) 6.125 ms 2.067 ms 12.666 ms
5 [AS13030] r1qls1.core.init7.net (77.109.128.65) 2.762 ms 2.529 ms 13.410 ms
6 [AS13030] r1ber1.core.init7.net (77.109.128.181) 3.754 ms 3.736 ms 3.861 ms
7 [AS13030] r1zba1.core.init7.net (77.109.128.173) 6.119 ms 12.326 ms 4.891 ms
8 [AS13030] r1zlz1.core.init7.net (77.109.128.229) 4.996 ms 5.397 ms 13.835 ms
View ow_parsename.c.patch
diff -u -r1.220 ow_parsename.c
--- ../../..//owlib/src/c/ow_parsename.c 24 Jul 2012 01:47:31 -0000 1.220
+++ ../../..//owlib/src/c/ow_parsename.c 8 May 2013 14:39:46 -0000
@@ -343,11 +343,11 @@
return parse_nonreal;
} else if (strcasecmp(pathnow, "text") == 0) {
- pn->state |= ePS_json;
+ pn->state |= ePS_text;
return parse_first;
You can’t perform that action at this time.