Skip to content

Instantly share code, notes, and snippets.

@maxheadroom
maxheadroom / find_process_count.awk
Last active August 29, 2015 14:11
Find processes with more than X instances
# usage: ps -e | awf -f find_process_count.awk
# output
{
limit = 5
# turn the process names into lowercase
$4 = tolower($4) # remove case distinctions
# count occurances of $4
freq[$4]++
}
@maxheadroom
maxheadroom / gist:ab4c455776887bccccc6809c59b054f5
Created November 6, 2016 03:43
Fix RoundCube DB issue for new users
ALTER TABLE users MODIFY COLUMN preferences text NULL;
ALTER TABLE user MODIFY COLUMN alias VARCHAR(128) NOT NULL DEFAULT '{no alias}';
@maxheadroom
maxheadroom / netcat-performancetest.md
Created September 28, 2020 12:29
pure network performance test with netcat

destination side (listening and receiving traffic):

while true; do sudo nc -v -l 8888 > /dev/null; done

source side (sending traffic to destination):

while true;do dd if=/dev/zero bs=512 count=1000000 2>> ./transfer.log | nc -v 10.90.7.3 8888; time >> ./transfer.log; done
@maxheadroom
maxheadroom / video-workstation.toml
Created January 28, 2024 19:57
Traffic Config file for reverse proxy to ext. host
[http]
[http.routers.video-workstation-rtr]
entrypoints = ["websecure"]
rule = "Host(`video-workstation.example.com`)"
service = "video-workstation-svc"
[http.routers.video-workstation-rtr.tls]
certResolver = "letsencrypt"
[http.services]
[http.services.video-workstation-svc.loadbalancer]
@maxheadroom
maxheadroom / fedifetcher.service
Created August 5, 2025 06:33
FediFetcher systemD Service
[Unit]
Description=FediFetcher Script
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/bash /home/user/FediFetcher/FediFetcher.sh
WorkingDirectory=/home/user/FediFetcher
User=username
Group=username