Skip to content

Instantly share code, notes, and snippets.

@jdrews
jdrews / ecobeeLogger.py
Created May 1, 2016
Grab temp and humidity from ecobee API and store in influxdb. Poll trigger via cron
View ecobeeLogger.py
import ecobee
from influxdb import InfluxDBClient
def logPoint(sensorName=None, sensorValue=None, sensorType=None):
return {
"measurement": sensorType,
"tags": {
"sensor": sensorName
},
"fields": {
@jdrews
jdrews / weatherLogger.py
Created May 1, 2016
Grab temp and humidity from forecast.io and store in influxdb. Poll trigger via cron
View weatherLogger.py
import forecastio
from influxdb import InfluxDBClient
client = InfluxDBClient(host='YOUR_IP',
port=8086,
database='YOURDB',
username='username',
password='password',
verify_ssl=False)
@jdrews
jdrews / tc-con
Last active Apr 21, 2016
tc-con: Manipulate Linux Kernel netem for simulation of high latency, low bandwidth, and high packet loss networks.
View tc-con
#!/bin/bash
#
# Script to reduce bandwidth rate and create network delay and packet loss on linux interfaces
# Can be placed on one interface (one server) or both interfaces (both servers).
#
# Simply run ./tc-con start to start it
# and ./tc-con stop to stop it.
# Run ./tc-con status to see if it's running.
#
# tc uses the following units when passed as a parameter.
@jdrews
jdrews / log-color
Last active Oct 24, 2015 — forked from jdanbrown/log-color
log4j logs in color!
View log-color
#!/bin/bash -eu
#
# Color log4j-style logs for easier visual parsing.
#
# Usage:
# tail foo.log | log-color
# run-service | log-color
export TERM=xterm-256color