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/local/bin/python3 | |
# To use this snippet: | |
# Create a bucket and upload a private file into it beforehand. | |
# To make the private file shareable for a fixed number of seconds | |
# you can "presign" the URL, which creates an expiring hashed URL. | |
# You can then distribute that URL to other systems or coleagues. | |
import boto3 |
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 | |
/usr/bin/yum update -y | |
/bin/amazon-linux-extras install -y epel | |
/usr/bin/yum install -y git python3 python3-dev python3-pip nfs-utils | |
/bin/pip3 install boto3 pandas requests |
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
# Written for AWS Lambda, for the Python 3.6 runtime. | |
import json | |
import boto3 | |
import datetime | |
## Be sure to set account number on line 57. | |
## Set DRY RUN value - for testing or running. | |
dryrun = False |
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/local/bin/python | |
import boto3 | |
import json | |
# The calls to AWS STS AssumeRole must be signed with the access key ID | |
# and secret access key of an existing IAM user or by using existing temporary | |
# credentials such as those from antoher role. | |
# Python SDK documentation: | |
# http://boto3.readthedocs.io/en/latest/reference/services/sts.html#client |
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 json | |
import boto3 | |
from datetime import datetime | |
# Use as a starter/stub -- can and should be modified for production | |
FORMAT = '%Y%m%d-%H:%M:%S' | |
now = datetime.now().strftime(FORMAT) | |
def lambda_handler(event, context): | |
invoking_event = json.loads(event['invokingEvent']) |
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/local/bin/python3 | |
# A dumb/simple script to retrieve the value of a SecretsManager secret | |
import boto3 | |
import base64 | |
from botocore.exceptions import ClientError | |
def get_secret(): |
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
# 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 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 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 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 | |