Skip to content

Instantly share code, notes, and snippets.

@darthfork
Last active September 30, 2025 19:20
Show Gist options
  • Select an option

  • Save darthfork/f12d6473f2959acb345dbcaee91297b1 to your computer and use it in GitHub Desktop.

Select an option

Save darthfork/f12d6473f2959acb345dbcaee91297b1 to your computer and use it in GitHub Desktop.
Dump of some old binaries that were kicked out of the dotfiles repo as they are no longer in active use
#!/usr/bin/env bash
# Sample aws credentials file
# [default]
# credential_process = sh -c "$HOME/.local/bin/awscreds_lpass personal_aws_creds"
readonly lastPassEntry=$1
readonly accessKeyId=$(lpass show --username "$lastPassEntry")
readonly secretAccessKey=$(lpass show --password "$lastPassEntry")
# Create JSON object that AWS CLI expects
jq -n \
--arg accessKeyId "$accessKeyId" \
--arg secretAccessKey "$secretAccessKey" \
'.Version = 1
| .AccessKeyId = $accessKeyId
| .SecretAccessKey = $secretAccessKey'
#!/usr/bin/env bash
ICON=$HOME/.config/i3/icon.png
TMPBG=/tmp/screen.png
scrot /tmp/screen.png
convert $TMPBG -scale 10% -scale 1000% $TMPBG
convert $TMPBG $ICON -gravity center -composite -matte $TMPBG
i3lock -i $TMPBG
#!/usr/bin/env bash
echo "!!!! WARNING !!!!"
echo "DO NOT RUN THIS MORE THAN ONCE"
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
if [[ $(uname -s) != 'Linux' ]]; then
echo "This script is intended to be run on linux only"
fi
cat << EOF >> /etc/zshrc
autoload -U +X compinit && compinit
source <(kubectl completion zsh)
complete -C '$(command -v aws_completer)' aws
EOF
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "$0 needs name of guest"
exit 1
fi
virsh --connect qemu:///system dumpxml "$1" |\
grep "mac address" |\
awk -F\' '{print $2}' |\
while read -r mac; do
ip neigh | grep "$mac" | awk '{print $1}'
done
#!/usr/bin/env bash
# Fuzzy man page explorer with dmenu
if [ $# -eq 0 ]; then
man -k . | awk -F- '{print $1}' | fzf | tr -d '\([0-9]\)' | xargs man
# comment above and uncomment below if you are running i3wm and dmenu
# man -k . | dmenu -l 30 | awk '{print $1}' | xargs -r man
else
man "$@"
fi
#!/usr/bin/env bash
ISO=""
NETWORK="default"
NAME=""
POOL="$HOME/libvirt_pool"
usage(){
cat <<EOF
Usage: $0 [options]
-i|--iso name of iso file in the storage pool
-n|--name name of the domain/host
-b|--bridge Bridged network
EOF
}
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-i|--iso)
ISO="$2"
shift
shift
;;
-b|--bridged)
NETWORK="bridge:br0"
shift
;;
-n|--name)
NAME="$2"
shift
shift
;;
*)
usage
exit 1
;;
esac
done
if [[ -z "$NAME" ]]; then
echo "Please provide a domain/host name"
usage
exit 1;
fi
if [[ -z "$ISO" ]]; then
echo "Please provide installation cdrom"
usage
exit 1;
fi
virt-install\
--connect qemu:///system\
--network $NETWORK\
--cdrom "$POOL/$ISO"\
--name "$NAME"\
--ram=4096\
--vcpus=2\
--disk path="$POOL/$NAME.qcow2",size=20,sparse=yes\
--check disk_size=off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment