Skip to content

Instantly share code, notes, and snippets.

cron { 'pingscanner':
command => 'checkping'
,user => nobody
,hour => '*'
,minute => [3,8,13,18,23,28,33,38,43,48,53,58]
}
@devicenull
devicenull / raidcontroller.rb
Created May 18, 2012 00:48
raidcontroller.rb
Facter.add("raidcontroller") do
confine :kernel => :linux
ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
setcode do
controllers = []
lspciexists = system "/bin/bash -c 'which lspci >&/dev//null'"
if $?.exitstatus == 0
output = %x{lspci}
output.each {|s|
controllers.push("megaraid") if s =~ /RAID bus controller: .* MegaRAID .*/
/usr/lib/ruby/gems/1.9.1/gems/puppet-lint-0.1.13/bin/puppet-lint:89:in `<top (required)>': undefined method `each' for "shared.pp":String (NoMethodError)
from /usr/bin/puppet-lint:19:in `load'
from /usr/bin/puppet-lint:19:in `<main>'
@devicenull
devicenull / gist:3055719
Created July 5, 2012 19:01
Puppet raidcontroller fact
Facter.add("raidcontroller", :timeout => 10) do # Terminate the fact if resolution takes too long
confine :kernel => :linux
setcode do
controllers = []
if output = Facter::Util::Resolution.exec('lspci') # Use facter's built in execution
output.each {|s|
controllers.push("megaraid") if s =~ /RAID bus controller: .* MegaRAID .*/
controllers.push("3ware") if s =~ /RAID bus controller: 3ware .*/
}
end
@devicenull
devicenull / gist:3896763
Created October 16, 2012 01:25
Clonezilla Live iPXE config
:imaging
set image_name your-image-name
kernel http://${next-server}/tools/clonezilla-live/vmlinuz initrd=tools/clonezilla-live/initrd.img boot=live live-config noswap nolocales edd=on nomodeset ocs_daemonon="ssh" ocs_live_run="ocs-live-restore" ocs_live_extra_param="--batch -g auto -e1 auto -e2 -r -j2 -p reboot restoredisk ${image_name} sda" ocs_live_keymap="/usr/share/keymaps/i386/qwerty/us.kmap.gz" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 nosplash fetch=http://${next-server}/tools/clonezilla-live/filesystem.squashfs ip=eth0:${netX/ip}:${netX/netmask}:${netX/gateway}:8.8.8.8 ocs_prerun="mount -t nfs ${next-server}:/home/partimag /home/partimag"
initrd http://${next-server}/tools/clonezilla-live/initrd.img
boot
@devicenull
devicenull / gist:4348614
Created December 20, 2012 21:11
Linux iPXE net install
:centos6_x64
set centos-version 6
set arch x86_64
set os centos
goto centos_installer
:centos6_i386
set centos-version 6
set arch i386
set os centos
===============================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================
Installing:
redhat-lsb x86_64 4.0-3.el6.centos base 24 k
Installing for dependencies:
alsa-lib x86_64 1.0.22-3.el6 base 370 k
at x86_64 3.1.10-43.el6_2.1 base 60 k
atk x86_64 1.28.0-2.el6 base 191 k
avahi-libs x86_64 0.6.25-11.el6
I recently upgraded PuppetDB from v0.9.1 to v1.1.1 and now I'm seeing this error in my log file:
puppet-master[9385]: Could not retrieve resources from the PuppetDB at XXXX:8081: undefined method `log_x_deprecation_header' for #<Puppet::Resource::Puppetdb:0x7f98c16ba9c0> on node XXXX
Looking at the PuppetDB log file, everything seems to be okay except for this error:
2013-02-19 16:18:57,749 WARN [qtp1488632133-65] [http.server] Use of unversioned APIs is deprecated; please use /v1/commands
Why is puppet producing this error?
/usr/bin/java -jar /usr/share/java/logstash.jar agent -f /etc/logstash
Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (ENOENT) No such file or directory - file:/usr/share/java/logstash.jar!/data/unicode.data
at org.jruby.RubyFile.initialize(org/jruby/RubyFile.java:333)
at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1179)
at RUBY.IDNA(file:/usr/share/java/logstash.jar!/addressable/idna/pure.rb:322)
at RUBY.Addressable(file:/usr/share/java/logstash.jar!/addressable/idna/pure.rb:20)
at RUBY.(root)(file:/usr/share/java/logstash.jar!/addressable/idna/pure.rb:19)
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
at Kernel.require(jar:file:/usr/share/java/logstash.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)
at Kernel.require(file:/usr/share/java/logstash.jar!/logstash/JRUBY-6970.rb:10)
input {
file {
path => "/var/log/nginx/access_log"
charset => "UTF-8"
type => "access_log"
}
}