Skip to content

Instantly share code, notes, and snippets.

View kpettijohn's full-sized avatar

Kevin Pettijohn kpettijohn

  • Figure Markets
  • Portland, Oregon
  • 14:16 (UTC -07:00)
View GitHub Profile
@kpettijohn
kpettijohn / vagrantfile_multi_boxes
Created August 14, 2014 06:21
Create multiple Vagrant boxes from one Vagranfile
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
boxes = [
{ :name => "zoo1", :ip => "10.10.10.35" },
{ :name => "zoo2", :ip => "10.10.10.36" },
{ :name => "zoo3", :ip => "10.10.10.37" },
{ :name => "zoo4", :ip => "10.10.10.38" },
{ :name => "zoo5", :ip => "10.10.10.39" }
@kpettijohn
kpettijohn / kitchen_local_chef
Created September 20, 2014 01:37
Kitchen configuration to install Chef from a local file
---
driver:
name: vagrant
synced_folders:
- ["chef/","/chef_instance"]
provisioner:
name: chef_zero
require_chef_omnibus: true
chef_omnibus_url: "file:///chef_instance/install.sh"
@kpettijohn
kpettijohn / client.rb
Created November 7, 2014 18:00
Sample client.rb
environment_path "/var/chef/env/"
environment "production"
chef_zero.enabled true
local_mode true
json_attribs "/var/chef/attribs.json"
node_path "/var/chef/node"
cookbook_path [
"/var/chef/cookbooks"
]
@kpettijohn
kpettijohn / lower_case_sting.sh
Created July 31, 2015 18:26
Lower case a string
uuidgen |tr '[:upper:]' '[:lower:]'
@kpettijohn
kpettijohn / docker_host_vsphere.sh
Created August 3, 2015 15:35
Example docker-machine vSphere create
#!/bin/bash
# Example docker-machine vSphere create
export VSPHERE_CPU_COUNT=4
export VSPHERE_MEMORY_SIZE=8192
export VSPHERE_DISK_SIZE=100000
export VSPHERE_VCENTER="vcenter.doamin.com"
export VSPHERE_USERNAME="DOAMIN\user"
export VSPHERE_PASSWORD=""
export VSPHERE_NETWORK="VM Traffic"
@kpettijohn
kpettijohn / fork.js
Last active September 25, 2015 21:28
nodejs fork
const
fs = require('fs'),
child_process = require('child_process');
var workers = [];
for(var i=0; i<5; i++) {
var worker = child_process.fork("lib/ExportWorker.js", [i]);
workers.push(worker);
console.log('Worker PID: ' + worker.pid);
@kpettijohn
kpettijohn / docker-compose.yml
Last active August 29, 2015 14:27
Docker Compose
redis:
image: redis
ports:
- "6379:6379"
# Create the koop databause with the following command:
# docker exec b5c14ac0d764 psql -U postgres -c "CREATE DATABASE koop TEMPLATE template_postgis;"
postgis:
image: kpettijohn/postgis:9.3
ports:
log_destination = 'syslog' # Valid values are combinations of
# These are relevant when logging to syslog:
syslog_facility = 'LOCAL7'
syslog_ident = 'postgres'
postgis:
image: kpettijohn/postgis
command: postgres -c log_min_duration_statement=0
ports:
- "5432:5432"
@kpettijohn
kpettijohn / ghprb_auth.groovy
Last active June 23, 2019 04:38
Configure GitHub Pull Request Builder Jenkins plugin with Groovy
// ghprb 1.29.2
import java.lang.reflect.Field
import jenkins.model.*
import org.jenkinsci.plugins.ghprb.*
def descriptor = Jenkins.instance.getDescriptorByType(org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl.class)
Field auth = descriptor.class.getDeclaredField("githubAuth")
auth.setAccessible(true)