This file contains hidden or 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
from hashlib import md5 | |
import os | |
import sys | |
from argparse import ArgumentParser | |
parser = ArgumentParser(description='Compare an S3 etag to a local file') | |
parser.add_argument('inputfile', help='The local file') | |
parser.add_argument('etag', help='The etag from s3') | |
args = parser.parse_args() |
This file contains hidden or 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 | |
#require two regions as parameters | |
# example: ./rc.sh us-east-2 us-west-1 | |
# | |
# will outoput the following: | |
# | |
# Service count | |
# ------------- | |
# us-east-2 has 205 services |
This file contains hidden or 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 | |
# CIDR should be provided as an argument | |
#example ./byoip.sh 1.1.1.0/24 | |
if [[ $# -eq 0 ]] ; then | |
echo '1 argument required: BYOIP CIDR in notation n.n.n.n/nn' | |
echo 'i.e. ./byoip.sh 1.1.1.0/24' | |
exit 1 | |
fi | |
#get account from default user in ~/.aws/credetials |
This file contains hidden or 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 | |
declare -a regions=() | |
#from parameter store get list of regions | |
regionlist=$(aws ssm get-parameters-by-path --path /aws/service/global-infrastructure/regions/ | jq .Parameters[].Value | cut -d'"' -f 2) | |
# count number of regions | |
regioncount=$(echo ${regionlist} | wc -w | tr -d '[:space:]') | |
# put regions into an array | |
for region in "${regionlist[@]}" |
This file contains hidden or 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 | |
/usr/bin/yum -y install httpd | |
/sbin/chkconfig httpd on | |
/sbin/service httpd start | |
/bin/echo “Welcome to my web server. My private IP is” > /var/www/html/index.html | |
/opt/aws/bin/ec2-metadata -o | /bin/cut -d: -f2 | /bin/cut -d" " -f2 >> /var/www/html/index.html |
This file contains hidden or 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
<?php | |
require 'vendor/autoload.php'; | |
use Aws\SecretsManager\SecretsManagerClient; | |
use Aws\Exception\AwsException; | |
$client = new SecretsManagerClient([ | |
'region' => 'us-east-1', | |
'version' => '2017-10-17', | |
]); |