Skip to content

Instantly share code, notes, and snippets.

View darron's full-sized avatar
🎯
Focusing

darron froese darron

🎯
Focusing
View GitHub Profile
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866

Simple ambassador container

The Simple Ambassador Container (let's just call it the ambassador) is a reusable container which can be added to your stack to represent a remote service. Using an ambassador your application can discover remote services using docker's standard links features.

Usage

Example usage:

REDIS_REMOTE_IP=1.2.3.4
@darron
darron / Dockerfile
Created November 29, 2013 02:04 — forked from fairchild/Dockerfile
# Apt-Proxy hosting image
#
# VERSION 0.1.0
# Use a modified version of the Ubuntu base image provided by dotCloud
FROM fairchild/ubuntu
MAINTAINER Michael Fairchild fairchild@stimble.net
ENV APT_PROXY apt.dockerdev.att.io
RUN apt-get update && apt-get install -y apt-cacher-ng
@darron
darron / deploy.rb
Created November 23, 2013 00:29 — forked from dnagir/deploy.rb
set :domain, ENV["domain"]
set :application, domain
set :user, ENV["user"]
set :destination, ENV["destination"] || domain
set :web_conf, ENV["web_conf"] || ENV["environment"] || 'production'
raise "please set domain=app.domain.name.com" unless domain
raise "please set user=server_username" unless user
set :port, ENV["port"] || 1234
set :repository, "."
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
require 'feedzirra'
# fetching a single feed
feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing")
# feed and entries accessors
feed.title # => "Paul Dix Explains Nothing"
feed.url # => "http://www.pauldix.net"
feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing"
feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0"
#showlinks
-@links.each do |link|
%p= link_to( link.title, link.url, :title => link.title, :target => '_blank' )
#linknote
%p Send this link to your friends:
%b
%a{:href => "/" } Dude
/ This works, but I am trying to put @instance_variable in the "/" and the "Dude"
class Order < ActiveRecord::Base
def processing_fee
packages_with_processing_fees = ['Package', 'FamilyPackage', 'LadiesPackage', 'CompletePackage']
fee = 0
# Only apply fee if cart contains an item with processing fees
fee = 3.00 if line_items.any? {|line_item| packages_with_processing_fees.include? line_item.item.class.to_s }
if customer