Skip to content

Instantly share code, notes, and snippets.

John E. Vincent lusis

Block or report user

Report or block lusis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View python argparse subcommand
import argparse
from mock import Mock
m = Mock()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
query_group = subparsers.add_parser('query')
add_group = subparsers.add_parser('add')
lusis /
Last active Jul 13, 2019
Docker "Best Practices"

This is a copy/paste from an internal wiki on how we should use docker

This guide is to serve as an outline of internal best practices to using Docker. The idea is to give enough information to allow engineers to create containers for new stack components while minimizing the cleanup required to make them production ready.


Before we get to the practices, it's important to understand WHY we are doing this. The key concepts we're concerned about with broad Docker usage are provenance, determinism, repeatability and auditability.


Provenance refers to knowing WHERE something comes from. Generally with the end use of software, this is easy:

  • Maven artifacts are pulled from central
lusis /
Created Apr 10, 2019
exabgp promethues exporter

Current metrics at startup

root@node1:~# curl -s http://localhost:9569/metrics  | grep peer
# HELP peer_route_state shows the current peer state for a given route
# TYPE peer_route_state gauge
peer_route_state{family="ipv4 unicast",peer_asn="64496",peer_ip="",route="",self_asn="64496",self_ip=""} 1
# HELP peer_state shows the current peer state
# TYPE peer_state gauge
peer_state{peer_asn="64496",peer_ip="",self_asn="64496",self_ip=""} 1
lusis /
Last active Apr 10, 2019
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the
  • terraform apply


Tests will be matched based on roles defined for a given node.

View artifactory.conf
# place in /etc/yum/pluginconf.d/artifactory.conf
lusis / keytool.rb
Created Mar 26, 2012
recipe for adding certs to keytool
View keytool.rb
keystore = "/etc/java-6-sun/security/cacerts"
keystore_pass = "foobar"
# you'll need foo.cert et. al. in files/default
certs = %w{foo bar bang}
certs.each do |cert|
cookbook_file "#{Chef::Config[:file_cache_path]}/#{cert}.cert" do
source "#{cert}.cert"
lusis / dba-user.json
Created Jan 7, 2011
Managing MySQL user accounts with Chef
View dba-user.json
"comment":"DBA User",
"groups": [
"ssh_key": "XXXXXXXXXX"
lusis /
Created Feb 26, 2013
Generate system packages with FPM as part of maven.
#!/usr/bin/env bash
if [ -z ${CURRENT_ITERATION} ]; then
case "${PKG_VERSION}" in
echo "Packaging a snapshot version!"
#CURRENT_SHA=`git rev-parse HEAD`
lusis / iam-s3-policy.json
Created Jan 5, 2011
A sample AWS IAM json policy file with read-only access to certain S3 buckets
View iam-s3-policy.json
lusis / log4j.xml
Created Nov 23, 2011
Ruby logstash cli application - allows searching historical data in ElasticSearch or live tailing from AMQP topic exchange
View log4j.xml
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>
You can’t perform that action at this time.