Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am stevehoggnz on github.
  • I am stevehogg (https://keybase.io/stevehogg) on keybase.
  • I have a public key ASCkpu8ZPsaiafMHIqjcbuylMSAPLsK9h_SNeEVH-Ld7Sgo

To claim this, I am signing this object:

@SteveHoggNZ
SteveHoggNZ / gist:37d0d4b3b804354e6e881dd494c2c6fd
Created February 4, 2018 21:54
Git - Create local branch from remote pull request
git clone https://github.com/awslabs/aws-mobile-react-native-starter.git
cd aws-mobile-react-native-starter
git fetch origin pull/49/head:feat/amplify-v2
git checkout feat/amplify-v2
@SteveHoggNZ
SteveHoggNZ / curl-cors-test.sh
Created February 12, 2017 20:31
curl / CORS headers
curl -H "Origin: http://example.com" --verbose https://fill-in-the-blanks.h4.nz/markdown/About.md
@SteveHoggNZ
SteveHoggNZ / gist:222a8216ce0bbb6943b2d1029274b75d
Created January 20, 2017 02:49
CloudFormation / Public-readable bucket policy
"MyS3BucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": { "Ref": "MyS3Bucket" },
"PolicyDocument" : {
"Version":"2012-10-17",
"Statement":[{
"Sid": "PublicReadAccess",
"Effect": "Allow",
"Principal": "*",
@SteveHoggNZ
SteveHoggNZ / gist:3347bf2ab30f16a29b44c936ebcdd39a
Created December 2, 2016 00:12
CloudFormation / Nested stack bastion example
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "EC2 Bastion Server",
"Parameters": {
"VpcId": {
"Type": "AWS::EC2::VPC::Id",
"Description": "The VPC ID"
},
"DeployBastion": {
"Description": "Should a bastion server be deployed?",
@SteveHoggNZ
SteveHoggNZ / gist:cd3855a329632a3c3934adb80a5a646d
Created December 2, 2016 00:02
CloudFormation / Nested stack example
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Master template that includes nested templates",
"Parameters": {
"DeployBastion": {
"Description": "Should a bastion server be deployed?",
"Default": "No",
"Type": "String",
"AllowedValues": ["No", "Yes"]
}
@SteveHoggNZ
SteveHoggNZ / gist:bdc55a1a6c633346f44620f1a9a9d848
Created December 1, 2016 22:50
CloudFormation / DeletionPolicy example
{
"Resources": {
"myS3Bucket": {
"Type" : "AWS::S3::Bucket",
"Properties" : {},
"DeletionPolicy" : "Retain"
},
"myEBSVolume": {
"Type":"AWS::EC2::Volume",
"Properties" : {
@SteveHoggNZ
SteveHoggNZ / gist:2319b3bf3c30a2f1876c0dbf7aaba5c6
Created December 1, 2016 06:44
CloudFormation / WaitCondition / WaitConditionHandler example
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Mappings" : {
"RegionMap" : {
"us-east-1" : {
"AMI" : "ami-76f0061f"
},
"us-west-1" : {
"AMI" : "ami-655a0a20"
},
@SteveHoggNZ
SteveHoggNZ / gist:9a58f2dba8e2205f84be33a706b052a9
Created December 1, 2016 00:26
CloudFormation / CreationPolicy / AutoScalingGroup example
{
"Resources": {
"AutoScalingGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": { "Fn::GetAZs": "" },
"LaunchConfigurationName": { "Ref": "LaunchConfig" },
"DesiredCapacity": "2",
"MinSize": "1",
"MaxSize": "4"
@SteveHoggNZ
SteveHoggNZ / gist:4cc9e5d60fe546ffbd73870379fb5f64
Created November 30, 2016 21:58
CloudFormation / CreationPolicy / Minimal EC2 example
{
"Resources": {
"SSHServerSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"VpcId" : "vpc-fdcfd098",
"GroupDescription" : "Allow SSH access",
"SecurityGroupIngress" : [
{"IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "<REDACTED>/32"}
]