Last active
April 8, 2020 13:42
-
-
Save ekesken/a1045085dcd8df659930010d2ed37abb to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -eo pipefail | |
cat /tmp/copy-pasted-text-from-browser.txt \ | |
| grep host | awk -F: '{print $2}' \ | |
| xargs -P6 -n 10 aws ec2 describe-instances --query 'Reservations[*].Instances[*].PrivateIpAddress' --output text --instance-ids \ | |
| xargs -P6 -n 1 -I % ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" % docker image prune -a -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just select table content below
and copy-paste it into /tmp/copy-pasted-text-from-browser.txt and then run the script.
you need to have this setting in your ssh_config: