Skip to content

Instantly share code, notes, and snippets.

View kubastick's full-sized avatar

Jakub Tomana kubastick

View GitHub Profile
@kubastick
kubastick / backup.sh
Created January 13, 2026 21:57
Backup linux system to another disk using rsync
#!/bin/bash
BACKUP_ROOT="/mnt/backup"
LOG_FILE="/var/log/rsync-backup.log"
# Check if backup drive is mounted
if ! mountpoint -q "$BACKUP_ROOT"; then
echo "$(date): Backup drive not mounted!" | tee -a "$LOG_FILE"
exit 1
fi
@kubastick
kubastick / gist:1355373e65c300db70db8d0db5d402bd
Created January 9, 2026 23:27
Sorted linux memory usage by process in MB
ps -eo pid,user,%mem,rss,comm --sort=-rss | awk 'NR==1{print $0" MB"; next} {printf "%s %s %s %d %s %.1f\n", $1,$2,$3,$4,$5,$4/1024}' | column -t | head -20