Skip to content

Instantly share code, notes, and snippets.

View hardillb's full-sized avatar
🚴‍♂️
Suitably Employed

Ben Hardill hardillb

🚴‍♂️
Suitably Employed
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hardillb on github.
  • I am hardillb (https://keybase.io/hardillb) on keybase.
  • I have a public key whose fingerprint is EDAC A275 E3DC AE15 2432 220F 74DD 0769 79AB B1E7

To claim this, I am signing this object:

@hardillb
hardillb / Sample flow
Created September 10, 2014 09:44
Tata F1 Timing flow
[{"id":"595f8cc.92912f4","type":"file in","name":"","filename":"/data/f1.xml","format":"utf8","x":319.08331298828125,"y":46.083335876464844,"z":"1c9784d4.222773","wires":[["a915baa2.9ecae"]]},{"id":"6a5d6db5.efe6b4","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":96.08332824707031,"y":46.083335876464844,"z":"1c9784d4.222773","wires":[["595f8cc.92912f4"]]},{"id":"8f7943ec.516408","type":"xml","name":"","x":535.0833129882812,"y":142.08334350585938,"z":"1c9784d4.222773","wires":[["d4cb38f5.69dbc"]]},{"id":"730d4af8.19591c","type":"debug","name":"","active":true,"console":"false","complete":"true","x":817.0833129882812,"y":45.083335876464844,"z":"1c9784d4.222773","wires":[]},{"id":"a915baa2.9ecae","type":"function","name":"","func":"var lines = msg.payload.split(\"\\n\");\nvar messages = [];\n\nfor (var i=0; i<lines.length; i++) {\n //deep copy the orginal message to ensure we don't loose any other fields\n var tmp = JSON.parse(JSON.stringify(ms
[{"id":"850a2c6d.e68098","type":"twilio-api","sid":"update-this","from":"+15005550006","name":"SMS out"},{"id":"2672a104.4e7d26","type":"inject","name":"","topic":"","payload":"helloWorld","payloadType":"string","repeat":"","crontab":"","once":false,"x":248.0833282470703,"y":266.9999771118164,"z":"9a815f24.3bf388","wires":[["e758f3a5.ccf1d8"]]},{"id":"e758f3a5.ccf1d8","type":"twilio out","twilio":"850a2c6d.e68098","number":"+4455555555","name":"SMS","x":433.0833282470703,"y":143.00000762939453,"z":"9a815f24.3bf388","wires":[]}]
@hardillb
hardillb / gen-secure-log.py
Created January 23, 2015 21:58
Generate /var/log/secure from systemd journald data. This is to try and get denyhosts working on Fedora 20
#!/usr/bin/env python
# {
# '_BOOT_ID': UUID('50a800f6-f77b-4110-a0bc-e5f16609d257'),
# '_SELINUX_CONTEXT': u'system_u:system_r:chkpwd_t:s0-s0:c0.c1023',
# '__REALTIME_TIMESTAMP': datetime.datetime(2015, 1, 18, 22, 42, 51, 62301),
# '__MONOTONIC_TIMESTAMP': (datetime.timedelta(0, 8300, 665432), UUID('50a800f6-f77b-4110-a0bc-e5f16609d257')),
# '_MACHINE_ID': UUID('6ffa4760-01ea-4a4d-96c3-560e48051718'),
# '_PID': 8774,
# 'SYSLOG_FACILITY': 10,
@hardillb
hardillb / helloWorld-gatt.js
Created February 6, 2015 16:59
Simple HelloWorld bleno iBeacon test app
var bleno = require('bleno');
var uuid = 'B9407F30F5F8466EAFF925556B57FE6D';
var major = 0;
var minor = 0;
var measuredPower = -59;
var data = new Buffer('HelloWorld');
bleno.on('stateChange', function(state) {
if (state === 'poweredOn') {
@hardillb
hardillb / gist:d17331c148128334eae0
Last active August 29, 2015 14:18
SensorTag debug log
Fri, 10 Apr 2015 09:27:18 GMT hci-ble hciBle = /opt/share/playing/node/temp/multi-sensortag/node_modules/sensortag/node_modules/noble-device/node_modules/noble/lib/linux/../../build/Release/hci-ble
Fri, 10 Apr 2015 09:27:18 GMT hci-ble buffer = "adapterState poweredOn\n"
Fri, 10 Apr 2015 09:27:18 GMT hci-ble line = adapterState poweredOn
Fri, 10 Apr 2015 09:27:18 GMT hci-ble adapterState = poweredOn
Fri, 10 Apr 2015 09:27:18 GMT noble stateChange poweredOn
Fri, 10 Apr 2015 09:27:18 GMT noble scanStart
Fri, 10 Apr 2015 09:27:18 GMT noble scanStart
Fri, 10 Apr 2015 09:27:18 GMT hci-ble buffer = "event 1C:BA:8C:20:CA:F3,public,020105,-59\n"
Fri, 10 Apr 2015 09:27:18 GMT hci-ble line = event 1C:BA:8C:20:CA:F3,public,020105,-59
Fri, 10 Apr 2015 09:27:18 GMT hci-ble address = 1C:BA:8C:20:CA:F3
@hardillb
hardillb / clock.html
Last active August 29, 2015 14:20
Esprino pico LED Strip clock prototype
<html>
<head>
<title>Clock test</title>
<style>
.segment {
padding: 2px;
width: 5px;
height: 5px;
border-style: solid;
border-width: 1px;
@hardillb
hardillb / MainActivity.java
Last active September 16, 2015 10:42
MQTT2BLE demo android app
package com.example.blemqtttest;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import com.example.blefuelmeter.R;
import android.app.Activity;
@hardillb
hardillb / NextCalEntry.java
Last active December 12, 2015 12:09
Set the RGB values for Blink(1)/Digispark+RGB according to the time to the next meeting in your Lotus Notes Calendar. Moving from green at 20min (or more) to red in the last 5 mins before a meeting. The light turns blue for the duration of the meeting.
package uk.me.hardill.notes;
/**
* NextCalEntry
*
* Sets the RGB values for Blink(1)/Digispark+RGB
* according to the time to the next meeting in
* your Lotus Notes Calendar
*
* This should be run with the JRE that ships with
@hardillb
hardillb / httprc
Created March 6, 2013 16:09
Quick script to look up http status codes on their wikipedia page ./httprc 200
#!/bin/sh
links http://en.wikipedia.org/wiki/HTTP_code#$1