Skip to content

Instantly share code, notes, and snippets.

View tyrostone's full-sized avatar
🐈

Laura Stone tyrostone

🐈
View GitHub Profile
@tyrostone
tyrostone / wrapper.sh
Created July 11, 2019 20:38
Bash wrapper to complement the usage of aws-vault for AWS credentials
ENV=$1
RED='\[\033[1;31m\]'
YELLOW='\[\033[1;33m\]'
NC='\[\033[0m\]' # No Color
if [[ "$OLD_PS1" == "" ]]; then
OLD_PS1="$PS1"
fi
@tyrostone
tyrostone / import_users.sh
Created July 11, 2019 20:34
A small bash script to import AWS IAM users into Terraform
#!/bin/bash
aws iam list-users --profile=${DEV_PROFILE} | grep UserName | awk '{ print substr($2, 2, length($2)-3) }' > iam_users.txt
terraform init
INPUT="./iam_users.txt"
while IFS= read -r USER
do
terraform import aws_iam_user.${USER//\./_} "$USER"
done < "${INPUT}"
@tyrostone
tyrostone / aws_mfa_audit.py
Created July 9, 2019 16:57
A short script to audit MFA enablement in AWS
import boto3
import os
import statsd
# Add your accounts here
AWS_ACCOUNTS = []
# Add programmatic users here
PROGRAMMATIC_ACCESS_ONLY = [

Keybase proof

I hereby claim:

  • I am tyrostone on github.
  • I am tyrostone (https://keybase.io/tyrostone) on keybase.
  • I have a public key ASAUJqEs26BcnjBTWFAZyMZkioAK6hBWIy-rDYou_tVW2go

To claim this, I am signing this object:

@tyrostone
tyrostone / instructions.md
Last active August 16, 2019 03:33
Shiny Server Tutorial

Shiny Server Tutorial Instructions

Prerequisites

  • AWS account is created
  • Non-root user is created
  • VPC exists in the us-east-1 region
    • We can go over the networking of what this should look like

Creating the Host

  1. Log into your AWS account
@tyrostone
tyrostone / check_missing_emails.py
Created August 23, 2017 21:13
Script to search through s3 for missing company, campaign, and/or email data
import argparse
import csv
import fnmatch
import multiprocessing
import os
import re
import sys
def search_logfiles_for_email(email):
@tyrostone
tyrostone / app.js
Last active April 24, 2017 23:54
Horse Donkey Heart
const Image = (props) => {
return (
<div style={{width: '150px', margin: '1em'}}>
<img src={props.imageUrl} style={{width: "20em", height: "13em"}} placeholder={props.name} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
</div>
</div>
);
};
@tyrostone
tyrostone / app.css
Created April 24, 2017 19:28
Play Nine React App
.fa-star {
margin: 0.5em;
font-size: 24px;
}
span {
display: inline-block;
margin: 0.5em;
text-align: center;
background-color: #ccc;
const Card = (props) => {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
<div>{props.company}</div>
</div>
</div>
);
class Button extends React.Component {
render() {
return (
<button onClick={() => this.props.onClickFunction(this.props.incrementValue)}>
+{this.props.incrementValue}
</button>
);
}
};