4 ms·
At my work I've gone through and setup a variety of "replacement" commands for commands that may have dire impact on production systems. All of these replacemen
by overshard 5y ago
At my work I've gone through and setup a variety of "replacement" commands for commands that may have dire impact on production systems. All of these replacement commands dry run by default (or fake dry run/try to create a dry run the best they can) and require a "--do-it" (think emperor palpatine voice) flag to do the intended operation. I've had multiple coworkers thank me for this setup as it's saved people from silly typos and mistakes, one such being the different handling of programs in the use of and ending "/" in folders. ex. "/etc" is different than "/etc/" sometimes for certain operations.
I'd like to one day see a global flag on operating systems to dry run nearly all commands that changed anything.
- danmur 5y agoDitto :). I use --really though.
- MAGZine 5y ago--void-warranty
- andrewshadura 5y ago--deliberately-do-insane-thing
- matsemann 5y agoReact.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
- Sohcahtoa82 5y agoHow about Handler.runWithScissors()? https://android.googlesource.com/platform/frameworks/base/+/android-5.0.0_r1/core/java/android/os/Handler.java#461 https://android.googlesource.com/platform/frameworks/base/+/...
- wtetzner 5y ago--launch-the-missles
- maherbeg 5y ago+1. I prefer having a --real flag that you have to invocate.
- jdfellow 5y agoI think I've done --really when doing something similar.
- Hjfrf 5y agoIt's official best practice for powershell to enable - whatif in any potentially dangerous scripts. Seems to be followed most of the time.
- Twirrim 5y agoI've largely switched to writing all my tools dry-run by default. We've had a few undesirable events from tools that had --dry-run modes and accidentally got run without. Making --run or similar necessary almost guarantees it's never run without intention.
- nicoburns 5y ago> All of these replacement commands dry run by default Same here. In addition if there's never a use case for running in production (e.g. at one point we had a command that reset a dev environment to a clean slate) then the command will actually specifically check for the production environment and refuse to run as an extra failsafe.
- IgorPartola 5y ago--make-it-so is even better.
- andrewshadura 5y agoI sometimes create a makefile with "it so: build" so that I can make it so :)
- greggyb 5y agoIt should be a parameter that takes as an argument the current user and logs the invocation, "--if-it-breaks-i-take-personal-responsibility $USER" to really make sure folks understand what they're doing.
- jonnycomputer 5y agoGood idea. I'm writing some db scripts, and I think I'll do this.
- hnick 5y agoExactly how I do it. It guards against people who don't read the docs or bump enter halfway through accidentally (damn laptop keyboards).