This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import os | |
import time | |
""" | |
Writing from Spark to S3 is ridiculously slow. This is because S3 is an object | |
store and not a file system. Because of consistency model of S3, when writing | |
Parquet (or ORC) files from Spark. Data will be stored to a temporary destination | |
then renamed when the job is successful. As S3 is an object store, renaming files | |
is very expensive (complete rewrite). The Spark job will only terminate when all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Copyright (c) 2013-2016 Beebotte <[email protected]> | |
# This program is published under the MIT License (http://opensource.org/licenses/MIT). | |
############################################################ | |
# This code uses the Beebotte API, you must have an account. | |
# You can register here: http://beebotte.com/register | |
############################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* to compile this code | |
* cc -g -o subscriber subscriber.c -lpaho-mqtt3cs -lpthread | |
**/ | |
#include "stdio.h" | |
#include "stdlib.h" | |
#include "string.h" | |
#include "MQTTClient.h" | |
// set protocol to ssl and port number to 8883 to use encryption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp ../../src/MQTTClient.c . | |
sed -e 's/""/"MQTTLinux.h"/g' ../../src/MQTTClient.h > MQTTClient.h | |
gcc sub.c -I ../../src -I ../../src/linux -I ../../../MQTTPacket/src MQTTClient.c ../../src/linux/MQTTLinux.c ../../../MQTTPacket/src/MQTTFormat.c ../../../MQTTPacket/src/MQTTPacket.c ../../../MQTTPacket/src/MQTTDeserializePublish.c ../../../MQTTPacket/src/MQTTConnectClient.c ../../../MQTTPacket/src/MQTTSubscribeClient.c ../../../MQTTPacket/src/MQTTSerializePublish.c -o sub ../../../MQTTPacket/src/MQTTConnectServer.c ../../../MQTTPacket/src/MQTTSubscribeServer.c ../../../MQTTPacket/src/MQTTUnsubscribeServer.c ../../../MQTTPacket/src/MQTTUnsubscribeClient.c | |
gcc pub.c -I ../../src -I ../../src/linux -I ../../../MQTTPacket/src MQTTClient.c ../../src/linux/MQTTLinux.c ../../../MQTTPacket/src/MQTTFormat.c ../../../MQTTPacket/src/MQTTPacket.c ../../../MQTTPacket/src/MQTTDeserializePublish.c ../../../MQTTPacket/src/MQTTConnectClient.c ../../../MQTTPacket/src/MQTTSubscribeClient.c ../../../MQTTPacket/src/MQTTSerializeP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////// | |
// Copyright (c) 2013-2014 Beebotte <[email protected]> | |
// This program is published under the MIT License (http://opensource.org/licenses/MIT). | |
// | |
// This code uses the Beebotte API, you must have an account. | |
// You can register here: http://beebotte.com/register | |
// | |
// This program measures the latency of Beebotte real time service. | |
// | |
// Use the NuGet package manager console install dependencies: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding: utf8 | |
############################################################ | |
# This code uses the Beebotte API, you must have an account. | |
# You can register here: http://beebotte.com/register | |
############################################################ | |
import sys | |
import os | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
############################################################ | |
# This code uses the Beebotte API, you must have an account. | |
# You can register here: http://beebotte.com/register | |
############################################################ | |
import time | |
import Adafruit_DHT | |
from beebotte import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mqtt = require('mqtt') | |
var crypto = require('crypto'); | |
//Creates a hash mac of a string | |
function sign (key, algo, str){ | |
var hmac = crypto.createHmac(algo, key); | |
hmac.setEncoding('base64'); | |
hmac.write(str); | |
// you can't read from the stream until you call end() | |
hmac.end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2013-2014 Beebotte <[email protected]> | |
// This program is published under the MIT License (http://opensource.org/licenses/MIT). | |
///////////////////////////////////////////////////////////// | |
// This code uses the Beebotte API, you must have an account. | |
// You can register here: http://beebotte.com/register | |
///////////////////////////////////////////////////////////// | |
var mqtt = require('mqtt') | |
var crypto = require('crypto'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2013-2014 Beebotte <[email protected]> | |
// This program is published under the MIT License (http://opensource.org/licenses/MIT). | |
///////////////////////////////////////////////////////////// | |
// This code uses the Beebotte API, you must have an account. | |
// You can register here: http://beebotte.com/register | |
///////////////////////////////////////////////////////////// | |
var mqtt = require('mqtt') | |
var crypto = require('crypto'); |
NewerOlder