Skip to content

Instantly share code, notes, and snippets.

@antaflos
antaflos / opsview-web.patch
Created December 5, 2011 22:40
Patches to make opsview init script LSB compatible
--- /etc/init.d/opsview-web 2011-10-12 01:19:02.000000000 +0200
+++ opsview-web.new 2011-12-05 23:06:55.149909067 +0100
@@ -179,7 +179,14 @@
start) start;;
stop) stop;;
restart) restart;;
- status) status;;
+ status)
+ status
+ case "$?" in
@antaflos
antaflos / recvfrom-conn-ref
Created January 3, 2012 04:30
Foreman recvfrom connection refused
Errno::ECONNREFUSED
Connection refused - recvfrom(2)
/usr/lib/ruby/1.8/resolv.rb:703:in `recv'
/usr/lib/ruby/1.8/resolv.rb:703:in `recv_reply'
/usr/lib/ruby/1.8/resolv.rb:618:in `request'
/usr/lib/ruby/1.8/resolv.rb:489:in `each_resource'
/usr/lib/ruby/1.8/resolv.rb:939:in `resolv'
/usr/lib/ruby/1.8/resolv.rb:937:in `each'
/usr/lib/ruby/1.8/resolv.rb:937:in `resolv'
/usr/lib/ruby/1.8/resolv.rb:936:in `each'
inspecting changes that are required for DHCP infrastructure
Adding new DHCP reservations
CACHE (0.0ms) SELECT * FROM "smart_proxies" WHERE ("smart_proxies"."id" = 3) ORDER BY LOWER(smart_proxies.name)
SQL (0.2ms) ROLLBACK
Connection refused - recvfrom(2)
/usr/lib/ruby/1.8/resolv.rb:703:in `recv'
/usr/lib/ruby/1.8/resolv.rb:703:in `recv_reply'
/usr/lib/ruby/1.8/resolv.rb:618:in `request'
/usr/lib/ruby/1.8/resolv.rb:489:in `each_resource'
/usr/lib/ruby/1.8/resolv.rb:939:in `resolv'
@antaflos
antaflos / foreman-ubuntu-12.04.preseed
Created June 14, 2012 16:33
Foreman Ubuntu 12.04 preseed provision template
d-i debian-installer/language string en
d-i debian-installer/country string AT
d-i debian-installer/locale string en_IE.UTF-8
d-i localechooser/supported-locales en_US.UTF-8, en_IE.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap string de
d-i keyboard-configuration/layoutcode string de
d-i keyboard-configuration/modelcode string pc105
d-i console-keymaps-at/keymap string de-latin1-nodeadkeys
@antaflos
antaflos / foreman-ubuntu-12.04.pxe
Created June 14, 2012 16:34
Foreman Ubuntu 12.04 PXE provision template
default Ubuntu
label Ubuntu
kernel <%= @kernel %>
append initrd=<%= @initrd %> video=vga16fb:off vga16fb.modeset=0 interface=eth0 url=<%= foreman_url("provision")%> ramdisk_size=10800 root=/dev/rd/0 rw auto=true priority=critical hostname=unassigned-hostname DEBCONF_DEBUG=5 language=en locale=en_IE.UTF-8 console-setup/ask_detect=false keyboard-configuration/layoutcode=de console-keymaps-at/keymap=de-latin1-nodeadkeys keyboard-configuration/xkb-keymap=de debian-installer/country=AT debian-installer/fb=false BOOTIF=<%= mac %>
@antaflos
antaflos / foreman-ubuntu-10.04-12.04.ptable
Created June 14, 2012 23:15
Foreman Ubuntu 10.04/12.04 partition table
d-i partman-auto/disk string /dev/vda
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg_sys01
d-i partman-auto-lvm/no_boot boolean true
d-i partman-auto/method string lvm
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
@antaflos
antaflos / sasl.erb
Created July 23, 2012 17:44
augeas erb iteration
rm sasl_allowed_username_list
<% i = 0 %>
<% sasl_allowed_usernames.each do |username| -%>
<% i += 1 %>
set sasl_allowed_username_list/<% sprintf("%02d", i) -%> <%= username %>
<% end -%>
@antaflos
antaflos / gist:6709690
Last active December 23, 2015 23:19
Shouldn't a deep merge by Hiera (1.2.1, :merge_behaviour: deeper) produce a users hash for user "ant" with four groups?
# common.yaml:
users:
ant:
uid: 1001
realname: Andreas
pwhash: '$6$thesalt$thehash'
groups:
- sudo
- adm
@antaflos
antaflos / gist:7085586
Last active December 26, 2015 03:19
hiera hashes with no key-value pairs for feeding into create_resources
# How does one define a hash with a name but no keys/values?
---
site_repos_ppa:
'ppa:git-core/ppa':
'ppa:mercurial-ppa/releases':
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'