Earlier quoted context omitted.
Two terms was such a common source of mistakes: I shut down a server parked in a nearby country and we had to drive there to turn it on. Since then I’ve adopted custom prompt and color scheme for production. I really wish there was some practical information course at compsci with these kind of tips to prevent the most common slippages
> 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…
Times I've Messed Up as a Developer
61–70 of 137 posts
Re: Times I've Messed Up as a Developer
#62Here is a fun one for you: In Git, a push-force used to (or at least how I remember it) only force-push your current branch. I force-pushed on a branch... and it force-pushed master. Thankfully no one had pushed to master since I last pulled from it. Here is the fix: ``` [push] default = current ``` Or you can just, not force-push... or be explicit, which I do now. I use force pushes for rebasing and --amend. I am on…
Re: Times I've Messed Up as a Developer
#63Back 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. "…
This is why I do a "mv" to "tmp" instead of using "rm" when I can. Having special messages or colours to differentiate between production and other environments is a great idea as well. Generally if I'm about to do something on production, I'll close everything else to do with other environments as it's just too easy to slip up.
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
Re: Times I've Messed Up as a Developer
#64Stop mucking around in production. Stop. Seriously, stop.
If you have never screwed up anything in production, no one at your org trusts you enough to give you production access. Which is ok and great for you, but at the end of the day SOMEONE has to have production access. You can write a devops template that wipes out data just as easy as you can sudo rm -rf /
Re: Times I've Messed Up as a Developer
#65I've seen a DBA drop a production table as well, fortunately it was a small in memory table for non persisting data that could be quickly repopulated. Still lead to about 5 mins of downtime. I always have two terminals open, both running tmux. One is white text on black for dev work, the other is white text on red. I only ever ssh into production servers on the white on red terminal so there's a strong visual signal…
And let's not talk about my own (mostly minor) disasters.
Re: Times I've Messed Up as a Developer
#66Re: Times I've Messed Up as a Developer
#67Back 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. "…
To prevent this, my iTerm2 has a custom background enabled when logged in on any production servers. I wish the same were easily possible on a Linux terminal without much "trickery" :|
Re: Times I've Messed Up as a Developer
#68Earlier quoted context omitted.
Two terms was such a common source of mistakes: I shut down a server parked in a nearby country and we had to drive there to turn it on. Since then I’ve adopted custom prompt and color scheme for production. I really wish there was some practical information course at compsci with these kind of tips to prevent the most common slippages
> Since then I’ve adopted custom prompt and color scheme for production. An AHA moment for me. I've always wondered why people cared about all the terminal customization options (I grew up typing on an 80x48 AAA glass TTY). This is a good reason. I've used a custom prompt with the host name built in for decades, but this kind of color issue makes sense!
Re: Times I've Messed Up as a Developer
#69Earlier quoted context omitted.
If you have never screwed up anything in production, no one at your org trusts you enough to give you production access. Which is ok and great for you, but at the end of the day SOMEONE has to have production access. You can write a devops template that wipes out data just as easy as you can sudo rm -rf /
Imo, it's not about trust, it's about rigor.
Re: Times I've Messed Up as a Developer
#70I was relying on expressions like
mode == "Test"
to fail to type-check to spot all the places that I needed to update.Sadly some parts of the codebase weren't very idiomatic and had some
"Test".Equals(mode)
This caused a bit of involuntary testing in production and thought me not to trust anything while refactoring.