Skip to content

Instantly share code, notes, and snippets.

View jchauncey's full-sized avatar

Jonathan Chauncey jchauncey

  • Workday
  • Hahira, GA
View GitHub Profile
Main cookbook berksfile will look something like this
cookbook 'foo', :github => 'MyOrg/foo'
The foo cookbook has a dependency on a forked cookbook that we have modified that also exists in the community site
(at a higher version)
cookbook 'bar', :github => 'MyOrg/bar'
When I try and do a berks install on the Main cookbook it will always download the community cookbook of bar and not my forked
package 'apache2'
motherbucker ~/projects/metal-spike (knife:zero) (rbenv:2.0.0-p451)
◯ : bundle exec metal -z cat spike1 /tmp/spike1.txt ⏎
[2014-05-06T11:12:51-06:00] INFO: Starting chef-zero on port 8889 with repository at repository at /Users/pairing/projects/metal-spike
One version per cookbook
/Users/pairing/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-metal-vagrant-0.3.1/lib/chef_metal_vagrant/vagrant_provisioner.rb:354:in `strip_quotes': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/pairing/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-metal-vagrant-0.3.1/lib/chef_metal_vagrant/vagrant_provisioner.rb:324:in `create_ssh_transport'
from /Users/pairing/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-metal-vagrant-0.3.1/lib/chef_metal_vagrant/vagrant_provisioner.rb:275:in `transport_for'
from /Users/pairing/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-met
{
"name":"foo",
"environments": {
"bld": {
"env_vars": {
"foo":"1",
"bar":"2"
},
"docker_hosts":["foo-docker-01", "foo-docker-02"]
},
@jchauncey
jchauncey / 001-add-github-key.groovy
Created December 14, 2014 20:40
Jenkins master in Docker
import jenkins.model.*
import hudson.model.*
import hudson.security.*
import org.jenkinsci.plugins.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
@jchauncey
jchauncey / gist:a45c2037fed09745fed3
Last active August 29, 2015 14:15
application logs to splunk with docker!
Getting application logs from a container to splunk
Application running in the container writes their logs to /var/log/service (placing any number of directories or files in this parent directory). This is conatiner is started with /var/log/service mounted to /var/log on the host system. We then have another container running splunk-forwarder which mounts /var/log into the container. Splunk forwarder is configured to send /var/log (recursing) to the splunk indexer in the correct data center (using consul).
More to come!
(require '[clojure.string :as str])
(require '[riemann.common :as common])
(logging/init)
(info "loading" *config-file*)
(tcp-server :host "0.0.0.0" :port 5555)
(udp-server :host "0.0.0.0" :port 5556)
<source>
type tail
path /var/log/containers/*.log
pos_file /var/log/containers.log.pos
time_format %Y-%m-%dT%H:%M:%S.%NZ
tag kubernetes.*
format json
read_from_head true
</source>
require 'fluent/mixin/config_placeholders'
require 'fluent/mixin/plaintextformatter'
require 'fluent/mixin/rewrite_tag_name'
require 'fluent/output'
module Fluent
class DeisOutput < Output
Fluent::Plugin.register_output("deis_output", self)
include Fluent::Mixin::PlainTextFormatter
@jchauncey
jchauncey / get-pod-ips
Created June 5, 2016 06:55
get pod ips from kubernetes
export GET_PODS_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/namespaces/$POD_NAMESPACE/pods
pod_names=$(curl -s $GET_PODS_URL --header "Authorization: Bearer $TOKEN" --insecure | jq --raw-output '.items[].metadata.name' | grep deis-nsqlookupd)
while read -r pod; do
GET_POD_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/namespaces/$POD_NAMESPACE/pods/${pod}
pod_ip=$(curl -s $GET_POD_URL --header "Authorization: Bearer $TOKEN" --insecure | jq --raw-output '.status.podIP')
export LOOKUP_COMMAND="$LOOKUP_COMMAND -lookupd-tcp-address ${pod_ip}:4161"
done <<< "$pod_names"
exec nsqd -broadcast-address ${NODE_NAME} ${LOOKUP_COMMAND}