Skip to content

Instantly share code, notes, and snippets.

Peter Sanford psanford

Block or report user

Report or block psanford

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
psanford / examples.sql
Last active Apr 7, 2019
sqlite3 examples
View examples.sql
.mode csv
-- import column names from first show
.headers on
-- show current settings
.import transactions.csv transactions
select * from transactions;
# Hello world of rootless runc with an overlayfs root file system.
# This will only work as is with kernels that allow overlayfs mounts
# from non-root accounts (such as ubuntu 18.04).
set -e
set -x
mkdir /tmp/runc-rootless
psanford / gist:8ed59ae471b2d9d4524dc5a2cfc03d66
Last active Feb 15, 2018 keyboard shortcuts
View gist:8ed59ae471b2d9d4524dc5a2cfc03d66
["f", "Show next/latest diffs", "setProposedRevRanges()"],
["j", "Next unreviewed file", "nextUnreviewedFile()"],
["k", "Previous unreviewed file", "prevUnreviewedFile()"],
[null, "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"],
[null, "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"],
["shift+n", "Next changed file", "nextChangedFile()"],
["shift+p", "Previous changed file", "prevChangedFile()"],
["shift+j", "Next visible file", "nextVisibleFile()"],
psanford /
Last active May 27, 2019
connect to meraki client vpn from strongswan (ubuntu 16.04 edition)

These are my notes for connecting to a meraki client vpn from ubuntu 16.04. This configuration assumes you are using a psk for the ipsec auth.

Install the following packages:

apt-get install -y strongswan xl2tpd

Configure strong swan

psanford / usdt
Created Jan 30, 2016 — forked from brendangregg/usdt
usdt (ftrace)
View usdt
# usdt - trace user statically defined tracepoints. User-level dynamic tracing.
# Written using Linux ftrace. Experimental.
# WARNING: This is a proof of concept for USDT tracing from Linux ftrace, and
# is not safe to use in production environments. In particular, the -i option
# sets memory semaphores by piping the output of printf through dd and then
# to process memory via /proc/PID/mem. Yes, this program pipes the output of
# the shell directly over top of live process memory. If you don't understand
psanford /
Last active Sep 15, 2015
dvb dtv scanning notes
# speak the signal strength out loud
script -c "azap -c ~/.mplayer/channels.conf -r 'KNTV HD'" /dev/null | perl -nl -e '$|=1; /signal ([a-zA-Z0-9]+).*FE_HAS_LOCK/; `echo $1 | festival --tts`; '
#yes or no
script -c "azap -c ~/.mplayer/channels.conf -r 'KNTV HD'" /dev/null | tee /tmp/azap | perl -nl -e '$|=1; /signal ([a-zA-Z0-9]+).*FE_HAS_LOCK/; $out=$1 eq "541d" ? "no": "yes" ; `echo $out | festival --tts` ; '
# edit /usr/share/festival/voices/english/kal_diphone/festvox/kal_diphone.scm to adjust speech rate
(Parameter.set 'Duration_Stretch 0.5)
psanford / gist:242a1222571fd418745a
Created Jul 30, 2015
binary over telnet/netcat
View gist:242a1222571fd418745a
# send binary as hex over telnet
cat file | od -A n -v -t x1 | tr -d ' \n' | telnet x.x.x.x 1337
# convert from hex to binary over netcat
nc -l 1337 | xxd -r -p > /tmp/binary
psanford / gist:229d46edfc5242bffddf
Last active Aug 29, 2015
ec2 instance type history
View gist:229d46edfc5242bffddf
Date Instances
[August 2006][0] m1.small
[October 2007][1] m1.large, m1.xlarge
[May 2008][2] c1.medium, c1.xlarge
[October 2009][3] m2.2xlarge, m2.4xlarge
[February 2010][4] m2.xlarge
[July 2010][5] cc1.4xlarge
[September 2010][6] t1.micro
[November 2010][7] cg1.4xlarge
View gist:1936987b6dbd3ec3fc53
[NOTICE: Zone booting up]
init: Unable to mount /sys filesystem: Function not implemented
<4>init: procps (virtual-filesystems) main process (19850) terminated with status 139
<4>init: Temporary process spawn error: Interrupted system call
<4>init: Temporary process spawn error: Interrupted system call
<4>init: Temporary process spawn error: Interrupted system call
<4>init: failsafe post-start process (19917) killed by SEGV signal
<4>init: upstart-socket-bridge main process ended, respawning
<4>init: Temporary process spawn error: Interrupted system call
<4>init: networking main process (19891) terminated with status 2
View 49-keyboard.conf
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbOptions" "caps:super,terminate:ctrl_alt_bksp"
Section "InputClass"
Identifier "Apple Keyboards"
MatchUSBID "05ac:0259"
You can’t perform that action at this time.