Skip to content

Instantly share code, notes, and snippets.

View FabianBartl's full-sized avatar
🤖
studies robotics

Fabian FabianBartl

🤖
studies robotics
View GitHub Profile
@FabianBartl
FabianBartl / jellyfin.css
Last active April 22, 2025 20:04
Just for backup, here is the custom CSS of my Jellyfin server. Press Ctrl+Shift+R to fully reload the Jellyfin homepage.
/* https://github.com/CTalvio/Ultrachromic?tab=readme-ov-file#customization-using-multiple-import-lines */
@import url('https://cdn.jsdelivr.net/gh/CTalvio/Ultrachromic/presets/kaleidochromic_preset.css');
@import url('https://cdn.jsdelivr.net/gh/CTalvio/Ultrachromic/progress/floating.css');
/* hide ratings until you hover over them, to prevent biased movie selection behavior */
.itemMiscInfo > .starRatingContainer,
.itemMiscInfo > .mediaInfoCriticRating {
filter: blur(4px) contrast(0);
transition: filter 250ms;
}
@FabianBartl
FabianBartl / kps.py
Last active March 9, 2025 14:24
A small cli script to quickly and easily get a shell for any pod of any kubernetes container. Written and tested for TrueNAS Scale Dragonfish 24.04
#!/usr/bin/env python3
"""
usage: kps.py [-h] [--search {contains,startswith,equals}] [-s {c,s,e}] [--show-commands] app_name
A small cli script to quickly and easily get a shell for any pod of any kubernetes container.
Written and tested for TrueNAS Scale Dragonfish 24.04
positional arguments:
app_name name of the kubernetes container
@FabianBartl
FabianBartl / uniquemail.py
Last active February 28, 2025 14:28
Extracts every unique email from multiple text files and copies the result into your clipboard. So (at least on windows) you can just drag-n-drop any amount of txt-files onto the python script in your file explorer, it opens a terminal, prints the emails and puts them into your clipboard.
"""
Extracts every unique email from multiple text files and copies the result into your clipboard.
So (at least on windows) you can just drag-n-drop any amount of txt-files onto the python script
in your file explorer, it opens a terminal, prints the emails and puts them into your clipboard.
"""
import sys
import os
import re
@FabianBartl
FabianBartl / verify-file-gpg-signature.py
Last active February 18, 2025 20:53
Simple Python script to verify a given GPG signature of a file. The signature can be provided as a local file or an url, where the script can download it.
"""
Simple Python script to verify a given GPG signature of a file.
The signature can be provided as a local file or an url, where the script can download it.
Example Usage:
`verify-file-gpg-signature.py --keyserver keyserver.ubuntu.com --sig_file OpenVPN-2.6.13-I001-amd64.msi.asc OpenVPN-2.6.13-I001-amd64.msi`
`verify-file-gpg-signature.py --sig_url https://swupdate.openvpn.net/community/releases/OpenVPN-2.6.13-I001-amd64.msi.asc OpenVPN-2.6.13-I001-amd64.msi`
"""
@FabianBartl
FabianBartl / create-chapters.py
Last active October 24, 2024 23:21 — forked from cliss/mergechapters.py
Create chapters from text file by modifying ffmetadata. Merge videos with chapters while keeping all audio and subtitle tracks.
# Create chapters from text file by modifying ffmetadata
# https://ikyle.me/blog/2020/add-mp4-chapters-ffmpeg
import re, sys
if len(sys.argv) < 2:
print(f"Usage: {__file__} [chapters file]")
exit()
chapters = list()
@FabianBartl
FabianBartl / batch-processing.sh
Last active February 28, 2025 14:41
Slowly re-encode high quality video files into H.265 format to reduce the file size while maintaining quality. The audio tracks are not re-encoded as this does not affect the file size as much as the video.
#!/bin/bash
# Directory containing the files to process
input_dir="$1"
# Iterate over all files in the directory
for file in "$input_dir"/*; do
if [ -f "$file" ]; then
echo "Processing file: $file"
bash /root/slow-reencode-to-h265.sh "$file" # absolute path (!) to the script below
@FabianBartl
FabianBartl / .md
Last active February 7, 2024 16:49
Regular expression to remove blank lines and single line comments in C/C++ files.
  • remove blank lines with ^\s*$\n
  • remove single line comments with *//.*$\n
  • remove inline comments with /\*.*\*/
  • replace tabs with \t by a single space
  • replace multiple spaces with + by a single space

all in one:

  • replace all above with (^\s*$\n)|( *//.*$\n)|(/\*.*\*/)|(\t) by spaces
  • reduce all the spaces with + to a single space
@FabianBartl
FabianBartl / inset-crop.py
Created February 7, 2024 11:15
A script to resize an image of any size while keeping the original aspect ratio.
# A script to resize an image of any size while keeping the original aspect ratio.
# To keep the output size and the aspect ratio, the free space next to the image
# is filled with a given RGBA color.
from PIL import Image
import sys
import re
@FabianBartl
FabianBartl / advanced_custom_logger.py
Last active February 7, 2024 11:18
Advanced custom logger with colored messages and color-highlighted progressbar
# Extension of the standard Python logging library with handlers for tqdm progress bars,
# colored logging messages and support for any UTF-8 characters like emojies.
import logging
from datetime import datetime
from os.path import abspath, basename
from os.path import join as joinpath
@FabianBartl
FabianBartl / mouse-emulator.ahk
Last active April 8, 2023 15:44
An AHK script to emulate mouse movements and clicks with key combinations.
; Mouse Emulator
; An AHK script to emulate mouse movements and clicks with key combinations.
; # Win
; ^ Control
; ! Alt
; + Shift
; Right click
#LButton::RButton