Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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.md
Last active August 29, 2015 14:06
Flynn Cluster on AWS notes
@johndagostino
johndagostino / boil.sh
Last active August 29, 2015 13:58
Development Machine
aescrypt apple-gcc42 autoconf automake cloc cmake cscope ctags docker
ec2-ami-tools ec2-api-tools elasticsearch enca freetds freetype gdbm git git-flow
graphviz heroku-toolbelt hub imagemagick jmeter jpeg libevent libpng libtool libyaml
lua luajit macvim mtr mysql node openssl ossp-uuid pcre phantomjs pkg-config postgresql
pwgen qt rbenv readline reattach-to-user-namespace redis ruby-build ruby-install scala
the_silver_searcher tmux wget xz zsh
@johndagostino
johndagostino / sidekiq.conf
Created April 7, 2014 05:10
sidekiq.conf
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with:
# sudo start sidekiq app=/path/to/app index=0
@johndagostino
johndagostino / template.rb
Created April 6, 2014 01:44
Rails Template
gem 'haml-rails'
gem 'puma'
gem 'simple_form'
gem 'sidekiq'
gem 'nokogiri'
gem 'carrierwave'
gem 'kaminari'
gem 'dotenv-rails'
gem 'searchkick'