Skip to content

Instantly share code, notes, and snippets.

@tdack
tdack / readme.txt
Created May 8, 2016
Buildroot config for OrangePi Plus
View readme.txt
# 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 / console.log
Last active Jan 10, 2016
Kivy Raspberry Pi installation
View console.log
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 / upgrade_ghost.sh
Last active Jan 6, 2016 — forked from anonymous/upgrade_ghost.sh
Bash script to upgrade your Ghost blog installation to the latest version
View upgrade_ghost.sh
#!/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 / Makefile
Last active Dec 31, 2015
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…
View Makefile
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 / README.md
Last active Dec 27, 2015
PHP .htpasswd admin
View README.md

Quick and dirty .htpasswd admin page for Apache 2.4 or greater.

This uses the newer authentication providers in Apache 2.4 to secure access to the page.

Add the vhost.conf snippet to your directive or server config.

Your .htpasswd file will need write permissions for the group or user that Apache is running as so it can be updated.

There's not many safety checks here, so be careful.

@tdack
tdack / date.php
Last active Dec 27, 2015
Simple php script to run a shell command on a server when a button is pressed and return the result.
View date.php
<?php
$output = array();
$retvar = "";
if ($_GET['run'])
{
// 2>&1 redirects STDERR to STDOUT
exec("/bin/date 2>&1", $output, $retvar);
}
?>
<html>
@tdack
tdack / README
Created Sep 27, 2012
XML -> HTML using XSL in PHP
View README
The parse-xml.php file uses the opf.xsl style sheet to read the book.opf XML file and output some minimal html for he description of the book.
The html produced is the contents of the <dc:description> tag surrounded by a <div>.
View 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 / README.md
Last active Aug 29, 2015
Grab Bigpond usage using Python
View README.md

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

View appswitch.pl
#!/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
##