Skip to content

Instantly share code, notes, and snippets.

@maethor
maethor / check_lsb_services.sh
Created Dec 3, 2014
This is a nagios/shinken plugin to check if all LSB services are running using the "service" command.
View check_lsb_services.sh
#!/bin/sh
#
# Guillaume Subiron, Sysnove, 2014
#
# Description :
#
# This plugin checks if all installed daemons are running.
# Works on Debian.
#
@maethor
maethor / hubot-init
Last active Dec 24, 2015
hubot init script for Debian
View hubot-init
#!/bin/sh
### BEGIN INIT INFO
# Provides: hubot
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the hubot hubot service
# Description: starts the hubot bot for the Campfire rooms
@maethor
maethor / nagios.coffee
Created Oct 3, 2013
Nagios and Shinken hubot script
View nagios.coffee
# Description:
# This script receives pages in the formats
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d state="$SERVICESTATE$" $CONTACTADDRESS1$
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d state="$HOSTSTATE$" $CONTACTADDRESS1$
#
# Author:
# maethor
# based on oremj (https://gist.github.com/oremj/3702073)
irc = require('irc')
@maethor
maethor / ldap.in
Created Oct 8, 2013
Backupninja LDAP handler for Debian (without using slapd.conf)
View ldap.in
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# openldap backup handler script for backupninja
#
getconf backupdir /var/backups/ldap
getconf suffixes all
getconf compress yes
getconf ldif yes
@maethor
maethor / ldap.helper.in
Created Oct 8, 2013
Backupninja LDAP handler for Debian (without using slapd.conf)
View ldap.helper.in
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
HELPERS="$HELPERS ldap:ldap_database_backup"
ldap_create_file() {
while true; do
checkBox "ldap action wizard" "check options" \
"compress" "compress the ldif output files" yes
status=$?
@maethor
maethor / example.ldap
Created Oct 8, 2013
Backupninja LDAP helper for Debian (without using slapd.conf)
View example.ldap
##
## configuration file for openldap backups
##
## Only support "slapcat" method.
## The LDIFs generated are suitable for use with slapadd.
## As the entries are in database order, not superior first order,
## they cannot be loaded with ldapadd without being reordered.
##
## backupdir (default /var/backups/ldap): the destination for the backups
@maethor
maethor / fail2ban-shorewall-wrapper.conf
Created Oct 5, 2016
Fail2Ban action to use shorewall-drop-wrapper.sh
View fail2ban-shorewall-wrapper.conf
#
# Author: Guillaume Subiron
#
# Block using shorewall-drop-wrapper.sh
# https://gist.github.com/maethor/2661311b394c5a610a3d258e54d8ac2a
#
[Definition]
# Option: actionstart
@maethor
maethor / shorewall-drop-wrapper.sh
Last active Oct 5, 2016
Shorewall wrapper to manage a whitelist and a blacklist. Written for fail2ban multiban.
View shorewall-drop-wrapper.sh
#!/bin/bash
#
# Guillaume Subiron, Sysnove, 2016
#
# Description :
#
# This script uses shorewall drop and shorewall allow to manage a blacklist.
#
# Instead of allowing an IP everytime we call shorewall allow. This script
@maethor
maethor / check_kernel.sh
Last active Jan 7, 2018
This is a nagios/shinken plugin to check if a Debian host is running the last installed kernel.
View check_kernel.sh
#!/bin/sh
#
# Guillaume Subiron, Sysnove, 2013
#
# Description :
#
# This plugin checks if we're running the newest installed kernel.
# Works on Debian.
#
@maethor
maethor / example.borg
Created Jun 15, 2016
BorgBackup handler for backupninja : example configuration file
View example.borg
##
## This is an example borgbackup configuration file.
##
## Here you can find all the possible borgbackup options, details of
## what the options provide and possible settings. The defaults are set
## as the commented out option, uncomment and change when
## necessary. Options which are uncommented in this example do not have
## defaults, and the settings provided are recommended.
##
## The defaults are useful in most cases, just make sure to configure the
You can’t perform that action at this time.