Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🛠️
tinkering

Andy Piper andypiper

🛠️
tinkering
View GitHub Profile
@andypiper
andypiper / get-cf.sh
Last active December 29, 2015 08:29
Downloads bleeding-edge Go CLI for Cloud Foundry
#!/bin/bash
if [ -f /usr/local/bin/cf ]
then
version=`/usr/local/bin/cf -v | cut -d " " -f 3`
echo 'Current version of cf installed is ' $version
fi
echo 'Downloading latest binary'
curl http://go-cli.s3.amazonaws.com/cf-darwin-amd64.tgz -o cf-darwin-amd64.tgz -s
echo 'Uncompressing...'
tar -xf cf-darwin-amd64.tgz
# Python sample to publish data to Aercloud
# uses mosquitto Python API
# see https://aeriscom.jira.com/wiki/display/DOCS/API+Reference#APIReference-MQTT
# Andy Piper @andypiper November 2013
import json
import mosquitto
# define callbacks
# Python sample to publish data to Aercloud
# uses mosquitto Python API
# see https://aeriscom.jira.com/wiki/display/DOCS/API+Reference#APIReference-MQTT
# Andy Piper @andypiper November 2013
import json
import mosquitto
# define callbacks
@andypiper
andypiper / PowerLCD.py
Created December 2, 2013 21:30
Show home power / temperature on LCDsysinfo display
#!/usr/bin/python
from pylcdsysinfo import BackgroundColours, TextColours, TextAlignment, TextLines, LCDSysInfo
import mosquitto
import textwrap
import sys
from time import sleep
def on_message(mosq, obj, msg):
if 'CC' in msg.topic:
@andypiper
andypiper / morse.ino
Last active December 31, 2015 03:38
"use mqtt" morse code flasher
// 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
int ledPin = 12;
char* letters[] = {
".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", // A-I
@andypiper
andypiper / wstest
Created January 28, 2014 12:46
Test MQTT over WebSocket with mows module
#!/usr/bin/env node
'use strict';
var nopt = require('nopt');
var url = require('url');
var mows = require('mows');
var opts = nopt({});
@andypiper
andypiper / firewall.sh
Last active January 15, 2016 21:34
Using MQTT with Google Compute Engine
gcutil addfirewall mqtt --description="MQTT allowed." --allowed="tcp:1883" --project="your-project"
@andypiper
andypiper / spring-int-error
Last active April 27, 2020 13:30
failure to launch
w12:05:56.217 [main] DEBUG o.s.core.env.StandardEnvironment - Initializing new StandardEnvironment
12:05:56.225 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
12:05:56.229 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
12:05:56.229 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
12:05:56.332 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@717a6926: startup date [Thu Feb 13 12:05:56 GMT 2014]; root of context hierarchy
12:05:56.333 [main] DEBUG o.s.c.a.AnnotationConfigApplicationContext - Bean factory for org.springframework.context.annotation.AnnotationConfigApplicationContext@717a6926: org.springframework.beans.factory.support.DefaultListableBeanFactory@18aaa1c3: defining beans [org.s
@andypiper
andypiper / nats-all.rb
Created February 17, 2014 16:25
Connect to NATS in bosh-lite and display all the messages received - thanks @drnic
#!/usr/bin/env ruby
require "nats/client"
NATS.start(:uri => "nats://nats:nats@10.244.0.6:4222") do
NATS.subscribe('>') { |msg, reply, sub| puts "Msg received on [#{sub}] : '#{msg}'" }
end
@andypiper
andypiper / largeapp
Created March 8, 2014 17:38
Large app containers on Pivotal Web Services
$ cf-scale-demo git:(master) ✗ cf push largeapp -m 6G
Updating app largeapp in org apiper-org / space development as apiper@gopivotal.com...
OK
Uploading largeapp...
Uploading from: /Users/andyp/Development/cloudfoundry/cf-scale-demo
7.2K, 24 files
OK
Stopping app largeapp in org apiper-org / space development as apiper@gopivotal.com...