···
set script-interpreter := ["uv", "run", "--script"]
4
+
# List systemd services
7
+
sudo systemctl list-units --type=service
9
+
# Copy public IPv4 address
10
+
[group('utilities')]
12
+
curl -s -m 5 ipv4.icanhazip.com | xclip -selection clipboard
14
+
# Copy SSH public key
15
+
[group('utilities')]
18
+
cat "${HOME}/.ssh/id_ed25519.pub" | tr -d '\n' | xclip -selection clipboard
19
+
echo "--> SSH public key copied to clipboard"
21
+
# Generate a pseudo-random 16-character string
22
+
[group('utilities')]
24
+
openssl rand -base64 16
26
+
# Remove all .jpeg, .jpg, .png, .svg, .webp files from downloads
27
+
[group('utilities')]
30
+
find "${HOME}/downloads" \
33
+
\( -name "*.jpg" -o -name "*.jpg_original" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.png" -o -name "*.webp" \) \
36
+
# Remove ISOs and disk images from downloads
37
+
[group('utilities')]
40
+
find "${HOME}/downloads" \
43
+
\( -name "*.iso" -o -name "*.img" \) \
46
+
# Clear downloads folder
47
+
[group('utilities')]
50
+
rm -rf "${HOME}/downloads/"*
52
+
# List zshrc aliases
53
+
[group('utilities')]
56
+
_begin_line=$(grep -n "### ALIASES" ~/.zshrc | awk -F: '{print $1}')
57
+
_end_line=$(grep -n "### BINDINGS" ~/.zshrc | awk -F: '{print $1}')
58
+
_end_line=$(( $_end_line - 2 ))
59
+
_quit_line=$(( $_end_line + 1 ))
60
+
sed -n "${_begin_line},${_end_line}p;${_quit_line}q" ~/.zshrc | bat -l zsh
62
+
# List zshrc functions
63
+
[group('utilities')]
66
+
_begin_line=$(grep -n "### FUNCTIONS" ~/.zshrc | awk -F: '{print $1}')
67
+
_end_line=$(grep -n "### FZF" ~/.zshrc | awk -F: '{print $1}')
68
+
_end_line=$(( $_end_line - 2 ))
69
+
_quit_line=$(( $_end_line + 1 ))
70
+
sed -n "${_begin_line},${_end_line}p;${_quit_line}q" ~/.zshrc | bat -l zsh
# Quickly copy the Tailscale install command