Skip to content

Instantly share code, notes, and snippets.

@rgevaert
rgevaert / pre-commit
Created December 3, 2012 13:29
git puppet pre-commit hook
#!/bin/sh
syntax_errors=0
error_msg=$(mktemp /tmp/error_msg.XXXXXX)
if git rev-parse --quiet --verify HEAD > /dev/null
then
against=HEAD
else
# Initial commit: diff against an empty tree object
@rgevaert
rgevaert / Rakefile
Created December 3, 2012 13:31
Puppet-lint rake file
require 'rake'
require 'puppet-lint/tasks/puppet-lint'
#PuppetLint.configuration.send("disable_80chars")
#PuppetLint.configuration.send("disable_selector_inside_resource")
PuppetLint.configuration.send("disable_autoloader_layout")
@rgevaert
rgevaert / mcollective-wheezy.patch
Created May 3, 2013 15:11
Patch to make mcollective Debian packages that use ruby 1.9.1
diff --git a/ext/debian/control b/ext/debian/control
index 7fb71de..71c07c9 100644
--- a/ext/debian/control
+++ b/ext/debian/control
@@ -8,14 +8,14 @@ Homepage: http://marionette-collective.org/
Package: mcollective
Architecture: all
-Depends: ruby (>= 1.8.1), mcollective-common (= ${source:Version})
+Depends: ruby (>= 1.9.1), mcollective-common (= ${source:Version})
grok {
tags => "postfix/smtpd"
pattern => [ "%{POSTFIXSMTPDCONNECTS}",
"%{POSTFIXSMTPDACTIONS}",
"%{POSTFIXSMTPDTIMEOUTS}",
"%{POSTFIXSMTPDLOGIN}",
"." ]
named_captures_only => true
}
# Put this in /etc/systemd/system/logstash.service.d/
# And then run systemctl daemon-reload
# Will make logstash start if it wasn't cleanly stopped.
# see https://github.com/elastic/logstash/issues/3606, https://github.com/systemd/systemd/issues/1211
[Service]
RemainAfterExit=false
#!/bin/bash
version=$1
maintainer="Rudy Gevaert <[email protected]>"
description="Kibana is webinterface for Elasticsearch. To recreate this package use https://gist.github.com/rgevaert/5ea816c4ad0ef2979f32"
if [ "$version" == "" ]
then
echo Usage: $0 version-number
exit
@rgevaert
rgevaert / apache_no_type.rb
Created January 19, 2016 13:38
logstash rspec rules
# -*- encoding : utf-8 -*-
# Checks the configuration of the apache.conf logstash file
require 'spec_helper'
require 'logstash/filters/grok'
describe "apache common log format" do
config <<-CONFIG
filter {
VERSION v2.6.2
MYSELF 127.0.0.1 HOSTNAME
J_HOSTNAME SYSTEM
PRESENCE SHOW
FOOTER SHOW
FILTER_URL http://helpdesk.ugent.be/email/
POLICY_URL http://helpdesk.ugent.be/email/faq.php
DAEMON_FILTER_DISABLE
USER jchkmail
GROUP jchkmail
### Keybase proof
I hereby claim:
* I am rgevaert on github.
* I am rgevaert (https://keybase.io/rgevaert) on keybase.
* I have a public key ASDQfxSECsTK-sryvE31KHLAyl2vthXY7afdnZBdqBN9OQo
To claim this, I am signing this object: