Skip to content

Instantly share code, notes, and snippets.

View chiefmikey's full-sized avatar
🎵

Mikl Wolfe chiefmikey

🎵
View GitHub Profile
@chiefmikey
chiefmikey / git-delete-remote.sh
Last active May 21, 2022 21:49
Git delete n oldest remote branches
# Delete 10 oldest branches
git fetch --prune && \
git branch -r --sort=committerdate | head -n 10 | sed 's/ origin\///' | xargs git push origin --delete
@chiefmikey
chiefmikey / user-data.sh
Created February 23, 2022 22:48
AWS EC2 run a script on every instance start
# Select the AWS EC2 instance and change the state to stopped
# Go to Actions -> Instance settings -> Edit user data
# Paste this with your script and save
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
@chiefmikey
chiefmikey / subdir-up.sh
Last active January 22, 2024 14:29
Move files from subdirectories to root
find . -mindepth 2 -type f -print -exec mv {} . \;