This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read -r MODULE; do | |
terraform_0.12.29 init "$MODULE" | |
yes yes | terraform_0.12.29 0.12upgrade "$MODULE" | |
yes yes | terraform_0.13.2 0.13upgrade "$MODULE" | |
rm -rf .terraform & | |
wait $! | |
done < <( | |
find . -type d | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N=100 | |
for job in {1..1000}; do | |
((i=i%N)); ((i++==0)) && wait | |
python something.py & | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import statsd | |
STATSD_HOST = os.environ.get('STATSD_HOST', 'localhost') | |
STATSD_PORT = os.environ.get('STATSD_PORT', 8125) | |
STATSD = statsd.StatsClient(STATSD_HOST, STATSD_PORT) | |
def main(): | |
STATSD.incr('invoke') | |
mfa_code = get_totp() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# backup | |
plutil -p ~/Library/Preferences/com.apple.Terminal.plist | |
# restore | |
# tbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minikube config set memory 16384 | |
minikube config set cpus 4 | |
minikube config set vm-driver virtualbox | |
minikube start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENDPOINT=https://something/ping | |
while true; do | |
curl -s "$ENDPOINT" > /dev/null && | |
printf "." || | |
printf "\n%sFAIL\n" "$(date)"; | |
sleep; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restart pods in a deployment | |
kubepatch(){ | |
TYPE="${1:-"deployment"}" | |
NAMESPACE="${2:-"dev"}" | |
NAME="$(kubectl get "$TYPE" -n "$NAMESPACE" | awk '{print $1}' | fzf)" | |
kubectl patch "$TYPE" \ | |
"$NAME" \ | |
-n "$NAMESPACE" \ | |
-p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"$(date '+%s')\"}}}}}" && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
def call(Map parameters) { | |
env = parameters.env | |
service = parameters.service | |
region = parameters.region | |
withCredentials([ | |
string(credentialsId: 'GITHUB_ACCESS_TOKEN', variable: 'GITHUB_ACCESS_TOKEN') | |
]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Change file extensions | |
while read -r f; do | |
git mv "${f%.*}.yml" "${f%.*}.yaml" | |
done < <( | |
find . -name "*.yml" | |
) |