Skip to content

Instantly share code, notes, and snippets.

@maethor
maethor / debian_upgrade.yml
Created July 18, 2014 14:06
Ansible playbook to update and upgrade Debian hosts
---
- hosts: all
sudo: yes
tasks:
- name: Update packages list
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: List packages to upgrade (1/2)
<?php
#
# Copyright (c) 2014 Guillaume <maethor> Subiron (http://www.sysnove.fr/)
# Plugin: check_nginx_status
#
$colors = array(
'read' => '#5a3d99',
'write' => '#ff0000',
'wait' => '#e5ca44',
@maethor
maethor / letsencrypt-auto-renew.sh
Last active January 15, 2020 16:49
This script generates or regenerates SSL certificates using acme-tiny to sign the certificate signing requests found in /etc/letsencrypt/
#!/bin/sh
#
# Guillaume Subiron, Sysnove, 2016
# Inspired by Benjamin Sonntag's https://github.com/octopuce/octopuce-goodies/blob/master/letsencrypt-renew/letsencrypt-auto-renew.sh
#
# Description :
#
# This script generates or regenerates SSL certificates using acme-tiny
# to sign the certificate signing requests found in /etc/letsencrypt/
@maethor
maethor / backups.yml
Created June 15, 2016 09:51
Example ansible playbook for backupninja + borg (incomplete)
---
- hosts: backup-servers
tasks:
- name: Install rdiff-backup
apt: pkg=rdiff-backup state=installed
- name: Install borgbackup
apt: pkg=borgbackup state=installed
- hosts: all
vars:
@maethor
maethor / borg
Last active September 27, 2018 11:18
BorgBackup handler script for backupninja
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# borg handler script for backupninja
# requires borgbackup
#
# Guillaume Subiron, Sysnove, 2016
#
# Copyright 2016 Guillaume Subiron <guillaume@sysnove.fr>
# This work is free. You can redistribute it and/or modify it under the
@maethor
maethor / example.borg
Created June 15, 2016 09:20
BorgBackup handler for backupninja : example configuration file
##
## 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
@maethor
maethor / check_kernel.sh
Last active January 7, 2018 23:18
This is a nagios/shinken plugin to check if a Debian host is running the last installed kernel.
#!/bin/sh
#
# Guillaume Subiron, Sysnove, 2013
#
# Description :
#
# This plugin checks if we're running the newest installed kernel.
# Works on Debian.
#
@maethor
maethor / shorewall-drop-wrapper.sh
Last active October 5, 2016 13:22
Shorewall wrapper to manage a whitelist and a blacklist. Written for fail2ban multiban.
#!/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 / fail2ban-shorewall-wrapper.conf
Created October 5, 2016 13:20
Fail2Ban action to use shorewall-drop-wrapper.sh
#
# Author: Guillaume Subiron
#
# Block using shorewall-drop-wrapper.sh
# https://gist.github.com/maethor/2661311b394c5a610a3d258e54d8ac2a
#
[Definition]
# Option: actionstart
@maethor
maethor / ldap.helper.in
Created October 8, 2013 14:47
Backupninja LDAP handler for Debian (without using slapd.conf)
# -*- 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=$?