Skip to content

Instantly share code, notes, and snippets.

View kmcquade's full-sized avatar

Kinnaird McQuade kmcquade

View GitHub Profile
@krisnova
krisnova / Terraform-Destroy-Provisioners.md
Last active January 20, 2018 20:04
Destroy Provisioners in Terraform

Destroy Provisioners in Terraform

Feature Spec - Issue #386

Terraform users would like to see Terraform support destroy provisioners that would run before a destroy action. There are many use cases documented in the terraform github issue #386 on how this would be helpful to users.

It seems the Terraform community has a shared consesus that custom destroy steps should be handled somehow with a terraform provisioner. This feature spec is an attempt to propose a solution to the following question.

What would be the best way to implement custom destroy action with provisioners?

#!/usr/bin/env bash
#
# Check a WordPress domain against CVE-2017-8295.
# https://exploitbox.io/vuln/WordPress-Exploit-4-7-Unauth-Password-Reset-0day-CVE-2017-8295.html
#
# Usage:
# ./wordpress-host-check <domain> <username>
#
# <domain>
# The WordPress domain you wish to check. For example, http://example.com.
@sdesalas
sdesalas / Terraform-Blue-Green-AWS.md
Created June 21, 2017 06:54 — forked from ryan0x44/Terraform-Blue-Green-AWS.md
Blue-Green AWS Auto Scaling Deployments with Terraform

A quick note on how I'm currently handling Blue/Green or A/B deployments with Terraform and AWS EC2 Auto Scaling.

In my particular use case, I want to be able to inspect an AMI deployment manually before disabling the previous deployment.

Hopefully someone finds this useful, and if you have and feedback please leave a comment or email me.

Overview

I build my AMI's using Packer and Ansible.

@TyMac
TyMac / gist:2c7a907af17cb4c8d2479ad5b16cad5c
Created June 7, 2018 19:23
Assure an ENA instance boots after a yum update
tldr - remove microcode_ctl package - configure dracut to insure needed drivers are included for kernel/initrd updates
And exmaple - The Chef way:
################
1.) create a recipe with the following code:
################
if node['ec2']['instance_type'].include? ( "c5" || "f1" || "g3" || "h1" || "i3" || "m4.16xlarge" || "m5" || "p2" || "p3" || "r4" || "x1" )
template '/etc/dracut.conf' do
@webstandardcss
webstandardcss / pedantically_commented_playbook.yml
Last active April 23, 2019 06:03 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options.
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@0xdabbad00
0xdabbad00 / aws actions
Created August 3, 2018 17:10
AWS API calls as extracted from boto using the technique on https://github.com/duo-labs/cloudtracker#aws_actionstxt
a4b:AssociateContactWithAddressBook
a4b:AssociateDeviceWithRoom
a4b:AssociateSkillGroupWithRoom
a4b:CreateAddressBook
a4b:CreateContact
a4b:CreateProfile
a4b:CreateRoom
a4b:CreateSkillGroup
a4b:CreateUser
a4b:DeleteAddressBook
@0xdabbad00
0xdabbad00 / gist:e25cf5599881c13d3b644bc4109cf619
Created August 9, 2018 14:40
trailblazer output (https://github.com/willbengtson/trailblazer-aws). Did have to comment out the call for s3 `upload_file` and `upload_fileobj`. Output sorted and the header line moved back to the top.
EventSource, EventName, Recorded Name, Match
a4b, AssociateDeviceWithRoom, associatedevicewithroom, True
a4b, AssociateSkillGroupWithRoom, associateskillgroupwithroom, True
a4b, CreateProfile, createprofile, True
a4b, CreateRoom, createroom, True
a4b, CreateSkillGroup, createskillgroup, True
a4b, CreateUser, createuser, True
a4b, DeleteProfile, deleteprofile, True
a4b, DeleteRoom, deleteroom, True
a4b, DeleteRoomSkillParameter, deleteroomskillparameter, True
@0xdabbad00
0xdabbad00 / privilege_verbs.txt
Last active October 6, 2019 22:13
AWS IAM privilege verbs, use https://gist.github.com/0xdabbad00/fa918ad85c0c3f0e0fa9a3f6b53696de and `cat privileges.txt | sed 's/.*://' | sed 's/\([A-Z][a-z]*\).*/\1/' | sort | uniq -c` and then removed the one letter apigateway results.
5 Abort
9 Accept
3 Acknowledge
4 Activate
48 Add
23 Admin
6 Allocate
4 Apply
2 Approve
1 Archive
a4b
account
acm
acm-pca
amplify
apigateway
application-autoscaling
appstream
appsync
artifact
@woodhull
woodhull / auto_scaling_group.rb
Created July 31, 2015 02:01
random bits of ruby for doing green/blue deploys
require "timeout"
class AutoScalingGroup
attr_accessor :name
def initialize(attrs = {})
attrs.each do |key,value|
if self.respond_to?("#{key}=")
self.send("#{key}=", value)
end