Skip to content

Instantly share code, notes, and snippets.

@tdack
tdack / README.md
Last active August 29, 2015 14:18
Grab Bigpond usage using Python

Telstra Bigpond Usage

A simple python script to grab the current usage from your Telstra Bigpond account.

Dependencies: python-requests
bs4

Change the username and password as appropriate

@tdack
tdack / README.md
Last active September 2, 2018 19:54
Re-usable D3 chart to graph RRD data

Re-usable Chart for RRD data

  • data is fetched from a binary RRD file and converted to JavaScript object
  • charts are generated with re-usable chart object to reduce duplication of code
#!/usr/bin/perl -w
###############################################################################################################################
## Name: appswitch.pl
##
## Purpose: Executed by irexec this script will cycle between mythtv and kodi using a single button.
##
## (C)opyright 2008 Arksoft.
##
## Author: Arkay
##
@tdack
tdack / rrd2D3.js
Created February 2, 2015 05:52
Output data from javascriptrrd for use with D3js
// return an array of objects containing D3elements, one per DS
//
// data = [
// {
// name: <DS name>,
// values: [{ date: <timestamp>, value: 1}, { date: <timestamp>, value: 2}]
// },
// {
// name: <DS name>,
// values: [{ date: <timestamp>, value: 1}, { date: <timestamp>, value: 2}]
@tdack
tdack / README.md
Last active July 30, 2019 15:56
D3 graph from RRD data
@tdack
tdack / gist:59b1ff3a1eef77df7f79
Created December 17, 2014 06:46
MetricsGraphics test case
D1=[{"time":"2014-12-10T07:00:00.000Z","val":23963.329444444444},{"time":"2014-12-10T08:00:00.000Z","val":0},{"time":"2014-12-10T09:00:00.000Z","val":7350.143697764535},{"time":"2014-12-10T10:00:00.000Z","val":1230.5423714379733},{"time":"2014-12-10T11:00:00.000Z","val":2680.6423191974077},{"time":"2014-12-10T12:00:00.000Z","val":5110.947544547842},{"time":"2014-12-10T13:00:00.000Z","val":2972.8870586764733},{"time":"2014-12-10T14:00:00.000Z","val":14244.08293326015},{"time":"2014-12-10T15:00:00.000Z","val":4154.984313596681},{"time":"2014-12-10T16:00:00.000Z","val":21274.571393023052},{"time":"2014-12-10T17:00:00.000Z","val":12827.169734152581},{"time":"2014-12-10T18:00:00.000Z","val":767.7136190974885},{"time":"2014-12-10T19:00:00.000Z","val":2.654181912484959},{"time":"2014-12-10T20:00:00.000Z","val":1.4527777777777775},{"time":"2014-12-10T21:00:00.000Z","val":659.5492520499265},{"time":"2014-12-10T22:00:00.000Z","val":547.1229701722958},{"time":"2014-12-10T23:00:00.000Z","val":1.6424999999999998},{"time"
@tdack
tdack / README.md
Last active August 29, 2015 14:07
Apache MythWeb reverse proxy

Apache reverse proxy configuration for MythWeb over HTTPS

@tdack
tdack / lcdui.py
Last active August 29, 2015 14:06 — forked from ufux/lcdui.py
import smbus
import getopt
import sys
from time import *
from time import gmtime, strftime
# TODO: Factor out all device_write calls to some PCF8574 specific module ...
# will be different with another io expander
# communication from expander to display: high nibble first, then low nibble
@tdack
tdack / SharpIR.py
Last active July 20, 2022 07:55
Python object for Sharp 2Y0A21 InfraRed distance sensor (and similar). Includes calibration routine to calculate the coefficient and power for the distance equation
#!/usr/bin/python
import Adafruit_BBIO.ADC as ADC
from time import sleep
import sys
#
# For the BeagleBone Black the input voltage has to be 0-1.8V
# The easiest way is with a voltage divider
#
# Ra Rb
@tdack
tdack / smb.conf
Created August 6, 2014 15:03
BeagleBone Black smb.conf for Cloud 9 IDE to enable access from other systems. This is insecure as it allows a guest connecting to the samba share root access to the /var/lib/cloud9 directory - but you already get this through the Cloud9 browser IDE
################################################################################
# samba.conf
# This configuration file allows you to customize the samba shares
# available from your machine
[global]
server string = BeagleBone Black Cloud 9 IDE
workgroup = WORKGROUP
netbios name = %h