Live data from Hacker News

Scripts I wrote that I use all the time

evanhahn.com

211–220 of 408 posts

Re: Scripts I wrote that I use all the time

#211
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 ../../../../../..'

[deleted]

Re: Scripts I wrote that I use all the time

#212
The most useful script I wrote is one I call `posh`. It shorten a file path by using environment variables. Example:

  $ posh /home/ramrachum/Dropbox/notes.txt
  $DX/notes.txt
Of course, it only becomes useful when you define a bunch of environment variables for the paths that you use often.

I use this a lot in all of my scripts. Basically whenever any of my script prints a path, it passes it through `posh`.

Re: Scripts I wrote that I use all the time

#213

> alphabet just prints the English alphabet in upper and lowercase. I use this surprisingly often (probably about once a month) I genuinely wonder, why would anyone want to use this, often?

If your native language uses a different alphabet, you might not have been taught "the alphabet song". For example, I speak/read passable Russian, but could not alphabetize a list in Russian.

Re: Scripts I wrote that I use all the time

#216

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…

I can't say I relate at all (5 years of experience). They'll have to pry my 1000-line .zshrc from my cold, dead hands. For example, zsh-autosuggestions improves my quality of life so ridiculously much it's not even funny.

Re: Scripts I wrote that I use all the time

#217
post #46

Earlier quoted context omitted.

I think it's more likely to say that this comes from a place of laziness than some enlightened peak. (I say this as someone who does the same, and is lazy). When I watch the work of coworkers or friends who have gone these rabbit holes of customization I always learn some interesting new tools to use - lately I've added atuin, fzf, and a few others to my linux install

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?

Re: Scripts I wrote that I use all the time

#218

I had youtube and serveit and some others, but pasta is really good, thanks!

Last month I saw a tweet how to serve files using

python3 -m http.server 1337

Then I turned it into an alias, called it "serveit" and tweeted about it. And now I see it as a bash script, made a little bit more robust in case python is not installed :)

Re: Scripts I wrote that I use all the time

#219

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…

I can't say I relate at all (5 years of experience). They'll have to pry my 1000-line .zshrc from my cold, dead hands. For example, zsh-autosuggestions improves my quality of life so ridiculously much it's not even funny.

I moved away from 1000 lines .zshrc when I had to do stuff on linux VMs/dockers and I was lost a lot. But you zsh-autosuggestions, and fzf-tab is not going anywhere.

Re: Scripts I wrote that I use all the time

#220
post #63

Earlier quoted context omitted.

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.

Besides many nix computers I also have wife, dog, children, chores, shopping to be done. Unlike when I was young engineer I could stay all night fiddling with bash scripts and environments.

What does your wife, dog, children, chores, and shopping have to do with custom configuration and scripts? Just set up a Git repo online, put your files there, and take a couple of minutes to improve it incrementally when you encounter inconveniences. And just like that, you made your life easier for a marginal effort.
Post reply on HN