Skip to content

Instantly share code, notes, and snippets.

notice: Scope(Class[main]): Puppet version: 2.7.19
Must pass required to Class[Bar] at line 9 on node dcarley-mba.local
@dcarley
dcarley / anchor_pattern.png
Last active December 19, 2015 02:29
Puppet dependency patterns
anchor_pattern.png
@dcarley
dcarley / version.pp
Created June 25, 2013 08:12
PuppetMaster version
notice(inline_template('PuppetMaster version: <%= Puppet::PUPPETVERSION %>'))
@dcarley
dcarley / problem.sh
Last active December 18, 2015 22:19
Puppet 2.7.22 agent/master error
info: Retrieving plugin
err: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate: Could not intern_multiple from yaml: Invalid option ftype for Puppet::FileServing::Metadata
err: /File[/var/lib/puppet/lib]: Could not evaluate: Could not intern from yaml: Invalid option ftype for Puppet::FileServing::Metadata Could not retrieve file metadata for puppet://puppet/plugins: Could
not intern from yaml: Invalid option ftype for Puppet::FileServing::Metadata
info: Loading facts in /var/lib/puppet/lib/facter/fqdn_underscore.rb
info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
info: Loading facts in /var/lib/puppet/lib/facter/iptables_persistent_version.rb
info: Loading facts in /var/lib/puppet/lib/facter/ip6tables_version.rb
info: Loading facts in /var/lib/puppet/lib/facter/iptables_version.rb
info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
@dcarley
dcarley / unicorn_test.py
Last active December 16, 2015 12:19
Test the effect of Unicorn's `check_client_connection` option on a queue of disconnected requests. For use with: https://github.com/nickstenning/timeouttest
"""
Test the effect of Unicorn's `check_client_connection` option on a queue of
disconnected requests. For use with:
https://github.com/nickstenning/timeouttest
"""
import sys
import time
import requests
@dcarley
dcarley / monitorama_stream_simple.html
Created March 28, 2013 12:49
Simple version of the Monitorama stream so that the window can be resized.
<html>
<body>
<div data-fastly-live="http://streamtest.fastly.com/hds-live/livepkgr/_definst_/monitorama/monitorama.f4m"></div>
<script async src="http://live.fastly.net/live.js"></script>
</body>
</html>
#!/bin/env ruby
require 'fileutils'
require 'pathname'
ARGV.each do |old_name|
match = old_name.match(/^(.+)\/([^\/]+_production)\/(.*?)_?(nginx|varnish)\/(.+\.wsp)$/)
next unless match
root, host, vhost, prog, wsp = match.captures
@dcarley
dcarley / vagrant-105
Created March 17, 2013 11:59
Vagrant 1.0 and 1.1 speed for Vagrantfile with 60 VMs.
dcarley-MBA:vagrant-govuk dcarley$ b vagrant --version
Vagrant version 1.0.5
dcarley-MBA:vagrant-govuk dcarley$ time b vagrant status >/dev/null
real 0m3.430s
user 0m3.528s
sys 0m1.172s
@dcarley
dcarley / Rakefile
Created January 10, 2013 09:19
puppet/face/parser $confdir
require 'puppet/face'
desc "Check for puppet syntax errors"
task :syntax do
puts '---> Checking puppet syntax'
def validate_manifest(file)
Puppet::Face[:parser, :current].validate(file)
end
@dcarley
dcarley / gist:4077894
Created November 15, 2012 10:34
Antivirus on servers
$ ps -o user,pid,vsz,rss,args -C cma
USER PID VSZ RSS COMMAND
root 1819 196940 12964 /opt/McAfee/cma/bin/cma
root 1834 196940 12964 /opt/McAfee/cma/bin/cma
root 1836 196940 12964 /opt/McAfee/cma/bin/cma
root 1838 196940 12964 /opt/McAfee/cma/bin/cma
root 1895 196940 12964 /opt/McAfee/cma/bin/cma
root 1896 196940 12964 /opt/McAfee/cma/bin/cma
root 1897 196940 12964 /opt/McAfee/cma/bin/cma
root 1898 196940 12964 /opt/McAfee/cma/bin/cma