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
#!/usr/bin/env rspec | |
require 'mocha' | |
require 'mysql' | |
describe "foo" do | |
it "should mock mysql query" do | |
mock_mysql = mock("Mysql") | |
Mysql.expects(:new).returns(mock_mysql) | |
mock_mysql.expects(:query).with("create database foo") |
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
# rvm gemset list ruby-1.8.7-p352@global | |
gemsets for ruby-1.8.7-p352 (found in /Users/ken/.rvm/gems/ruby-1.8.7-p352) | |
ci | |
esperfoo | |
=> global | |
puppet | |
[ken@kb Development]# cd facter ruby-1.8.7-p352@global | |
installing diff-lcs 1.1.2... |
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
#!/usr/bin/env bash | |
# This is an RVM Project .rvmrc file, used to automatically load the ruby | |
# development environment upon cd'ing into the directory | |
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional. | |
environment_id="ruby-1.8.7-p352@facter" | |
# | |
# Uncomment following line if you want options to be set only for given project. |
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
scope.class_scope(find_hostclass('your::class')).to_hash(false) |
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
define create_rsa_key ( | |
) { | |
# Private key | |
exec { "genprivkey": | |
command => "generate private key", | |
creates => "/home/${name}/.mcollective/${name}-private.pem", | |
} | |
file { "/home/${name}/.mcollective/${name}-private.pem": | |
ensure => "present", |
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
[ken@kb test]# ~/Development/facter/bin/facter networking | |
--- | |
interfaces: | |
lo0: | |
ip: | |
addresses: | |
- 127.0.0.1 | |
status: active | |
en0: | |
status: inactive |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
a = { | |
"a" => "b", | |
"e" => "b", | |
"c" => "b", | |
"p" => "b", | |
"z" => "b", |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
a = { | |
"a" => "b", | |
"e" => "b", | |
"c" => "b", | |
"p" => "b", | |
"z" => "b", |
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/facter arp_table | |
--- | |
arp_table: | |
list: | |
- &id001 | |
ip_address: 169.254.245.13 | |
protocol: ethernet | |
mac_address: b8:8d:12:5a:c9:45 | |
hostname: "" | |
interface: en1 |
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
{"kb2.local":{"arp_table":[{"hostname":"","interface":"en1","ip_address":"192.168.16.1","protocol":"ethernet","mac_address":"0:c:42:bd:d3:91"},{"hostname":"","interface":"en1","ip_address":"192.168.16.205","protocol":"ethernet","mac_address":"0:c:29:6b:b7:cf"},{"hostname":"","interface":"en1","ip_address":"192.168.16.207","protocol":"ethernet","mac_address":"c8:2a:14:50:69:91"},{"hostname":"","interface":"en1","ip_address":"192.168.16.215","protocol":"ethernet","mac_address":"68:a8:6d:4f:e0:a4"},{"hostname":"","interface":"en1","ip_address":"192.168.16.255","protocol":"ethernet","mac_address":"ff:ff:ff:ff:ff:ff"}],"operatingsystem":"sunos"},"kb.local":{"arp_table":[{"hostname":"","interface":"en1","ip_address":"192.168.16.1","protocol":"ethernet","mac_address":"0:c:42:bd:d3:91"},{"hostname":"","interface":"en1","ip_address":"192.168.16.204","protocol":"ethernet","mac_address":"0:c:29:6b:b7:ce"},{"hostname":"","interface":"en1","ip_address":"192.168.16.207","protocol":"ethernet","mac_address":"c8:2a:14:50:69:9 |