Skip to content

Instantly share code, notes, and snippets.

Tom Davidson tomdavidson

Block or report user

Report or block tomdavidson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomdavidson
tomdavidson / ghteams.tf
Last active Sep 3, 2019
tf to create children teams after looking up parent ids
View ghteams.tf
## Existing list of teams with members list:
"0" = {
"description" = "No one cared enough to add a description to this team"
"members" = [
{
"role" = "maintainer"
"username" = "bob"
},
{
@tomdavidson
tomdavidson / main.tf
Created Sep 1, 2019
the find file sub mod
View main.tf
variable "filter" {
type = string
default = "*.yaml"
description = "The pattern used to filter files, i.e. '*.yaml'."
}
variable "search_dir" {
type = string
default = "."
description = "The the directory to search from. Default is '.'."
View gist:26a05aff8b31ee85338ae3b348732dd8
$ terraform plan
2019/09/01 02:45:19 [INFO] Terraform version: 0.12.7
2019/09/01 02:45:19 [INFO] Go runtime version: go1.12.9
2019/09/01 02:45:19 [INFO] CLI args: []string{"/home/tom/.asdf/installs/terraform/0.12.7/bin/terraform", "plan"}
2019/09/01 02:45:19 [DEBUG] Attempting to open CLI config file: /home/tom/.terraformrc
2019/09/01 02:45:19 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/09/01 02:45:19 [INFO] CLI command args: []string{"plan"}
2019/09/01 02:45:19 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/09/01 02:45:19 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/09/01 02:45:19 [DEBUG] New state was assigned lineage "156a7836-272f-0a26-f953-8f8fc4b37f8b"
@tomdavidson
tomdavidson / install_gnucmd_osx.sh
Created Jul 19, 2015
Installs GNU Command Line Tools & then some.
View install_gnucmd_osx.sh
#!/usr/bin/env bash
# Installs GNU Command Line Tools & then some. Requires homebrew.
# Most are newer and more powerful that than OSX’s but also solves most OS compatibility issues
echo "Installing GNU coreutils and various."
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
brew install coreutils
brew install binutils
brew install diffutils
brew install ed --with-default-names
brew install findutils --with-default-names
@tomdavidson
tomdavidson / config.tf
Last active Feb 24, 2018
tectonic-installer#3025
View config.tf
/**
* Defaults and other config items for the K8S Installer
*
*/
terraform {
backend "s3" {}
required_version = ">= 0.10.7"
}
@tomdavidson
tomdavidson / example-aws-assume-role-wrapper.sh
Created Jun 17, 2016
wrapper scirpt that assumes aws role
View example-aws-assume-role-wrapper.sh
#! /usr/bin/env bash
# Wrapper scirpt that assumes aws role and then runs your script that needs the creds.
# Im not remembering where I got it, but it was at least inspired by another if not verbarium.
account_id=$1
role=$2
CMD="$@"
ACCOUNT_ID=11111111111
View allow-user-iam.json
{
"Version": "2012-10-17",
"Statement":[
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action":[
"iam:ListAccountAliases",
"iam:ListUsers",
"iam:GetAccountSummary"
@tomdavidson
tomdavidson / install_digicert_on_aws.sh
Last active May 16, 2016
install ssl cert on aws, including creating intermediate for a complete chain
View install_digicert_on_aws.sh
#!/bin/bash
# unofficial bash strict mode
set -euo pipefail
IFS=$'\n\t'
# Run script from dir with both certificate files and the private key
# certificate name on AWS
You can’t perform that action at this time.