Skip to content

Instantly share code, notes, and snippets.

View Elwell's full-sized avatar

Andrew Elwell Elwell

View GitHub Profile
--- issue.item.html-orig 2011-03-20 00:24:03.049357938 +0800
+++ issue.item.html 2014-04-15 01:41:32.974950437 +0800
@@ -74,7 +74,16 @@
<tr>
<th i18n:translate="">Assigned To</th>
- <td tal:content="structure context/assignedto/menu">assignedto menu</td>
+ <td>
+ <select name="assignedto">
+ <option value="-1">- no selection -</option>
@Elwell
Elwell / log
Created May 11, 2014 13:21
nanode uip
#include <UIPEthernet.h>
EthernetClient client;
signed long next;
int led = 6;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
Serial.begin(115200);

Keybase proof

I hereby claim:

  • I am Elwell on github.
  • I am elwell (https://keybase.io/elwell) on keybase.
  • I have a public key whose fingerprint is 86FE 807B 075D 6A0E 9D02 A0DE B252 F8D8 F822 3247

To claim this, I am signing this object:

@Elwell
Elwell / gist:35dea60bf32e02ed9fcf
Created May 16, 2015 07:43
Arduino Ethernet to MQTT publisher
// Reed Switch to MQTT publisher for home
// Andrew Elwell, May 2015
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
byte mac[] = { 0x00, 0x04, 0xA3, 0x2C, 0x1D, 0xF1 };
byte server[] = { 10, 1, 1, 251 };
@Elwell
Elwell / publish.ino
Last active August 29, 2015 14:21
testcase for pubsubclient retained
// Reed Switch to MQTT publisher for home
// Andrew Elwell, May 2015
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
byte mac[] = { 0x00, 0x04, 0xA3, 0x2C, 0x1D, 0xF1 };
byte server[] = { 10, 1, 1, 251 };
@Elwell
Elwell / get_sunrise.py
Created May 22, 2015 14:43
Sunrise / Sunset calculation
andrew@mythic:~$ cat bin/get_sunrise.py
#!/usr/bin/python
# calculate sunrise/sunset times for location
# Andrew Elwell <Andrew.Elwell@gmail.com> 2013-09-02
import ephem
import ConfigParser
import paho.mqtt.client as mqtt
@Elwell
Elwell / planning
Last active August 29, 2015 14:22
Ideas for new Improved rotator control
Current "standard"
* 5500 or equivalent az/el rotator controller
* serial -> yaesu interface
* loadsa cables / boxes
New plan
* Keep the toggle switches from 5500 (nice n clunky) - even though a pair of centre off sprung would be more logical
* keep the analogue meters? 50mm height needed so >1u - UPDATE - No. Aim for 1U. Have a 2nd LCD display for Az/El current position
* Add in either LVB tracker or the arduino one http://ava.upuaut.net/?p=372
* Back panel - out with screw contacts and use something like http://www.altronics.com.au/connectors/pluggable-headers/?pins_3=6-pin
@Elwell
Elwell / init.lua
Created September 6, 2015 17:14
ESP-01 temp/humidity publishing
if wifi.sta.status() ~= 5 then tmr.alarm(6, 10000,0, function(d) dofile('init.lua') end) return end
if wifi.sta.status() == 5 then dofile('pub.lua') return end
@Elwell
Elwell / transmission-stats.py
Created January 27, 2012 15:14
Transmission statisics via RPC/json/python
#!/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 / tagit.sh
Created March 5, 2012 14:06
Script to geotag single images from command line
#!/bin/sh
#
# Copyright (C) 2010 Alexander Heinlein
# This program is free software blah GNU GPL version 3+ blah.
#
set -e
decimal_to_sexagesimal()
{