Skip to content

Instantly share code, notes, and snippets.

@squi-ddy
squi-ddy / btrfs-clean-unreachable.sh
Last active September 22, 2025 11:34
Clean unreachable files on btrfs based on btdu stats, via no reflink copy
#!/usr/bin/env bash
set -e
args=("$@")
n=${args[0]}
btdu_location=${args[1]}
base_path=${args[2]}
duration=${args[3]:-5s}
tmp_path=${args[4]:-.}
tmp_name=${args[5]:-TEMP}
@squi-ddy
squi-ddy / nyt_dailies.fish
Last active September 22, 2025 11:34
Daily NYT Games Status Fetcher
function show_nyt_dailies -a nyt_s
function display_time -a time_s
set -f seconds (math "$time_s % 60")
set -f minutes (math "floor($time_s / 60) % 60")
set -f hours (math "floor($time_s / 3600) % 24")
set -f days (math "floor($time_s / 86400)")
if test "$days" -gt 0
printf "%d:%02d:%02d:%02d" $days $hours $minutes $seconds
else if test "$hours" -gt 0
printf "%02d:%02d:%02d" $hours $minutes $seconds