Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
@symm
symm / composer.json
Created April 13, 2015 21:29
Github Label Manager
{
"require": {
"guzzlehttp/guzzle": "~5.2"
}
}
#!/bin/bash
POWERDNS_API_KEY="XXX"
POWERDNS_API_URL="http://x.x.x.x:8081"
POWERDNS_ZONE="example.com"
DNS_NAME="foo.example.com"
DNS_TTL="120"
SERVICE_IP="1.2.3.4"
curl --silent -X PATCH --data '{"rrsets":[{"name":"'$DNS_NAME'","type":"A","changetype":"REPLACE","records":[{"name":"'$DNS_NAME'","type":"A","content":"'$SERVICE_IP'","ttl":'$DNS_TTL',"priority":0,"disabled":false}]}]}' -H 'X-API-Key: '$POWERDNS_API_KEY'' $POWERDNS_API_URL/servers/localhost/zones/$POWERDNS_ZONE > /dev/null
@symm
symm / ee-data-usage.rb
Last active August 29, 2015 14:25
A little script for showing the remaining data allowance on EE data SIM
#!/usr/bin/env ruby
require 'mechanize'
require 'filecache'
cache = FileCache.new("data-usage", "/tmp", 60 * 30, 3)
unless cache.get('usage').nil?
puts cache.get('usage')
exit 0
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
https://www.raspberrypi.org/magpi-issues/MagPi01.pdf
https://www.raspberrypi.org/magpi-issues/MagPi02.pdf
https://www.raspberrypi.org/magpi-issues/MagPi03.pdf
https://www.raspberrypi.org/magpi-issues/MagPi04.pdf
https://www.raspberrypi.org/magpi-issues/MagPi05.pdf
https://www.raspberrypi.org/magpi-issues/MagPi06.pdf
https://www.raspberrypi.org/magpi-issues/MagPi07.pdf
https://www.raspberrypi.org/magpi-issues/MagPi08.pdf
https://www.raspberrypi.org/magpi-issues/MagPi09.pdf
https://www.raspberrypi.org/magpi-issues/MagPi10.pdf
@symm
symm / unix
Last active July 3, 2016 10:14 — forked from xero/unix
curl -L git.io.unix
,_ ,_==▄▂
, ▂▃▄▄▅▅▅▂▅¾. / /
▄▆<´ "»▓▓▓%\ / / / /
,▅7" ´>▓▓▓% / / > / >/%
▐¶▓ ,»▓▓¾´ /> %/%// / /
▓▃▅▅
#! /bin/sh
upSeconds=`/usr/bin/cut -d. -f1 /proc/uptime`
secs=$(($upSeconds%60))
mins=$(($upSeconds/60%60))
hours=$(($upSeconds/3600%24))
days=$(($upSeconds/86400))
UPTIME=`printf "%d days, %02dh %02dm %02ds " "$days" "$hours" "$mins" "$secs"`
echo "\033[0;32m
.~~. .~~. \033[0;37m`date +"%A, %e %B %Y, %R"`\033[0;32m
diff --git a/utils/nfc-mfclassic.c b/utils/nfc-mfclassic.c
index 1242886..8d9c6f0 100644
--- a/utils/nfc-mfclassic.c
+++ b/utils/nfc-mfclassic.c
@@ -431,8 +431,8 @@ write_card(int write_block_zero)
}
} else {
// The first block 0x00 is read only, skip this
- if (uiBlock == 0 && ! write_block_zero && ! magic2)
- continue;
@symm
symm / Makefile
Created November 5, 2016 14:17
avrfid
# Hey Emacs, this is a -*- makefile -*-
# AVR-GCC Makefile template, derived from the WinAVR template (which
# is public domain), believed to be neutral to any flavor of "make"
# (GNU make, BSD make, SysV make)
MCU = attiny85
FORMAT = ihex
TARGET = avrfid
Anti Hijack Feature
1. Turn on ignition until the dash lights come on but don't start engine!
2. Lock the door using the lever on the door handle and then unlock 3 Times
3. Turn off ignition
4. Repeat 2 but with ignition OFF