Skip to content

Instantly share code, notes, and snippets.

View zerwes's full-sized avatar
🤯
I may be slow to respond.

Klaus Zerwes zerwes

🤯
I may be slow to respond.
View GitHub Profile
@zerwes
zerwes / ocsp_check.sh
Last active December 17, 2023 19:59
test script for ocsp support for openvpn @ opnsense
#!/bin/sh
# based on https://github.com/OpenVPN/openvpn/blob/master/contrib/OCSP_check/OCSP_check.sh
# for testing ocsp support in openvpn @ opnsense
# OCSP responder URL (mandatory)
# you can extract this from the cert ...
ocsp_url=`openssl x509 -in /var/etc/openvpn/server${1}.ca -noout -ocsp_uri`
# CA CERTIFICATE
@zerwes
zerwes / RT_SiteConfig.pm
Last active December 1, 2023 11:16 — forked from trev71/RT_SiteConfig.pm
Best Practical Request Tracker (RT) LDAP User Import and Authentication RT_SiteConfig.pm
# Any configuration directives you include here will override
# RT's default configuration file, RT_Config.pm
#
# To include a directive here, just copy the equivalent statement
# from RT_Config.pm and change the value. We've included a single
# sample value below.
#
# This file is actually a perl module, so you can include valid
# perl code, as well.
#
@zerwes
zerwes / check_redis_ping.sh
Created May 12, 2023 04:39
simple checkmk local plugin to check redis server state using a redis ping: expected response = pong
#!/bin/bash
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 smartindent nu ft=bash
declare -i RET=0
STATUS="OK"
O=$(REDISCLI_AUTH="$(sed '/^masterauth/!d;s/.* //g' /etc/redis/redis.conf)" redis-cli ping 2>&1)
RET=$?
if [ $RET -gt 0 ]; then
RET=2
STATUS="CRITICAL"
@zerwes
zerwes / sync-fail2ban-opnsense.sh
Last active January 27, 2024 01:40
opnsense fail2ban sync script
#! /bin/bash
# complementing https://github.com/zerwes/opnsense-fail2ban
# script will check all banned IPs listed in a list of fail2ban jails
# and compare them against a opnsense alias,
# removing the elements that are not in the ban list from fail2ban
#
# this will ensure that banned IPs that for what reaseon ever are left
# in the opnsense alias are cleaned up (avoiding neverending bans)
@zerwes
zerwes / aptupgrade.yml
Last active February 13, 2023 20:42
keep the debian zoo updated ...
---
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 smartindent nu ft=yaml
# run a upgrade and optional
# check later if the expected version of a desired package is installed
# run needrestart
#
# example: ansible-playbook -e run_versioncheck=true -e apt_upgrade=full aptupgrade.yml
- name: run apt upgrade
@zerwes
zerwes / gitcheats.txt
Created November 21, 2022 19:03 — forked from mkhairi/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# push changes to an empty git repository for the first time
git push --set-upstream origin master
# Remove + and - from start of diff lines
git diff --color | sed "s/^\([^-+ ]*\)[-+ ]/\\1/" | less -r
# clear out git hooks

Horizontal Tab Menu Slider v0.2

Responsive Horizontal Tab Menu Slider with left and right arrow key navigation. Built with Stylus and jQuery.

Show case your content with this easy to implement presentation.

A Pen by Ettrics on CodePen.

License.

@zerwes
zerwes / orphaned_packages.py
Created September 1, 2022 06:47
find packages not distributed by the current distro - for example after doing what you should never do: a dist upgrade from ubuntu to debian :-)
#! /usr/bin/env python3
# apt install python3-apt
import apt
cache = apt.Cache()
for pkg in cache:
if cache[pkg.name].is_installed:
continue
if cache[pkg.name].candidate:
continue
print(pkg.name)
@zerwes
zerwes / rspamd.local.lua
Created May 11, 2022 03:05
Rspamd: Simple per user Whitelist / Blacklist
-- When using Whitelist and Blacklist last result wins!
-- So maybe redis latency will decide ;)
rspamd_config.PER_USER_WL = {
-- CAUTION: This will whitelist the mail for every recipient when there is
-- match for any recipient
-- ADD a WL entry with: SADD RS_UWL_recipient@address.com sender@example.net
-- This function searches redis like this:
-- "SSCAN" "RS_UWL_recipient@address.com" "0" "MATCH" "sender@example.net"