Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
#!/bin/bash
# http://blog.nguyenvq.com/blog/2011/09/13/remote-unlocking-luks-encrypted-lvm-using-dropbear-ssh-in-ubuntu/
host=pink
timeout=35
echo "ssh'ing to $host to unlock luks. Wait $timeout secs for password prompt"
ssh -o "UserKnownHostsFile=~/.ssh/known-initram" root@$host << EOF
pid=\`ps | grep "/scripts/local-top/cryptroot" | grep -v "grep" | cut -d " " -f 3\`
echo "Found pid(s) of cryptroot: \$pid"
kill -9 \$pid
echo "Waiting $timeout secs for wait-for-root script to time out..."
# error running npm for tutorial
# http://docs.angularjs.org/tutorial
# fix: https://github.com/angular/angular-phonecat/pull/129
tim@sammy:~/repo/angular-phonecat(7fd0846...)
$ npm install
npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer karma@0.10.10 wants karma-requirejs@~0.2.0
npm ERR! System Linux 3.11.0-17-generic
@timabell
timabell / README.md
Last active August 29, 2015 13:59 — forked from mbostock/.block

Run like so:

node gist-clone-all.js username

You'll want to replace "username" with your own username.

This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url instead.

@timabell
timabell / rsnapshot-backup.sh
Created September 1, 2014 19:46
rsnapshot anacron script
#!/bin/sh
# to be called from anacron.
# first arg is name of backup set to run
if [ ! -d /backup/ ]; then
echo "ERROR: backup disk not mounted at /backup/, aborting"
exit 1
fi
/usr/bin/rsnapshot $1
echo "rsnapshot $1 done"
@timabell
timabell / tidy-insert-sql.pl
Last active August 29, 2015 14:08
takes generated SQL for INSERTing records en masse and strips repetition of column names
#!/usr/bin/perl
# https://gist.github.com/timabell/94b55a12db4c6ee42e10
# takes generated SQL for INSERTing records en masse and strips repetition of column names
# modern sql server accepts multiple rows separated by commas in one insert block
# before
# INSERT (x,y,z) VALUES (1,2,3)
# INSERT (x,y,z) VALUES (1,2,3)
# INSERT (x,y,z) VALUES (1,2,3)
@timabell
timabell / git-fire
Last active August 29, 2015 14:11
git-tfs scripts
#!/bin/sh -v
git branch -D fire 2>&1 > /dev/null
git branch fire
time git tfs rcheckin
git branch -D fired 2>&1 > /dev/null
git branch fired
git poll
#!/bin/sh
SKIP="noone"
cd ~/repo/uk-it-recruiter-domains/
cat ~/Documents/config/sieve-part1.txt > ~/Documents/config/sieve.txt
scripts/domains2sieve.py domains.txt | egrep -v "$SKIP|require" >> ~/Documents/config/sieve.txt
gedit ~/Documents/config/sieve.txt &
echo "skipped:"
@timabell
timabell / SqlQuoter.vba
Last active August 29, 2015 14:19
spreadsheet macro for making pretty sql insert blocks
'todo: handle empty properly, handle boolean true/false
' value - the value to turn into quoted and padded sql
' width - the largest item in this field, values will padded to fit.
' - use array formula =MAX(LEN(B290:B295)) to calculate this (ctrl-shift-enter to save an array formula)
' usage - apply this to all the cells you want to turn into sql, then concatenate the result in a final column
' like this =CONCATENATE(" (",P290,Q290,R290,S290,T290,U290,"),")
function SqlQuoter(value, width)
dim result as string
dim padding as integer
Chocolatey (v0.9.8.33) is installing 'VisualStudio2015Professional' and dependen
cies. By installing you accept the license for 'VisualStudio2015Professional' an
d each dependency you are installing.
VisualStudio2015Professional v14.0.22823.0-RC
Write-Error : Package 'VisualStudio2015Professional v14.0.22823.0-RC' did not i
nstall successfully: The term 'Install-ChocolateyPackage' is not recognized as
the name of a cmdlet, function, script file, or operable program. Check the spe
lling of the name, or if a path was included, verify that the path is correct a
nd try again.