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 | |
# NOTE: UPDATE PATH TO LOG FILES ON LINE 10 | |
# Prune all stopped containers | |
echo "Prune all stopped/hung containers:" | |
docker container prune | |
# Search the log file for the last occurrence of the specified message | |
last_failed_bind=$(grep -Eo "Bind for 0.0.0.0:[0-9]+ failed: port is already allocated|listen tcp4 0.0.0.0:[0-9]+: bind: address already in use" /PATHTOLOGS/shinyproxy.log | tail -n 1) |
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 | |
# 0. Ensure AWS CLI tool installed: sudo apt install awscli | |
# 1. Make shell script executable: chmod u+x ec2-spot-prices.sh | |
# 2. Run script and provide instance type to check: ./ec2-spot-prices.sh c4.8xlarge | |
# 3. Script runs and outputs full stops while querying the Amazon API, | |
# returning three columns: Region+AZ, Instance Type, Current Spot Price in $ | |
allSpot="" | |
for Reg in eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 ca-central-1 us-east-1 us-east-2 us-west-1 us-west-2 sa-east-1 ap-southeast-1 ap-northeast-1 ap-east-1 ap-northeast-2 ap-southeast-2 ap-south-1 |