Skip to content

Instantly share code, notes, and snippets.

View gregsymons's full-sized avatar

Greg Symons gregsymons

View GitHub Profile
@gregsymons
gregsymons / consul-template.log
Created February 7, 2019 18:32
trace logs for trying to execute a consul-template plugin
2019/02/07 18:31:25.789347 [INFO] consul-template v0.19.5 (57b6c71)
2019/02/07 18:31:25.789386 [INFO] (runner) creating new runner (dry: true, once: false)
2019/02/07 18:31:25.789935 [DEBUG] (runner) final config: {"Consul":{"Address":"","Auth":{"Enabled":false,"Username":"","Password":""},"Retry":{"Attempts":12,"Backoff":250000000,"MaxBackoff":60000000000,"Enabled":true},"SSL":{"CaCert":"","CaPath"
:"","Cert":"","Enabled":false,"Key":"","ServerName":"","Verify":true},"Token":"","Transport":{"DialKeepAlive":30000000000,"DialTimeout":30000000000,"DisableKeepAlives":false,"IdleConnTimeout":90000000000,"MaxIdleConns":100,"MaxIdleConnsPerHost":5
,"TLSHandshakeTimeout":10000000000}},"Dedup":{"Enabled":false,"MaxStale":2000000000,"Prefix":"consul-template/dedup/","TTL":15000000000},"Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":[],"Custom":[],"Pristine":false,"Whitelist":[]},"Kill
Signal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay":0,"Timeout":0},"KillSignal":2,"LogLevel":"trace","MaxStale":200
@gregsymons
gregsymons / Jenkinsfile
Last active October 18, 2017 17:46
weird jenkins checkout failure
#!/usr/bin/env groovy
node('packer') {
stage('Checkout') {
multibranchCheckout(scm, env.BRANCH_NAME)
}
}
def multibranchCheckout(scm, branch) {
def scmUrl = scm.getUserRemoteConfigs()[0].getUrl()
@gregsymons
gregsymons / keybase.md
Created August 31, 2017 20:44
Keybase Proof

Keybase proof

I hereby claim:

  • I am gregsymons on github.
  • I am gregsymons (https://keybase.io/gregsymons) on keybase.
  • I have a public key ASC0E2W_QvF_8saK8PYeysvOuPNljnZKj0VCVGJeN7MkBQo

To claim this, I am signing this object:

require 'artifactory'
require 'semantic'
RSpec::Matchers.define :be_latest_version_in_artifactory do
# If I define this method outside of this block then it is (unintuitively) not in scope within the block due
# to dynamic class voodoo. If I define it outside of the block, it is also unavailable to the outside world,
# so I can't call it in any control blocks.
def normalize_version_to_semver(version)
version.gsub(/~/, '-')
end
@gregsymons
gregsymons / actual.txt
Last active March 28, 2017 23:49
Ansible 2.0 nested task loops don't work
> ansible-playbook main.yml -i hosts -c local
PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"deploy_descriptors": [
@gregsymons
gregsymons / example.scala
Created January 13, 2016 00:42
How I would format the "command" example for scopt
cmd("update").
action { (_, c) => c.copy(mode = "update") }.
text("update is a command.").
children(
opt[Unit]("not-keepalive").
abbr("nk").
action { (_, c) => c.copy(keepalive = false) }.
text("disable keepalive"),
opt[Boolean]("xyz").
action { (x, c) => c.copy(xyz = x) }.
[template]
src = "zoo.cfg.tmpl"
dest = "/var/lib/zookeeper/zoo.cfg"
uid = 0
gid = 0
mode = "0644"
keys = [
"/servers",
"/config"
]
@gregsymons
gregsymons / example.rb
Created May 29, 2013 00:03
Chef: Merging normal attributes from a local JSON file
require 'chef/mixin/deep_merge'
require 'json'
node.normal = Chef::Mixin::DeepMerge.merge(node.normal, JSON.load(File.read('/my/custom/node/attributes.json')))
@gregsymons
gregsymons / chef.log
Created October 16, 2012 17:43
Creating a postgis template database in chef
[Mon, 15 Oct 2012 22:45:22 +0000] DEBUG: Processing execute[create-postgis-template-db] on vagrant.vm
[Mon, 15 Oct 2012 22:45:22 +0000] INFO: Processing execute[create-postgis-template-db] action run (postgis::server line 25)
[Mon, 15 Oct 2012 22:45:22 +0000] DEBUG: Skipping execute[create-postgis-template-db] due to not_if command ` PGPASSWORD=R3n41rAfFMQzoOghaAYV psql -d postgis -U postgres >/dev/null 2&>1
`