News for hackers. Stuff that matters.
Re:Scripts I wrote that I use all the time by oceanplexian on Wednesday October 22, 2025 @02:11PM (#45672984)
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.

Re:Scripts I wrote that I use all the time by trenchpilgrim on Wednesday October 22, 2025 @02:42PM (#45673397)
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.

Re:Scripts I wrote that I use all the time by ozim on Wednesday October 22, 2025 @04:16PM (#45674593)
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.
Re:Scripts I wrote that I use all the time by soraminazuki on Thursday October 23, 2025 @03:30AM (#45679185)
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.
Re:Scripts I wrote that I use all the time by 1718627440 on Thursday October 23, 2025 @07:13AM (#45680528)
They compete for time.
Re:Scripts I wrote that I use all the time by mlrtime on Thursday October 23, 2025 @07:58AM (#45680838)
Don't even try to explain the scripts to wife*, try the dog. At least he'll understand it just as much and be enthusiastic to hear it!

*may not be applicable to all wives, ymmv.

Re:Scripts I wrote that I use all the time by TsiCClawOfLight on Thursday October 23, 2025 @11:47AM (#45683234)
I thought my wife latex, she loves me for it :D
Re:Scripts I wrote that I use all the time by soraminazuki on Thursday October 23, 2025 @08:23AM (#45681022)
I'm saying that makes no sense, as I've wrote in the comment you're replying to.
Re:Scripts I wrote that I use all the time by 1718627440 on Thursday October 23, 2025 @05:58PM (#45687821)
Having a wife increases the opportunity costs of the time you spend on maintaining the scripts and also increases the costs while writing these (when the wife is nagging).
Re:Scripts I wrote that I use all the time by sestep on Wednesday October 22, 2025 @04:29PM (#45674750)
For anyone else reading this comment who was confused because this seems like the opposite of what you'd expect about Nix: Hacker News ate the asterisks and turned them into italics.
Re:Scripts I wrote that I use all the time by fragmede on Wednesday October 22, 2025 @05:06PM (#45675141)
use a backslash. \*

(had to use a double backslash to render that correctly)

Re:Scripts I wrote that I use all the time by latexr on Wednesday October 22, 2025 @05:26PM (#45675365)
Or two consecutive asterisks: ** becomes *
Re:Scripts I wrote that I use all the time by Ferret7446 on Thursday October 23, 2025 @04:05AM (#45679407)
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.
Re:Scripts I wrote that I use all the time by trenchpilgrim on Friday October 24, 2025 @07:31AM (#45693513)
I run two OSes. So two variants.

Some are desktops, some laptops, some servers. Different packages installed, different hardware. Three more variants.

Yes, I do have a script to set up my environment, but it already has a lot of conditional behavior to handle these five total variants. And I don't want to have to re-test the scripts and re-sync often.

Re:Scripts I wrote that I use all the time by chis on Wednesday October 22, 2025 @03:37PM (#45674098)
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

Re:Scripts I wrote that I use all the time by heyitsguay on Wednesday October 22, 2025 @04:07PM (#45674487)
I went through a similar cycle. Going back to simplicity wasn't about laziness for me, it was because i started working across a bunch more systems and didn't want to do my whole custom setup on all of them, especially ephemeral stuff like containers allocated on a cluster for a single job. So rather than using my fancy setup sometimes and fumbling through the defaults at other times, i just got used to operating more efficiently with the defaults.
Re:Scripts I wrote that I use all the time by nijaru on Wednesday October 22, 2025 @04:31PM (#45674779)
You can apply your dotfiles to servers you SSH into rather easily. I'm not sure what your workflow is like but frameworks like zsh4humans have this built in, and there are tools like sshrc that handle it as well. Just automate the sync on SSH connection. This also applies to containers if you ssh into them.
Re:Scripts I wrote that I use all the time by theshrike79 on Wednesday October 22, 2025 @04:44PM (#45674909)
I'm guessing you haven't worked in Someone Else's environment?

The amount of shit you'll get for "applying your dotfiles" on a client machine or a production server is going to be legendary.

Same with containers, please don't install random dotfiles inside them. The whole point of a container is to be predictable.

Re:Scripts I wrote that I use all the time by nijaru on Wednesday October 22, 2025 @05:55PM (#45675655)
Do you have experience with these tools? Some such as sshrc only apply temporarily per session and don't persist or affect other users. I keep plain 'ssh' separate from shell functions that apply dotfiles and use each where appropriate. You can also set up temporary application yourself pretty easily.
Re:Scripts I wrote that I use all the time by YouAreWRONGtoo on Wednesday October 22, 2025 @06:17PM (#45675868)
Someone else's environment? That should never happen. You should get your own user account and that's it.
Re:Scripts I wrote that I use all the time by theshrike79 on Thursday October 23, 2025 @01:07AM (#45678328)
I don’t even get an account on someone else’s server. There’s no need for me to log in anywhere unless it’s an exceptional situation.
Re:Scripts I wrote that I use all the time by YouAreWRONGtoo on Thursday October 23, 2025 @05:50AM (#45680066)
This doesn't make sense.

You said you were already using someone else's environment.

You can't later say that you don't.

Whether or not shell access makes sense depends on what you are doing, but a well written application server running in a cloud environment doesn't need any remote shell account.

It's just that approximately zero typical monolithic web applications meet that level of quality and given that 90% of "developers" are clueless, often they can convince management that being stupid is OK.

Re:Scripts I wrote that I use all the time by 1718627440 on Thursday October 23, 2025 @07:12AM (#45680523)
They do get to work on someone else's server, they do not get a separate account on that server. There client would be not happy to have them mess around with the environment.
Re:Scripts I wrote that I use all the time by YouAreWRONGtoo on Thursday October 23, 2025 @10:40AM (#45682361)
By definition, it the client Alice gives contractor Mallory access to user account alice, that's worse than giving them an account called mallory.

Accounts are basically free. Not having accounts; that's expensive.

Re:Scripts I wrote that I use all the time by nomel on Thursday October 23, 2025 @01:15PM (#45684333)
They specifically mentioned service accounts. If they’re given an user account to login as, they still might have to get into and use the service account, and its environment, from there. If the whole purpose was to get into the service account, and the service account is already setup for remote debug, then the client might prefer to skip the creation of the practically useless user account.
Re:Scripts I wrote that I use all the time by YouAreWRONGtoo on Thursday October 23, 2025 @06:32PM (#45688206)
That's still not professional, but then again 99.9% of companies aren't.
Re:Scripts I wrote that I use all the time by nomel on Thursday October 23, 2025 @07:41PM (#45688910)
Could you help me understand what assumptions about the access method you have in place that make this seem unprofessional?

Let's assume they need access to the full service account environment for the work, which means they need to login or run commands as the service account.

This is a bit outside my domain, so this is a genuine question. I've worked on single user and embedded systems where this isn't possible, so I find the "unprofessional" statement very naive.

Re:Scripts I wrote that I use all the time by mlrtime on Thursday October 23, 2025 @07:55AM (#45680811)
Sometimes we need to use service accounts, so while you do have your own account all the interesting things happen in svc_foo which you cannot add your .files.
Re:Scripts I wrote that I use all the time by fragmede on Wednesday October 22, 2025 @05:05PM (#45675131)
If, in the year 2025, you are still using a shared account called "root" (password: "password"), and it's not a hardware switch or something (and even they support user accounts these days), I'm sorry, but you need to do better. If you're the vendor, you need to do better, if you're the client, you need to make it an issue with the vendor and tell them they need to do better. I know, it's easy for me to say from the safety of my armchair at 127.0.0.1. I've got some friends in IT doing support that have some truly horrifying stories. But holy shit why does some stuff suck so fucking much still. Sorry, I'm not mad at you or calling you names, it's the state of the industry. If there were more pushback on broken busted ass shit where this would be a problem, I could sleep better at night, knowing that there's somebody else that isn't being tortured.
Re:Scripts I wrote that I use all the time by theshrike79 on Thursday October 23, 2025 @01:06AM (#45678321)
It’s 2025. I don’t even have the login password to any server, they’re not unicorns, they’re cattle.

If something is wrong with a server, we terminate it and spin up a new one. No need for anyone to log in.

In very rare cases it might be relevant to log in to a running server, but I haven’t done that in years.

Re:Scripts I wrote that I use all the time by LinXitoW on Thursday October 23, 2025 @06:22AM (#45680273)
In other replies you explicitly state how rare it is that you log in to other systems.

Aren't you therefore optimizing for 1% of the cases, but sabotaging the 99%?

Re:Scripts I wrote that I use all the time by tester457 on Wednesday October 22, 2025 @08:02PM (#45676671)
The defaults are unbearable. I prefer using chezmoi to feel at home anywhere. There's no reason I can't at least have my aliases.

I'd rather take the pain of writing scripts to automate this for multiple environments than suffer the death by a thousand cuts which are the defaults.

Re:Scripts I wrote that I use all the time by fragmede on Wednesday October 22, 2025 @08:40PM (#45676914)
chezmoi is the right direction, but I don't want to have to install something on the other server, I should just be able to ssh to a new place and have everything already set up, via LocalCommand and Host * in my ~/.ssh/config
Re:Scripts I wrote that I use all the time by bigwheels on Wednesday October 22, 2025 @06:20PM (#45675898)
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

Re:Scripts I wrote that I use all the time by auraham on Wednesday October 22, 2025 @08:10PM (#45676728)
I gave it a try a few months ago, but did not work for me. My main issue is that atuin broke my workflow with fzf (If I remember correctly, pressing ctrl + r to lookup my shell history did not work well after installing atuin).
Re:Scripts I wrote that I use all the time by bigwheels on Wednesday October 22, 2025 @09:06PM (#45677064)
I'm sympathetic, also a longtime fzf user here. I install it reflexively on any system I use for more than a day or two.
Re:Scripts I wrote that I use all the time by TsiCClawOfLight on Thursday October 23, 2025 @11:46AM (#45683213)
This is configurable! I use atuin, but fzf with ctrl-r.
Re:Scripts I wrote that I use all the time by tacker2000 on Thursday October 23, 2025 @03:13AM (#45679105)
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 by johntash on Thursday October 23, 2025 @03:30AM (#45679188)
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 by YouAreWRONGtoo on Thursday October 23, 2025 @04:41AM (#45679644)
Either it wasn't a design goal or they are stupid. Why don't you tell us?

The right way this would work is via a systemd service and then it should be instant.

Re:Scripts I wrote that I use all the time by planb on Wednesday October 22, 2025 @02:59PM (#45673606)
Yeah - been there, done that, too. I feel like the time I gain from having a shortcut is often less that what I wound need to maintain it or to remember the real syntax when I'm on a machine where it's not available (which happens quite often in my case). I try to go with system defaults as much as possible nowadays.
Re:Scripts I wrote that I use all the time by eikenberry on Wednesday October 22, 2025 @03:06PM (#45673685)
Prepare to swing back again. With nearly 30 years experience I find the shell to be the best integration point for so many things due to its ability to adapt to whatever is needed and its universal availability. My use of a vanilla shell has been reduced to scripting cases only.
Re:Scripts I wrote that I use all the time by D13Fd on Wednesday October 22, 2025 @02:33PM (#45673276)
I would still call my Python scripts “scripts.” I don’t think the term “scripts” is limited to shell scripts.
Re:Scripts I wrote that I use all the time by jamesbelchamber on Wednesday October 22, 2025 @02:50PM (#45673493)
I am going through a phase of working with younger engineers who have many dotfiles, and I just think "Oh, yeh, I remember having lots of dotfiles. What a hassle that was."

Nowadays I just try to be quite selective with my tooling and learn to change with it - "like water", so to speak.

(I say this with no shade to those who like maintaining their dotfiles - it takes all sorts :))

Re:Scripts I wrote that I use all the time by dbalatero on Thursday October 23, 2025 @11:39AM (#45683115)
I've been programming 30 years and I really don't find it a hassle:

- if you commit them to git, they last your entire career

- improving your setup is basically compound interest

- with a new laptop, my setup script might cause me 15 minutes of fixing a few things

- the more you do it, the less any individual hassle becomes, and the easier it looks to make changes – no more "i don't have time" mindset

Re:Scripts I wrote that I use all the time by nonethewiser on Wednesday October 22, 2025 @02:44PM (#45673416)
On the other hand, the author seems to have a lot of experience as well.

Personally I tend to agree... there is a very small subset of things I find worth aliasing. I have a very small amount and probably only use half of them regularly. Frankly I wonder how my use case is so different.

edit: In the case of the author I guess he's probably wants to live in the terminal full time. And perhaps offline. there is a lot of static data he's stored like http status codes: https://codeberg.org/EvanHahn/dotfiles/src/commit/843b9ee13d...

In my case i'd start typing it in my browser then just click something i've visited 100 times before. There is something to be said about reducing that redundant network call but I dont think it makes much practical difference and the mental mapping/discoverability of aliases isnt nothing.

Re:Scripts I wrote that I use all the time by grimgrin on Wednesday October 22, 2025 @03:31PM (#45674022)
this is how it works for you

as a person who loves their computer, my ~/bin is full. i definitely (not that you said this) do not think "everything i do has to be possible on every computer i am ever shelled into"

being a person on a computer for decades, i have tuned how i want to do things that are incredibly common for me

though perhaps you're referring to work and not hobby/life

Re:Scripts I wrote that I use all the time by stronglikedan on Wednesday October 22, 2025 @03:36PM (#45674094)
Different strokes for different folks - tenured engineers just settle into whatever works best for them.
Re:Scripts I wrote that I use all the time by denimnerd42 on Wednesday October 22, 2025 @02:58PM (#45673595)
I prefer using kubectl than any other method so i have plenty of functions to help with that. I'd never consider using python or go for this although I do have plenty of python and go "scripts" on my path too.
Re:Scripts I wrote that I use all the time by fragmede on Wednesday October 22, 2025 @03:14PM (#45673787)
If you come through the other side, you set up LocalCommand in your .ssh/config which copies your config to every server you ssh to, and get your setup everywhere.
Re:Scripts I wrote that I use all the time by apprentice7 on Wednesday October 22, 2025 @04:37PM (#45674837)
It's the bell curve meme all along.
Re:Scripts I wrote that I use all the time by imiric on Wednesday October 22, 2025 @05:44PM (#45675554)
I've heard this often, but I'm going on ~25 years of using Linux, and I would be lost without my dotfiles. They represent years of carefully crafting my environment to suit my preferences, and without them it would be like working on someone else's machine. Not impossible, just very cumbersome.

Admittedly, I've toned down the configs of some programs, as my usage of them has evolved or diminished, but many are still highly tailored to my preferences. For example, you can't really use Emacs without a considerable amount of tweaking. I mean, you technically could, but such programs are a blank slate made to be configured (and Emacs is awful OOB...). Similarly for zsh, which is my main shell, although I keep bash more vanilla. Practically the entire command-line environment and the choices you make about which programs to use can be considered configuration. If you use NixOS or Guix, then that extends to the entire system.

If you're willing to allow someone else to tell you how you should use your computer, then you might as well use macOS or Windows. :)

Re:Scripts I wrote that I use all the time by russellbeattie on Wednesday October 22, 2025 @06:22PM (#45675916)
The moment of true enlightenment is when you finally decide to once and for all memorize all the arguments and their order for those command line utilities that you use at an interval that's just at the edge of your memory: xargs, find, curl, rsync, etc.

That, plus knowing how to parse a man file to actually understand how to use a command (a skill that takes years to master) pretty much removes the need for most aliases and scripts.

Re:Scripts I wrote that I use all the time by whatevertrevor on Wednesday October 22, 2025 @07:18PM (#45676372)
I already have limited space for long term memory, bash commands are very far down the list of things I'd want to append to my long term storage.

I use ctrl-R with a fuzzy matching program, and let my terminal remember it for me.

And before it's asked: yes that means I'd have more trouble working in a different/someone else's environment. But as it barely ever happens for me, it's hardly an important enough scenario to optimize for.

Re:Scripts I wrote that I use all the time by npodbielski on Thursday October 23, 2025 @09:22AM (#45681523)
Why would I even attempt to do that? Life is too short to try to remember something like that. Maybe 20 years ago when internet was not that common. Or maybe if you are a hacker, hacking other peoples machines. Me? Just some dev trying yo make some money to feed my family? I prefer to have a walk to the woods.
Re:Scripts I wrote that I use all the time by subsection1h on Wednesday October 22, 2025 @06:27PM (#45675962)
> 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

Does this mean that you learned to code to earn a paycheck? I'm asking because I had written hundreds of scripts and Emacs Lisp functions to optimize my PC before I got my first job.

Re:Scripts I wrote that I use all the time by shermanyo on Wednesday October 22, 2025 @08:25PM (#45676837)
I use a dotfile with aliases and functions, mostly to document / remember commands I find useful. It's been a handy way to build a living document of the utils I use regularly, and is easy to migrate to each new workstation.
Re:Scripts I wrote that I use all the time by bdangubic on Wednesday October 22, 2025 @08:45PM (#45676947)
or just ask claude etc to do it for ya
Re:Scripts I wrote that I use all the time by dylan604 on Wednesday October 22, 2025 @08:57PM (#45677013)
man, i couldn't live without alias ..='cd ..' or alias ...='cd ../..'

to this day, i still get tripped up when using a shell for the first time without those as they're muscle memory now.

Re:Scripts I wrote that I use all the time by fiddlerwoaroof on Wednesday October 22, 2025 @10:21PM (#45677475)
I just use the autocd zsh shell option for this. And I also use `hash -d` to define shortcuts for common directories. Then just “executing” something like `~gh/apache/kafka` will cd to the right place.
Re:Scripts I wrote that I use all the time by 1718627440 on Thursday October 23, 2025 @07:16AM (#45680552)
Thanks. I haven't considered these aliases, but they seam useful, so I just added them for my user. :-)
Re:Scripts I wrote that I use all the time by 400thecat on Thursday October 23, 2025 @09:50AM (#45681815)
you can configure Alt+Left to go up level
Re:Scripts I wrote that I use all the time by Mikhail_Edoshin on Thursday October 23, 2025 @12:09AM (#45678082)
Given the nature of current operating systems and applications, do you think the idea of “one tool doing one job well” has been abandoned? If so, do you think a return to this model would help bring some innovation back to software development?

Rob Pike: Those days are dead and gone and the eulogy was delivered by Perl.

Re:Scripts I wrote that I use all the time by president_zippy on Thursday October 23, 2025 @01:46AM (#45678541)
But was the eulogy written in Perl poetry? I see it everywhere, but I don't know who this JAPH guy is. It's a strange way of spelling Jeff, and it's odd that he types his name in all caps, but he has published a remarkable quantity of works and he's even more famous than the anonymous hacker known as 4chan.
Re:Scripts I wrote that I use all the time by npodbielski on Thursday October 23, 2025 @09:17AM (#45681454)
Oh I hate that paradigm. Well, maybe chmod and ls rsync and curl all do they OWN thing very well but every time I am using one of those tools I have to remember if i.e. more detailed response is -v or maybe -vvv or --verbose or -x for some reason because maintainer felt like it at 2:32 in the morning 17 years ago... Some consistency would help, but... Probably it is impossible the flame war over -R being recursive or read-only would never end.
Re:Scripts I wrote that I use all the time by heap_perms on Thursday October 23, 2025 @03:11AM (#45679080)
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 by cvak on Thursday October 23, 2025 @03:23AM (#45679153)
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 by criddell on Thursday October 23, 2025 @11:40AM (#45683141)
AT 5 years of experience, I was the same as you. One of my favorite ways of avoiding work was tweaking my window manager (Enlightenment) and polishing my library of custom scripts and aliases.

Twenty some years later, I’m more like the person you replied to. I leave things pretty much at their defaults and install as little software as possible because when things break, it’s easier to troubleshoot and find solutions when the environment isn’t heavily customized. It’s also easier to set up (or reset) a computer.

Re:Scripts I wrote that I use all the time by mlrtime on Thursday October 23, 2025 @07:51AM (#45680781)
For the Infra Engineers out there who still manage fleets of pets, this is double true. You may not have access or be able to use all your shortcut scripts so you better know the raw commands on that unsupported RHEL6 host.