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 | |
tagname = "Name" | |
tagvalue = "Value" | |
ec2 = boto3.resource('ec2') | |
ec2.instances.filter(Filters=[ | |
{'Name': 'tag': [tagname], 'Values': [tagvalue]}, | |
{'Name': 'instance-state-name', 'Values': ['running']} | |
]).start() | |
ec2.instances.filter(Filters=[ |
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 | |
tagname = "Name" | |
tagvalue = "Value" | |
asg_client = boto3.client('autoscaling') | |
groups = asg_client.describe_auto_scaling_groups() | |
for group in groups[u'AutoScalingGroups']: |
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 | |
bucket = "bucket" | |
s3_client = boto3.client('s3') | |
response = s3_client.get_object(Bucket=bucket, Key="filename.yaml") | |
try: | |
configfile = yaml.safe_load(response["Body"]) | |
except yaml.YAMLError as exc: | |
return exc |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "*", | |
"Resource": "*", | |
"Condition": { | |
"Bool": { | |
"aws:MultiFactorAuthPresent": "true" |
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 json | |
# update these with your actual settings | |
maxreceivecount = 3 | |
queueurl = "https://sqs.region.amazonaws.com/accountnumber/queuename" | |
deadlettertargetarn = "arn:aws:sqs:region:accountnumber:deadletterqueuename" | |
# you could just create a json string | |
policy = {"maxReceiveCount" : maxreceivecount, "deadLetterTargetArn": deadlettertargetarn} |
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
#uncomment in nfs config file | |
LOCKD_TCPPORT=32803 | |
LOCKD_UDPPORT=32769 | |
MOUNTD_PORT=892 | |
#Setup Security Group Rules as follows | |
TCP 111 - [source] | |
UDP 111 - [source] | |
TCP 892 - [source] | |
UDP 892 - [source] |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "CloudFormation Template for deploying a local NFS Server using Amazon Linux AMI", | |
"Parameters" : { | |
"AZ1" : { | |
"Description" : "What availability zone should this stack be launched in? us-east-1a, us-east-1b, etc.", | |
"Type" : "String", | |
"Default" : "eu-west-1a", | |
"ConstraintDescription" : "must be a valid EC2 Availability Zone" | |
}, |
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
# Connect to AWS SES | |
openssl s_client -crlf -quiet -connect email-smtp.us-east-1.amazonaws.com:465 | |
openssl s_client -crlf -quiet -starttls smtp -connect email-smtp.us-east-1.amazonaws.com:25 | |
# SMTP commands | |
EHLO 2ndwatch.com | |
AUTH LOGIN | |
# Username by 'echo -n [accesskey] | base64' | |
skdfjlskdflskj |
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 datetime | |
import random | |
import string | |
import time | |
import argparse | |
import json | |
try: | |
import unicodecsv as csv | |
except ImportError: |
OlderNewer