This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet' | |
class Parser | |
def scan(input_file_name) | |
@input_file_name = input_file_name | |
environment = Puppet::Node::Environment.new | |
@known_resource_types = environment.known_resource_types | |
unless environment.known_resource_types.watching_file?(@input_file_name) | |
Puppet.info "rdoc: scanning #{@input_file_name}" | |
if @input_file_name =~ /\.pp$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
equire 'thread' | |
def scroll | |
puts "In the thread!!" | |
end | |
thread = false | |
if thread | |
scroller = Thread.new do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Puppet Instrumentation Framework | |
# | |
# * probes are code bits that trigger events to the framework | |
# * listeners receive those events and do what they want. Listeners can | |
# be subscribed to some events types only. | |
# | |
# Currently 4 probes: | |
# * indirector find | |
# * indirector save | |
# * indirector search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
set -o pipefail | |
hostname=$2 | |
RET=`/usr/bin/mk-heartbeat --database test --table heartbeat --user <user> --pass <pass> --host $hostname --check | sed -r -e 's, ,,g'` | |
RETVAL="$?" | |
if [ "$RETVAL" != "0" ]; then | |
exit $RETVAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands ping => "/usr/bin/ping" | |
... | |
# we can use it later with: | |
# ping "www.puppetlabs.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AST::VarDef | |
AST::Variable(file) | |
AST::Function(basename) | |
AST::String(...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/snmp/snmpd.conf | |
... | |
extend .1.3.6.1.4.1.20267.3.4 m44stats /bin/cat /var/run/games/m44-beta_stats | |
# emulating opennms snmp bulk get with the command-line: | |
snmpbulkget -v 2c -c public localhost .1.3.6.1.4.1.20267.3.4.4.1.2.8.109.52.52.115.116.97.116.115.1 | |
iso.3.6.1.4.1.20267.3.4.4.1.2.8.109.52.52.115.116.97.116.115.2 = STRING: "1660289024" | |
iso.3.6.1.4.1.20267.3.4.4.1.2.8.109.52.52.115.116.97.116.115.3 = STRING: "1660289024" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c2950#sh interfaces FastEthernet 0/1 status | |
Port Name Status Vlan Duplex Speed Type | |
Fa0/1 --> to end-user wo connect 1000 auto auto 10/100BaseTX | |
c2950#sh etherchannel 1 summary | |
Flags: D - down P - in port-channel | |
I - stand-alone s - suspended | |
H - Hot-standby (LACP only) | |
R - Layer3 S - Layer2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/puppet/provider/service/runit.rb b/lib/puppet/provider/service/runit.rb | |
index 0315b95..b83d235 100644 | |
--- a/lib/puppet/provider/service/runit.rb | |
+++ b/lib/puppet/provider/service/runit.rb | |
@@ -71,7 +71,7 @@ Puppet::Type.type(:service).provide :runit, :parent => :daemontools do | |
output = sv "status", self.daemon | |
return :running if output =~ /^run: / | |
rescue Puppet::ExecutionFailure => detail | |
- unless detail.message =~ /(warning: |runsv not running$)/ | |
+ unless detail.message =~ /(warning: |runsv not running$|unable to change to service directory$)/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./test/ruby/1.8/gems/mocha-0.9.10/lib/mocha/integration/mini_test.rb:3: uninitialized constant MiniTest (NameError) | |
from /Users/brice/devl/vagrant/test/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' | |
from /Users/brice/devl/vagrant/test/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 | |
from /Users/brice/devl/vagrant/test/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' | |
from /Users/brice/devl/vagrant/test/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 | |
rake aborted! | |
Command failed with status (1): [/opt/local/bin/ruby -I"lib:test" "/Users/b...] |