Skip to content

Instantly share code, notes, and snippets.

View eamonnfaherty's full-sized avatar

Eamonn Faherty eamonnfaherty

View GitHub Profile
#!/usr/bin/env bash
set -e
echo "Starting to prune change sets"
ALL_STACKS=$(aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE UPDATE_ROLLBACK_COMPLETE --query 'StackSummaries[].StackName' --output text)
for STACK_NAME in $ALL_STACKS
do
@eamonnfaherty
eamonnfaherty / gist:7ac332daf24a0d6d7fc313c8ba72045c
Created January 20, 2021 15:07
terminates products, deletes products and portfolios across your org
import boto3
from multiprocessing import Pool
import traceback
# config
account_access_role_arn = "arn:aws:iam::{}:role/OrganizationAccountAccessRole"
regions_to_clean = [
"eu-west-1",
"eu-west-2",
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: '2010-09-09'
Description: IAM Role needed to use AWS Organizations to assume role into member AWS Accounts.
Parameters:
ServiceCatalogFactoryAccountId:
Description: The account you will be installing AWS Service Catalog Factory into
Type: String
Cable Modem Status
Item Status Comments
Acquired Downstream Channel (Hz)
402750000
Locked
Ranged Upstream Channel (Hz)
39400000
Locked
Provisioning State
@eamonnfaherty
eamonnfaherty / filename
Created December 15, 2019 02:04
some description
Schema: factory-2019-04-01
Products:
- Name: "aws-config-enable-config"
Owner: "data-governance@example.com"
Description: "Enables AWS Config"
Distributor: "cloud-engineering"
SupportDescription: "Speak to data-governance@example.com about exceptions and speak to cloud-engineering@example.com about implementation issues"
SupportEmail: "cloud-engineering@example.com"
SupportUrl: "https://wiki.example.com/cloud-engineering/governance/aws-config-enable-config"
Tags:
@eamonnfaherty
eamonnfaherty / pre-push
Last active December 11, 2018 21:22
delete your internet password for AWS CodeCommit repos
#!/bin/sh
# guide on how to add global git hooks:
# https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
# add this as a pre-push git hook
# .git/hooks/pre-push
remote="$1"
url="$2"
REGION=$(git remote -v | grep codeco | awk -F\/ '{print $3}' | awk -F. '{print $2}' | uniq)
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst puppet
1 2016-02-12
1 2016-02-16
1 2016-02-24
1 2016-03-02
1 2016-03-18
1 2016-03-24
1 2016-04-07
1 2016-04-08
1 2016-04-12
1 2016-04-27
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
# A category can be added with @category
HELP_FUN = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^(\w+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; \
for (keys %help) { \
print "$$_:\n"; $$sep = " " x (20 - length $$_->[0]); \
@eamonnfaherty
eamonnfaherty / envelope_encryption_kms_boto_pycrypto.md
Created August 21, 2016 22:12 — forked from pmp/envelope_encryption_kms_boto_pycrypto.md
Envelope Encryption using AWS KMS, Python Boto, and PyCrypto.

If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.

KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.

The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.

KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio