Skip to content

Instantly share code, notes, and snippets.

View schorschfunke's full-sized avatar
💭
Energie folgt der Aufmerksamkeit

Georg Funke schorschfunke

💭
Energie folgt der Aufmerksamkeit
  • Germany
View GitHub Profile
@gordonmurray
gordonmurray / convertCaddyCerts.md
Last active March 6, 2025 15:00
Steps to convert certificates generated by Caddy Server to certificates that Nginx can use

Convert Caddy Server certificates to LetsEncrypt certificates to be used by Nginx

Caddy

When using Caddy Server, it stores certificates in ~/.caddy/acme/acme-v01.api.letsencrypt.org/sites/{your domain name}/

3 files are stored in the folder called:

  • {yourdomain}.crt
  • {yourdomain}.json
  • {yourdomain}.key
@ageis
ageis / systemd_service_hardening.md
Last active March 7, 2026 03:39
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@sfan5
sfan5 / alpine-container.sh
Last active January 2, 2026 20:08
Create bootable systemd-nspawn containers with Alpine, Arch Linux or Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.23}
APKTOOLS_VERSION=3.0.3-r1
wget_or_curl () {
if command -v wget >/dev/null; then
@kvaps
kvaps / rspamd-lists.md
Last active October 9, 2025 16:10
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@lonetwin
lonetwin / locked_open.py
Last active April 9, 2025 09:31
Simple python file locking context manager example on linux using python stdlib's `fcntl.flock`
import logging
import fcntl
from contextlib import contextmanager
@contextmanager
def locked_open(filename, mode='r'):
"""locked_open(filename, mode='r') -> <open file object>
Context manager that on entry opens the path `filename`, using `mode`
(default: `r`), and applies an advisory write lock on the file which