Skip to content

Instantly share code, notes, and snippets.

View justinclayton's full-sized avatar

Justin Clayton justinclayton

View GitHub Profile
@vStone
vStone / test.txt.erb
Created December 4, 2012 07:05
Puppet Template Headers
Original header used now:
### File managed with puppet ###
## Served by: '<%= scope.lookupvar('::servername') %>'
## Module: '<%= scope.to_hash['module_name'] %>'
## Template source: 'MODULES<%= template_source.gsub(Regexp.new("^#{Puppet::Node::Environment.current[:modulepath].gsub(':','|')}"),"") %>'
Problem: When using puppet apply with relative modulepath, the information can be wrong or messy.
Alternative 1:
@matt-deboer
matt-deboer / Bakefile
Last active September 2, 2016 22:33
Bakefile to create a docker 1.12 swarm on OSX with docker-machine-driver-xhyve support
#!/bin/bash
set -u
#. creates a new swarm. params name, [driver], [workers], [managers]
create-swarm() {
bake_params name
local driver=${driver:=virtualbox}
local workers=${workers:=2}
local managers=${managers:=1}
#!/usr/bin/env ruby
require 'fileutils'
class VmList
@@cache_file = ENV['vm_list_cache_file'] || '/tmp/vm_list_cache'
@@cache_ttl = ENV['vm_list_cache_ttl'] || 60
def self.get_vm_list
vmware = %x{"/Applications/VMware\ Fusion.app/Contents/Library/vmrun" list | grep -v Total}.split("\n")
@curator
curator / YAML.tmLanguage
Created June 26, 2014 22:18
Updated YAML that deals with hiera data a bit better (double colons)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>yaml</string>
<string>yml</string>
</array>
<key>foldingStartMarker</key>
@lutter
lutter / README.md
Created June 25, 2014 12:17
Hook design document

Hooks

Hooks provide a way to be notified of certain events during the operation of the Razor server; the behavior of a hook is defined by a hook type.

File layout for a hook type

Similar to brokers and tasks, hook types are defined through a .hook directory and files within that directory: