Skip to content

Instantly share code, notes, and snippets.

View theking2's full-sized avatar
🎯
contemplating the odds

Johannes Kingma theking2

🎯
contemplating the odds
View GitHub Profile
@theking2
theking2 / create_signed_security_txt.sh
Created May 30, 2026 18:57
Create a signed security.txt file
# Basic usage
./create_signed_security_txt.sh -d example.com -c "mailto:security@example.com" -k ABC12345
# Full example with all options
./create_signed_security_txt.sh \
-d example.com \
-c "mailto:security@example.com" \
-k ABC12345 \
-e "https://example.com/pgp-key.asc" \
-a "https://example.com/thanks" \
@theking2
theking2 / compress.bash
Last active May 23, 2026 14:38
qcow2 Compression
#!/usr/bin/bash
# Function to get file size in human-readable format
get_size() {
du -h "$1" | cut -f1
}
# Function to get file size in bytes for calculation
get_size_bytes() {
stat -c %s "$1" 2>/dev/null || stat -f %z "$1" 2>/dev/null
@theking2
theking2 / vacuum-systemd-journal
Created May 20, 2026 14:18
Vacuum systemd journal
#!/usr/bin/env python3
"""
Interactive System Journal Vacuum Tool
This script allows you to safely clean systemd journal logs interactively.
"""
import subprocess
import sys
import os
from datetime import datetime, timedelta
@theking2
theking2 / prompt-creator.html
Created May 14, 2026 07:33
App Prompt creator
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prompt Creator</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css">
<style>
*{box-sizing:border-box;margin:0;padding:0}
:root{
@theking2
theking2 / docker_logs
Created May 3, 2026 06:41
Docker Log sizes
#!/usr/bin/env python3
"""
Docker Container Log Size Calculator
Lists all Docker containers with their log sizes and total log usage.
"""
import subprocess
import json
import sys
from typing import Dict, List, Tuple
@theking2
theking2 / style-test.php
Last active April 7, 2026 11:22
Elementor global style revealer
<?php
/**
* Elementor Global Style Test Page
*
* Drop this file into your WordPress root (or theme folder).
* It bootstraps WordPress just enough to get the stylesheet URL
* and all Elementor global CSS variables — no manual copy-paste needed.
*
* Usage:
* - Place in WP root: https://yoursite.com/elementor-style-test.php
@theking2
theking2 / excerpt-setup.md
Last active March 6, 2026 16:41
Install Win11 on virtio scsi with kmu

Virtio DISK 1

<disk type="file" device="disk">
  <driver name="qemu" type="qcow2" cache="unsafe" discard="unmap"/>
  <source file="/var/lib/libvirt/images/win11.qcow2" index="3"/>
  <backingStore/>
  <target dev="vda" bus="virtio"/>
  <alias name="virtio-disk0"/>
  <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
@theking2
theking2 / README.md
Last active February 25, 2026 09:45
copy path

Copy path

  1. upload the path.php to a location you want the path of
  2. run the https://<host>/path.php file, and click Copy path
  3. paste the path where you really need it.
#! /bin/bash
cp /etc/hosts.base ~/hosts
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts >> ~/hosts
sudo mv ~/hosts /etc/hosts
sudo systemctl reload dnsmasq
@theking2
theking2 / nextcloud_report
Last active May 24, 2025 10:12
nextcloud support request
#!/bin/bash
reverse_proxy_version=$(docker container exec nginx-proxy nginx -v 2>&1 | head -n 1)
echo "
Some or all of the below information will be requested if it isn't supplied; for fastest response please provide as much as you can. :heart:
* Nextcloud Server version:
- \`$(docker container exec nextcloud php /var/www/html/occ --version)\`