Skip to content

Instantly share code, notes, and snippets.

@tdack
tdack / Makefile
Last active December 31, 2015 12:09
Commercial detection with silence for UK freeviewHD and Australian Freeview SD/HDSee http://www.mythtv.org/wiki/Commercial_detection_with_silence_for_UK_freeviewHD for detailsRunning:Assuming you use the same locations, your 'Advert-detection command' (mythtv-setup/General/Page 8) should be: /usr/local/bin/silence.py %JOBID% %VERBOSEMODE% --logl…
CC = g++
CFLAGS = -c -Wall -std=c++0x
LIBPATH = -L/usr/lib
TARGETDIR = /usr/local/bin
.PHONY: clean install
all: silence
silence: silence.o
@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 / readme.txt
Created May 8, 2016 22:51
Buildroot config for OrangePi Plus
# board/orangepi/orangepi_plus/readme.txt
OrangePi Plus
Intro
=====
This default configuration will allow you to start experimenting with the
buildroot environment for the OrangePi PC. With the current configuration
it will bring-up the board, and allow access through the serial console.
@tdack
tdack / create-ovpn.sh
Last active August 9, 2016 13:28
Create Feral Hosting .ovpn for iOS OpenVPN client
#!/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
@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 / browse.css
Created November 12, 2013 23:38
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…
/*
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 / README.md
Last active July 30, 2019 15:56
D3 graph from RRD data
@tdack
tdack / overviewer_config.py
Created September 12, 2012 12:09
Minecraft Overviewer dynamic config file
# 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 / 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