tips
3,578 tips one command at a time
One command, setting or habit at a time: what it does, the command to copy and a caveat or two. Pick a topic, or search.
Linux
260 tips See all-
Lower the priority of a job that is already running, without restarting it.
renice -n 10 -p 4242 -
Copy command output to the desktop clipboard and paste it back from the terminal.
cat config.yml | xsel -ib -
Give a graphical program a virtual display on a headless machine.
xvfb-run -a your-program --some-flag
Docker
192 tips See all-
Registers a trigger that runs inside the next image build that uses yours as its base.
ONBUILD RUN /usr/local/bin/python-build --dir /app/src -
Overrides the default shell for shell-form RUN, CMD and ENTRYPOINT lines in the rest of the Dockerfile.
SHELL ["/bin/bash", "-c"] -
Saves the current state of a container as a new image, with optional Dockerfile-style changes.
docker commit <container> myname/testimage:version3
Network and access
163 tips See all-
Copy a file from one server to another with scp, routed through the machine you type on
scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ -
Asks Tailscale which exit node it recommends for this device, without switching to it.
tailscale exit-node suggest -
Signs a new node's key from a signing node so it is accepted when Tailnet Lock is on.
tailscale lock sign nodekey:1abddef1 tlpub:abcdef12
Git
144 tips See all-
Shows in one table which commits are on which branch since they split.
git show-branch main feature -
List commits together with a per-file summary of what changed
git log --stat -5 -
Always creates a merge commit, so a finished feature branch stays visible as a group in the history.
git merge --no-ff feature -m "Merge feature"
Tmux
125 tips See all-
Starts a background tmux session wider than 80 columns, so scripts don't get wrapped output.
tmux new -d -s report -x 200 -y 50 'top' -
Pauses a command until something in another pane says it's done, without polling or sleep.
tmux wait-for build-done -
Lets programs inside tmux send terminal-specific escape codes, such as iTerm2's, past tmux.
set -g allow-passthrough on
Terminal
116 tips See all-
Prints the battery cycle count of a MacBook straight from the terminal.
ioreg -rn AppleSmartBattery | grep CycleCount -
Save a set of Terminal windows and tabs under a name and reopen them in one click.
-
Copy your Terminal colours, fonts and shell settings to another Mac with an exported profile file.
Python
107 tips See all-
Wrap awaits in asyncio.timeout and get a TimeoutError when the time is up.
import asyncio -
StrEnum members are real strings, and auto() gives each one its lowercase name.
from enum import StrEnum, auto -
Use except* to catch some exceptions from a group and leave the others for later.
except* ValueError as eg:
macOS
99 tips See all-
Hold Command over small text on your Mac and a larger version pops up in a window.
System Settings > Accessibility > Hover Text > When using the pointer -
Smart Folders in the Notes app fill themselves with notes that match rules you set.
-
Hashtags in Notes become tags that you can click in the sidebar to filter notes.
Systemd
88 tips See all-
Sets how long a service gets to stop after SIGTERM before systemd sends SIGKILL.
[Service] -
A type-level drop-in folder applies one setting to all units of a type.
sudo mkdir -p /etc/systemd/system/service.d -
Terminates a service and marks it failed when it exceeds a maximum run time.
[Service]
WordPress
85 tips See all-
Creates a revocable password for one script or app to call the REST API.
wp user application-password create anna backup-script --porcelain -
Makes deleted media go to the trash first instead of disappearing with its files.
define( 'MEDIA_TRASH', true ); -
Checks for a newer WP-CLI release and updates the phar after you confirm.
wp cli check-update
Claude
83 tips See all-
Prints a one-line summary of the current Claude Code session whenever you ask for it.
/recap -
Collapses a Claude Code turn to your prompt, a one-line tool summary and the final response.
/focus -
Lists what each of your skills costs in context and flags the ones nobody has invoked.
/skill-doctor
Journalctl
81 tips See all-
Find out which program the kernel killed when memory ran out.
journalctl -k -g 'killed process' --since "2 days ago" -
Read the service manager's own messages about starts, stops and failures without the services' chatter.
journalctl _PID=1 -b -
Understand the journal files with a tilde at the end and read them when needed.
ls -lh /var/log/journal/*/*.journal~
Security
79 tips See all-
Open a saved packet capture in tcpdump and filter it with the usual expressions
tcpdump -nn -r capture.pcap port 53 -
Creates a local CA and trusted certificates for localhost and test names in two commands.
mkcert -install -
Explains how a site turns HSTS off again and why that only works over HTTPS.
Strict-Transport-Security: max-age=0
Shell
78 tips See all-
Preview a pattern-based bulk rename in zsh before running it.
zmv -n '(*).log' '$1.txt' -
List the folders zoxide remembers, with scores, to understand its jumps.
zoxide query -ls project -
Create a unique temporary file that ends in a chosen extension
f=$(mktemp --suffix=.json)
Unraid
77 tips See all-
Switches a BTRFS pool between Single, RAID 1 and other profiles from the Main tab while the array runs.
-
Swaps a failing or small drive in a mirrored cache pool and lets Unraid rebuild onto the new one.
-
Runs read tests across the surface of each drive and draws heat maps that show slow zones.
Curl
71 tips See all-
Writes a readable log of everything curl sends and receives, headers and body included.
curl --trace-ascii - https://example.com/ -
The Retry-After header sets how long a client should wait, and curl --retry follows it.
Retry-After: 120 -
Make a multi URL curl command exit with an error as soon as one transfer fails.
curl -fsS --fail-early \
Web-Development
67 tips See all-
Send many concurrent requests to a URL to see how the server copes
ab -n 200 -c 10 https://example.com/ -
Prints an error to the console only when the checked condition fails.
console.assert(items.length > 0, 'cart is empty', items) -
Turns the entire page into an editable document so you can type over any text.
document.designMode = "on"
Css
66 tips See all-
Captures a report of all colors, fonts, unused declarations and media queries on a page.
-
Matches elements with no children, so empty wrappers can be hidden or styled differently.
.notice:empty { -
A list of points creates easing curves that cubic-bezier() cannot express.
.toast {
Arr-suite
56 tips See all-
Decides how Sonarr writes the episode part of a file name when one file holds several episodes.
Scene S01E01-E02-E03 -
A Prowlarr Sync Profile can require a minimum number of seeders for the apps that use an indexer.
Minimum Seeders -
Radarr can put the parsed edition, like IMAX or Final Cut, in the file name.
Database
53 tips See all-
Pulls one database out of a full server dump without touching the others.
mariadb -e 'CREATE DATABASE IF NOT EXISTS blog' -
Dumps only rows as INSERT IGNORE, so loading them adds missing rows and keeps the rest.
mariadb-dump --no-create-info --insert-ignore shop orders > orders-rows.sql -
Shows which tables use the most disk space, data and indexes together, in megabytes.
SELECT table_schema, table_name,
Bash
52 tips See all-
Brace expansion can pad numbers with zeros and skip values with a step.
echo {01..10} -
Explains why `cmd > file 2>&1` and `cmd 2>&1 > file` send errors to different places.
cmd > file 2>&1 -
Lists command patterns that bash never saves in the history, like ls, pwd and exit.
export HISTIGNORE='ls*:pwd:cd*'
Nginx
50 tips See all-
Get a Let's Encrypt certificate and enable it in nginx with one command
sudo certbot --nginx -d example.com -d www.example.com -
A custom file that Nginx Proxy Manager includes at the end of every redirection server block.
/data/nginx/custom/server_redirect.conf -
Sends Connection upgrade only when the client asks for it, and close otherwise.
map $http_upgrade $connection_upgrade {
Find
46 tips See all-
Selects files that sit on a given filesystem type, and -printf %F shows which type that is.
find / -maxdepth 1 -fstype proc -
Uses a command's exit status inside find to keep only the files that fail a check.
find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/null -
Lists files between two sizes, for example everything between 100 MB and 1 GB.
find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} +
Backup
45 tips See all-
Show restic snapshots grouped by host, path or tag.
restic snapshots --group-by host,paths -
Adds stored procedures, functions and scheduled events to a mysqldump backup.
mysqldump --routines --events mydb > mydb.sql -
Reads the list of files to transfer from a text file or from standard input.
rsync -a --files-from=list.txt /home/me/ backup:/backup/
Vim
45 tips See all-
Pastes the word under the cursor into a command or search you are typing in Vim.
:%s/<Ctrl-r><Ctrl-w>/newname/g -
An empty pattern in a substitute command reuses your last search, so you can look first and replace after.
/oldname -
Reads text from a pipe into a new Vim buffer so you can search and edit it.
find . -name "*.conf" | vim -
CLI
44 tips See all-
Cap the speed of a wget download so the rest of the network stays usable.
wget --limit-rate=2m https://example.com/big-file.iso -
Check if a URL or a list of links still works, without fetching the content.
wget --spider https://example.com/file.zip -
Limit ripgrep to some file types or skip noisy files with a glob.
rg 'apiKey' -g '!*.min.js' -g '!package-lock.json'
Disk
44 tips See all-
Reports free space fragmentation on ext2, ext3 and ext4, with a histogram of free chunk sizes.
sudo e2freefrag /dev/sdb1 -
Prints SMART data as JSON, so scripts can check pass or fail, temperature and hours with jq.
sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' -
Lists SCSI-layer devices such as disks with capacity, in one line each.
lsscsi -s
Apt
42 tips See all-
Lets apt autoremove clean up dependencies of metapackages that were once marked manual.
sudo apt-mark minimize-manual -
Cleans out packages that are gone but still left their configuration behind.
apt list '~c' -
Lists each install, upgrade and removal at dpkg level with versions and times.
grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail
Javascript
40 tips See all-
Pause a Node.js script on line one so a debugger can attach before anything runs
node --inspect-brk app.js -
Reads a property or calls a function only when the value in front of it exists.
obj?.prop -
Turns a template literal into a string where backslashes stay as written.
const filePath = String.raw`C:\Development\profile\about.html`;
Ffmpeg
38 tips See all-
Repeats an input a set number of times, which is handy for loops and background videos.
ffmpeg -stream_loop 2 -i in.mp4 -c copy out.mp4 -
Fades the picture and the sound in at the start and out at the end of a clip.
ffmpeg -i in.mp4 \ -
Puts an SRT file into an MP4 as a subtitle track instead of burning it into the picture.
ffmpeg -i video.mp4 -i video.en.srt -map 0 -map 1 -c copy -c:s mov_text -metadata:s:s:0 language=eng video-subs.mp4
Finder
37 tips See all-
Select several files in Finder and flip through them in full screen, one after another.
Option-Command-Y -
Buttons at the bottom of the Finder Preview pane rotate an image or create a PDF without opening an app.
-
See camera, lens, dimensions and dates of a file without opening it.
Shift-Command-P show or hide the Preview pane
Dig
36 tips See all-
Compare the DS record at the parent with your DNSKEY key tags before and after a key change.
dig +noall +answer DS example.com -
Read whether a name does not exist or just lacks that record type, and how long resolvers cache the miss.
dig nope.iana.org @9.9.9.9 | grep -E 'status|SOA' -
Make dig resolve a short host name the way your system does, through the search list.
dig +search nas
Openssl
34 tips See all-
Sends a chosen host name in the TLS handshake so you see that site's certificate.
openssl s_client -connect 203.0.113.10:443 -servername example.com </dev/null | openssl x509 -noout -subject -
Re-signs an existing self-signed certificate with new dates, keeping its key and extensions.
openssl x509 -in cert.pem -days 365 -signkey key.pem -out cert-new.pem -
Computes an HMAC of a file or text with a secret key, as used for webhook signatures.
printf %s hello | openssl dgst -sha256 -hmac secret
Windows
33 tips See all-
A keyboard shortcut that toggles the color filter you picked in Windows settings.
Win+Ctrl+C -
Send the active window to the monitor on the left or right without touching the mouse.
Win+Shift+Left arrow -
Create a desktop, switch between desktops and rename them from the keyboard.
Win+Ctrl+Left arrow
Ufw
32 tips See all-
After you edit or create a ufw application profile, this command makes the firewall use the new version.
sudo ufw app update all -
Shows everything ufw has actually loaded, which is handy when a rule does not behave as expected.
sudo ufw show raw -
IPsec uses protocols 50 and 51, so a normal port rule does not cover it.
sudo ufw allow to 10.0.0.1 proto esp
Cron
32 tips See all-
Schedules a single command for later without adding a cron line you have to remember to delete.
echo 'systemctl restart myapp' | at 03:00 tomorrow -
Runs a cron job on the last day of every month, whatever its length.
55 23 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && /usr/local/bin/month-end.sh -
Picks the editor for crontab -e for one command or for good.
EDITOR=nano crontab -e
Permissions
30 tips See all-
Opens a shell as a service account to try file access step by step.
sudo su -s /bin/bash www-data -
Makes new files in a shared folder get the right ACL automatically.
sudo setfacl -R -d -m g:media:rwX /srv/media -
Copies a folder while keeping its owners, modes, timestamps and links.
sudo cp -r /srv/site /srv/site.r
Portainer
28 tips See all-
Lets Portainer check your Git repository on a timer, so no inbound webhook is needed.
-
Organizes environments into groups, so access and tags apply to all of them at once.
-
Sets how often Edge Agents call home to the Portainer server.
Sqlite
27 tips See all-
Converts a date or time string into a Unix timestamp directly in SQL.
SELECT unixepoch('2026-01-01 00:00:00'); -
Picks a value based on conditions, without writing a full CASE expression.
SELECT name, iif(qty > 0, 'in stock', 'sold out') AS state -
Makes a SQL script stop at the first failing statement instead of running the rest.
sqlite3 -bail app.db < migrate.sql
Postgresql
24 tips See all-
Shows which edited settings in the config file are not active yet because the server has to restart.
FROM pg_settings -
Lists the rules in pg_hba.conf as rows, with an error message for lines that cannot be parsed.
FROM pg_hba_file_rules -
A contrib module that logs the execution plan of any statement slower than a limit you set.
LOAD 'auto_explain';
Cache
24 tips See all-
See whether a file is being served from RAM or still from disk.
fincore /var/lib/example/data.db -
Check the package cache for damage and clear out unneeded data safely.
npm cache verify -
Get programs to see a font you just copied into your home folder.
fc-cache -f -v ~/.local/share/fonts
Devtools
22 tips See all-
Wipes storage and cache for the current site only, leaving other sites alone.
-
Pauses the debugger on a line only when your condition is true.
user.id === 42 -
Finds page elements with an XPath expression and returns them as an array.
$x(path [, startNode])
Apple
21 tips See all-
Pause your Activity rings for up to 90 days without breaking the award streak.
-
Add a filter to a Focus so apps such as Mail and Calendar show only what fits.
-
A trusted person can give you a code to reset your Apple Account, without any access to the account.
Settings > [your name] > Sign-In & Security > Recovery Contacts
Troubleshooting
21 tips See all-
Lists every TCP port Windows is listening on, with the process ID that owns each one.
Get-NetTCPConnection -State Listen -
Find the parameters a driver offers before copying one from a forum.
modinfo -p usb_storage -
Check whether a service really restarted after your change or crashed recently.
ps -o pid,lstart,etime,cmd -p 1234
Netplan
21 tips See all-
With two network cards on different subnets, source-based rules keep the replies on the right card.
- to: 192.168.3.0/24 -
Netplan's hidden key changes how the SSID is scanned, so networks that do not broadcast their name can be joined.
hidden: true -
Only used in 802.3ad mode, lacp-rate chooses between a slow 30 second and a fast one second LACP interval.
lacp-rate: fast
Iphone
20 tips See all-
Type a sentence on the iPhone and have it spoken aloud, in person or on a call.
Settings > Accessibility > Live Speech -
Choose different color, text size and motion settings for one app or for the Home Screen.
Settings > Accessibility > Per-App Settings -
iPhone listens for chosen sounds and shows a notification, useful with headphones on or when you can't hear.
Settings > Accessibility > Sound & Name Recognition > Sound Recognition > Sounds
Jq
20 tips See all-
Turns JSON strings into single-quoted shell words that survive spaces and apostrophes.
jq -r '.files[] | @sh' data.json -
Takes only the first few results of a jq generator and quits early.
jq -n -c 'limit(3; range(1; 1000000000))' -
Passes any number of values from the shell to a jq filter as an array.
jq -n -c '$ARGS.positional' --args a "b c"
Smart
19 tips See all-
Reads wear, temperature and error counters straight from an NVMe drive.
sudo nvme smart-log /dev/nvme0 -
Decodes the smartctl exit status so your script knows what went wrong.
sudo smartctl -q silent -a /dev/sda -
Shows device statistics with plain descriptions instead of vendor attribute numbers.
sudo smartctl -l devstat /dev/sda
Awk
17 tips See all-
Replaces all matches of a pattern in the line or in one chosen column, and counts them.
echo 'cost: 1,50 and 2,25' | awk '{n=gsub(/,/,"."); print n": "$0}' -
Writes each line to a file named after a value in that line, such as a country code.
awk -F, 'NR>1 {print > ($2".csv")}' data.csv -
Extracts part of a string by start position and length, counting from 1.
echo 20261201 | awk '{print substr($0,1,4)"-"substr($0,5,2)"-"substr($0,7,2)}'
Watch
17 tips See all-
Let the watch call for help after a hard fall when you can't.
On the watch: Settings > SOS > Fall Detection -
Get a tap when the sound around you stays loud for a while.
On the watch: Settings > Noise > Noise Threshold > pick a level -
Take group photos with the phone on a shelf and you in the picture.
Open Camera Remote on the watch
Files
15 tips See all-
Verify only the downloaded files against a big checksum list, without errors for the rest.
sha256sum -c --ignore-missing SHA256SUMS -
Quickly detect a changed or damaged file with a very fast, non-cryptographic hash.
xxhsum -H64 backup.tar > backup.xxh -
Unpack the files of a zip flat into one directory, ignoring its folder structure
unzip -j archive.zip -d out/
Mariadb
15 tips See all-
Hides a column from SELECT * and from inserts that do not name it.
ALTER TABLE t ADD COLUMN z INT INVISIBLE; -
Creates a sequence object that hands out numbers, usable as a column default.
CREATE SEQUENCE s START WITH 100 INCREMENT BY 10; -
Creates a table, replacing it if it already exists, so reruns of a script do not fail.
CREATE OR REPLACE TABLE scratch (
Rclone
14 tips See all-
Copies the content of a web URL directly to a remote without saving a temporary file.
rclone copyurl https://example.com/files/big.iso remote:isos -a -
Prints the total size and number of objects at a remote path, optionally as JSON.
rclone size remote:photos -
Prints your remote settings with secrets hidden so you can ask for help.
rclone config redacted
Snap
14 tips See all-
Preview pending snap updates without installing any of them.
snap refresh --list -
Keep a restorable copy of an app's data and settings.
sudo snap save lxd -
Restart a misbehaving snap service by name, after seeing what it runs.
snap services
Html
14 tips See all-
Write import statements without long URLs and without a build step.
import { format } from "dates"; -
Make a short silent clip start by itself without taking over the screen.
width="640" height="360" poster="demo.jpg"> -
Group the choices of a select so people find theirs faster.
Parity
14 tips See all-
Keeps you from corrupting parity while trying to repair an unmountable drive.
Main > Array Devices > Parity, Disk 1, Disk 2, ... -
A saved list of drive serials makes recovery after a lost configuration much easier.
Main > Array Devices > Identification column -
Explains why you still need a separate copy next to parity protection.
rsync -a /mnt/user/documents/ /mnt/disks/usbdrive/documents/
Tools
14 tips See all-
Shuffle lines, draw a few at random, or pick a random number.
shuf -n 3 films.txt -
Indent XML for reading and find where a broken document goes wrong.
xmllint --format feed.xml -
Turn a PDF into plain text you can search or paste.
pdftotext -layout invoice.pdf invoice.txt
Spotlight
14 tips See all-
Re-index a single folder or test what Spotlight extracts from one file.
mdimport -i ~/Documents/Invoices -
Switch Spotlight to only apps or only files so other results stop getting in the way.
Command-2 Files -
Find a file packed in a zip or disk image by opening the archive before you search.
double-click backup-2025.zip unpacks it next to the zip
Nextcloud
13 tips See all-
Prints a small table with total, active and disabled accounts, split by user backend.
sudo -E -u www-data php occ user:report -
A dry run for app updates: see what is available before you update one app or all of them.
sudo -E -u www-data php occ app:update --showonly -
Filters the history of background jobs by status, so crashed and failed jobs stand out.
sudo -E -u www-data php occ background-job:history -s 3 -l 10
Nmap
12 tips See all-
Prints a summary line for each packet Nmap sends or receives during a scan.
nmap --packet-trace -p 22,80 192.0.2.10 -
Saves scan results as one line per host, so grep and cut can pick out open ports.
nmap -p 22,80,443 -oG scan.gnmap 192.0.2.0/24 -
Identify the service and often the version behind each open port.
nmap -sV 192.0.2.10
Diff
12 tips See all-
Leaves out files and folders matching a pattern when comparing two directories recursively.
diff -r -x .git -x '*.log' one two -
Puts two versions next to each other in columns, which is easier to read for short config files.
diff -y -W 100 old.conf new.conf -
Creates a patch of a whole folder that includes new and deleted files, not only changed ones.
diff -Naur original/ changed/ > fix.patch
Xargs
12 tips See all-
Sets an environment variable in each parallel xargs job, holding the slot number it runs in.
printf '%s\n' a b c d e f | xargs -n1 -P3 --process-slot-var=SLOT sh -c 'echo "slot $SLOT got $0"; sleep 0.2' -
Connects the command xargs starts to your terminal, so editors and prompts work normally.
grep -l 'TODO' *.py | xargs -o vim -
Shows every command xargs is about to run and waits for you to confirm it.
find . -name '*.orig' -print0 | xargs -0 -p rm
Memory
12 tips See all-
Prints the online and offline memory the kernel manages and the size of one memory block.
lsmem --summary -
List the programs that are actually sitting in swap, biggest first.
for f in /proc/[0-9]*/status; do -
Get per process and per user memory numbers that add up sensibly.
sudo apt install smem
Safari
12 tips See all-
Safari traffic goes through two relays, so no single party sees who you are and what you visit.
Settings > [your name] > iCloud > Private Relay -
Pinned tabs in Safari shrink to a site icon on the left and come back after you quit.
-
Tab Overview shows every open Safari tab as a thumbnail so you can find one quickly.
Chrome
12 tips See all-
Capture DNS, proxy and connection problems that the Network panel cannot explain.
chrome://net-export/ -
Test a site without your extensions, cookies and settings getting in the way.
google-chrome --user-data-dir=/tmp/chrome-clean --no-first-run -
Find the right tab by typing part of its title or address.
Windows and Linux: Ctrl+Shift+A
Search
11 tips See all-
Redirects to an external search page, or to the first result like a Feeling Lucky button.
!!wfr Wau Holland -
Find which file in an archive mentions a word, without extracting anything.
zipgrep db_host backup.zip -
Find the right manual or invoice by what is written in it.
pdfgrep -rin "warranty" ~/Documents
Home Assistant
11 tips See all-
Fixes requests being blocked when Home Assistant sits behind a proxy.
Trust X-Forwarded-For: on -
Slows down password guessing, and shows how to unban yourself.
Unlimited login attempts: off -
Lets you inspect older runs of an automation that fires often.
automation:
Yaml
10 tips See all-
Print yamllint results as one machine-readable line per problem.
yamllint -f parsable config.yaml -
Switch yamllint to a more forgiving preset so real YAML errors stand out.
yamllint -d relaxed docker-compose.yml -
iif() turns a condition into one of two values in a single template expression.
iif(condition, if_true, if_false, if_none)
Firefox
10 tips See all-
Opens a page's source at a given line using a #line anchor.
view-source:https://www.mozilla.org/#line100 -
Narrow address bar results to one kind of thing with a single character.
^ invoice history -
Spot the heavy tab and close it without guessing.
about:processes
Scripting
10 tips See all-
Print a diff of two texts from a script, in the same format as git and diff -u.
import difflib -
Call a REST API and work with the fields directly, without parsing JSON yourself.
$r = Invoke-RestMethod https://api.github.com/repos/PowerShell/PowerShell/releases/latest -
Write a file safely by writing a temp copy first and then replacing the original.
import json, os, tempfile
Config
9 tips See all-
The include line pulls another file into config.txt, but a few boot settings must stay in the main file.
include extraconfig.txt -
Put indent and line ending rules in the project, so editors follow them.
root = true -
See the active npm settings grouped by the file they come from.
npm config list
Logs
9 tips See all-
Keeps all rotated copies of a log in one separate directory instead of next to the live file.
rotate 4 -
Read events from two files in the order they happened.
sort -m app.log worker.log | less -
Collapse near identical lines to see which message dominates a file.
sed -E 's/[0-9]+/N/g' app.log | sort | uniq -c | sort -rn | head -n 15
Performance
9 tips See all-
Adds a line to the plan with every planner-related setting that has a non-default value.
EXPLAIN (SETTINGS) SELECT * FROM my_table WHERE id = 42; -
Benchmark two ways of doing something with repeated, comparable runs.
sudo apt install hyperfine -
Test small random reads, which feel closer to real use than big copies.
sudo apt install fio
Json
9 tips See all-
Parses a string field that itself contains JSON, so you can filter into it.
echo '{"id":1,"payload":"{\"user\":\"ann\",\"tags\":[\"x\",\"y\"]}"}' | jq -c '.payload | fromjson | .tags' -
Catch a broken config before the program that reads it does.
jq empty config.json -
Find the exact route to a value without scrolling through nested output.
Mac
9 tips See all-
Boot with less loaded to see whether extra software causes a problem.
4. Hold Shift and click Continue in Safe Mode -
Test the hardware with the tool that is built into the Mac.
1. Shut down the Mac -
Put contact details on the lock screen in case the Mac gets lost.
System Settings > Lock Screen > Show message when locked (on)
Systemctl
9 tips See all-
Load unit file changes before you restart the service.
sudo systemctl daemon-reload -
Get a clean list of what is active on a machine right now.
systemctl list-units --type=service --state=running -
Check or restart a remote service without opening a shell there first.
systemctl -H [email protected] status nginx
Pip
9 tips See all-
Limit which version a dependency may get, without adding it to the project.
urllib3<2 -
Fetch packages and dependencies on one machine and install them on another.
python3 -m pip download -r requirements.txt -d ./wheels -
Write pip settings to a config file and check which file holds them.
python3 -m pip config set global.timeout 60
Hardware
8 tips See all-
A config.txt line that stops the startup probe for a PoE HAT fan, which saves a little boot time.
disable_poe_fan=1 -
Prints a single DMI string such as BIOS version or product name, handy in scripts.
sudo dmidecode -s bios-version -
List the machine's parts with their device names in one table.
sudo lshw -short
Mysql
8 tips See all-
Makes a locking read skip rows that another transaction has locked, instead of waiting.
FOR UPDATE SKIP LOCKED; -
Stores host, user and password so you stop typing them in commands.
mysql_config_editor set --login-path=shop \ -
Applies a server setting immediately without editing a config file.
SET PERSIST max_connections = 300;
iOS
8 tips See all-
Messages from people you never wrote to go into their own filter instead of your main list.
Messages > Filters > Unknown Senders -
The tiny Control Center button hides a microphone switch, so recordings can include your voice.
Touch and hold the Screen Recording button > Microphone > Start Recording -
Remove an app but keep its documents for when you reinstall it.
Settings > General > iPhone Storage > pick an app > Offload App
Shortcuts
8 tips See all-
Give an extension its own key, or take a clashing one away.
chrome://extensions/shortcuts -
See every command that is bound to the same key combination.
right click an entry > Show Same Keybindings -
Run a shortcut with one tap, with its own name and picture.
change the name and icon if you like > Add
Ubuntu
8 tips See all-
Remove an extra PPA and downgrade what came from it.
sudo apt install ppa-purge -
Stay on long term support releases, or switch the upgrade offers off.
grep ^Prompt /etc/update-manager/release-upgrades -
Add your own status lines to the message shown when you log in.
sudo tee /etc/update-motd.d/60-disk >/dev/null <<'EOF'
Commit
7 tips See all-
Runs a script on every commit message and cancels the commit when the script exits with an error.
if ! head -n1 "$1" | grep -qE '^[A-Z]'; then -
Commit new content with the message and authorship of an existing commit.
git commit -C ORIG_HEAD -
Queue a better message for an earlier commit without touching its files.
git commit --fixup=reword:HEAD~1
Productivity
7 tips See all-
The taskbar has four shortcut families built on position numbers, from launching to jump lists.
Win+1 ... Win+9 -
Pick a window layout from the keyboard, then fill the rest of the screen.
Win+Z -
Push an email to later so it returns to the top of your inbox.
Open the message > tap the Reply button > Remind Me > pick a time
Privacy
7 tips See all-
Sets how much detail Pi-hole keeps in its statistics, from everything down to nothing.
sudo pihole-FTL --config misc.privacylevel 1 -
Stop senders from learning when you read their message.
Settings > Apps > Mail > Privacy Protection > Protect Mail Activity -
Send a picture without telling the receiver where it was taken.
Share button > Options > Location (off)
Immich
7 tips See all-
Skips the CLI's local hashing before upload. Immich still deduplicates on the server.
immich upload --skip-hash --recursive directory/ -
Turns password sign in back on from the server when single sign on fails.
docker exec -it immich_server immich-admin enable-password-login -
Takes Immich out of normal service from the terminal before a restore.
docker exec -it immich_server immich-admin enable-maintenance-mode
Unattended-Upgrades
7 tips See all-
Keep automatic updates on while a few sensitive packages wait for you.
sudo nano /etc/apt/apt.conf.d/52unattended-upgrades-local -
Include packages from an extra repository in your automatic updates.
apt-cache policy -
Check the switch that turns daily automatic upgrades on.
cat /etc/apt/apt.conf.d/20auto-upgrades
Wp-Config
7 tips See all-
Writes plugin updates directly to disk when ownership allows it.
ls -ld wp-content wp-content/plugins index.php -
Points WordPress at a writable folder for its temporary files.
define( 'WP_TEMP_DIR', '/var/www/example.com/tmp' ); -
Loads admin scripts one by one so you can find the failing file.
define( 'CONCATENATE_SCRIPTS', false );
Sed
6 tips See all-
Print the number of lines in a file, or the line numbers of matches, with sed.
sed -n '$=' access.log -
Upper- or lowercases a match inside the replacement part of an s command in GNU sed.
echo 'hello world' | sed 's/.*/\U&/' -
Inserts a line of text after each line that matches a pattern.
printf 'key=1\nport=80\n' | sed '/^port=/a timeout=5'
Macbook
6 tips See all-
Keep a shut down laptop off until you press a key or button.
sudo nvram BootPreference=%01 # only block lid open -
See whether macOS calls the battery normal or asks for service.
System Settings > Battery > Battery Health > (i) -
Let downloads and shares keep running while only the display sleeps.
when the display is off: on
Clipboard
6 tips See all-
Copy a file or command output without selecting it with the mouse.
xclip -selection clipboard < ~/.ssh/id_ed25519.pub -
Pipe text to the clipboard and paste it back on Wayland.
uname -r | wl-copy -
Send output or a whole file to the clipboard without selecting.
dir | clip
Filesystems
6 tips See all-
Flush and pause a mounted volume so a disk snapshot is consistent.
sudo fsfreeze -f /srv/data -
Count the pieces a large file is split into on disk.
filefrag /var/lib/libvirt/images/vm1.qcow2 -
See allocated and unallocated space when df gives a misleading answer.
sudo btrfs filesystem usage /mnt/pool
Web
6 tips See all-
Fingerprint text or a file in the page without adding a library.
async function sha256(text) { -
Show the picked image at once, without sending it to a server first.
url = URL.createObjectURL(file); -
Make a filtered view shareable without adding a history entry per click.
function setFilter(name, value) {
Tail
5 tips See all-
Look at the end of a file that has very long lines or none.
tail -c 2000 export.json -
Watch a job's output and get your prompt back when the job finishes.
tail -f --pid=1234 build.log -
Watch more than one log in a single terminal window.
tail -f /var/log/nginx/access.log /var/log/nginx/error.log
Dmesg
5 tips See all-
Clear old messages, reproduce a problem and read only what it produced.
sudo dmesg -C -
See how serious each kernel message is, right in front of the line.
sudo dmesg -x -
Save raw kernel messages on one machine and study them on another.
sudo dmesg -r > kernel.raw
Media
5 tips See all-
Re-encodes a large video to 720p with a tool that ships with macOS.
avconvert -s clip.mov -o clip-720.m4v -p Preset1280x720 -
Shows what is inside a video without installing any extra tools.
avmediainfo holiday.mov -
Creates a short video with picture and tone for trying out settings.
ffmpeg -f lavfi -i testsrc2=size=1280x720:rate=30 \
Screenshot
4 tips See all-
Capture an entire long page, not only the part on screen.
Tap the preview > Full Page > Done > Save PDF to Files -
Get the file immediately instead of after the preview disappears.
Shift-Command-5 > Options > Show Floating Thumbnail -
Grab an exact rectangle of the screen with identical size each run.
screencapture -R 0,0,1280,720 ~/Desktop/step-1.png
Monitoring
4 tips See all-
See how much data a network interface moved per day or month.
sudo apt install vnstat -
Check load and memory at the time a problem happened, after the fact.
sudo apt install sysstat -
Find which process is using the bandwidth right now.
sudo apt install nethogs
Array
4 tips See all-
Stops you from erasing a data disk that only needs a filesystem check.
Main > click the disk > Check Filesystem Status > Check -
Makes sure a new data drive gets the file system you meant to use.
Settings > Disk Settings > Default file system -
Let the Mover empty an Unraid array disk so you can safely change its file system.
Main > Array Operation: stop the array
Preview
3 tips See all-
Open a GIF in Preview and look at each frame in the thumbnail sidebar.
View > Thumbnails show the Preview sidebar -
Add bookmarks to pages in a PDF and jump back to them from the sidebar.
Tools > Add Bookmark -
Export a PDF with a password to open it and an owner password for printing and editing.
Edge
3 tips See all-
Start or stop Read aloud in Edge with a keyboard shortcut on Windows and Mac.
Ctrl+Shift+U (Windows) -
Get a text cursor on web pages so you can move and select text with the keyboard.
F7 -
Lets Portainer manage a remote Docker host that cannot accept incoming connections.
Unbound
3 tips See all-
Refreshes popular DNS entries just before they expire so repeat lookups stay fast.
prefetch: yes -
Prints the cached records and messages Unbound holds for a name, without sending a query.
unbound-control cache_lookup example.com -
Checks an Unbound config file for errors before you restart the resolver.
unbound-checkconf /etc/unbound/unbound.conf
Xml
2 tips See all-
Change or delete one specific XML node in place, picked by XPath.
xmlstarlet ed -u '//item[@id="1"]/title' -v 'Changed' feed.xml -
Read single values from an XML file with an XPath, from the command line.
xmlstarlet sel -t -v '//item/title' -n feed.xml
Metadata
2 tips See all-
Restore the date, camera and GPS tags of a photo from the original file.
exiftool -TagsFromFile original.jpg -all:all edited.jpg -
Writes selected metadata tags of many files into one CSV file you can open in a spreadsheet.
exiftool -csv -FileName -Model -LensModel -ISO -r photos/ > photos.csv
Winget
2 tips See all-
Read a package's publisher, licence and versions before installing it.
winget show --id Git.Git -
Lists the Windows app updates that are waiting, and updates one app or all of them.
winget upgrade
Zfs
2 tips See all-
See how much disk space ZFS compression saves per dataset.
zfs get compressratio tank/media -
Hides healthy pools and shows only those with errors or that are unavailable, which suits a quick check.
zpool status -x
Archive
2 tips See all-
Leaves .git and other version control folders out of a tar archive.
tar --exclude-vcs -czf project.tar.gz project/ -
Shows what is inside a tar archive without extracting it, and pulls out a single file.
tar -tf backup.tar.gz | head
Acl
2 tips See all-
Explains the mask entry, and how setfacl -m m::rx removes write access from all named entries at once.
setfacl -m m::rx file -
Gives one extra named user access to a folder without touching owner or group.
sudo setfacl -m u:alice:rX /srv/data
Exiftool
2 tips See all-
Renames every photo in a folder after the date and time stored in its EXIF data.
exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e photos/ -
Removes GPS position and all other metadata from a photo before you share it.
exiftool -all= photo.jpg
Images
2 tips See all-
Combines many images into one grid image with a single ImageMagick command.
montage *.jpg -tile 4x -geometry 300x300+4+4 sheet.jpg -
Resizes many images in one command, and with -path the originals stay untouched in their folder.
magick mogrify -path small -resize "1600x1600>" *.jpg
Less
2 tips See all-
Makes searches in less case-insensitive, except when you type a capital letter.
less -i /var/log/syslog -
Follows a growing log file, and lets you stop and scroll back through it.
less +F /var/log/syslog
Ntfy
2 tips See all-
Holds a notification on the ntfy server and delivers it after a delay or at a set time.
curl -H "In: 30min" -d "Check the oven" ntfy.sh/mytopic -
Sends a push notification with a title, priority and emoji from one curl command.
curl \
Tar
2 tips See all-
Leaves cache folders out of a tar backup by marking them with one small file.
printf 'Signature: 8a477f597d28d172789f06886806bc55' > /mnt/user/appdata/app/cache/CACHEDIR.TAG -
Unpacks an archive straight into an existing folder without the extra version folder.
tar -xzf app-2.4.1.tar.gz -C /mnt/user/appdata/app --strip-components=1
More tips
40 tipsLinux and shell 178 See all
-
Use fzf's Alt-C binding to change directory with fuzzy search.
eval "$(fzf --bash)" -
Turns on line numbers permanently in nano, so you don't need the -l flag each time.
nano -l file.txt -
Runs Neovim's self-checks and reports missing tools, broken plugins and provider problems.
:checkhealth
Apps and containers 52 See all
-
Deletes the stored file versions of a user, limited to one folder with --path.
sudo -E -u www-data php occ versions:cleanup \ -
Summarizes a long Claude Code conversation while keeping the parts you name.
/compact keep the failing test names and the decision to use SQLite -
Explains how the Series Type changes the way Sonarr searches and why a wrong type finds nothing.
Series > Edit > Series Type: Standard | Daily | Anime
Git settings and fixes 40 See all
-
Removes stale remote-tracking branches every time you fetch.
git fetch --prune -
Lists your branches with the most recently committed one at the top.
git branch --sort=-committerdate -
Makes the first push of a new branch set up tracking automatically.
git config --global push.autoSetupRemote true
Mac terminal 60 See all
-
Prints a macOS preferences file as readable text.
plutil -p ~/Library/Preferences/com.apple.finder.plist -
Lists which programs are stopping your Mac from going to sleep.
pmset -g assertions
Nginx Proxy Manager 32 See all
-
Gets one wildcard certificate for all your subdomains in Nginx Proxy Manager without opening port 80.
dns_cloudflare_api_token=0123456789abcdef0123456789abcdef01234567 -
Raises the upload size limit on all Nginx Proxy Manager proxy hosts, so big uploads stop failing with 413.
client_max_body_size 10g;
Tailscale 2
-
Keeps local network devices like printers reachable while the rest of your traffic uses an exit node.
sudo tailscale set --exit-node=100.101.102.103 --exit-node-allow-lan-access=true -
Explains which three ports a public Tailscale Funnel can use and what you need to enable it.
tailscale funnel --bg 3000
Access and security 119 See all
-
Turns off Portainer's plain HTTP port so the web UI is only served over HTTPS.
docker run -d ... portainer/portainer-ce:lts --http-disabled
Backup repositories 20 See all
-
Reads, verifies and decrypts an archive as if restoring it, but writes no files to disk.
borg extract --dry-run /path/to/repo::my-files
Boots and kernel 16 See all
-
Sets which GRUB menu entry boots once, and the normal default returns after that.
sudo grub-reboot MENU_ENTRY
Cache and Mover 15 See all
-
Unraid 7.4 can show Mover progress, a setting that is off until you turn it on.
Disk usage 18 See all
-
Shows the size a file claims to be next to the space it really uses on disk.
truncate -s 10G test.img
Files and media 98 See all
-
Shows which NFO file names Jellyfin reads and why they override online providers.
/movies/Movie (2021)/Movie (2021).mkv
Globbing 12 See all
-
Switches off filename expansion in the current shell, so a * is passed on as a plain character.
set -f
Images and volumes 32 See all
-
Prints the sha256 digest of an image as the registry has it, so you can pin it.
crane digest nginx:latest
Network and DNS 90 See all
-
List every process that is listening on a TCP port.
sudo lsof -nP -iTCP -sTCP:LISTEN
Privacy 4 See all
-
Share chosen Health topics, such as heart rate or sleep, with a contact and stop whenever you like.
SQL shells 40 See all
-
Writes a query result to a CSV file on your own computer, without server file permissions.
\copy (SELECT id, email FROM users WHERE active) TO 'users.csv' WITH (FORMAT csv, HEADER)
Search syntax 5 See all
-
Generates a UUID, averages numbers or hashes text straight from the search box.
random uuid
Setup and devices 9 See all
-
Turns on the serial console on the GPIO pins, so you can see boot messages without a monitor or network.
enable_uart=1
System 34 See all
-
Unraid's Power Mode and the Tips and Tweaks plugin can both set the CPU governor.
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Text processing 85 See all
-
Aligns the output of any command, or a CSV file, into readable columns.
mount | column -t
WP-CLI 78 See all
-
Lets WP-CLI run on a crashing WordPress site by not loading plugins or themes, so you can fix it.
wp plugin list --skip-plugins --skip-themes
Web development 159 See all
-
See your design the way someone with colour vision deficiency might.
Accessibility tab > Simulate
Windows 87 See all
-
Looks up DNS records from PowerShell, with the record type and DNS server you choose.
Resolve-DnsName example.com -Type MX -Server 1.1.1.1
More tips 1
-
Lists the processes using the most memory first, so you can see what is filling your RAM.
ps aux --sort=-%mem | head -n 6
Still worth readingmost read lately, a new pick every day
Nothing in this filter yet.