Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View TobiX's full-sized avatar

Tobias Gruetzmacher TobiX

View GitHub Profile
@TobiX
TobiX / Caddyfile
Last active February 8, 2024 08:33
Caddy Tar Pit
# Tar pit
@shit {
path */.env
path /wp-login.php
}
handle @shit {
root * /srv/www
vars compression gzip
@is_br header Accept-Encoding *br*
vars @is_br compression br
@TobiX
TobiX / bcryptbench.pl
Created May 17, 2022 10:25
Quick & dirty bcrypt benchmark
#!/usr/bin/perl
use 5.12.0;
use strict;
use warnings;
use Benchmark ':hireswallclock';
my $time;
my $rounds = 0;
@TobiX
TobiX / stream-console.sh
Created April 18, 2021 10:15
Simple script to stream "Webcam" input to Twitch
#!/bin/sh
INDEV="/dev/v4l/by-id/usb-MACROSILICON_USB3._0_capture-video-index0"
INRES="1920x1080" # input resolution
FPS="30" # target FPS
GOP="$((FPS * 2))"
THREADS="2"
CBR="6000k"
STREAM_KEY="XXX"
if [ "$1" = live ]
@TobiX
TobiX / test.sh
Created February 14, 2021 23:30
Get Linux MMC transfer speeds
# Background: https://github.com/ThomasKaiser/Knowledge/blob/master/articles/A1_and_A2_rated_SD_cards.md
# Symptoms: Write speed seems to be capped at ~ 20MByte/s if controller does only support 3.3V
# To see if your controller supports higher speeds, enable these debug message:
echo "func mmc_set_ios +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
echo "func mmc_set_initial_signal_voltage +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
# Verify:
sudo grep mmc.*=p /sys/kernel/debug/dynamic_debug/control
# (this assumes debugfs under /sys/kernel/debug)
# On the next card insert, you should see power/speed debug messages in dmesg
def call(Map params = [:], Closure inner) {
catchError {
inner.call()
}
def notifyCulprits = params.getOrDefault('notifyCulprits', true)
def extraMails = params.getOrDefault('extraMails', [])
if (shouldSendMail(currentBuild)) {
def providers = []
@TobiX
TobiX / server.py
Created December 21, 2019 01:06
Remote Address API server
#!/usr/bin/env python3
import json
from werkzeug.wrappers import Request, Response
from werkzeug.middleware.proxy_fix import ProxyFix
@Request.application
def application(request):
@TobiX
TobiX / pom-bom-output.txt
Created April 27, 2019 14:41
BOM vs. direct
>mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------< test:test >------------------------------
[INFO] Building test 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test ---
[INFO] test:test:jar:1
[INFO] \- org.eclipse.jetty:jetty-hazelcast:jar:9.4.15.v20190215:compile
@TobiX
TobiX / apache.conf
Created January 13, 2018 11:15
Generic ACME/HTTPS vhost
<VirtualHost 192.168.99.99:80 [2001:0002:6c::430]:80>
ServerName example.com
ServerAlias www.example.com host1.example.com host2.example.com
ServerAdmin tobias@example.com
AddDefaultCharset utf-8
DocumentRoot /home/certmaster/webroot/
RewriteEngine on
RewriteRule ^/.well-known/ - [L]
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>
@TobiX
TobiX / hosted-on-cloudflare.py
Created February 24, 2017 16:05
Quick-and-dirty script to find sites hosted on CloudFlare
#!/usr/bin/python3
import argparse
# pip install urlextract dnspython tldextract
import dns.name
import dns.resolver
import urlextract
import tldextract
@TobiX
TobiX / friendcode.py
Last active May 31, 2020 03:55
Nintendo 3DS friendcode verification
#!/usr/bin/python3
# Released into the public domain, where possible (http://creativecommons.org/publicdomain/zero/1.0/)
import sys
import re
import hashlib
fc = sys.argv[1]
parts = re.match('^(\d{4})-(\d{4})-(\d{4})$', fc)