Skip to content

Instantly share code, notes, and snippets.

View jeffmccune's full-sized avatar

Jeff McCune jeffmccune

View GitHub Profile
@jeffmccune
jeffmccune / console.md
Created April 18, 2012 00:25
Order dependant failures

This fails as expected:

$ rspec --format d spec/unit/application/describe_spec.rb 

TypeDoc
  (#13070) Should not explode (Will fail on Puppet 2.7.7 through 2.7.14) (FAILED - 1)

Failures:

  1) TypeDoc (#13070) Should not explode (Will fail on Puppet 2.7.7 through 2.7.14)
@jeffmccune
jeffmccune / subkey.pp
Created April 17, 2012 23:02
Registry Defined Type
# Use it
# I want this windows machine to announce the time as described at:
# http://support.microsoft.com/kb/816042
registry::subkey { 'HKLM\System\CurrentControlSet\Services\W32Time\Config\AnnounceFlags':
value_data => 'A',
value_type => DWORD,
}
# The definition
@jeffmccune
jeffmccune / different_versions.rb
Created April 16, 2012 16:41
Sorting out Exceptions at Runtime
#! /usr/bin/env ruby
module Stomp
class Error < StandardError
end
end
module Jeff
def self.unknown_error
if Stomp.const_defined? "Error"
@jeffmccune
jeffmccune / lucid_sources.list
Created April 16, 2012 05:42
Lucid Sources
#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################
###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
@jeffmccune
jeffmccune / puppet_mysql.md
Created April 11, 2012 23:42
Puppet Database

Install the MySQL module in PE 2.5

This module is located at http://forge.puppetlabs.com/puppetlabs/mysql

Installing the module is a single command in PE 2.5

root@pe-centos6:~# puppet module install puppetlabs-mysql

Preparing to install into /etc/puppetlabs/puppet/modules ...

@jeffmccune
jeffmccune / root_user.pp
Created April 11, 2012 18:01
Manage the Root User Password on Linux
# = Class: site::root_user
#
# This is a simple class to manage the root user password.
# The shadow hash of an existing password can be easily obtained
# by running `puppet resource user root` on a Linux system
# that has the desired root password already set.
# Puppet will then manage this password everywhere.
#
# First, I set the password to "puppet" on one Linux node and then get back the
# shadow hash.
@jeffmccune
jeffmccune / jenkins_motw.md
Created April 10, 2012 06:07
Jenkins MOTW Blog Post

Jenkins MOTW Blog Post

root@pe-centos6:~# puppet module install rtyler/jenkins
Preparing to install into /etc/puppetlabs/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppetlabs/puppet/modules
└─┬ rtyler-jenkins (v0.2.1)

└── puppetlabs-apt (v0.0.2)

Stdlib

  • 2.1.x (PE 2.0.x)

  • 2.2.x

  • master

  • 2.1.x → master 184 Commits

  • 2.1.x → 2.2.x 177 Commits

  • 2.2.x → master 6 Commits

@jeffmccune
jeffmccune / init.pp
Created January 6, 2012 21:44
Style Guide 11.9
# = motd class
#
# A Hierarchy of Class Param Value => Node Param Value => Module Default Value
#
# WITHOUT _real and UNSET ugliness! Hooray!
# ... but WITH inherits! Boo..?
#
# The class param value part of the hierarchy happens here since this is a parameterized class.
# The node param value and module default part of the hierarchy happens in params class
# we're inheriting from.
@jeffmccune
jeffmccune / type_provider_doc_irb.irb
Created December 14, 2011 01:06
Puppet Documentation for all types and providers found
[jeff@maynard] (2.7.x)(clean) 1.8.7@puppet src/puppet/lib/puppet
% irb
1.8.7 :001 > require 'puppet'
=> true
1.8.7 :002 > Puppet::Type.loadall
=> ["/vagrant/src/puppet/lib/puppet/type/augeas.rb", "/vagrant/src/puppet/lib/puppet/type/component.rb", "/vagrant/src/puppet/lib/puppet/type/computer.rb", "/vagrant/src/puppet/lib/puppet/type/cron.rb", "/vagrant/src/puppet/lib/puppet/type/exec.rb", "/vagrant/src/puppet/lib/puppet/type/file.rb", "/vagrant/src/puppet/lib/puppet/type/filebucket.rb", "/vagrant/src/puppet/lib/puppet/type/group.rb", "/vagrant/src/puppet/lib/puppet/type/host.rb", "/vagrant/src/puppet/lib/puppet/type/interface.rb", "/vagrant/src/puppet/lib/puppet/type/k5login.rb", "/vagrant/src/puppet/lib/puppet/type/macauthorization.rb", "/vagrant/src/puppet/lib/puppet/type/mailalias.rb", "/vagrant/src/puppet/lib/puppet/type/maillist.rb", "/vagrant/src/puppet/lib/puppet/type/mcx.rb", "/vagrant/src/puppet/lib/puppet/type/mount.rb", "/vagrant/src/puppet/lib/puppet/type/nagios_command.rb", "/vagrant/src/pup