Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Ward atward

  • Melbourne, Australia
View GitHub Profile
@atward
atward / aws-console
Last active May 26, 2017
AWS Web console login via boto credentials (IAM access token/profile)
View aws-console
#!/usr/bin/env python
import boto3
import json
import sys
import urllib2
import webbrowser
from urllib import urlencode
@atward
atward / custom-resource.yaml
Created Nov 21, 2016
AWS Custom resource example. Multiplies number by 42
View custom-resource.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: 'Custom resource test'
Parameters:
Value:
Type: Number
Description: input a number
Default: 1
Resources:
@atward
atward / asg-suspend.yaml
Last active Nov 20, 2016
AWS CustomResource example - Autoscaling group suspend/resume processes
View asg-suspend.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: 'Custom resource example - ASG suspend/resume'
Parameters:
Input:
Type: String
Description: Make ASG
Default: true
AllowedValues: [true, false]
@atward
atward / cf-templater.yaml
Last active Jan 24, 2017
CloudFormation Templating Custom Resource
View cf-templater.yaml
# NOTE: there is a 4k CustomResource response limit, so keep all templates well under that
AWSTemplateFormatVersion: 2010-09-09
Description: 'CloudFormation Templating Custom Resource'
Resources:
TemplateFunctionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
View cloud-init_chef-zero.yaml
#cloud-init
# https://docs.chef.io/packages.html#enterprise-linux
# vendor chef-repo to /var/lib/chef with cookbooks in /var/lib/chef/cookbooks
yum_repos:
chef-stable:
name: chef-stable
baseurl: https://packages.chef.io/stable-yum/el/7/\$basearch/
enabled: true
failovermethod: priority
@atward
atward / source_tfvars.sh
Last active Jul 13, 2021
Rudimentary parsing of terraform tfvars in bash
View source_tfvars.sh
#!/bin/bash
# source: https://gist.github.com/atward/7a2eb1b4a78fbaebe585
# here be dragons: this is as dangerous as it looks
## terraform variable defaults
# takes *.tf and assigns env=default (if any)
# - map not supported (obvious reasons)
# - Tested on Darwin sed(1) only
function source_tfdefaults() {
eval "$(
View POK3R-Layer-3-OSX.kbd.json
[
{
"name": "POK3R Layer 3 OSX",
"author": "sublimal",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-C1xx",
"plate": true
},
[
View POK3R-Layer-2-Windows.kbd.json
[
{
"name": "POK3R Layer 2 Windows",
"author": "sublimal",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-C1xx",
"plate": true
},
[
View POK3R-Default.kbd.json
[
{
"name": "POK3R Default",
"author": "Vortex"
},
[
{
"y": 1.5,
"c": "#3c4041",
"t": "#aba18b",
View POK3R-Default-v1_14.kbd.json
[
{
"name": "POK3R Default v1.14",
"author": "Vortex"
},
[
{
"c": "#3c4041",
"t": "#aba18b",
"p": "DCS",