Skip to content

Instantly share code, notes, and snippets.

View jhulten's full-sized avatar

Jeffrey Hulten jhulten

View GitHub Profile
@jhulten
jhulten / deployment.rb
Created November 3, 2011 19:32
airbrake block
execute "notify airbrake" do
command %Q[bundle exec rake airbrake:deploy TO=#{deploy_environment} REVISION=`git log --pretty=format:'%h' -n 1` REPO=#{repository} USER=chef >> /tmp/airbrake.log]
user node.default_user
group node.default_group
end
@jhulten
jhulten / knife.rb
Created February 16, 2011 22:55 — forked from jbz/knife.rb
# This knife.rb orig. provided by jtimberman@opscode.com - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = "https://api.opscode.com/organizations"
require 'grit'
branch = Grit::Repo.new("#{current_dir}/..").head.name
case branch
@jhulten
jhulten / split-em.rb
Created November 22, 2010 23:04 — forked from lusis/split-em.rb
require 'json'
require 'optparse'
all_json = []
options = {}
options[:overwrite] = false
optparse = OptionParser.new do |opts|
opts.banner = "Usage: split-em -f FILE -d DATABAG [-o]"
opts.on( '-f' ,'--file FILE', 'JSON file to split') do |file|
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;
-module(port_scanner).
-export([scan/3]).
scan(Addr, Start, End) ->
Services = parse_services(),
scan(Addr, Start, End, Services).
%% Internal functions
scan(Host, Start, End, Services) ->
[Data || Data <-
-module(port_scanner).
-export([scan/3]).
scan(Addr, Start, End) ->
Services = parse_services(),
scan(Addr, Start, End, Services).
%% Internal functions
scan(Host, Start, End, Services) ->
[Data || Data <-
-module(port_scanner).
-export([scan/3]).
scan(Addr, Start, End) ->
Services = parse_services(),
scan(Addr, Start, End, Services).
%% Internal functions
scan(Host, Start, End, Services) ->
[Data || Data <-
@jhulten
jhulten / gist:66581
Created February 18, 2009 22:13 — forked from anonymous/gist:66217
#!/usr/bin/env ruby
ARGV = ['foo'] if ARGV.empty?
require 'rubygems'
require 'commander'
program :name, 'foo'
program :version, '1.1.1'
program :description, 'Foo'