View aws-trail-by-region.sh
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
# | |
# This only collecting the non read-only actions. This will save a lot of time and space. If you want all events simple remove the --lookup-attributes and the arg. | |
# | |
CMD='cloudtrail lookup-events --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false --start-time "2022-03-31, 00:00" --end-time "2022-04-03, 23:59" ' | |
for region in $(aws ec2 describe-regions --output text | awk {'print $4'}) | |
do | |
echo $region && eval aws --region $region "$CMD" |tee trail.$region.json.log |
View aws-list-by-region.sh
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
CMD="eks list-clusters" | |
CMD="ec2 describe-volumes" | |
for item in $(aws ec2 describe-regions --output text | awk {'print $4'}) | |
do | |
echo $item && aws --region $item $CMD | |
done |
View ami-clean.sh
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 | |
# This script cleans up your EC2 instance before baking a new AMI. | |
# this works on Ubuntu (18+) | |
# Run the following command in a root shell: | |
# | |
# bash <(curl -s https://gist.githubusercontent.com/AstroTom/fb0f54d125d38574eae76f57c188c4f0/raw/ami-clean.sh) | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" |
View send-slow-q.sh
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
# | |
# send to q a few treks at a time, then wait till Q is empty to send again | |
# | |
AWSACCNT=123456789012 | |
Q=https://sqs.eu-west-1.amazonaws.com/$AWSACCNT/prd_navigation_q | |
Q=https://sqs.eu-west-1.amazonaws.com/$AWSACCNT/stg_navigation_q | |
QMAX=29 # do not fill Q with more than these |
View aws-assume-exp.sh
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 | |
# Tom R. | |
# based on https://gist.github.com/dukejones/36128decdb1e003ac5d77f5c4523f1f5 | |
# Changed to use ~/.aws/config instead | |
# | |
set -e | |
usage () { |
View credentials.sh
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
# | |
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# You must use 'source' to run this file, otherwise it has no effect | |
# Alternately, you can put it in .bashrc | |
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# e.g. | |
# $ source credentials.sh | |
# | |
# |
View fix-bucket-acl.sh
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 | |
# | |
# Change the ownership of anonymously owned objects in my Amazon S3 bucket | |
# see https://aws.amazon.com/premiumsupport/knowledge-center/s3-object-change-anonymous-ownership/ | |
# | |
# The -r option passed to read command prevents backslash escapes from being interpreted. | |
# Add IFS= option before read command to prevent leading/trailing whitespace from being trimmed | |
# | |
echo 'NOTE: You can ignore the error: |
View resize-eli-up.sh
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
# | |
# resize an ec2 between t3.medium and GPU g4dn.xlarge | |
# | |
AWS_INSTANCE_ID=i-0d286d48c371f57b1 | |
TYPE=g4dn.xlarge | |
echo This will stop your instance $AWS_INSTANCE_ID to type $TYPE | |
# find name | |
echo Name tag is: |
View resize-eli-down.sh
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
# | |
# resize an ec2 from and GPU g4dn.xlarge to t3.medium | |
# | |
AWS_INSTANCE_ID=i-0d286d48c371f57b1 | |
TYPE=t3.medium | |
echo This will stop your instance $AWS_INSTANCE_ID to type $TYPE | |
# find name | |
echo Name tag is: |
View live-server
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/sh | |
# May 2018 | |
# removed iptables and just run directly on port 443 | |
# added RNT_ENV | |
# | |
# | |
# read in wishtrip config file for value of RNT_ENV etc | |
# |
NewerOlder