Scripts I wrote that I use all the time
General reception
- Many commenters find the collection inspiring and exactly the kind of practical, workflow-focused content they want on HN.
- Several say they’ll “steal” or adapt specific ideas, especially around small quality-of-life terminal helpers.
- Others find some scripts amusing or overkill, but still useful as idea fuel.
Standard tools vs custom scripts
- Multiple replies point out built‑in or standard equivalents to some scripts:
sed -n 10pinstead of alinescript (and for ranges2,4p).jqorpython -m json.toolinstead of a Node-based JSON formatter.uuidgenor/proc/sys/kernel/random/uuidinstead of a customuuid.- macOS
trashcommand instead of AppleScript-based trashing;date -I,unicode,trurlfor URL parsing, etc.
- Several Vim users show how the markdown quote script can be replaced with visual-block edits or simple
:scommands. - Some argue many of these could be aliases rather than standalone scripts; others link to the author’s rationale for preferring scripts.
Portability, dotfiles, and environments
- One major thread debates heavy customization vs “vanilla” shells:
- Some veterans describe a lifecycle: vanilla → huge .rc with many helpers → back to mostly stock tools, scripting in Python/Go for bigger tasks.
- Others say their large dotfile setups are essential “compound interest” and easy to port with Git, chezmoi, or similar tools.
- People who frequently log into random/ephemeral or client/production systems avoid relying on personal shortcuts, emphasizing mastery of
sed/awk/grep/xargs/findinstead. - There’s pushback against automatically “applying your dotfiles” on other people’s servers due to professionalism and predictability concerns; others suggest careful per-user or per-session approaches.
Examples of shared utilities
- Many commenters share their own staples:
- Variants of
mkcd/take,../...navigation,kp(kill by port),unix/epochtime converters, archive extractors (ex/un),prep_for_webimage processors, ffmpeg wrappers, stats-on-stdin scripts,memofor caching expensive commands, and directory-stack helpers. - Clipboard helpers (
copy/pasta, OSC 52 “clip”, macOSclippy, OCR scripts) are especially popular.
- Variants of
- Some recommend higher-level tools (fzf, ripgrep, atuin, direnv, mise, Nushell, babashka, up, bkt) that subsume many ad‑hoc scripts.
NATO phonetic alphabet
- The
natoscript sparks a subthread:- Some think it’s overkill or not widely understood (“S as in Sugar” is enough).
- Others argue the NATO/ICAO alphabet is designed for clarity over noisy channels, works even if the other side doesn’t “know” it, and prevents ambiguous choices like “nail” vs “mail”.
Automation economics and learning
- Several invoke or critique the xkcd “Is It Worth the Time?” chart:
- One side stresses not over-optimizing rare tasks; small monthly tasks may never repay a big scripting investment.
- Others note time isn’t fungible: scripts can reduce stress, encode error-prone procedures safely, avoid downtime, and serve as learning exercises.
- Commenters highlight AI/LLMs as dramatically lowering the cost of writing these utilities, making experimentation more justifiable.