Skip to content

Instantly share code, notes, and snippets.

View robbwagoner's full-sized avatar

Robb Wagoner robbwagoner

View GitHub Profile
@robbwagoner
robbwagoner / amazon-linux-python27-pip.sh
Last active July 24, 2017 21:28 — forked from jnrbsn/gist:8062545
Install Python 2.7 for Amazon Linux 2014.03 and older. Python 2.7 is the default for Amazon Linux 2014.09 and newer.
# Amazon Linux 2014.03 and older
sudo yum update
sudo yum install python27
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo /usr/bin/python27
sudo easy_install pip
echo "alias python='python27'" >> ~/.bashrc
source ~/.bashrc
# Amazon Linux 2014.09
yum install python27-setuptools
@robbwagoner
robbwagoner / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Find the IAM username belonging to the TARGET_ACCESS_KEY
# Useful for finding IAM user corresponding to a compromised AWS credential
# Requirements:
#
# Environmental variables:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# or
# AWS_PROFILE
# python:
#!/usr/bin/python
DOCUMENTATION = '''
---
module: git_facts
version_added: "devel"
short_description: retrieve facts about a git repository
description:
- retrieve facts about a git repository. This module has a dependency on GitPython.
options:
@robbwagoner
robbwagoner / s3-to-es-lamba.py
Created January 9, 2017 15:49 — forked from s-fujimoto/s3-to-es-lamba.py
Import Elasticsearch from ELB access log for AWS Lambda Function
##################################################
### Elasticsearch host name
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "awslogs"
#################################################
### ELB access log format keys
ELB_KEYS = ["timestamp", "elb", "client_ip", "client_port", "backend_ip", "backend_port", "request_processing_time", "backend_processing_time", "response_processing_time", "elb_status_code", "backend_status_code", "received_bytes", "sent_bytes", "request_method", "request_url", "request_version", "user_agent"]