Skip to content

Instantly share code, notes, and snippets.

@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}}")
(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:506a438562815ab156c0
Last active August 29, 2015 14:16
Awkward Mustache Examples
;; Nested data in tokens
(def template
"{{#parent}}
{{child1}}
{{child2}}
{{#child3}}
{{grandchild}}
{{/child3}}
{{/parent}}")
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: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

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: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)'
@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 / run.sh
Created July 8, 2014 22:27
new coreos/etcd wrapper script
#!/bin/sh
IP_ADDR=$(ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
exec /opt/etcd/bin/etcd -addr $IP_ADDR:4001 -peer-addr $IP_ADDR:7001 "$@"
@cap10morgan
cap10morgan / gist:49b8e5b2a268b25275d1
Created July 8, 2014 20:33
confd command & output
# confd -verbose -onetime -debug -node 172.17.0.2:4001 -confdir /confd
2014-07-08T20:33:35Z 76837d23da9b confd[104]: WARNING Skipping confd config file.
2014-07-08T20:33:35Z 76837d23da9b confd[104]: NOTICE Starting confd
2014-07-08T20:33:35Z 76837d23da9b confd[104]: NOTICE Backend set to
2014-07-08T20:33:35Z 76837d23da9b confd[104]: NOTICE etcd nodes set to http://172.17.0.2:4001
2014-07-08T20:33:35Z 76837d23da9b confd[104]: DEBUG Loading template resources from confdir /confd
2014-07-08T20:33:35Z 76837d23da9b confd[104]: DEBUG Processing template resource /confd/conf.d/haproxy.toml
2014-07-08T20:33:35Z 76837d23da9b confd[104]: DEBUG Loading template resource from /confd/conf.d/haproxy.toml
2014-07-08T20:33:35Z 76837d23da9b confd[104]: DEBUG Retrieving keys from store
2014-07-08T20:33:35Z 76837d23da9b confd[104]: DEBUG Key prefix set to /