Cool commands I use all the time

Started on 2020-05-22

Enable SSH on Raspbian via MacOS and eject the disk when done:

touch /Volumes/boot/ssh && diskutil list | grep external | awk '{ print $1 }' | xargs diskutil unmountDisk

Get credentials from EC2 instance meta-data:


Extract credentials into environment variables:


export AWS_ACCESS_KEY_ID=$(jq --raw-output .AccessKeyId <(echo $CREDENTIALS))
export AWS_SECRET_ACCESS_KEY=$(jq --raw-output .SecretAccessKey <(echo $CREDENTIALS))
export AWS_SESSION_TOKEN=$(jq --raw-output .Token <(echo $CREDENTIALS))