Skip to content

Instantly share code, notes, and snippets.

hack the planet

Alex Sadleir maxious

hack the planet
View GitHub Profile
maxious /
Last active Dec 28, 2019
bme680 mqtt publisher for python
#!/usr/bin/env python
import bme680
# import context # Ensures paho is in PYTHONPATH
import paho.mqtt.publish as publish
import time
import platform
hostname = platform.node()
sensor = bme680.BME680()
# gdalinfo aus_for18_publish/aus_for18 -nogcp -nomd -noct -nofl | grep "<.*>"
# gdalwarp --config GDAL_CACHEMAX 10096 -multi -of GTiff -co "TILED=YES" -co "TFW=YES" -co BIGTIFF=YES -co COMPRESS=PACKBITS aus_for18 aus_for18.tiff
import xml.etree.ElementTree as ET
rat = ET.parse('rat.xml').getroot()
headers = [defn.find('Name').text for defn in rat.findall('FieldDefn')]
grouped_data = {}
id_to_label = {}
max_value = 0
id_var = 'VALUE'
# Python
import time
import logging
import argparse
import os
import sys
import numpy as np
import subprocess
import dothat.backlight as backlight
import dothat.lcd as lcd
View clum.sld.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation=" StyledLayerDescriptor.xsd"
<!-- a Named Layer is the basic building block of an SLD document -->
maxious /
Last active Aug 10, 2019
ANKO Pan and Tilt Camera E952
View nm.json
{"services":[],"homeCamera":{"north":-8,"east":158,"south":-45,"west":109},"corsDomains":["", "", "", ""],"catalog":[
maxious /
Last active May 22, 2019
Data Plumbing
NAME="yourname" # all lower case one word
import datetime
import pandas
from airflow import models
from airflow.operators.python_operator import PythonOperator
from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
DATA_DIR = '/home/airflow/gcs/data/'
GCS_BUCKET = 'us-east1-dta-airflow-b3415db4-bucket'
RUN_R_SCRIPT = [('gsutil cp gs://{GCS_BUCKET}/data/{NAME}.csv . && ' +
maxious / rc.local
Last active Feb 24, 2019
rc.local for booking up a Quectel GPS chip with assisted GPS data
View rc.local
stty -F /dev/ttyAMA0 raw speed 115200;
# clone from
/home/pi/mt3339-utils/gpsinit -f /home/pi/mt3339-utils/gpsinit.conf /dev/ttyAMA0 ;
if ifconfig -a | grep --quiet wlan0; then
echo wlan exists, wait to load epo;
while ! ping -c 1 -W 1; do
echo "Waiting for - network interface might be down..."
sleep 1
View PWlist.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 7. in line 7.
Licence Number,Licensee,Weighbridge Capacity,Weighbridge Length,Main Phone ,State,Postcode,Street Address,lat,lng
PW-0401,Plumbspark Pty Ltd Trading As City Weighbridge,74,23,02 93194438,NSW,2015,33 Bourke Rd Alexandria NSW 2015 Australia,-33.914104,151.193125
PW-0449,Visa Global Logistics Pty Ltd,120,26,02 9695 3888,NSW,2019,1 Coal Pier Botany NSW 2019 Australia,-33.9451,151.199
PW-0378,Numeve Pty Ltd,60,20,02 9975 5044,NSW,2100,50 Meatworks Ave Oxford Falls NSW 2100 Australia,-33.735232,151.245816
PW-0404,Mitch Bastaja Trading As Enfield Public Weighbridge,50,16,02 9742 3382,NSW,2136,74 Cosgrove Rd Strathfield South NSW 2136 Australia,-33.890197,151.073095
PW-0126,Sydney Markets Limited T/A Sydney Markets Public Weighbridge,90,27,02 9325 6173,NSW,2140,Parramatta Rd Homebush West NSW 2140 Australia,-33.859837,151.071293
PW-0010,Sydney Weighbridges Auburn,140,27,02 9748 2391,NSW,2144,6 Rawson Rd Auburn NSW 2144 Australia,-33.851528,151.037279
PW-0011,Sydney Weighbridges Smithfield,120,27,02 9604 2677,NSW,216
View visualiser.oy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------- #
import os, threading, re, sys, time, math, unicodedata
from collections import deque
# import non-standard libraries
for libraryName in ['dothat','dothat.lcd','dothat.backlight']:
You can’t perform that action at this time.