Skip to content

Instantly share code, notes, and snippets.

View tamsky's full-sized avatar

Marc Tamsky tamsky

View GitHub Profile
@tamsky
tamsky / BundleConfig.ps1
Created January 28, 2017 20:55 — forked from mefellows/BundleConfig.ps1
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@tamsky
tamsky / iam-terraform-create-policy.tf
Created February 20, 2017 19:16 — forked from arsdehnel/iam-terraform-create-policy.tf
AWS IAM policies for running Terraform from an EC2 instance.
resource "aws_iam_policy" "terraform_create_policy" {
name = "terraform_create_policy"
path = "/"
policy = "${data.aws_iam_policy_document.terraform_create_policy.json}"
}
data "aws_iam_policy_document" "terraform_create_policy" {
statement {
sid = "1"
actions = [
@tamsky
tamsky / ipsec.conf
Created April 1, 2017 05:14 — forked from nlacourte/ipsec.conf
StrongSwan ipsec updown script for mangle TCPMSS
#Ipsec.conf example
conn vrackxxxxx_psk
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
authby=secret
keyexchange=ikev2
mobike=no
auto=add
@tamsky
tamsky / delete_all_object_versions.sh
Created August 30, 2017 17:12 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@tamsky
tamsky / github_repo.py
Created September 13, 2017 00:58 — forked from toast38coza/github_repo.py
An Ansible module for managing github repos
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
@tamsky
tamsky / gulpfile.coffee
Created September 29, 2017 05:12 — forked from koenbok/gulpfile.coffee
Wercker Git Versions
gulp.task "version", (callback) ->
async.series [
(cb) -> command("git rev-parse --abbrev-ref HEAD", cb) # branch
(cb) -> command("git describe --always --dirty", cb) # hash
(cb) -> command("git rev-list --count HEAD", cb) # build
], (err, results) ->
info =
branch: results[0]
@tamsky
tamsky / aws.md
Created January 10, 2018 22:24 — forked from colinvh/aws.md
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

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

Schemes

@tamsky
tamsky / TfExternal.py
Created February 15, 2018 01:34 — forked from lorengordon/TfExternal.py
Python helper for a Terraform External provider
import json
class TfExternal(object):
"""Wrap Terraform External provider."""
@staticmethod
def query_args(obj):
"""Load json object from stdin."""
return {} if obj.isatty() else json.load(obj)
@tamsky
tamsky / all_aws_managed_policies.json
Created August 6, 2018 23:47 — forked from gene1wood/all_aws_managed_policies.json
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
{
"AWSAccountActivityAccess": {
"Arn": "arn:aws:iam::aws:policy/AWSAccountActivityAccess",
"AttachmentCount": 0,
"CreateDate": "2015-02-06T18:41:18+00:00",
"DefaultVersionId": "v1",
"Document": {
"Statement": [
{
"Action": [
@tamsky
tamsky / vmware-ubuntu-workspace.md
Created August 11, 2018 03:08 — forked from earnubs/vmware-ubuntu-workspace.md
Ubuntu on VMware with LXD containers