Skip to content

Instantly share code, notes, and snippets.

# Here's the script I'll use to demonstrate - it just loops forever:
$ cat test.rb
#!/usr/bin/env ruby
loop do
sleep 1
end
# Now, I'll start the script in the background, and redirect stdout and stderr
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbOptions" "caps:super,terminate:ctrl_alt_bksp"
EndSection
Section "InputClass"
Identifier "Apple Keyboards"
MatchUSBID "05ac:0259"
[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
@psanford
psanford / gist:229d46edfc5242bffddf
Last active August 29, 2015 14:22
ec2 instance type history
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
@psanford
psanford / gist:242a1222571fd418745a
Created July 30, 2015 21:09
binary over telnet/netcat
# 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
psanford / dvb.sh
Last active September 15, 2015 00:15
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
psanford / usdt
Created January 30, 2016 03:25 — forked from brendangregg/usdt
usdt (ftrace)
#!/bin/bash
#
# 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
psanford / meraki_strongswan_notes.md
Last active February 20, 2024 06:52
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
psanford / gist:8ed59ae471b2d9d4524dc5a2cfc03d66
Last active February 15, 2018 17:44
reviewable.io keyboard shortcuts
[
["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
psanford / runc_rootless_with_overlayfs.sh
Last active February 7, 2019 23:02
runc rootless examples
#!/bin/bash
# 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