Skip to content

Instantly share code, notes, and snippets.

/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@tdack
tdack / initramfs.conf
Created July 3, 2014 01:07
/etc/initramfs-tools/initramfs.conf
MODULES=dep
COMPRESS=gzip
DEVICE=wlan0
BOOT=local
@tdack
tdack / iscsi
Created July 3, 2014 01:05
/usr/share/initramfs-tools/scripts/local-top/iscsi
PREREQ="wlan"
@tdack
tdack / iscsi.initramfs
Created July 3, 2014 00:58
/etc/iscsi/iscsi.initramfs
# iscsi name for the RPi
ISCSI_INITIATOR=iqn.1993-08.lan.internal.rpi:01:6df87742251d
# iscsi target (eg: your NAS)
ISCSI_TARGET_NAME=iqn.2004-04.com.qnap:ts-419pii:iscsi.rpi.d55618
ISCSI_TARGET_IP=192.168.1.100
@tdack
tdack / wlan
Created July 3, 2014 00:54
/etc/initramfs-tools/scripts/local-top/wlan
#!/bin/sh
# Boot script to bring up wlan interface using wpa_supplicant before rest of boot process
PREREQ="udev"
prereqs()
{
echo "$PREREQ"
}
case $1 in
@tdack
tdack / wlan
Created July 3, 2014 00:50
/etc/initramfs-tools/hooks/wlan
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
#!/usr/bin/env python
from commands import getstatusoutput
from platform import node
from socket import socket, AF_INET, SOCK_STREAM
from sys import argv, exit
from time import sleep, time
from daemon import runner
import re
DELAY = 60
@tdack
tdack / create_config.py
Last active August 29, 2015 13:56
DS18B20 1-wire data collection on Raspberry Pi
#!/usr/bin/env python
import os, sys, glob, argparse
import ConfigParser
LOCATIONS = { 'rrd': ''
, 'graphs': ''
, 'sys_base': '/sys/bus/w1/devices/'
, 'config': ''
}
@tdack
tdack / pw.js
Created January 30, 2014 02:32
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.dack.com.au/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
@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