curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 2 ] ; then | |
echo 'Usage: mount-nbd.sh <device> <mount_point>' | |
exit 1 | |
fi | |
device=$1 | |
fs_type=$(blkid -o value -s TYPE $device) | |
if [[ -z $fs_type ]] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y usbmount | |
sudo bash -c "cat <<EOT > /etc/usbmount/mount.d/01_create_label_symlink | |
#!/bin/sh | |
# This script creates the volume label symlink in /var/run/usbmount. | |
# Copyright (C) 2014 Oliver Sauder | |
# | |
# This file is free software; the copyright holder gives unlimited | |
# permission to copy and/or distribute it, with or without | |
# modifications, as long as this notice is preserved. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
paste this code into a playground to test it out | |
*/ | |
import Foundation | |
/** | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Protect the '$' alias and add scope by putting everything in | |
// an Immediately Invoked Function Expression: | |
// http://stage.learn.jquery.com/javascript-101/functions/#immediately-invoked-function-expression-iife | |
(function($) { | |
// As $.fn is just an alias for $.prototype, all jQuery | |
// objects ($ constructor) get our function. | |
$.fn.helloWorld = function(options) { | |
debug(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common::jailuser { 'nova': | |
sections => ['jk_lsh', 'basicshell'], | |
binds => ['/var/log => log', '/opt => opt'], | |
keys => ['funky', 'george'], | |
} | |
define common::jailuser( | |
$user = $title, | |
$sections = [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fail on error | |
set -e | |
pushd `dirname $0` > /dev/null | |
SCRIPT=`pwd -P` | |
popd > /dev/null | |
KEEP_DAYS=150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "mechanize" | |
site = 'http://pi:9094/home/postprocess/' | |
user = 'xbian' | |
pass = 'raspberry' | |
downloads = '/home/xbian/downloads/tv' | |
agent = Mechanize.new |
#Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MathBook Pro" | |
scutil --set HostName "MathBook Pro" | |
scutil --set LocalHostName "MathBook-Pro" |