Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🔨
Fixing code things with finger hammers.

Andy Piper andypiper

🔨
Fixing code things with finger hammers.
View GitHub Profile
@andypiper
andypiper / start.sh
Created May 31, 2012 14:58
start wrapper for IBM ia92 MQTT client on OS X
#!/bin/sh
java -Dapple.laf.useScreenMenuBar=true -Dswing.defaultlaf=com.apple.laf.AquaLookAndFeel -Xdock:name="WMQTT Utility" -Xdock:icon=mqtticon-vlarge.png -jar wmqttSample.jar
@andypiper
andypiper / amqpget.php
Created June 25, 2012 12:46
RabbitMQ test scripts
<?php
$cnn = new AMQPConnection();
$cnn->setLogin("guest");
$cnn->setPassword("guest");
$cnn->setHost("localhost");
if ($cnn->connect()) {
echo "Established a connection to the broker\n";
}
@andypiper
andypiper / _vmc
Last active December 14, 2015 01:49
zsh plugin for vmc (pre-ng version) based on the brew zsh plugin, delete the stuff towards the end. install to .oh-my-zsh/custom/vmc and enable in .zshrc
#compdef vmc
#autoload
# vmc autocompletion for oh-my-zsh
# requires: the vmc gem (gem install vmc)
# author: Andy Piper (http://andypiper.co.uk)
_list_apps() {
for APP in `vmc apps | grep -oE '^\| [[:alnum:]-]+ . ' | grep -oE '[[:alnum:]-]+'`; do
compadd "$@" $APP
@andypiper
andypiper / main.lua
Created March 26, 2013 19:38
Sample using Eclipse Mihini and Paho to read modbus values from an Arduino attached to a Raspberry Pi and publish them over MQTT
require 'sched'
require 'shell.telnet'
-- Start a telnet server on port 1234
-- Once this program is started , you can start a Lua VM through telnet
-- using the following command: telnet localhost 1234
local function run_server()
shell.telnet.init {
address = '0.0.0.0',
port = 1234,
@andypiper
andypiper / RadioLCD.py
Created May 9, 2013 17:16
Read BBC Radio livetext from MQTT and display on LCDsysinfo (http://coldtearselectronics.wikispaces.com/USB+LCD+-+LCD+System+info)
#!/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):
lines = textwrap.wrap(msg.payload, width=20)
@andypiper
andypiper / DBparms
Created June 21, 2013 15:00
TinyTinyRSS on Cloud Foundry
➜ Tiny-Tiny-RSS-1.8 cf logs tinytiny
Using manifest file manifest.yml
Getting logs for tinytiny #0... OK
Reading logs/env.log... OK
TMPDIR=/home/vcap/tmp
VCAP_APP_PORT=64299
VCAP_CONSOLE_IP=0.0.0.0
USER=vcap
@andypiper
andypiper / list-broker-topics.rb
Created June 26, 2013 11:01
Ruby script to list the topics known by an MQTT broker. These will be topics with retained messages published.
#!/usr/bin/env ruby
require 'rubygems'
require 'mqtt'
MQTT::Client.connect('localhost',1883) do |client|
client.get('#') do |topic,message|
puts "#{topic}: #{message}"
end
end
test make -C broker 07
./07-will-qos0.py
./07-will-null.py
./07-will-acl-denied.py
./07-will-null-topic.py
➜ test make -C broker 08
./08-ssl-connect-no-auth.py
./08-ssl-connect-no-auth-wrong-ca.py
1375717037: mosquitto version 1.1.90 (build date 2013-08-05 16:24:24+0100) starting
1375717037: Config loaded from 08-ssl-connect-no-auth-wrong-ca.conf.
mosquitto make
Scanning dependencies of target libmosquitto
[ 2%] Building C object lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o
[ 4%] Building C object lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o
[ 6%] Building C object lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o
[ 8%] Building C object lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o
[ 11%] Building C object lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o
[ 13%] Building C object lib/CMakeFiles/libmosquitto.dir/read_handle.c.o
[ 15%] Building C object lib/CMakeFiles/libmosquitto.dir/read_handle_client.c.o
[ 17%] Building C object lib/CMakeFiles/libmosquitto.dir/read_handle_shared.c.o
@andypiper
andypiper / .cfignore
Last active May 25, 2018 13:26
Run a reveal.js presentation on Cloud Foundry
# we can safely ignore all of this content
# use the nginx buildpack
# cf push --buildpack https://github.com/cloudfoundry-community/nginx-buildpack.git
.git
.gitignore
.sass-cache
.travis.yml
LICENSE
README.md
Gruntfile.js