Skip to content

Instantly share code, notes, and snippets.

from fabric.api import *
from fabric.operations import local,put
import subprocess
import os
@task
def deploy_small_ec2_instance():
local('/usr/bin/ec2-run-instances ami-6dacf728 --instance-type m1.small --region us-west-1 --key ${EC2_KEYPAIR} --user-data-file user-data.sh --group ${SGROUP}')
@task
# salt-minion.conf
description "salt-minion upstart daemon"
author "Jeff Bauer <[email protected]>"
# copy this file to /etc/init
start on (net-device-up and local-filesystems)
stop on shutdown
expect fork
@inthecloud247
inthecloud247 / yaml_aws_acl_rules
Last active December 18, 2015 23:59
aws vpc acl rules defined in yaml and templated using mako for readability. salt-master subnet can talk to both app and db subnets on ports 22 and 4505-4506 app and db can talk over 3306 app allows incoming external requests on port 8080 can now add security groups to further filter requests :-)
<%
salt_master_subnet='10.0.1.0/24'
db_subnet='10.0.2.0/24'
app_subnet='10.0.3.0/24'
%>
- mcp-salt-master:
- acl:
- inbound:
- {rule: 100, source: ${salt_master_subnet}, tcp: 22, allow-deny: 'ALLOW'}
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

# Example config to run single processes in docker, managed by
# supervisord.
#
# This probably isn't the "right" way to do it, I haven't
# found a better solution online though. Keep in mind, supervisor
# wants non-daemonized processes, which is why we run them with the
# -i flag. If you are running something like mysqld, be sure to use
# the pidproxy application as described here:
# http://supervisord.org/subprocess.html?highlight=pidproxy#pidproxy-program
#
#!/usr/bin/python
# vim:ts=2:sw=2:expandtab
"""
A Python library to perform low-level Linode API functions.
Copyright (c) 2010 Timothy J Fontaine <[email protected]>
Copyright (c) 2010 Josh Wright <[email protected]>
Copyright (c) 2010 Ryan Tucker <[email protected]>
Copyright (c) 2008 James C Sinclair <[email protected]>
FROM google/cloud-sdk
RUN apt-get update && apt-get install -y --no-install-recommends curl sshpass netcat-traditional
RUN curl https://get.docker.io/builds/Linux/x86_64/docker-latest -o /bin/docker && chmod +x /bin/docker
RUN curl http://stedolan.github.io/jq/download/linux64/jq -o /bin/jq && chmod +x /bin/jq
ADD gce2docker-fork.sh /
EXPOSE 44243
ENV DOCKER_HOST :44243
ENTRYPOINT ["/gce2docker-fork.sh"]
sudo apt-get update
sudo apt-get install -y libssl1.0.0 openssl
# Confirm Build Date is at least Aril 7th 2014
openssl version -a | grep built
# Restart all services listed by this command:
sudo lsof -n | grep ssl | grep DEL