Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jritchey on github.
  • I am joeritchey (https://keybase.io/joeritchey) on keybase.
  • I have a public key ASBEkgZvkvZbwZ-b5R2tUJYrL3b3XoiEzTUtvJTgXxPt7Qo

To claim this, I am signing this object:

@jritchey
jritchey / boto3_hands_on.md
Created October 5, 2015 04:34 — forked from iMilnb/boto3_hands_on.md
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@jritchey
jritchey / logstash.conf
Last active August 29, 2015 14:20 — forked from ssp/logstash.conf
input {
stdin {
type => "stdin-type"
}
file {
type => "apache"
path => ["/var/log/apache2/access_log", "/var/log/apache2/error_log", "/var/log/apache2/ssl_request_log"]
}
@jritchey
jritchey / running_instances.py
Last active August 29, 2015 14:02
How to find all running instances in a AWS region using Python and the Boto library
import boto.ec2
ec2_connection = boto.ec2.connect_to_region(region, aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
instances = ec2_connection.get_only_instances(filters={'instance-state-name': 'running'})
bash -c '
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name
cat /tmp/chef_node_name | cut -d. -f1 > /tmp/proper_hostname
cat /tmp/chef_node_name | cut -d. -f2 | tr -d "\n" > /tmp/proper_dnsdomainname
echo -n "." >> /tmp/proper_dnsdomainname
cat /tmp/chef_node_name | cut -d. -f3 >> /tmp/proper_dnsdomainname
IPV4ADDR=`ip addr | grep eth0 | grep "inet " | cut -d " " -f 6 | cut -d \/ -f 1`