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
sudo apt-get update | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs | |
cd | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
exec $SHELL | |
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
const Twitter = require('twitter'); | |
const client = new Twitter({ | |
consumer_key: 'XYZ', | |
consumer_secret: 'XYZ', | |
access_token_key: 'XYZ-XYZ', | |
access_token_secret: 'XYZ' | |
}); | |
const params = { |
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
const elasticsearch = require('elasticsearch'); | |
const mqtt = require('mqtt'); | |
const chalk = require('chalk'); | |
const jsonSize = require('json-size'); | |
const ProgressBar = require('ascii-progress'); | |
const memwatch = require('memwatch-next'); | |
const os = require('os'); | |
const INDEX = 'mqtt', | |
TYPE = 'eclipse', |
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
const mqtt = require('mqtt'); | |
const ES = require('esta'); | |
const INDEX = 'mqtt', | |
TYPE = 'eclipse'; | |
let counter = 0, | |
errors = 0; | |
ES.CONNECT(INDEX, () => { |
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
Server : mqtt://iot.eclipse.org | |
Time : 2016-12-22T18:36:12.101Z | |
Messages: 178.51666666666668 per second | |
Average topic size: 28.958920735692278 bytes | |
Average payload size: 121.65670805713752 bytes | |
Date size: 24 bytes | |
Total time: 60.289 seconds | |
------------------ | |
Server : mqtt://test.mosquitto.org | |
Time : 2016-12-22T18:38:14.669Z |
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
const mqtt = require('mqtt'); | |
const ES = require('esta'); | |
const INDEX = 'mqtt', | |
TYPE = 'eclipse'; | |
ES.CONNECT(INDEX, function(response) { | |
// When DB is on => connect to mqtt | |
const client = mqtt.connect('mqtt://iot.eclipse.org'); |
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
const mqtt = require('mqtt'); | |
const client = mqtt.connect('mqtt://iot.eclipse.org'); | |
let start = null, | |
count = 0, | |
topicAverage = 0, | |
payloadAverage = 0; | |
const topics = [], | |
payloads = []; |
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
#!/bin/bash | |
timestamp() { | |
date +"%T" | |
} | |
if (( RANDOM % 2 )) | |
then | |
cd /path/to/directory/ |
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 datetime | |
import os | |
#crontab -e | |
#0 12 * * * /usr/bin/python /path/to/file.py > /path/to/log.txt | |
with open('/path/to/file.txt', 'a') as file: | |
file.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"\n") | |
print "run ssh" |
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 datetime | |
import os | |
import sqlite3 | |
import warnings | |
import glob | |
import requests | |
warnings.filterwarnings("ignore", category=UnicodeWarning) |