Skip to content

Instantly share code, notes, and snippets.

View conoro's full-sized avatar

Conor O'Neill conoro

View GitHub Profile
@conoro
conoro / gist:8430ec8753317883c2b7
Last active August 29, 2015 14:12
RC Car Control Receiver with simple 433MHz modules
// receiver.pde
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley ([email protected])
// Copyright (C) 2008 Mike McCauley
// $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
@conoro
conoro / gist:223035df942b72d2d2f6
Created January 4, 2015 18:25
RC Car Control Transmitter with simple 433MHz modules
// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley ([email protected])
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
@conoro
conoro / README.md
Last active August 29, 2015 14:15 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

Keybase proof

I hereby claim:

  • I am conoro on github.
  • I am conor (https://keybase.io/conor) on keybase.
  • I have a public key whose fingerprint is A22A 500F 5FEC 3633 9022 3439 654C 2A78 2D86 B677

To claim this, I am signing this object:

@conoro
conoro / build_win81_forms_app.cmd
Last active August 29, 2015 14:24
Build a Red Hat Mobile Windows 8.1 Forms App locally
:: Building a Red Hat Mobile Forms Apps for Windows 8.1
::
::
:: Install Git for Windows (https://git-scm.com/download/win)
:: Make sure your SSH Public Key has been uploaded to the Red Hat Mobile Application Platform Studio
:: Install node.js 0.10.x (https://nodejs.org/download/)
:: Install Cordova (npm install -g cordova)
:: Install Visual Studio 2013 (https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
:: See more info at http://cordova.apache.org/docs/en/4.0.0/guide_platforms_win8_index.md.html
:: See matching video at https://vimeo.com/130214184
@conoro
conoro / totp_google_authenticator_espruino_pico.js
Created July 22, 2015 08:21
Google Authenticator compatible fob on Espruino Pico
// This particular assembly of code from three sources by Conor O'Neill. None of it copyright me.
// This code copyright Brian Turek https://github.com/Caligatio/jsSHA https://github.com/Caligatio/jsSHA/blob/master/LICENSE
'use strict';(function(E){function t(c,a,e){var g=0,b=[],d=0,f,k,l,h,m,w,n,q=!1,r=!1,p=[],t=[],v,u=!1;e=e||{};f=e.encoding||"UTF8";v=e.numRounds||1;l=y(a,f);if(v!==parseInt(v,10)||1>v)throw Error("numRounds must a integer >= 1");if("SHA-1"===c)m=512,w=z,n=F,h=160;else throw Error("Chosen SHA variant is not supported");k=x(c);this.setHMACKey=function(a,b,d){var e;if(!0===r)throw Error("HMAC key already set");if(!0===q)throw Error("Cannot set HMAC key after finalizing hash");if(!0===u)throw Error("Cannot set HMAC key after calling update");
f=(d||{}).encoding||"UTF8";b=y(b,f)(a);a=b.binLen;b=b.value;e=m>>>3;d=e/4-1;if(e<a/8){for(b=n(b,a,0,x(c));b.length<=d;)b.push(0);b[d]&=4294967040}else if(e>a/8){for(;b.length<=d;)b.push(0);b[d]&=4294967040}for(a=0;a<=d;a+=1)p[a]=b[a]^909522486,t[a]=b[a]^15
@conoro
conoro / harp2hugo.go
Last active October 5, 2015 07:53
HarpJS to Hugo Blog Migrator
/*
This tool takes a blog built on Harp.js (http://harpjs.com/) with the Baseline
theme (https://github.com/rosshj/baseline) and converts it into something
usable by Hugo (https://gohugo.io/). It will not work out of the box for you,
as it has some customisations to deal with mixed trailing/non-trailing slashes
and mixed use of directories for posts. This is what happens when you go from
Posterous to WordPress to Harp to Hugo! I also changed the format of _data.json
to put all the posts in an array to make it easier to parse before running
this tool. But it should be very easy to modify everything to suit your needs.
Just run it in the directory with all the Markdown source.
@conoro
conoro / HugoFlatten.go
Created October 5, 2015 12:48
This tool takes a directory tree with directory names as <slug> and leaf files as index.md and changes it to a set of <slug>.md files for use in Hugo
/*
This tool takes a directory tree with directory names as <slug> and leaf files
as index.md and changes it to a set of <slug>.md files for use in Hugo
The MIT License (MIT)
Copyright (c) 2015 Conor O'Neill ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@conoro
conoro / rgbled-go.go
Created November 8, 2015 11:50
Control H801 Wifi RGB LED Controller from Go
package main
import (
"fmt"
. "github.com/hugozhu/rpi"
"net"
"time"
)
func CheckError(err error) {
@conoro
conoro / DoorBell_Scream_01.ino
Last active November 8, 2015 13:32
DoorBell Scream 01
// Extra Halloween code Conor O'Neill 2015
// Note there is a debounce error in here where the doorbell has to be pressed twice.
/***************************************************
This is an example for the Adafruit VS1053 Codec Breakout
Designed specifically to work with the Adafruit VS1053 Codec Breakout
----> https://www.adafruit.com/products/1381
Adafruit invests time and resources providing this open source code,