Skip to content

Instantly share code, notes, and snippets.

View leighghunt's full-sized avatar

Leigh Hunt leighghunt

View GitHub Profile
@leighghunt
leighghunt / docker-install.sh
Created August 9, 2017 22:11
docker-install.sh
#!/bin/bash
curl -sSL https://get.docker.com | sh
systemctl enable docker
usermod -aG docker pi
sudo apt-get install python-setuptools
easy_install pip
pip install docker-compose
raspi-config nonint do_i2c 0
raspi-config nonint do_spi 0
docker login --username energymonitoringdashboard
@leighghunt
leighghunt / docker-pull-and-start.sh
Created August 9, 2017 22:09
docker-pull-and-start.sh
#!/bin/bash
curl -sSL https://gist.githubusercontent.com/leighghunt/f0539df3a2c20abbdd102228c0b24c36/raw > docker-compose.yml
docker-compose stop; docker-compose rm -f; docker-compose pull; docker-compose up -d
@leighghunt
leighghunt / docker-compose.yml
Last active April 15, 2019 21:18
Energy Monitoring Dashboard docker-compose.yml
version: '2.1'
services:
dashboard:
container_name: dashboard
image: leighghunt/energy-monitoring-dashboard:pi-zero-node-11
restart: unless-stopped
ports:
- 80:80
volumes:
- /home/pi/logFiles:/data/logFiles
# List wireless networks
sudo iw dev wlan0 scan
# Pipe ascii - Alt 124
# /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "<SSID>"
@leighghunt
leighghunt / index.html
Created February 9, 2017 01:16 — forked from anonymous/index.html
Vector tiles - 4.2 [Vector tiles - 4.2] // source https://jsbin.com/ruvisab
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<meta name="description" content="[Vector tiles - 4.2]">
<!--
ArcGIS API for JavaScript, https://js.arcgis.com
@leighghunt
leighghunt / multiple-deploy-keys.md
Created November 7, 2016 01:49
Multiple github deploy keys on one server

vim ~/.ssh/config

Host <site-prefix-1>.github.com
  HostName github.com
  User git
  IdentityFile /c/Users/Administrator/.ssh/<site-prefix-1>.id_rsa
  IdentitiesOnly yes

Keybase proof

I hereby claim:

  • I am leighghunt on github.
  • I am leighghunt (https://keybase.io/leighghunt) on keybase.
  • I have a public key ASC8Zo8mGRJMo1Yw-DNxGBQSrrx6WnzAOKiPnLJUrvpX-go

To claim this, I am signing this object:

@leighghunt
leighghunt / aws-grant-access.sh
Created March 23, 2016 19:48
aws-grant-access
#!/bin/bash
# By Ed Wiget
# This is run via cron whenever my ip address changes in order to update aws security group
# 20131120 - original script
# Copied from http://www.edwiget.name/2013/11/automatically-changing-dynamic-ips-in-aws-security-group/#codesyntax_7
############################################################################################################################################
@leighghunt
leighghunt / osrm-ec2-install.md
Last active February 18, 2019 20:49
OSRM EC2 install
  • Mount data volume
lsblk 
sudo file -s /dev/xvdb
sudo mkfs -t ext4 /dev/xvdb
sudo mkdir /mnt/data
sudo mount /dev/xvdb /mnt/data
sudo chmod gou+wrx /mnt/data
sudo vim /etc/fstab
@leighghunt
leighghunt / del_temp_files.py
Last active February 2, 2016 21:39
Delete windows temp files
#!/usr/bin/python
# run by crontab
# removes any files and folders in /tmp/ older than 1 day
# modified from http://pp19dd.com/2013/10/python-script-to-remove-tmp-files-older-than-7-days/
import os, sys, time, shutil
from subprocess import call