Skip to content

Instantly share code, notes, and snippets.

View aapjeisbaas's full-sized avatar

Stein van Broekhoven aapjeisbaas

View GitHub Profile
@m3nu
m3nu / cve-2026-31431.yml
Last active May 3, 2026 18:39
Ansible playbook for CVE-2026-31431 mitigation
# Mitigation for CVE-2026-31431 ("Copy Fail") — algif_aead LPE
# https://xint.io/blog/copy-fail-linux-distributions
# Apply: ansible-playbook playbooks/cve-2026-31431.yml
#
# One mitigation per OS family, plus a cleanup pass for hosts that received
# the (now-abandoned) systemd seccomp drop-ins in earlier runs.
#
# Tags:
# cve-kernel RHEL/Alma 9, 10: add initcall_blacklist=algif_aead_init
# to GRUB. No reboot — the arg becomes active on the
@lcrilly
lcrilly / README.md
Last active August 8, 2025 12:32
Prometheus exporter for NGINX Unit metrics

Prometheus exporter for NGINX Unit metrics

The NGINX Unit control API includes a /status endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.

The application (run by Unit) queries the /status URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.

These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.

Step 0. Install the preferred Unit language module (unit-php or unit-python)

@zidenis
zidenis / 5_steps_for_creating_templates_and_vms_on_proxmox_using_linux_distros_cloud_images.md
Last active April 25, 2026 16:54
Creating Templates and Virtual Machines on Proxmox using cloud images from various Linux distributions.

5 Steps for Creating Templates and Virtual Machines on Proxmox using Linux Distro's Cloud Images

This tutorial guides you through the process of creating Templates and Virtual Machines on Proxmox using cloud-based images from various Linux distributions. We provide clear instructions for Alma Linux 9, Amazon Linux 2, CentOS 9, Fedora 38, Oracle Linux 9, RHEL 9, Rocky Linux 9, and Ubuntu 23.04 Lynx Lobster.

Note: The instructions have been tested on Proxmox 8.0.4.

Let's begin by choosing the cloud-based image. If you already have your preferred Linux distribution, skip to the 1st step.

To assist in making informed choices when selecting a Linux distribution for your virtual machines, we've compiled a table showcasing key characteristics of each cloud image. This table provides a snapshot of important attributes, including kernel version, Python version, number of processes initialized after boot, number of packages installed, free memory after boot, VM disk size, root partition disk size, used size on t

@code-boxx
code-boxx / 0-PY-RESUME-UPLOAD.MD
Last active October 4, 2023 07:49
Python Flask Resumable Upload

PYTHON FLASK RESUMABLE UPLOAD

https://code-boxx.com/python-flask-resumable-upload/

NOTES

  1. Run unpack.bat (Windows) unpack.sh (Linux/Mac). This will automatically:
    • Create 4 folders - static, temp, templates, upload
    • Move S2_upload.css and S2_upload.js into static.
    • Move S2_upload.html into templates.
    • Create a virtual environment - virtualenv venv
  • Activate the virtual environment - venv\scripts\activate (Windows) venv/bin/activate (Mac/Linux)
@nginx-gists
nginx-gists / ubuntu_install.sh
Last active May 29, 2025 05:42
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@wipash
wipash / Create-VM-cloud-init.ps1
Last active August 3, 2025 20:45
Create Linux VM on Hyper-V with cloud-init
<#
Create Unix VM's.
PREREQUISITES:
- A VM that has been installed with an OS that supports cloud-init
- cloud-init is installed on the vm
How it works:
- Asks for a bunch of parameters
- Creates a disk from parent vhdx for speed
@mikejoh
mikejoh / docker-dhcpd.md
Last active January 3, 2026 00:48
Short guide on how to set up a Docker container as a DHCP server

Setting up a Docker container as a DHCP server

In this guide I’ve tested a number of different commands and configurations using Docker to run a container with dhcpd (+macvlan driver) to serve my clients in my home network. In the end i’ll migrate from my Windows 2012 R2 Server running DHCP to a much more lightweight Docker container (7.42 MB in total). Wow.

My home environment:

  • Firewall (Juniper)
    • I’m running IP helper for bootp which in this case means that i relay DHCP requests from various VLANs into one where i've placed my Windows 2012 R2 server. This is also where my container will live. See the FW configuration below:
@lopesivan
lopesivan / webcam.md
Last active November 10, 2023 12:03
Play webcam using mplayer

Play webcam using mplayer

To play webcam using mplayer, we will need to use TV input but with v4l2 as driver,

  $ mplayer tv:// -tv driver=v4l2

then it just plays with default values. We can add options to tweak such as width, height, output format, frame rate, select device…Each option is separated by a colon. For example, play webcam from /dev/video0, with widthxheight=1280×720, framerate=30, and output format is YUV (YUY2),

@denysvitali
denysvitali / stream-pulseaudio-vlc-sonos.md
Last active April 15, 2026 13:38
Quick tutorial on how to play sound from your computer to a Sonos device

Quick tutorial on how to play sound from your computer to a Sonos device

Introduction

Assumptions

192.168.1.111 IP of your Sonos Device
192.168.1.128 IP of your computer

Configuration

PulseAudio

@mdonkers
mdonkers / server.py
Last active April 29, 2026 17:31
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer