Skip to content

Instantly share code, notes, and snippets.

View kbabioch's full-sized avatar

Karol Babioch kbabioch

View GitHub Profile
@kbabioch
kbabioch / keybase.md
Created May 13, 2015 17:52
Keybase identity proof for kbabioch

Keybase proof

I hereby claim:

  • I am kbabioch on github.
  • I am kbabioch (https://keybase.io/kbabioch) on keybase.
  • I have a public key whose fingerprint is 758A B783 45F8 9BD7 CFE6 615D 749A 65CD 479F 3215

To claim this, I am signing this object:

@kbabioch
kbabioch / check_myip
Created April 22, 2017 20:07
Checks whether the given hostname matches the own external IP address. The external IP address is determined by querying https://myip.babioch.de.
#! /bin/sh
# Copyright (c) 2017 Karol Babioch <karol@babioch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@kbabioch
kbabioch / check_postfix_log.go
Created November 9, 2017 16:47
Analyzes mail log files from Postfix (in Go)
package main
import (
"bufio"
"flag"
"fmt"
"os"
"regexp"
"strconv"
"time"
@kbabioch
kbabioch / check_postfix_log.py
Created November 9, 2017 16:49
Analyzes mail log files from Postfix (in Python)
#! /usr/bin/env python
from datetime import datetime, timedelta
from optparse import OptionParser
import sys
import re
# TODO Read log lines backwards
desc="""This is a simple Nagios plugin that will analyze the mail log from
@kbabioch
kbabioch / hooks.py
Created June 7, 2018 09:46
Prototype of a hook for urlwatch to retrieve releases from GitHub via official API
# Copyright (c) 2018 Karol Babioch <karol@babioch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@kbabioch
kbabioch / check-soa-consistency.py
Created February 9, 2019 16:31
Checks for consistency of SOA records in zone belonging to a given name on all authoritative nameservers
#! /usr/bin/env python3
import argparse
import logging
import re
import subprocess
import sys
# Exit codes
EXIT_OK = 0
@kbabioch
kbabioch / check-nsec3param
Created February 14, 2019 21:00
Checks NSEC3PARAM for a given zone
#! /usr/bin/env python3
#
# Copyright (c) 2019 Karol Babioch <karol@babioch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@kbabioch
kbabioch / check_systemd_failed
Created June 3, 2019 22:06
This is a very simple script that will check for failed systemd units by parsing the output of systemctl(1).
#!/usr/bin/env python3
# Copyright (c) 2019 Karol Babioch <karol@babioch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@kbabioch
kbabioch / wireguard
Last active March 12, 2024 14:35
LSBInitScript for Wireguard: This is a leightweight init script for Wireguard. While Wireguard itself requires only minimal overhead to setup and start, it still requires some script invocations (e.g. during boot).
#! /bin/bash
# Copyright (c) 2021 Karol Babioch <karol@babioch.de>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@kbabioch
kbabioch / oea-box-info.py
Created March 18, 2021 21:52
Custom Ansible module to collection hardware-specific information about a Enigma2-based receiver (based on boxbranding from OE-Alliance).
#! /usr/bin/env python
# Copyright (c) 2021 Karol Babioch <karol@babioch.de>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,