Skip to content

Instantly share code, notes, and snippets.

@tdack
tdack / io.adafruit.com-bridge.conf
Last active Aug 2, 2021
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
View io.adafruit.com-bridge.conf
# 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
@tdack
tdack / README.md
Created Jun 12, 2016
Custom handlebars helpers for Ghost, as an app
View README.md
@tdack
tdack / main.py
Created Jan 12, 2016
Kivy custom properties on a widget
View main.py
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 / overviewer_config.py
Created Sep 12, 2012
Minecraft Overviewer dynamic config file
View overviewer_config.py
# Minecraft Overviewer dynamic config file for multiple Minecraft worlds
# managed by MSM (https://github.com/marcuswhybrow/minecraft-server-manager)
import os
# Define where to put the output here.
outputdir = "/storage/www/vhosts/minecraft.example.com"
# Add Javascript to map when rendering
from observer import JSObserver
@tdack
tdack / README.md
Last active Jul 30, 2019
D3 graph from RRD data
View README.md
@tdack
tdack / browse.css
Created Nov 12, 2013
Tweaks to calibre-content server browse view. Displays book list as covers. Add the css rules as described and patch browse.html and browse.js in /usr/share/calibre/content_server/browse/ Then restart the content server to see the changes. Result should be like https://plus.google.com/u/0/photos/+TroyDack/albums/5763024133998901281/5945519253353…
View browse.css
/*
Add these css rules to the end of /usr/share/calibre/content_server/browse/browse.css
Place them just before the final }}}
*/
#booklist .listnav {
padding-bottom: 1em;
@tdack
tdack / build_kernel.sh
Last active Sep 30, 2018
Build the kernel for the Next Thing Co C.H.I.P.
View build_kernel.sh
#!/bin/bash
# Desktop build
MAKE="make -j 4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-"
# C.H.I.P. build
#MAKE="make"
CDIR=$PWD
LINUX=$CDIR/CHIP-linux
WIFI=$CDIR/RTL8723BS
@tdack
tdack / README.md
Last active Sep 2, 2018
Re-usable D3 chart to graph RRD data
View README.md

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 / create-ovpn.sh
Last active Aug 9, 2016
Create Feral Hosting .ovpn for iOS OpenVPN client
View create-ovpn.sh
#!/bin/bash
NAME=$1
FERAL_SERVER=$2
KEYSTORE=./keys
CA=$(< ${KEYSTORE}/ca.crt)
CERT=$(< ${KEYSTORE}/${NAME}.crt)
KEY=$(< ${KEYSTORE}/${NAME}.key)
TLS_AUTH=$(< ${KEYSTORE}/tls-auth.key)
OUTPUT=./${NAME}.ovpn
View config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.4.11 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
CONFIG_MIGHT_HAVE_PCI=y