Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🛠️
tinkering

Andy Piper andypiper

🛠️
tinkering
View GitHub Profile
@andysc
andysc / IPspeak.pl
Last active June 6, 2020 18:11
Speak the IP address of your linux machine. Perfect for Raspberry PIs or other headless servers with audio output. Just plug in a speaker or earphones and wait to be told the IP address to ssh to!
#!/usr/bin/perl
# IPspeak
# Andy S-C
# 18-May-13
# 15-Oct-16 - made more "human" ... ten dot nought dot one nine three dot seventeen
# this is the order we check the interfaces
@interfaces = ("eth0", "wlan0");
@adamvr
adamvr / t.js
Created June 5, 2013 14:22
Testing for mqttjs reconnection
var mqtt = require('./');
var client = mqtt.createClient();
client.on('connect', function() {
console.log('connected');
});
client.on('close', function() {
console.log('close, dcing:', client.disconnecting);
@zellio
zellio / fbterm-hacks.md
Last active June 26, 2025 20:18
fbterm, installation and configuration hacks

fbterm setup and config hacks

Installation and setup

Install fbterm via your favorite package manager

pacman -S fbterm
@Dakuan
Dakuan / Simple Twitter Auth
Created July 1, 2013 11:01
Authenticate with the Twitter API using OAuth and Node.js
var OAuth2 = require('OAuth').OAuth2;
var https = require('https');
var oauth2 = new OAuth2(KEY, SECRET, 'https://api.twitter.com/', null, 'oauth2/token', null);
oauth2.getOAuthAccessToken('', {
'grant_type': 'client_credentials'
}, function (e, access_token) {
console.log(access_token); //string that we can use to authenticate request
var options = {
@aras-p
aras-p / preprocessor_fun.h
Last active November 24, 2025 16:27
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@peplin
peplin / training.mkd
Created September 27, 2013 15:34
Ford APA OpenXC Training Sessions

OpenXC Introduction

Length: 1 hour

OpenXC is an API to your car - by installing a small hardware module to read and translate metrics from a car's internal network, the data becomes accessible from most Android applications using the OpenXC library. You can start making vehicle-aware applications that have better interfaces based on context, can minimize distraction while driving, are integrated with other connected services, and can offer you more insight into your car's operation. This session presents a high level introduction to the OpenXC platform appropriate for engineers, business, IT, marketing, etc. The presentation will explain what OpenXC is and what was the motivation for creating the project at Ford and for releasing it as open source hardware and software. The high-level architecture of OpenXC will be detailed (Android apps, an DIY-friendly vehicle interface and a standardized data format) and some basic vehicle data concepts explained (like the CAN bus and read vs. write capabilities). The

@kujohn
kujohn / portforwarding.md
Last active June 5, 2025 22:43
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@thiseldo
thiseldo / gist:7402637
Created November 10, 2013 19:25
A quick CurrentCost to Node-RED function to read each channel and split out to topic/payload. Next node could be to publish to a mqtt topic that has already been defined in this node.
var result = msg.payload;
try {
msg.topic="ccost/" + result.msg.sensor;
msg.payload = (result.msg.ch1[0].watts[0])*1;
return msg;
} catch( e )
{
// console.log("Looks like history data");
}
return null;
@tullyhansen
tullyhansen / gist:7621632
Last active October 10, 2022 13:11
Draft spec 0.3 for a bot taxonomy (see also http://i.imgur.com/bKXNQ0V.png) #botALLY
# Towards a Taxonomy of Twitter Bots
## Intro
- towards a definition - autonomous non-human agents on Twitter
- critical thinking - MECE, rabbit rule, holding hands
- patterns of behaviour, rather than content
- Twitter largely a textual medium
- crossover between two broadest categories (automated/event-driven), but largely one or the other (maybe?)
- some bots will exhibit both behaviours (active/reactive), but tend to favour one (most commonly, tweeters will also exhibit conversationalist behaviours)
@codepope
codepope / Morseduino
Last active December 31, 2015 03:48
// Morse Code - USE MQTT!
// based on a project from 30 Arduino Projects for the Evil Genius
// thanks to Simon Monk
// Andy Piper @andypiper, Nov 2013
// Dj @codepope, Dec 2013 (Putting it all in a for loop - Just change the message
char* message="use mqtt";
int ledPin = 12;