Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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 / 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': ''
}
#!/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 / wlan
Created July 3, 2014 00:50
/etc/initramfs-tools/hooks/wlan
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
@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 / 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 / iscsi
Created July 3, 2014 01:05
/usr/share/initramfs-tools/scripts/local-top/iscsi
PREREQ="wlan"
@tdack
tdack / initramfs.conf
Created July 3, 2014 01:07
/etc/initramfs-tools/initramfs.conf
MODULES=dep
COMPRESS=gzip
DEVICE=wlan0
BOOT=local
/*
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 / smb.conf
Created August 6, 2014 15:03
BeagleBone Black smb.conf for Cloud 9 IDE to enable access from other systems. This is insecure as it allows a guest connecting to the samba share root access to the /var/lib/cloud9 directory - but you already get this through the Cloud9 browser IDE
################################################################################
# samba.conf
# This configuration file allows you to customize the samba shares
# available from your machine
[global]
server string = BeagleBone Black Cloud 9 IDE
workgroup = WORKGROUP
netbios name = %h