Live data from Hacker News

Scripts I wrote that I use all the time

evanhahn.com

1–10 of 408 posts

Re: Scripts I wrote that I use all the time

#3
Regarding the `line` script, just a note that sed can print an arbitrary line from a file, no need to invoke a pipeline of cat, head, and tail:

    sed -n 2p file
prints the second line of file. The advantage sed has over this line script is it can also print more than one line, should you need to:

    sed -n 2,4p file
prints lines 2 through 4, inclusive.

Re: Scripts I wrote that I use all the time

#5
post #4

It's been a while since I haven't read something as useful! There also some very niche stuff that I won't use but found funny

The nato phonetic alphabet one cracked me up. My dude you don't need that, call center employees don't know it, just say S as in Sugar like ur grandma used to.

Re: Scripts I wrote that I use all the time

#6
This is exactly the kind of stuff I'm most interested in finding on HN. How do other developers work, and how can I get better at my work from it?

What's always interesting to me is how many of these I'll see and initially think, "I don't really need that." Because I'm well aware of the effect (which I'm sure has a name - I suppose it's similar to induced demand) of "make $uncommon_task much cheaper" -> "$uncommon_task becomes the basis of an entirely new workflow/skill". So I'm going to try out most of them and see what sticks!

Also: really love the style of the post. It's very clear but also includes super valuable information about how often the author actually uses each script, to get a sense ahead of time for which ones are more likely to trigger the effect described above.

A final aside about my own workflows which betrays my origins... for some of these operations and for others i occasionally need, I'll just open a browser dev tools window and use JS to do it, for example lowercasing a string :)

Re: Scripts I wrote that I use all the time

#7
post #4

It's been a while since I haven't read something as useful! There also some very niche stuff that I won't use but found funny

The nato phonetic alphabet one cracked me up. My dude you don't need that, call center employees don't know it, just say S as in Sugar like ur grandma used to.

The nato phonetic alphabet is still useful even if the other party doesn't know it, I've used it a bunch of times on the phone to spell out my 10- letter last name. Saves quite a lot of time and energy for me vs saying "letter as in word" for each letter.

Re: Scripts I wrote that I use all the time

#8
post #7

Earlier quoted context omitted.

The nato phonetic alphabet one cracked me up. My dude you don't need that, call center employees don't know it, just say S as in Sugar like ur grandma used to.

The nato phonetic alphabet is still useful even if the other party doesn't know it, I've used it a bunch of times on the phone to spell out my 10- letter last name. Saves quite a lot of time and energy for me vs saying "letter as in word" for each letter.

[deleted]

Re: Scripts I wrote that I use all the time

#9
I also have a radio script to play internet streams with mpv (?). Other random stuff

A password or token generator, simple or complicated random text.

Scripts to list, view and delete mail messages inside POP3 servers

n, to start Nautilus from terminal in the current directory.

lastpdf, to open the last file I printed as PDF.

lastdownload, to view the names of the n most recent files in the Downloads directory.

And many more but those are the ones that I use often and I remember without looking at ~/bin

Re: Scripts I wrote that I use all the time

#10
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 native UNIX implementations. If it's more complicated than that, I'll code it in Python or Go.

Post reply on HN