Skip to content

Instantly share code, notes, and snippets.

@ehouse
ehouse / destutter.awk
Created September 29, 2016 15:07
Possible solution to apple interview destutter question
#!/usr/bin/awk -f
BEGIN { FS="," }
{ check=0; for(i=1; i<=NF; i++) if($i == check) { continue; } else { check=$i; printf "%s\ ", $i } }
END { print "" }
@ehouse
ehouse / generate_hash.sh
Created October 25, 2015 17:55
Generates secure sha512 password hashes for shadow file
#!/usr/bin/bash
python -c "import crypt,random,string; print crypt.crypt(raw_input('clear-text password: '), '\$6\$' + ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(16)]))"

Keybase proof

I hereby claim:

  • I am ehouse on github.
  • I am ehouse (https://keybase.io/ehouse) on keybase.
  • I have a public key whose fingerprint is 39ED 787C C0AD 6B60 C95B E9D9 F520 8355 5C35 872C

To claim this, I am signing this object:

@ehouse
ehouse / poudrier-kickstart.sh
Last active August 29, 2015 14:08
kickstart script to run weekly poudriere build
#!/bin/sh
if [ "$(id -u)" != "0" ]; then
echo "Script must be run as root"
exit 1
fi
TMUX_COMMAND="/usr/local/sbin/portmaster --list-origins | sort -d > /usr/local/etc/poudriere-list;
/usr/local/bin/poudriere ports -u;
/usr/local/bin/poudriere jails -u -j 10amd64;
/usr/local/bin/poudriere bulk -f /usr/local/etc/poudriere-list -j 10amd64;
@ehouse
ehouse / gist:6590595
Created September 17, 2013 06:04
xinitrc
xmodmap -e 'remove Lock = Caps_Lock'
xmodmap -e 'keysym Caps_Lock = Control_L'
xmodmap -e 'add Control = Control_L'
export LANG="en_US.UTF-8"
export MM_CHARSET="UTF-8"
LOCK="i3lock -i /home/ehouse/Pictures/Wallpapers/lockscreen.png"
xautolock -locker "$LOCK" -nowlock "$LOCK" &
exec i3