Skip to content

Instantly share code, notes, and snippets.

@cap10morgan
cap10morgan / database.yml
Created September 8, 2014 17:53
database.yml
defaults: &defaults
adapter: jdbc
driver: com.mysql.jdbc.Driver
encoding: utf8
collation: utf8_unicode_ci
reconnect: true
autocommit: false
pool: 100
database: turbovote_development
username: <%= ENV['DB_USERNAME'].present? ? ENV['DB_USERNAME'] : 'root' %>
@cap10morgan
cap10morgan / gist:d7a1bd28e4e7c9fbe9c9
Created September 8, 2014 17:57
jdbc-activerecord-adapter error output
$ bundle exec rake db:setup
Rake tasks not supported by '' adapter
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:172:in `class_for_adapter'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:73:in `create'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:87:in `create_current'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.10/lib/arjdbc/tasks/databases4.rake:12:in `each_current_configuration'
org/jruby/RubyArray.java:1613:in `each'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.10/lib/arjdbc/tasks/databases4.rake:11:in `each_current_configuration'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-4.0.5/lib/active_record/tasks/database_tasks.rb:86:in `create_current'
/opt/jruby-1.7.14/lib/ruby/gems/shared/gems/activerecord-4.0.5/lib/active_record/railties/databases.rake:20:in `(root)'

Keybase proof

I hereby claim:

  • I am cap10morgan on github.
  • I am wesmorgan (https://keybase.io/wesmorgan) on keybase.
  • I have a public key whose fingerprint is 1BBD 17AE A766 1500 922A EA08 FE91 16B8 1E33 CB8A

To claim this, I am signing this object:

@cap10morgan
cap10morgan / gist:70f6f4d059c26b41da29
Created November 20, 2014 18:13
Systemd dependent units
# This one is running on all 3 CoreOS hosts
# consul@.service
[Unit]
Description=Consul
After=docker.service
Requires=docker.service
[Service]
EnvironmentFile=/etc/environment
TimeoutStartSec=0
wmorgan@docker1:~$ docker run --rm ubuntu /bin/bash -c 'echo -n; ls -l /proc/1/exe'
ls: cannot read symbolic link /proc/1/exe: Permission denied
lrwxrwxrwx 1 root root 0 Dec 3 18:56 /proc/1/exe
wmorgan@docker1:~$ docker run --rm --cap-add SYS_PTRACE ubuntu /bin/bash -c 'echo -n; ls -l /proc/1/exe'
ls: cannot read symbolic link /proc/1/exe: Permission denied
lrwxrwxrwx 1 root root 0 Dec 3 18:57 /proc/1/exe
wmorgan@docker1:~$ docker run --rm --privileged ubuntu /bin/bash -c 'echo -n; ls -l /proc/1/exe'
lrwxrwxrwx 1 root root 0 Dec 3 18:57 /proc/1/exe -> /bin/bash
@cap10morgan
cap10morgan / gist:506a438562815ab156c0
Last active August 29, 2015 14:16
Awkward Mustache Examples
;; Nested data in tokens
(def template
"{{#parent}}
{{child1}}
{{child2}}
{{#child3}}
{{grandchild}}
{{/child3}}
{{/parent}}")
(ns hbs-test.core
(:require [hbs.core :refer :all]
[hbs.helper :refer :all])
(:gen-class))
(def broken-template
"Hello, World!
{{#parent}}
{{child}} says hi too.
{{/parent}}")
@cap10morgan
cap10morgan / gist:a7df909b1b7f16b8cc39
Created March 3, 2015 19:07
hbs Issue #3 w/ Java HashMap workaround
(ns hbs-test.core
(:require [hbs.core :refer :all]
[hbs.helper :refer :all])
(:gen-class))
(def broken-template
"Hello, World!
{{#parent}}
{{child}} says hi too.
{{/parent}}")
@cap10morgan
cap10morgan / install-datomic-pro.sh
Created March 13, 2015 16:22
A script for installing the Datomic Pro peer lib in docker build
#!/bin/bash
set -e
VERSION=$(grep '\[com.datomic/datomic-pro "' project.clj | awk -F\" '{print $2}')
curl -u $(<.datomic-credentials) -SL https://my.datomic.com/repo/com/datomic/datomic-pro/$VERSION/datomic-pro-$VERSION.zip -o /tmp/datomic.zip
unzip /tmp/datomic.zip -d /tmp/datomic
rm -f /tmp/datomic.zip
@cap10morgan
cap10morgan / coreos-stable-hvm-vpc.template
Created March 23, 2015 21:10
CoreOS in a VPC CloudFormation Template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-0e300d13"
},