Skip to content

Instantly share code, notes, and snippets.

View samv's full-sized avatar

Sam Vilain samv

View GitHub Profile
@samv
samv / README.rst
Last active August 29, 2015 14:01
System info for System76 Pangolin Performance (panp9)
@samv
samv / gist:34c5013278bf5e36d9f9
Created May 22, 2014 21:13
Error building atom
Usage: gyp_main.py [options ...] [build_file ...]
gyp_main.py: error: no such option: --no-parallel
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack at ChildProcess.onCpExit (/home/samv/oss/atom/build/node_modules/npm/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-20-generic
gyp ERR! command "node" "/home/samv/oss/atom/build/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
@samv
samv / start-ssh-agent
Created February 19, 2015 19:36
Script to reattach a shell to SSH
#!/bin/sh
# this script knows how to look in /tmp/ssh-* for SSH agent sockets.
# These are created by the SSH agent, or for hosts you connected to
# with 'ssh -A' (or you set 'ForwardAgent yes' in your .ssh/config).
# the upshot is that if *any* of your current ssh connections have an
# agent connection, then you can run this script and it will set your
# environment variables up in the shell you are currently working in.
@samv
samv / output.txt
Last active August 29, 2015 14:20
Remove 'unknown' json fields
JsonRecord(unknown_json_keys={'foo': 'bar'})
JsonRecord()
@samv
samv / git-wcpush
Last active August 29, 2015 14:24
'git wcpush'
#!/bin/bash
remote=$1
ssh_target=$(git config remote.$remote.url)
echo "remote $remote, ssh is $ssh_target"
cdup="$(git rev-parse --show-cdup)"
if [ -n "$cdup" ]
then
Script started on Tue 24 Mar 2009 16:20:55 NZDT
];samv@wilber:~/tmpwilber:~/tmp$
];samv@wilber:~/tmpwilber:~/tmp$
];samv@wilber:~/tmpwilber:~/tmp$ m
];samv@wilber:~/tmpwilber:~/tmp$
];samv@wilber:~/tmpwilber:~/tmp$ m
];samv@wilber:~/tmpwilber:~/tmp$
];samv@wilber:~/tmpwilber:~/tmp$ mk
];samv@wilber:~/tmpwilber:~/tmp$
];samv@wilber:~/tmpwilber:~/tmp$ mk
DB<7> p $_
color.branch=auto
DB<8> x split $_, "=", 2
0 '='
DB<9>
____________________________________
/ _ _ \
| _____ _____ _____ (_) | | Git version 1.6.4.3
| |_____|_____|_____| __ _ _| |_ | Copyright (c) 2005-2009
| _ _ _ / _` | | __| | various authors, all rights
| _| |_ _| |_ _| |_ | (_| | | |_ | reserved.
| |_ _|_ _|_ _| \__, |_|\__| |
| |_| |_| |_| __/ | | Checking for new git releases
| |___/ | on kernel.org
\____________________________________/
@samv
samv / slices.go
Created January 27, 2011 05:17
slices example
package main
import "tour/pic"
func Pic(dx, dy int) [][]uint8 {
var rv = make([][]uint8, dy)
for y := 0; y < dy; y++ {
rv[y] = make([]uint8, dx);
for x := 0; x < dx; x++ {
@samv
samv / contact-freelpg.txt
Created February 25, 2011 20:36
List of free LPG stations via Contact Energy
DONE Challenge - 45 Halswell Road, Halswell
DONE Challenge - corner Milton and Selwyn Street, Christchurch
DONE Challenge Waimak - Main North Road, Kaiapoi
DONE Caltex - Blenheim Road, Riccarton
DONE Caltex - Lincoln Road, Addington