Category: Bash / Terminal / Scripts

most possible basic apache2 web log file analyze script
07.01.2026

most possible basic apache2 web log file analyze script # what is the usage of the webserver? # what is the usage of a certain domain? vim ./analyze.sh #!/usr/bin/env bash shopt -s nullglob # Output header printf “%-30s %10s\n” “file” […]

GNU Linux bash how to concat pdf
25.11.2025

apt search pdfunite poppler-utils/stable,stable,now 25.03.0-5 amd64 [installed,automatic] PDF utilities (based on Poppler) # tested on hostnamectl Operating System: Debian GNU/Linux 13 (trixie) Kernel: Linux 6.12.48+deb13-amd64 Architecture: x86-64 # worked nicely pdfunite file1.pdf file2.pdf file3.pdf output.pdf # untested gs -dBATCH -dNOPAUSE […]

GNU Linux bash how to stabilize (anti shake) a video
09.11.2025

a lot of hand held videos are shaky, youtube used to have great stabilization filter… but Alphabet Google removed it (too CPU intense or what?) most smart phones and camera apps actually should apply some anti shake stabilization during recording […]

GNU Linux howto coolest way imho to schedule system shutdown
18.04.2025

first it might be a good idea to have a /script/shutdown.sh that calls /script/stop.sh (and a /scripts/start.sh, but that’s kinda complicated since systemd?) that stops all kinds of essential services (databases, vms…) before system shutdown but here is a neat […]

GNU Linux bash: how to get less with syntax highlighting?
23.03.2025

copy pasting lines from vim to other programs is a pain (selecting text with mouse Ctrl+C Ctrl+V process not working properly?) sometimes to debug a bash script it’s usefull to copy line-by-line and paste line-by-line to see what it does […]

GNU Linux bash stopwatch script
26.12.2024

sometimes it is usefull to meassure how long what took in the shell vim /scripts/stopwatch.sh #!/bin/bash # function to get current time in seconds and milliseconds get_time() { date +%s%N | cut -b1-13 } # initial time start_time=$(get_time) echo “press […]

how to example bash python – test driving Hetzner’s s3 bucket
04.10.2024

how to get started: have a hetzner account login to https://console.hetzner.cloud/ create a new project click on project in the left menu there is a new entry: Object Storage tested and works: upload download delete untested: https://docs.hetzner.com/de/storage/object-storage/howto-protect-objects/protect-versioning/ pricing: https://docs.hetzner.com/de/storage/object-storage/overview/#preise max. […]

GNU Linux bash run (graphical desktop) process as different user
12.05.2024

hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-20-amd64 Architecture: x86-64 # become root su – root apt update # if it’s graphical application echo $DISPLAY # and the user “user” is the user that started […]

01.01.2024

try but without gurantees screen -xr # -x Attach to a not detached screen session (Multi display mode) # Screen refuses to attach from within itself # But when cascading multiple screens, loops are not detected # take care -r […]

GNU Linux bash – maximum best compression for binary data – xz (LZMA) vs zstd vs 7zip (7z) vs (parallel multi threaded multi core) bzip2 – why it is better to have A LOT of swap space (RAM 3x or 4x)
16.10.2023

once upon a time, compressing massive amounts of binary was required. hostnamectl; # tested on Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-12-amd64 Architecture: x86-64 lscpu | grep -E ‘Architecture|Model name|Thread|Core’; # tested on CPU Architecture: x86_64 Model name: […]

GNU Linux (Debian) – how to – find the largest 30 duplicate files wasting disk space – multi line sorting madness (mlsm) – how to output x blocks of text separated by delimiter – build (Bill Poser’s and BSDs) msort from src
04.10.2023

This is actually VERY usefull to find files that waste disk space. lsb_release -a; # tested on Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) the solution: czkawka_cli install rust like this (no need to install rust as root) install […]