Skip to content

Instantly share code, notes, and snippets.

View nicinabox's full-sized avatar

Nic Haynes nicinabox

View GitHub Profile

Building and tuning a Raspberry Pi security camera

Parts

  • Raspberry Pi (I picked up a new 2B)
  • Camera module
  • Wifi adapter
  • Power adapter (5.1V 2.1A)
  • Micro USB
  • Micro SD card
#!/bin/bash
#
# A script to bootstrap dokku.
# It expects to be run on Ubuntu 14.04 via 'sudo'
# If installing a tag higher than 0.3.13, it may install dokku via a package (so long as the package is higher than 0.3.13)
# It checks out the dokku source code from Github into ~/dokku and then runs 'make install' from dokku source.
# We wrap this whole script in a function, so that we won't execute
# until the entire script is downloaded.
# That's good because it prevents our output overlapping with wget's.
function (view, selector) {
view.setElement(this.$(selector)).render();
}
@nicinabox
nicinabox / osx-for-hackers.sh
Last active October 28, 2015 21:17 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
MOTOR_OIL
- Change oil, oil filter. 4qt Rotella T6, 0.5 Mobil 1 5W-40
- Change oil, oil filter, air filter, spark plugs
- Oil, oil filter, gearbox oil, rear drive oil, valve adjustment, torque heads
- Change oil and oil filter
- Changed oil and filter
- Changed oil with Castrol GTX 5w-30 and new filter
- New Tensioner - AC Delco (Littens) \nNew O-Ring for Front Crank Sensor\nOil Change (Royal Purple 5w30)
@nicinabox
nicinabox / server.js
Created April 12, 2015 16:15
A handy server to use in development
var connect = require('connect')
var http = require('http')
var serveStatic = require('serve-static')
var PORT = 8000;
var app = connect()
app.use(serveStatic(__dirname + '/public'))
app.use(serveStatic(__dirname))
#!/usr/bin/env ruby
class MakePEM
def initialize(argv)
@file = argv[0]
abort help unless valid_args
parts = @file.split('.')
@name = parts.first
@nicinabox
nicinabox / favicon.sh
Last active October 24, 2019 07:17
Convert favicon.png to an .ico with multiple sizes
convert favicon.png -bordercolor white -border 0 \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
-delete 0 -alpha off -colors 256 favicon.ico
@nicinabox
nicinabox / gist:1a1ba1f846513f30fa4a
Created December 9, 2014 18:23
Source .env automatically in your projects with RVM
# ~/.rvm/hooks/after_cd
if [ -f .env ]; then
source .env
fi
var _ = require('lodash');
var natural = require('natural'),
classifier = new natural.BayesClassifier();
// First item denotes "changed motor oil"
var notes = [
[true, 'Change oil, oil filter, air filter, spark plugs'],
[true, 'Change oil, oil filter. 4qt Rotella T6, 0.5 Mobil 1 5W-40'],
[false, 'Change gearbox oil, rear drive oil, valve adjustment, torque heads'],
[false, 'Change transmission oil'],