Skip to content

Instantly share code, notes, and snippets.

@seantur
seantur / get_gh_ssh_keys.sh
Created July 29, 2021 21:08
Download github public ssh keys, and optionally exclude any by ID
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" == 0 ]; then
echo "./get_keys.sh username <key1> <key2>"
exit 1
fi
keys=$(curl -s https://api.github.com/users/${@:1:1}/keys)
function fasd_fzf_file () {
fasd -f | fzf --tac --reverse --height=25% | awk '{print $2}'
}
function fasd_fzf_dir () {
fasd - d | fzf --tac --reverse --height=25% | awk '{print $2}'
}
alias v='vim $(fasd_fzf_file)'
alias d='cd $(fasd_fzf_dir)'
@seantur
seantur / ddns.sh
Last active July 9, 2020 12:54
Update single cloudflare dns entry
#!/usr/bin/env bash
CLOUDFLARE_TOKEN=
CLOUDFLARE_EMAIL=
CLOUDFLARE_ZONE=
CLOUDFLARE_DNS_ID=
CLOUDFLARE_WEBSITE=
EXTERNAL_IP="$(curl icanhazip.com)"
@seantur
seantur / burn_iso.sh
Created December 16, 2018 15:29
Burn Iso to USB (OS X)
#!/usr/bin/env bash
# Unmount disk2 and then write iso to rdisk2
diskutil unmountDisk /dev/disk2
sudo dd if=$1 of=/dev/rdisk2 bs=1m