Skip to content

Instantly share code, notes, and snippets.

View nicwaller's full-sized avatar

Nic Waller nicwaller

View GitHub Profile
@jtimberman
jtimberman / gist:3088517
Last active February 7, 2018 16:40
Replace $VAGRANTBOX with box names that should be repackaged with updates. Don't specify it for up, ssh, and package if you're not using a multi-VM vagrantfile
% vagrant up --no-provision $VAGRANTBOX
% vagrant ssh $VAGRANTBOX
vagrant$ wget -O - http://opscode.com/chef/install.sh | sudo bash
vagrant$ rm /tmp/chef*{rpm,deb}
vagrant$ exit
% vagrant package $VAGRANTBOX
% rm -rf ~/.vagrant.d/boxes/$VAGRANTBOX
% vagrant box add $VAGRANTBOX package.box
@nicwaller
nicwaller / whohaskey.sh
Last active March 11, 2016 23:22
Find the Amazon IAM user associated with a given API Access Key
function whohaskey {
APIKEY="$1"
CACHE_DIR=~/.aws/keycache
mkdir -p $CACHE_DIR
if [ -f $CACHE_DIR/$APIKEY ]; then
cat $CACHE_DIR/$APIKEY
return
fi
for USER in $(aws iam list-users | jq -r .Users[].UserName); do
JSON=$(aws iam list-access-keys --user-name "$USER")