Live data from Hacker News

Times I've Messed Up as a Developer

medium.com

131–137 of 137 posts

Re: Times I've Messed Up as a Developer

#131
post #83
post #63

Earlier quoted context omitted.

You can also alias "rm -i" or "rm -I" to "rm" to avert major catastrophes. From man rm: -i prompt before every removal -I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protection against most mistakes

This alias seems to be set by default in many linux distributions these days (and has been that way for many years now). The problem is that you get used to this crutch and rely on it, until one day you're logged in someplace without the alias and end up deleting something you shouldn't. I'm not a fan and normally disable it. Instead, I prefer to be very careful and deliberate when using rm, especially with any wildc…

I'll probably get shit on for admitting it, but I generally keep rm aliased to `rm -rf`. Recursive, force.

It forces me to be careful and deliberate. There's never a safe option or a backstop. I treat rm like a gun - always assume it's loaded and going to murder whatever I point it at without hesitation. If I'm not 100% sure about what I'm about to delete or how a wildcard will expand, then I echo it first.

I messed up once, about 15 years ago now. Lost a few personal files. Haven't screwed up since.

Re: Times I've Messed Up as a Developer

#133

During the beta for a product, we were working on sending out daily summary emails to our users. We had a cron job which should run at 8:00 AM in the morning which would process the queue and summarize all activities into a single email. It being a very long day, I deployed the job with the cron expression * 8 * * * instead of 0 8 * * * , which meant it ran EVERY minute starting at 8:00 AM instead of just once. The n…

Oh yea, I've done that too. These days I use systemd timers, which are much less prone to that sort of error.

Re: Times I've Messed Up as a Developer

#134

Back in the early 90's I had 2 terminals up on my X windows console. One for local dev and another for a production server running a trading system for around 50 users. Naturally for production I was logged in as root. I typed rm -rf to clear out my dev folder only to figure out I just deleted the root folder and all sub folders on a production machine. I recalled a piece of advice a university friend had given me. "…

> Moral of the story - Don't let anyone give you access to production servers.

If you are root, make another user. you can delete it later.

Re: Times I've Messed Up as a Developer

#135

Earlier quoted context omitted.

> I really wish there was some practical information course at compsci with these kind of tips to prevent the most common slippages This is everyday Operations work. There is no school that teaches the eclectic mix of OS and container, networks and routes, app/db/code, CI/CD, BC/DR, writing KB articles, running standups and meetings, triage technical issues, configuration management, Change Control, and Incident Mana…

I also wonder how effective a program can be at teaching this kind of thing. No amount of studying ever ingrained something in my mind as well as the adrenaline shot of somehow fucking up production. I'm not aware of any pedagogical methods to engage the endocrine system, but I find it very useful for retention.

There's a theory that the same person should not be both a Developer and an Operator for the same project - that crucial mental separation between Making something and Keeping It Online gets too blurred when one person wears both hats. I've witnessed this in my own personal and professional projects. I guess it is a counter-argument to the DevOps/Agile philosophy.

Re: Times I've Messed Up as a Developer

#136

Fortune 500 company, Junior dev. Tried to log into our staging database, which has the same username, but different password than production. Tried 3 times, got the locked out error. Got frustrated, said I'd fix it after lunch, went out to eat, came back about 3 hours later after a doctor's appointment. My boss was waiting for me at the department door and I got sent back to his office for a stern talking to. I had l…

I dont know. Ive seen systems before where anyone could make catastrophic 'modifications' like what you describe. I tend towards blaming the system construction over the junior developer.

Re: Times I've Messed Up as a Developer

#137

Back in the nineties, at a previous employer, I wrote a code generator that read a kind of DSL from stdin and spat out C source to stdout. Having written the initial version and got it to compile, I thought I should test it before checking it into RCS for the first time. So I ran it with some simple input and piped the output to something like program.c. At that point I remembered that the code generator's main sourc…

set -o noclobber
Post reply on HN