An easy interface to use all of chartjs.org's charts.
Inspired by my own pain and suffering of trying to add a simple chart to dashing
Inspired by my own pain and suffering of trying to add a simple chart to dashing
Links and notes for ibeacon indoor location
##General links
##Trilatertion
| // Code based on | |
| // https://github.com/adafruit/DHT-sensor-library/blob/master/examples/DHTtester/DHTtester.ino | |
| // https://gist.github.com/igrr/7f7e7973366fc01d6393 | |
| // https://github.com/iot-playground/Arduino/blob/master/ESP8266ArduinoIDE/DS18B20_temperature_sensor/DS18B20_temperature_sensor.ino | |
| // esp8266 + dht22 + mqtt | |
| #include "DHT.h" | |
| #include <PubSubClient.h> | |
| #include <ESP8266WiFi.h> |
| #!/bin/bash | |
| set -eu | |
| main() { | |
| local args=("$@") | |
| local inFile=$(pwd)/docker-compose.yml | |
| local outFile=$(pwd)/$1 | |
| if [[ $# -lt 2 ]]; then | |
| usage |
| # Dockerfile for Node-RED - pulls latest master code from git | |
| # Use the node.js v4 LTS engine | |
| FROM node:4-slim | |
| MAINTAINER ceejay | |
| RUN mkdir -p /root/.node-red | |
| WORKDIR /root/.node-red | |
| # download latest stable node-red | |
| RUN npm install -g --unsafe-perm node-red |
| import csv | |
| import MySQLdb | |
| # open the connection to the MySQL server. | |
| # using MySQLdb | |
| mydb = MySQLdb.connect(host='igor.gold.ac.uk', user='co304so', passwd='*********', db='co304so_LondonCrime') | |
| cursor = mydb.cursor() | |
| csv_data = csv.reader(file('1.csv')) | |
| # execute and insert the csv into the database. | |
| for row in csv_data: | |
| cursor.execute('INSERT INTO AprilNov2013(Date,Westminster,HACKNEY,Tower_Hamlets)''VALUES(%s, %s, %s, %s)',row) |
| # following Python packages needs to be installed | |
| # xlrd, xlsxrd, unidecode, MySQLdb | |
| import xlrd | |
| import xlsxrd | |
| import MySQLdb as mdb | |
| import re | |
| import unidecode |
| #!/usr/bin/env python | |
| # Run with no args for usage instructions | |
| # | |
| # Notes: | |
| # - will probably insert duplicate records if you load the same file twice | |
| # - assumes that the number of fields in the header row is the same | |
| # as the number of columns in the rest of the file and in the database | |
| # - assumes the column order is the same in the file and in the database | |
| # |
| # cleans all images | |
| docker images | awk '{print $3}' | xargs docker rmi | |
| # cleans all stopped containers | |
| docker rm $(docker ps -q -f status=exited) |