Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
dhrrgn / gist:10125477
Last active February 26, 2021 18:42
Upgrade Ubuntu OpenSSL to patch Heartbleed
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
# Restart all services listed by this command:
sudo lsof -n | grep ssl | grep DEL
@proppy
proppy / Dockerfile
Last active August 29, 2015 13:57
gce2docker: bootstrap a GCE vm with docker
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"]
#!/bin/bash
#
# This file is managed by Chef, using the <%= node.name %> cookbook.
# Editing this file by hand is highly discouraged!
#
# Copyright (c) 2014 Jean Mertz <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@t-io
t-io / osx_install.sh
Last active April 27, 2025 20:06
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@eduardschaeli
eduardschaeli / gist:7768601
Last active December 30, 2015 03:19
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 applicat…
# 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
#
@czarneckid
czarneckid / init.sls
Created October 10, 2013 00:25
SaltStack application runit configuration
# Setup the application's runit directory
/etc/sv/application:
file.directory:
- mode: 0755
- user: someuser
- group: someuser
- recurse:
- user
- group
- mode
@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'}
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
@godber
godber / gist:5777861
Last active December 18, 2015 11:48
A Salt SLS Module for managing a per host /etc/salt/minion.d/grains.conf file based on matching host IDs. If there is a host.conf file, that will be used, if not, then default.conf will be used.
salt-minion:
pkg:
- installed
service:
- running
- require:
- pkg: salt-minion
- watch:
- file: /etc/salt/minion.d/grains.conf

Zero downtime deploys with unicorn + nginx + runit + rvm + chef

Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).

Other application notes:

  • Our application uses MongoDB, so we don't have database migrations to worry about as with MySQL or postgresql. That does not mean that we won't have to worry about issues with the database with indexes being built in MongoDB or what have you.
  • We use capistrano for deployment.

Salient points for each file: