Skip to content

Instantly share code, notes, and snippets.

@inthecloud247
inthecloud247 / gist:2834888
Created May 30, 2012 09:13 — forked from ewheeler/gist:1262989
flask + tornado + nginx + supervisord
# create stub, then run flask app in tornado on port 5000 (perhaps with supervisord config below http://supervisord.org/index.html)
#!/usr/bin/env python
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from myflaskapp import app
http_server = HTTPServer(WSGIContainer(app))
@inthecloud247
inthecloud247 / populate_dns.py
Created June 5, 2012 08:02 — forked from jawnb/populate_dns.py
Script to populate route53 DNS records from ec2 instance id and instance names.
#!/usr/bin/env python
import boto
from boto.route53.record import ResourceRecordSets
import logging
conn = boto.connect_ec2()
DNS_EXCLUSION_TAG = 'ExcludeFromDNS' # If this tag exists on an instance, no DNS values will be populated
DNS_TAGS = ['ShortName', 'Name'] # This is the list of instance tags we want to populate DNS entries from
DNS_SUFFIX = 'YOUR_SUBDOMAIN_HERE' # Suffix under which to create DNS records
ROUTE53_ZONE_ID = 'YOUR_ZONE_ID_HERE' # The zone id from route53 of the zone we will be adding these entries under
#!/bin/bash
# [Purpose]
# execute a command on remote servers
# note: we are basically rolling our own pssh here, without the parallelism
#Example: command.sh -tv -c "date" server1 special@server2 server3
# command.sh -tv -c "date" -i key.pem -l "user" server1 special@server2 server3
# command.sh -tv -i key.pem server2 server3 < get_date.sh
# command.sh -tbv -l cap -i ~/keys/cap.pem ${app_[@]} < build.sh
@inthecloud247
inthecloud247 / flume-site-agent.xml
Created July 26, 2012 05:23 — forked from elubow/flume-site-agent.xml
Flume Configuration files
<!-- a1 (agent) -->
<configuration>
<property>
<name>flume.master.servers</name>
<value>$master_IP</value>
<description>This is the address for the config servers status server (http)</description>
</property>
<property>
<name>flume.collector.event.host</name>
@inthecloud247
inthecloud247 / clojure.md
Created August 21, 2012 23:53 — forked from rakhmad/clojure.md
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

Hi David,
I came across your profile online and wanted to reach out about Development
Opportunities here at Groupon. The company is growing, and we're always
looking for folks with solid skills that can make positive contribution to
our continued success. Any chance you'd be open to a quick conversation
about opportunities, or for any possible networking potential? If so, let me
know when you're free and we can set up a time to chat. Also, if you are
interested, it would be great if you could forward a current resume over
that I can take a look at. I look forward to hearing back from you! Please
let me know if you have any questions.
@inthecloud247
inthecloud247 / fix_homebrew.rb
Created September 25, 2012 19:57 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@inthecloud247
inthecloud247 / deploy.sh
Created October 22, 2012 14:03
Minimal Race-free Deployment
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
@inthecloud247
inthecloud247 / saltstack-sudoers-config
Created January 15, 2013 23:16
salt sudoer config example
sudoer-amazing:
file.append:
- name: /etc/sudoers
- text:
- "ydavid ALL=(ALL) NOPASSWD: ALL"
sudoer-defaults:
file.append:
- name: /etc/sudoers
- text:
#!/usr/bin/env python
'''
Support for deploying an application
'''
# Import python libs
import os
import argparse
import re
import logging
import tempfile