Skip to content

Instantly share code, notes, and snippets.

View jiamaozheng's full-sized avatar

Jiamao Zheng jiamaozheng

View GitHub Profile
@colinvh
colinvh / aws.md
Last active July 1, 2025 13:43
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@dcloud9
dcloud9 / EC2-StackPolicy-for-Updates
Last active June 6, 2018 19:08
Secure your stack from accidental deletion of resources like EC2 instance. Enable and Disable stack policy during updates.
#! /bin/bash -e
#-----
# Pre-reqs: AWSCLI tool (python, pip) installed and configured. -DC 28.1.15
# v1.1: Added parameter/value checks. -DC 23.2.15
#-----
StackName=$1
Profile=$3
Creds=$HOME/.aws/credentials
[ $# -lt 3 ] && (echo "Usage: $0 <stack-name> {on|off} <profile>"; exit 1)
@djhocking
djhocking / dplyr-select-names.R
Last active February 28, 2022 19:08
Select columns by vector of names using dplyr
one <- seq(1:10)
two <- rnorm(10)
three <- runif(10, 1, 2)
four <- -10:-1
df <- data.frame(one, two, three)
df2 <- data.frame(one, two, three, four)
str(df)
@steinsag
steinsag / s3BucketPolicyEncryptionSSL.json
Created June 11, 2014 12:03
S3 bucket policy to enforce encryption and https:// access
{
"Version": "2008-10-17",
"Id": "Policy-GENERATED-ID",
"Statement": [
{
"Sid": "DenyUnSecureCommunications",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},