This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
def HeartBeat(request): | |
""" | |
This method is for the AWS load balancer health check. | |
""" | |
return HttpResponse('{\'data\': {\'status\': \'healthy\'}}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 10.10.10.10:80; | |
server_name demo.ambition.io; | |
location /heartbeat { | |
set $my_host $host; | |
if ($host ~ "\d+\.\d+\.\d+\.[\d\:]+") { | |
set $my_host "demo.ambition.io"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history -w /dev/stdout | grep -o "^git [a-zA-Z]*\( -\{1,2\}\([a-zA-Z]\)*\)*" | sort | uniq -c | sort -rg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# # vi: set ft=ruby : | |
require 'fileutils' | |
Vagrant.require_version ">= 1.6.0" | |
CLOUD_CONFIG_PATH = File.join(File.dirname(__FILE__), "user-data") | |
CONFIG = File.join(File.dirname(__FILE__), "config.rb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
etcdctl mkdir services/web/cust1/ | |
etcdctl mkdir services/web/cust2/ | |
etcdctl set services/web/cust1/1 '{"ip": "10.0.0.1"}' | |
etcdctl set services/web/cust1/2 '{"ip": "10.0.0.2"}' | |
etcdctl set services/web/cust2/1 '{"ip": "10.0.0.3"}' | |
etcdctl set services/web/cust2/2 '{"ip": "10.0.0.4"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shared Volume | |
FROM busybox:buildroot-2014.02 | |
MAINTAINER micah hausler, micah.hausler@ambition.com | |
VOLUME /data | |
CMD ["/bin/sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright (C) Micah Hausler, 2014 | |
# Using MIT License <http://opensource.org/licenses/MIT> | |
# | |
__doc__ = """ | |
This is a quick hack to download all your python packages from Gemfury. | |
$ virtualenv venv | |
$ source ./venv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup | |
import sys | |
if 'sdist' in sys.argv and sys.version_info < (2, 7, 9, 'final', 0): | |
import os | |
del os.link | |
setup( | |
# ... | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import models, migrations | |
import django.utils.timezone | |
import django.core.validators | |
#### SEE LINE 25! | |
class Migration(migrations.Migration): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import boto3 | |
def connect_ecs(region=None): | |
return boto3.client( | |
'ecs', | |
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID'), | |
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY'), | |
region_name=region or os.environ.get('AWS_EC2_REGION', 'us-east-1'), | |
) |