Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Remote</title>
<style type="text/css">
body {
font-family: sans-serif;
font-size: 4em;
}
#wrapper {
@andrewn
andrewn / instructions.md
Created August 21, 2013 16:23
Starting services as daemons on Raspbian
  • Save the script as /etc/init.d/raspi-printer
  • Make it executable chmod +x /etc/init.d/raspi-printer
  • Start by doing service raspi-printer start

To run automatically, you run the update-rc.d script:

sudo update-rc.d -f raspi-printer defaults

See: http://jimmyg.org/blog/2010/python-daemon-init-script.html

@andrewn
andrewn / gist:6320683
Last active December 21, 2015 14:38
HTTP 511Network authentication required
<html>
<head>
<title>Network Authentication Required</title>
<meta http-equiv="refresh"
content="0; url=http://raspberrypi.local/">
</head>
<body>
<p>You need to <a href="http://raspberrypi.local/">
configure a Wi-Fi network</a> to gain access.</p>
</body>
@andrewn
andrewn / gist:6352695
Last active December 21, 2015 19:09
USB Soundcard default
To make a USB souncard default:
1. Open `sudo nano /etc/modprobe.d/alsa-base.conf`
2. Comment out the following line: `#options snd-usb-audio index=-2`
3. Reboot
4. Check that USB audio is at the top of this list `cat /proc/asound/modules`
@andrewn
andrewn / app.css
Last active December 24, 2015 11:39
Attempt at blink detection
canvas {
margin: 0 auto;
-moz-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
filter: FlipH;
transform: scale(-1, 1);
}
@andrewn
andrewn / config.ru
Created October 8, 2013 13:43
Run PHP scripts via pow.cx
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
INDEXES = ['index.html','index.php', 'index.cgi']
base_path = Dir.getwd
base_path = "/Users/andrew/Projects/oss/tal/talexample"
use Rack::Rewrite do
<!DOCTYPE html>
<html>
<head>
<title>The Pips</title>
</head>
<body>
<button onclick="pips()">The Pips</button>
<script src="pips.js"></script>
</body>
@andrewn
andrewn / README.md
Last active December 30, 2015 19:39
Speaker images

Speaker images for Solidcon proposal

pi@raspberrypi ~/bluez-5.11 $ cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bluez configure 5.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --disable-systemd
## --------- ##
var wpi = require('./build/Release/wiringPi');
wpi.wiringPiSetup();
var colour = [255, 255, 0];
var pins = [0, 2, 3 ];
pins.forEach(createPwmPin);