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:
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; |
class CountingResourceHandler extends ResourceHandler { | |
int req_count=0; | |
MqttClient client; | |
public CountingResourceHandler() { | |
super(); | |
} | |
@Override |
// 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; |
/* | |
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 }; |
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) { |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
I hereby claim:
To claim this, I am signing this object:
# 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 |
###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791
For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt
file dtoverlay=dwc2
on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh
in the SD card as well. By default SSH is
from flask import Flask | |
from flask import render_template | |
from flask import request | |
import os | |
from urllib.parse import urlparse | |
import json | |
import psycopg2 | |
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT |