- a *nix system
- Ruby installed -
rvm
(curl -sSL https://get.rvm.io | bash
) is useful for installing the latest version and keeping gems local to your user - a directory called
workspace
in your home directory - Atom editor installed - https://atom.io/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .vimrc | |
set background=dark | |
set number | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
syntax on | |
filetype on | |
filetype plugin on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hardstatus on | |
hardstatus alwayslastline | |
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " | |
# Map ctrl+\ to screen command key | |
escape ^\\\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Fred(state){ | |
var innerState = state; | |
return { | |
getState: function() { | |
return innerState; | |
}, | |
setState: function(newState){ | |
innerState = newState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CERT_PATH=/etc/pki/ca-trust/source/anchors/verisign.crt | |
write_certs() { | |
cat > $1 <<EOF | |
Verisign Class 3 Public Primary Certification Authority | |
======================================================= | |
-----BEGIN CERTIFICATE----- | |
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_test_class(a_assignment) | |
test_class = <<-EOF | |
class T | |
attr_accessor(:a) | |
def initialize | |
@a = 42 | |
end | |
def t(this_a=nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for file in $(ls *.csv) | |
do | |
prefix=$(echo ${file} | cut -d'_' -f1) | |
echo $prefix | |
tmpfile=$(tempfile) | |
while read line | |
do echo "${prefix},${line}" >> ${tmpfile} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "random_id" "id" { | |
byte_length = 8 | |
provisioner "local-exec" { | |
command = "./provision.sh ${self.id}" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2017/12/21 12:35:40 [INFO] Terraform version: 0.11.1 a42fdb08a43c7fabb8898fe8c286b793bbaa4835+CHANGES | |
2017/12/21 12:35:40 [INFO] Go runtime version: go1.9 | |
2017/12/21 12:35:40 [INFO] CLI args: []string{"/bin/terraform", "apply", "-auto-approve"} | |
2017/12/21 12:35:40 [DEBUG] Attempting to open CLI config file: /root/.terraformrc | |
2017/12/21 12:35:40 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2017/12/21 12:35:40 [INFO] CLI command args: []string{"apply", "-auto-approve"} | |
2017/12/21 12:35:40 [INFO] command: empty terraform config, returning nil | |
2017/12/21 12:35:40 [DEBUG] command: no data state file found for backend config | |
2017/12/21 12:35:40 [DEBUG] New state was assigned lineage "eccad70b-25a5-464c-ae79-fcc8e0f8ff7d" | |
2017/12/21 12:35:40 [INFO] command: backend initialized: <nil> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
def assume_role(account_id: str, role_name: str) -> boto3.Session: | |
sts = boto3.client('sts') | |
response = sts.assume_role( | |
RoleArn=f'arn:aws:iam::{account_id}:role/{role_name}', | |
RoleSessionName='account_creation', | |
) | |
return boto3.Session( |