Skip to content

Instantly share code, notes, and snippets.

View jhulten's full-sized avatar

Jeffrey Hulten jhulten

View GitHub Profile
svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
err: Could not parse for environment production: Unknown function mysql_password at /tmp/tmp.XbAzeB7275:10
Puppet syntax error in puppet/modules/mysql/manifests/init.pp.
@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'
-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 <-
# 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;
@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|
(ns rest-api.core
(:use ring.adapter.jetty)
(:require clojure.contrib.classpath)
(:require [clojure.contrib.java-utils :as utils])
(:require [rest-api.web :as web]))
(defn load-resource [name]
(let [rsc-name (str name)
thr (Thread/currentThread)
ldr (.getContextClassLoader thr)]
@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 / knife.rb
Created August 15, 2011 22:44
general knife.rb for a repo
current_dir = File.dirname(__FILE__)
ORG = "my_hosted_chef_org"
log_level :info
log_location STDOUT
node_name "#{ENV['USER']}"
client_key "#{current_dir}/#{ENV['USER']}.pem"
validation_client_name "#{ORG}-validator"
validation_key "#{current_dir}/#{ORG}-validator.pem"
chef_server_url "https://api.opscode.com/organizations/#{ORG}"