This file contains hidden or 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
input { whatever } | |
filter { grok { pattern => "%{COMBINEDAPACHELOG}" } } output { statsd { increment => "apache.status.%{response}" } } |
This file contains hidden or 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/ruby | |
# Query Foreman | |
# example usage: | |
# | |
# query for hosts | |
# ~~~~~~~~~~~~~~~ | |
# $myhosts = foreman("hosts","facts.domain ~ lab") | |
# returns all hosts which have lab as part of their domain. | |
# |
This file contains hidden or 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 'fog' | |
compute = Fog::Compute.new(:provider => 'VirtualBox') | |
server = compute.servers.create(:name => 'lucid', :os => 'Ubuntu') | |
medium = compute.mediums.create(:device_type => :hard_disk, :location => '/Users/geemus/geemus/virtualbox_poc/lucid.vmdk', :read_only => false) | |
storage_controller = server.storage_controllers.create(:bus => :sata, :name => 'sata') | |
storage_controller.attach(medium, 0) |
This file contains hidden or 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
Usage: puppet-package-over-ssh.rb HOST PACKAGE ACTION | |
% ruby puppet-package-over-ssh.rb snack sl uninstall | |
Package[sl] uninstall status: {:status=>"not-installed", :error=>"ok", :desired=>"unknown", :ensure=>:purged, :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack sl install | |
Package[sl] install status: {:status=>"installed", :error=>"ok", :desired=>"install", :ensure=>"3.03-16", :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack fancypants install | |
Could not install package Package[fancypants]: Execution of 'ssh snack sudo "/usr/bin/apt-get" "-q" "-y" "-o" "DPkg::Options::=--force-confold" "install" "fancypants"' returned 100: Reading package lists... | |
Building dependency tree... |
NewerOlder