Live data from Hacker News

Scripts I wrote that I use all the time

evanhahn.com

221–230 of 408 posts

Re: Scripts I wrote that I use all the time

#221

Earlier quoted context omitted.

Atuin is new to me! https://github.com/atuinsh/atuin Discussed 4 months ago: Atuin – Magical Shell History https://news.ycombinator.com/item?id=44364186 - June 2025, 71 comments

I like atuin but why is it so slow when first opening (hitting up) in the shell?

I'd recommend disabling atuin when hitting up and just leave it on ctrl+r instead

Re: Scripts I wrote that I use all the time

#223

My fav script to unpack anything, found a few years ago somewhere # ex - archive extractor # usage: ex function ex() { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; *.tar.xz) tar xf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;; *.tgz) tar xzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1;; *.7z) 7z x $1 ;; *) echo "'$1' can…

`tar xf` autodetects compressed files now. You can replace any of your instances of tar with that.

Yes, but only bsdtar has support for zip, rar, and 7z.

Re: Scripts I wrote that I use all the time

#225
post #165

Earlier quoted context omitted.

I find that endearing for two reasons: - either critique is solid and I learn something - or commenter is clueless which makes it entertaining there is very seldom a “middle”

Yea I don't particularly mind it, just an interesting thing about HN compared to many other forums.

*fora

Re: Scripts I wrote that I use all the time

#226

Earlier quoted context omitted.

For me it's when I call customer service or support on the phone, and either give them an account #, or confirm a temporary password that I have been verbally given.

Are you referring to the nato alphabet utility? Or the alphabet script that prints abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ

I imagine all of his passwords are abcdefghijklmnopqrstuvwxyz

Re: Scripts I wrote that I use all the time

#227

no offense but a lot of those script are pretty hacky they may work for the user but i would not use them without making sure to review them and adapt them to my workflow

That's a fair point. I think the author intended the post to be a treasure trove of ideas for your own scripts, not as something to blindly include in your daily workflow.

Re: Scripts I wrote that I use all the time

#228
post #55

I have a bunch of little scripts and aliases I've written over the years, but none are used more than these... alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' alias ......='cd ../../../../..' alias .......='cd ../../../../../..'

Does zsh support this out-of-the-box? Because I definitely never had to setup any of these kinds of aliases but have been using this shorthand dot notation for years.

It's an oh-my-zsh thing.

Re: Scripts I wrote that I use all the time

#229
> url "$my_url" parses a URL into its parts. I use this about once a month to pull data out of a URL, often because I don’t want to click a nasty tracking link.

This sounds pretty useful!

Coincidentally, I have recently learned that Daniel Stenberg et al (of cURL fame) wrote trurl[1], a libcurl-based CLI tool for URL parsing. Its `--json` option seems to yield similar results as TFA's url, if slightly less concise because of the JSON encoding. The advantage is that recent releases of common Linux distros seem to include trurl in their repos[2].

[1]: https://curl.se/trurl/

[2]: https://pkgs.org/search/?q=trurl

Re: Scripts I wrote that I use all the time

#230

It's weird how the circle of life progresses for a developer or whatever. - When I was a fresh engineer I used a pretty vanilla shell environment - When I got a year or two of experience, I wrote tons of scripts and bash aliases and had a 1k+ line .bashrc the same as OP - Now, as a more tenured engineer (15 years of experience), I basically just want a vanilla shell with zero distractions, aliases or scripts and use…

When I had one nix computer, I wanted to customize it heavily. Now I have many nix computers and I want them consistent and with only the most necessary packages installed.

I don't get why this is a problem. Just stick all your configs in a git repo and clone it wherever you need it.
Post reply on HN