This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code licensed MIT 2023 Stefaan Lippens | |
import difflib | |
import itertools | |
from typing import List, Tuple, Iterator | |
class Sdiffer: | |
def __init__(self, max_width:int = 80): | |
# Two columns with a gutter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# License: WTFPL | |
# UPPERCASE space-separated country codes to ACCEPT | |
ALLOW_COUNTRIES="DE" | |
LOGDENY_FACILITY="authpriv.notice" | |
if [ $# -ne 1 ]; then | |
echo "Usage: `basename $0` " 1>&2 | |
exit 0 # return true in case of config issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# arpaname.py, (C)2022 by Jan-Piet Mens <[email protected]> | |
# Convert an IPv4 or IPv6 address in textual form into a string whose value is | |
# the reverse-map domain name of the address. | |
# | |
# - debug: msg="{{ "192.168.1.3" | arpaname }}" | |
# "3.1.168.192.in-addr.arpa." | |
# | |
# - debug: msg="{{ "2001:DB8::7" | arpaname }}" | |
# "7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code licensed LGPLv3 by Jérémie Lumbroso <[email protected]> | |
import difflib | |
import itertools | |
import textwrap | |
import typing | |
def side_by_side( | |
left: typing.List[str], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CheckCommand "check-smart" { | |
import "plugin-check-command" | |
command = [ "/usr/lib/monitoring-plugins" + "/check_smart" ] | |
arguments = { | |
"--device" = { | |
value = "$smart_device$" | |
set_if = {{ macro("$smart_device_is_glob$") == false }} | |
description = "A physical block device to be SMART monitored, eg /dev/sda. Pseudo-device /dev/bus/N is allowed." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: schedule downtime | |
uri: | |
url: "https://{{ icinga_host }}:{{ icinga_port | default(5665) }}/v1/actions/schedule-downtime" | |
user: "{{ icinga_user }}" | |
password: "{{ icinga_password }}" | |
force_basic_auth: True | |
validate_certs: False | |
method: POST | |
headers: | |
Accept: "application/json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log-queries | |
log-facility=/var/log/dnsmasq.log | |
no-resolv | |
server=8.8.4.4 | |
server=8.8.8.8 | |
address=/router/10.1.1.1 | |
address=/server/10.1.1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CIPHERS='ALL:eNULL' | |
DELAY=${2:-0.1} | |
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]} | |
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}') | |
echo Using $(openssl version). | |
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creates a silence in alertmanager that starts `now` and lasts for 10 minutes | |
- hosts: localhost | |
gather_facts: yes | |
tasks: | |
- set_fact: | |
start_datetime: "{{ ''| local_time_iso8601 }}" | |
future_datetime: "{{ ''|local_time_iso8601 | add_time_iso8601(minutes=10) }}" | |
- debug: | |
var: future_datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration | |
-- Listen on all interfaces (localhost would not work in Docker) | |
net.listen('0.0.0.0') | |
net.listen('0.0.0.0', 853, {tls=true}) | |
-- Auto-maintain root TA | |
trust_anchors.file = '/data/root.keys' | |
-- Load Useful modules |
NewerOlder