Skip to content

Instantly share code, notes, and snippets.

@pisatoshi
pisatoshi / es_banner.sh
Created September 16, 2014 05:35
Elasticsearch banner
#!/bin/sh
# 567
# 2345678901
# 2345678901
# 1234567890123
# 45 9012345678901
# 345678 901234567890123
# 2345678901 78901234567890123
# 12345678901234 78901234567890123456789
# 12345678901234567890123456789012345678901
@pisatoshi
pisatoshi / subscribe.js
Created March 4, 2014 16:33
MQTT subscribe example
var mqtt = require('mqtt');
var client = mqtt.createClient(61613, { username: 'admin', password: 'password' });
client.subscribe('test1/#');
client.on('message', function() {
console.log(arguments);
});
@pisatoshi
pisatoshi / publish.js
Created March 4, 2014 16:32
MQTT publish example
var mqtt = require('mqtt');
var client = mqtt.createClient(61613, { username: 'admin', password: 'password' });
setInterval(function() {
client.publish('test1/111/222');
client.publish('test1/111/222', 'foo');
client.publish('test1/111/222', Date.now().toString());
}, 1000);