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 | |
# This script creates a series of prompts to create an AMI of an EC2 instance from a few AWS profiles | |
# Comes with a fixed US-East-1 to US-West-2 migration path. Modify accordingly for your own needs. | |
# 09.05.2014 Neal Magee | |
set -e | |
clear | |
echo "" | |
read -p " What AWS profile does this AMI belong to? (Enter 'default' to use that profile): " profile |
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 | |
# This script creates a series of prompts to create an AMI of an EC2 instance from a few AWS profiles | |
# Note that the YYYYmmdd- is added to the name of the AMI automatically | |
set -e | |
clear | |
# Check for AWS CLI tools | |
type aws >/dev/null 2>&1 || { echo >&2 "\n\n I require the AWS CLI but it's not installed. Please visit http://aws.amazon.com/cli/ and install it. Aborting.\n"; exit 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
#!/usr/bin/env python | |
# http://boto3.readthedocs.org/en/latest/reference/services/rds.html | |
import boto3 | |
import sys, getopt | |
bucket = None | |
file_path = None | |
timeout_seconds = 3600 |
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
import boto3 | |
import botocore | |
import errorsns # A custom SNS handler | |
def check_queue(): | |
client = boto3.client('sqs', region_name='us-east-1') | |
req = client.receive_message( | |
QueueUrl='https://sqs.us-east-1.amazonaws.com/123456789012/my-queue', | |
MessageAttributeNames=[ | |
'JobID', |
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
{ | |
"success": { | |
"total": 1 | |
}, | |
"contents": { | |
"quotes": [ | |
{ | |
"quote": "When it comes to winning, you need the skill and the will.", | |
"length": "58", | |
"author": "Frank Tyger", |
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 | |
bucket='YOUR-BUCKET-NAME' | |
dir='/your/local/directory/' | |
aws s3 sync $dir s3://$bucket | |
# If you want the bucket to match the local directory exactly, including any files | |
# you may delete at a later point, add --delete after sync | |
# |
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 | |
bucket='YOUR-BUCKET-NAME' | |
dir='/your/local/directory/' | |
aws s3 sync s3://$bucket/ $dir | |
# If you want the bucket to match the local directory exactly, including any files | |
# you may delete at a later point, add --delete after sync | |
# |
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 can be one or more EC2 instance IDs, separated by a space. No commas. | |
instanceIds='' | |
aws ec2 start-instances --instance-ids $instanceIds | |
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 can be one or more EC2 instance IDs, separated by a space. No commas. | |
instanceIds='' | |
aws ec2 stop-instances --instance-ids $instanceIds | |
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 | |
# Transfers a directory, recurisvely. | |
# Note the optional --encrypt flag. | |
set -e | |
globus=`which globus` | |
srce=c4d80096-7612-11e7-8b5e-22000b9923ef | |
dest=c4d80096-7612-11e7-8b5e-22000b9923ed |
OlderNewer