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
| <# | |
| - BIOS of host machine also needs to be configured to allow hardware virtualization | |
| - Windows 10 Pro or otherwise is needed; Windows 10 Home Edition CANNOT get WSL | |
| - This gist WSLv2, but can use WSLv1 instead. I needed v1 as I run Windows 10 in a VM in Virtualbox. | |
| - WSLv2 has been giving me problems in Virtualbox 6.1, but WSLv1 works properly. | |
| - vbox has issues with the GUI settings when it comes to nested virtualization on certain systems, | |
| so run the following if needing to give a VM this enabled setting: | |
| VBoxManage modifyvm <vm-name> --nested-hw-virt on | |
| #> |
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
| <# | |
| Tested On: | |
| PSVersion PSEdition | |
| --------- --------- | |
| 6.2.2 Core | |
| Prereqs: | |
| AWS DOCS | |
| - git clone https://github.com/awsdocs/aws-cloudformation-user-guide.git | |
| CFN Spec File |
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 |
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
| 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
| 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
| # 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
| #!/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
| #!/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
| 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) |