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 10p instead of a line script (and for ranges 2,4p).
    • jq or python -m json.tool instead of a Node-based JSON formatter.
    • uuidgen or /proc/sys/kernel/random/uuid instead of a custom uuid.
    • macOS trash command instead of AppleScript-based trashing; date -I, unicode, trurl for URL parsing, etc.
  • Several Vim users show how the markdown quote script can be replaced with visual-block edits or simple :s commands.
  • 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/find instead.
  • 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/epoch time converters, archive extractors (ex/un), prep_for_web image processors, ffmpeg wrappers, stats-on-stdin scripts, memo for caching expensive commands, and directory-stack helpers.
    • Clipboard helpers (copy/pasta, OSC 52 “clip”, macOS clippy, OCR scripts) are especially popular.
  • Some recommend higher-level tools (fzf, ripgrep, atuin, direnv, mise, Nushell, babashka, up, bkt) that subsume many ad‑hoc scripts.

NATO phonetic alphabet

  • The nato script 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.