Skip to content

Instantly share code, notes, and snippets.

@johndagostino
johndagostino / environment.md
Last active August 29, 2015 14:06
Flynn Client Environment Variables

Flynn supports environment variables for applications

flynn env set

flynn env set RAILS_ENV=development

flynn env get

flynn env get RAILS_ENV

@johndagostino
johndagostino / flynn-cli.md
Created September 25, 2014 01:14
Using the flynn cli

Install the flynn cli

L=/usr/local/bin/flynn && curl -sL -A "`uname -sp`" https://cli.flynn.io/flynn.gz | zcat >$L && chmod +x $L

Add the flynn cluster (with details you should recieve from your flynn administrator)

flynn cluster add -g flynn.companyname.io:2222 -p cNemhn3qBtmhIz8QVxzBaMQSNChEb3KAyrdrC2uliS4= default https://flynn.companyname.io 41d6df8e0028f1f8b939c84792770b1e

Create a new instance

@johndagostino
johndagostino / hipchat-buildbox.sh
Last active August 29, 2015 14:07
Buildbox Project Notifications
# install https://github.com/hipchat/hipchat-cli in /usr/local/bin
echo '--- running specs'
if bundle exec rspec; then
echo "[Successful] $BUILDBOX_PROJECT_SLUG - Build - $BUILDBOX_BUILD_URL - Commit - $REVISION" | hipchat_room_message -t $HIPCHAT_TOKEN -r $HIPCHAT_ROOM -f "Buildbox" -c "green"
else
echo "[Failed] $BUILDBOX_PROJECT_SLUG - Build - $BUILDBOX_BUILD_URL - Commit - $REVISION" | hipchat_room_message -t $HIPCHAT_TOKEN -r $HIPCHAT_ROOM -f "Buildbox" -c "red"
exit 1;
fi
@johndagostino
johndagostino / buildbox-discover.rb
Last active August 29, 2015 14:07
Buildbox Agent Auto Discovery
require 'json'
require 'socket'
require 'net/http'
hostname = Socket.gethostname
api_key = ENV['API_KEY']
account_name = ENV['ACCOUNT_NAME']
uri = URI("https://api.buildbox.io/v1/accounts/#{account_name}/agents?api_key=#{api_key}")
req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
@johndagostino
johndagostino / application_controller.rb
Created October 14, 2014 23:12
Apartment Catch Not Found Exception
class ApplicationController < ActionController::Base
rescue_from Apartment::SchemaNotFound, :with => :render_not_found
end
@johndagostino
johndagostino / Makefile
Created November 6, 2014 05:06
gof3r makefile
NAME=gof3r
VERSION=1.0
all: build
build:
go build
clean:
rm $(NAME)_$(VERSION)_amd64.deb