Skip to content

Instantly share code, notes, and snippets.

View juliandunn's full-sized avatar

Julian C. Dunn juliandunn

View GitHub Profile
@juliandunn
juliandunn / jetty-mongo-sessions.xml
Created June 8, 2012 20:01
Jetty Mongo Session example
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<New id="mongodb" class="com.mongodb.Mongo">
<Arg>
<New class="java.util.ArrayList">
<Call name="add">
<Arg>
<New class="com.mongodb.ServerAddress">
@juliandunn
juliandunn / gist:2956486
Created June 19, 2012 20:52
Example structured databag
{
"id": "postfix",
"sasl": {
"servers": {
"sendgrid": {
"sasl_user": "fake",
"sasl_password": "fake"
},
"internal": {
"sasl_user": "somethingelse",
@juliandunn
juliandunn / jetty-mongo-sessions.xml
Created August 17, 2012 04:24
example jetty-mongo-sessions.xml
<New id="mongodb" class="com.mongodb.Mongo">
<Arg>
<New class="java.util.ArrayList">
<Call name="add">
<Arg>
<New class="com.mongodb.ServerAddress">
<Arg type="java.lang.String">foo.example.com</Arg>
<Arg type="int">27017</Arg>
</New>
</Arg>
@juliandunn
juliandunn / jetty-mongo-sessions-context.xml
Created August 17, 2012 04:30
jetty-mongo-sessions context
<Ref name="Server" id="Server">
<Call id="mongoIdMgr" name="getSessionIdManager"/>
</Ref>
<Set name="sessionHandler">
<New class="org.eclipse.jetty.server.session.SessionHandler">
<Arg>
<New id="mongoMgr" class="org.eclipse.jetty.nosql.mongodb.MongoSessionManager">
<Set name="idManager">
<Ref id="mongoIdMgr"/>
@juliandunn
juliandunn / gist:3381288
Created August 17, 2012 18:18
chef validation regen fail
Loading init file from ./config/init.rb
oQvG1pAvk3lYduI/zDdVFVf1pWNpDtlK5emWb905dWQBekQsqnC1nBT54yHXqi2p
[2012-08-17T14:06:01-04:00] ERROR: Error opening validation key: No such file or directory - /etc/chef/validation.pem -- destroying and regenerating
/usr/lib64/ruby/gems/1.8/gems/chef-10.12.0/lib/chef/couchdb.rb:157:in `delete': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/lib64/ruby/gems/1.8/gems/chef-10.12.0/lib/chef/api_client.rb:221:in `cdb_destroy'
from /usr/lib64/ruby/gems/1.8/gems/chef-10.12.0/lib/chef/certificate.rb:119:in `gen_validation_key'
from /usr/lib64/ruby/gems/1.8/gems/chef-server-api-10.12.0/config/init.rb:84
from /usr/lib64/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:529:in `load'
from /usr/lib64/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:529:in `load_initfile'
from /usr/lib64/ruby/gems/1.8/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:377:in `run'
@juliandunn
juliandunn / gist:3381643
Created August 17, 2012 19:03
REST cal that chef-server is trying to make
[Fri, 17 Aug 2012 19:00:31 GMT] [info] [<0.166.0>] 127.0.0.1 - - 'GET' /chef/_design/id_map/_view/name_to_id?key=[%22client%22,%22chef-validator%22]&include_docs=true 200
[Fri, 17 Aug 2012 19:00:31 GMT] [debug] [<0.166.0>] Include Doc: <<"7a9941a7-c7d7-4dd5-a92f-dcd6cba48b43">>
nil
@juliandunn
juliandunn / aws-named.conf
Created September 13, 2012 19:33
Example named.conf for use with AWS
include "/etc/named/named.rfc1912.zones";
include "/etc/named/named.options";
zone "." IN {
type hint;
file "named.ca";
};
zone "amazonaws.com" {
type forward;
@juliandunn
juliandunn / aws-named-options.conf
Created September 13, 2012 19:34
Example named.options for use with AWS
options {
directory "/var/named";
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";
listen-on-v6 { any; };
recursion yes;
allow-recursion { 10.0.0.0/8; }; // only recurse for hosts within EC2. otherwise, you'll get Amazon internal IPs returned from external hosts when CNAMEs to amazonaws.com are looked up
allow-query { any; };
forwarders { 172.16.0.23; };
@juliandunn
juliandunn / chef-expander-10.14.2-startup-error.txt
Created September 27, 2012 18:43
chef-expander 10.14.2 won't start
[2012-09-27T14:31:49-04:00] INFO: Processing service[chef-expander] action start (chef-server::rubygems-install line 224)
================================================================================
Error executing action `start` on resource 'service[chef-expander]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service chef-expander start ----
@juliandunn
juliandunn / are-you-serious.txt
Created September 27, 2012 22:43
rubygems hax0rry
[vagrant@vagrant-centos-6 1.8]$ pwd
/usr/lib/ruby/site_ruby/1.8
[vagrant@vagrant-centos-6 1.8]$ cat ubygems.rb
# This file allows for the running of rubygems with a nice
# command line look-and-feel: ruby -rubygems foo.rb
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++