Skip to content

Instantly share code, notes, and snippets.

View artburkart's full-sized avatar
💭
why

Arthur Burkart artburkart

💭
why
  • Coinbase
  • somewhere rainy, probably
View GitHub Profile
@artburkart
artburkart / README.md
Created April 30, 2016 01:55
Mongo-Connector setup instructions

Mongo-Connector Tutorial

Mongo-Connector

I don't know anything about elasticsearch. All I know is this mongo-connector thing makes life easy. Here are some quick start instructions to follow for setup:

AWS ES

@artburkart
artburkart / mongo.md
Last active May 4, 2016 00:03
mongo-bookmark

Mongo Installation

  1. Follow these instructions to install mongo on 14.04.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
@artburkart
artburkart / dock.sh
Created July 5, 2016 17:28
Custom changes for Mac dock
defaults write com.apple.dock static-only -bool TRUE; killall Dock
defaults write com.apple.dock showhidden -bool TRUE; killall Dock
defaults write com.apple.dock autohide-time-modifier -float 1; killall Dock
defaults write com.apple.dock tilesize -int 16; killall Dock
@artburkart
artburkart / sqs_stuff.py
Created July 22, 2016 14:01
Sample boto3 sqs stuff
sqs = boto3.resource('sqs', 'us-east-1') # python code
sqs_queue = sqs.get_queue_by_name(QueueName=queue_name)
msg = json.dumps({'timestamp': time.time(), 'type': 'job', 'data': payload)) # equivalent of JSON.stringify
sqs_queue.send_message(MessageBody=fake_message)
@artburkart
artburkart / find_user_by_aws_access_key.sh
Created August 17, 2016 20:16
Find IAM user with given AWS Access Key ID
#!/bin/bash
# Usage: bash find_user_by_aws_access_key.sh SOME_AWS_ACCESS_KEY
# This script finds the user in the account who has a given access key
ACCESS_KEY=$1
for user in `aws iam list-users | jq -r '.Users[].UserName'`; do
USER=`aws iam list-access-keys --user $user | jq '.AccessKeyMetadata[] | select(.AccessKeyId == "'"$ACCESS_KEY"'")'`
if [ -n "$USER" ]; then
echo "$USER"
exit 0
@artburkart
artburkart / bumpme
Last active November 11, 2016 17:03
bumpme
Fri Nov 11 17:03:17 UTC 2016
@artburkart
artburkart / main.tf
Last active March 12, 2017 22:44
Test case for aws_instances data source
provider "aws" {
region = "us-east-1"
}
data "aws_instances" "boxes" {
instance_ids = ["i-########", "i-########"]
}
data "template_file" "boxes" {
template = "$${instance_subnet}"
@artburkart
artburkart / main.tf
Created March 12, 2017 22:45
Test case for aws_route_table data source
provider "aws" {
region = "us-east-1"
}
data "aws_route_table" "art" {
subnet_id = "subnet-########"
}
data "template_file" "art" {
template = "$${rtb_route}"
@artburkart
artburkart / commands.md
Last active March 27, 2017 02:09
Terraform #12716

Should look like this:

$ tree
.
├── production
│   ├── production.tf
│   └── terraform.tfstate
└── site
    └── main.tf
@artburkart
artburkart / main.tf
Created June 14, 2017 02:39
aws_security_group test thing
provider "aws" {
region = "us-east-1"
}
variable "cidr" {
# default = "0.0.0.0/0"
default = ""
}
resource "aws_security_group" "dummy" {