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 argparse | |
""" | |
Creates multiplication tables | |
""" | |
def get_arguments(): | |
parser = argparse.ArgumentParser( | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter, |
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
# Requires AWSPowerShell.NetCore Module | |
# Install-Module AWSPowerShell.NetCore | |
# https://www.powershellgallery.com/packages/AWSPowerShell.NetCore | |
foreach ($OhNoes in Get-S3Bucket) { | |
if (($OhNoes | Get-S3ACL).Grants.Grantee | where {$_.URI -eq 'http://acs.amazonaws.com/groups/global/AllUsers'}) { | |
$OhNoes | |
} | |
} |
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 | |
s3 = boto3.resource('s3') | |
for bucket in s3.buckets.all(): | |
for oh_noes in s3.BucketAcl(bucket.name).grants: | |
if oh_noes['Grantee']['Type'] == 'Group' and oh_noes['Grantee']['URI'] == 'http://acs.amazonaws.com/groups/global/AllUsers': | |
print(bucket) |
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
#!/usr/bin/env bash | |
# Requires awcli | |
# pip install awscli --user --upgrade | |
# https://docs.aws.amazon.com/cli/latest/userguide/installing.html | |
BUCKETS=`aws s3api list-buckets --query 'Buckets[*].Name' --output text | tr " " "\n"` | |
for BUCKET in $BUCKETS | |
do | |
OH_NOES=`aws s3api get-bucket-acl --bucket $BUCKET | grep -e 'URI.*http\:\/\/acs\.amazonaws\.com\/groups\/global\/AllUsers\"'` | |
if [ ! -z "$OH_NOES" ] |
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
#!/usr/bin/env bash | |
# Push package to S3 bucket | |
$STACK_NAME="hello-world-dev" | |
sam deploy \ | |
--template-file packaged.yaml \ | |
--stack-name $STACK_NAME \ | |
--capabilities CAPABILITY_IAM | |
# Setup Alexa Skills Kit skill ID |
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
# Install | |
sudo npm install -g ask-cli | |
# Initial Configuration of ask-cli | |
# Asks for AWS creds and Amazon Developer creds | |
ask init | |
# Duplicate existing skill | |
mkdir ask-aws-app-name | |
cd ask-aws-app-name |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Alexa App Hello World Lambda Endpoint | |
Mappings: | |
Variables: | |
AlexaSkillKit: | |
Id: amzn1.ask.skill.xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
Globals: |
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
from boto3 import client | |
def gather_aws_regions(): | |
'''Return all available AWS Regions via EC2 api''' | |
conn = client('ec2') | |
regions = conn.describe_regions(AllRegions=True)['Regions'] | |
return [region['RegionName'] for region in regions] |
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
# Personal OpenVPN Server Deployment | |
# Updates applied by Derek Ardolf / @ScriptAutomate / https://icanteven.io | |
# 11/08/2019 - Version 2.x: | |
# - Released with many updates, and tracked here: https://github.com/ScriptAutomate/openvpn-cfn | |
# | |
# Created by John Creecy / @zugdug | |
# 10/30/2017 - Version 1.0: | |
# - Original: https://gist.github.com/zugdud/b39eea02faa6926305f57fbde8d31b68 | |
# Original Linux Academy blog series walkthrough on building the old OpenVPN template: | |
# - Part 1: https://linuxacademy.com/blog/tutorials/roll-vpn-aws-cloudformation-part-one/ |
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 requests | |
import re | |
import json | |
import boto3 | |
def get_all_ec2_types(): | |
''' | |
Modified version of get_instances() from | |
https://github.com/powdahound/ec2instances.info/blob/master/ec2.py |