Skip to content

Instantly share code, notes, and snippets.

View JoshAnderson's full-sized avatar

Josh Anderson JoshAnderson

View GitHub Profile
@JoshAnderson
JoshAnderson / puppet.template.vars.01.txt
Created June 1, 2012 05:28
Using "local" variables in Puppet templates is a Bad Idea
It turns out that using local variables (like "hostname") in templates
instead of instance variables (like "@hostname") is a really bad idea:
# Ruby treats variables like methods, so we used to expose variables
# within scope to the ERB code via method_missing. As per RedMine #1427,
# though, this means that conflicts between methods in our inheritance
# tree (Kernel#fork) and variable names (fork => "yes/no") could arise.
#
# Worse, /new/ conflicts could pop up when a new kernel or object method
# was added to Ruby, causing templates to suddenly fail mysteriously when
@JoshAnderson
JoshAnderson / facepalm.sh
Created September 12, 2013 20:42
Facepalm
#!/bin/bash
cat <<EOF
_______...
.-'"..........\`\`~.
,.-".................."-.
,/........................":
,?............................\\
/..............................,}