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
| 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 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
| { | |
| "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 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 | |
| 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 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 | |
| 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 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 | |
| # 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 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 | |
| # 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 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 | |
| # 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 |
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 | |
| # Transfers a single file via script. | |
| # Note the optional --encrypt flag. | |
| set -e | |
| globus=`which globus` | |
| srce=c4d80096-7612-11e7-8b5e-22000b9923ef | |
| dest=c4d80096-7612-11e7-8b5e-22000b9923ed |
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
| # DC/OS Prep for Install | |
| # | |
| # The following playbooks should be run, in order, to prep a CentOS cluster for installation of DC/OS. | |
| # This list is based on the software prerequisites published by Mesosphere: | |
| # https://docs.mesosphere.com/1.11/installing/production/system-requirements/ | |
| - 1-add-ansible-user.playbook | |
| - 2-install-basics.playbook | |
| - 3-add-nogroup.playbook | |
| - 4-docker.playbook |
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 | |
| # Display the EIPs associated with all of your instances: | |
| aws ec2 describe-instances \ | |
| | jq -r .Reservations[].Instances[].PublicIpAddress | |
| # Display the EIP attached to a specific EC2 instance: | |
| aws ec2 describe-instances --instance-ids i-1a2b3c4d5e6f7g8h9i \ | |
| | jq -r .Reservations[0].Instances[0].PublicIpAddress |
OlderNewer