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 | |
hosted_zone_id="<your Route53 hosted zone id>" | |
domain_name="<your domain name>" | |
# Abort script on any errors | |
set -e | |
# Get new IP address | |
ip_address=`curl http://169.254.169.254/latest/meta-data/public-ipv4` |
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 | |
tempdir="blog-export/" | |
editdomain=editor.example.com | |
publishdomain=blog.example.com | |
# fail on any errors | |
set -e | |
# clean up previous run |
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/python | |
# This script will download a file from a URL and stream it directly | |
# into AWS S3 without persisting the file to local disk. | |
# File is streamed as it arrives, so memory usage is low (typically <100MB) | |
import boto3, urllib2 | |
source_url = 'http://<Your URL Here>' |
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/python | |
# This script will download a file from a S3 bucket in one AWS account | |
# and stream it directly into another S3 bucket in another account. | |
# File is streamed as it arrives, so memory usage is low (typically <100MB) | |
import boto3 | |
# Create two S3 clients, one in each AWS account | |
# If wanting to use an instance role for one client, remove the access key parameters |
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
################################################################################################ | |
# Add the following code to your .bashrc file to add the all-regions command to your terminal | |
# This code will run the specified command once for each AWS region you have access to | |
################################################################################################ | |
all-regions () { | |
for region in `aws ec2 describe-regions --query "Regions[].RegionName" --output text` | |
do | |
echo "Region: $region..." | |
eval "$@ --region $region" | |
done |