Skip to content

Instantly share code, notes, and snippets.

View codepope's full-sized avatar
:shipit:
London, Cor Blimey Guvn'r

Dj Walker-Morgan codepope

:shipit:
London, Cor Blimey Guvn'r
View GitHub Profile
@codepope
codepope / mycqlshmin.sh
Created March 9, 2017 11:59
Extract the minimum needed for cqlsh from scylla-tools-java
# Call as
#
# sh mycqlshmin.sh newdirname scylla-tools-java-dir
# Will make name directory, copy minimum files in for cqlsh to run
#
mkdir $2 $2/bin $2/lib
cp $1/bin/cqlsh $2/bin
cp -r $1/pylib $2
cp $1/lib/*.zip $2/lib

Keybase proof

I hereby claim:

  • I am codepope on github.
  • I am codepope (https://keybase.io/codepope) on keybase.
  • I have a public key whose fingerprint is 324F FC97 2C0F C5DF 399C 4114 3F1E 02F7 A16C 08DA

To claim this, I am signing this object:

@codepope
codepope / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@codepope
codepope / mqtt2mongo.js
Created February 6, 2014 16:28
A simple MQTT to MongoDB bridge for Node
var mqtt=require('mqtt');
var mongodb=require('mongodb');
var mongodbClient=mongodb.MongoClient;
var mongodbURI='mongodb://username:[email protected]:port/database';
var deviceRoot="demo/device/";
var collection,client;
mongodbClient.connect(mongodbURI,setupCollection);
function setupCollection(err,db) {
@codepope
codepope / mqtt_temp_read.ino
Created February 6, 2014 16:23
The Arduino/MQTT temperature reading program
/*
Sensor to MQTT basic example
*/
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
@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;
class CountingResourceHandler extends ResourceHandler {
int req_count=0;
MqttClient client;
public CountingResourceHandler() {
super();
}
@Override
@codepope
codepope / MqttHangman.java
Created October 3, 2013 12:15
Just a rough first hack at Hangman over MQTT... players should subscribe to hangman/result and publish their single character guesses to hangman/guess. A client for playing is left as an exercise for the reader
package org.eclipse.pahodemo;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException;