Skip to content

Instantly share code, notes, and snippets.

@tdack
tdack / README.md
Last active July 30, 2019 15:56
D3 graph from RRD data
@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}]
#!/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 / 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
@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 / pendulum.cpp
Created August 16, 2015 13:19
pendulum.cpp
ofstream fSlots;
fSlots.open(SLOTS);
fSlots << "ADAFRUIT-UART2" << std::endl;
fSlots << "PyBBIO-epwmss0" << std::endl;
fSlots << "PyBBIO-eqep0" << std::endl;
fSlots << "PyBBIO-epwmss1" << std::endl;
fSlots << "PyBBIO-eqep1" << std::endl;
fSlots.close();
@tdack
tdack / upgrade_ghost.sh
Last active January 6, 2016 23:45 — forked from anonymous/upgrade_ghost.sh
Bash script to upgrade your Ghost blog installation to the latest version
#!/bin/bash
# Make sure only root can run our script
if [[ ${EUID} -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [[ $# -eq 0 ]]; then
echo "Usage:"
echo " $0 <systemd|sysv>"
@tdack
tdack / console.log
Last active January 10, 2016 06:18
Kivy Raspberry Pi installation
pi@raspberrypi ~ $ sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
pkg-config libgl1-mesa-dev libgles2-mesa-dev \
python-setuptools libgstreamer1.0-dev git-core \
gstreamer1.0-plugins-{bad,base,good,ugly} \
gstreamer1.0-{omx,alsa} python-dev cython
pi@raspberrypi ~ $ sudo pip install git+https://github.com/kivy/kivy.git@master
pi@raspberrypi ~ $ sudo apt-get install python-{pygments,docutils}
@tdack
tdack / main.py
Created January 12, 2016 05:38
Kivy custom properties on a widget
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.properties import NumericProperty, ObjectProperty
import RPi.GPIO as GPIO
@tdack
tdack / io.adafruit.com-bridge.conf
Last active May 2, 2024 15:04
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
# Connection name
connection adafruit
# Secure SSL/TLS
address io.adafruit.com:8883
# adjust path as approriate to point to directory with PEM encoded .crt CA files
bridge_capath /etc/ssl/certs/
# Insecure
# address io.adafruit.com:1883