Live data from Hacker News

Type in the exact number of machines to proceed

rachelbythebay.com

271–280 of 340 posts

Re: Type in the exact number of machines to proceed

#271

Earlier quoted context omitted.

A similar tip I picked up long ago: If you're typing a dangerous command, first type a `#` (or `--` if it's SQL, etc.), then the command. Then read it. Then go back to the start of the line and remove the comment and run it.

I always do destructive SQL commands in two steps: first run a select using the WHERE clause you intend to use and verify which records will be affected, then hit the up arrow and edit the beginning of the query leaving the WHERE intact. I also like adding redundant conditions to the WHERE so a typo in any single one of them won't sink me.

I do the same thing. I also keep auto commit off and make sure the rows updated looks correct before committing the change.

Re: Type in the exact number of machines to proceed

#273

Earlier quoted context omitted.

I always do destructive SQL commands in two steps: first run a select using the WHERE clause you intend to use and verify which records will be affected, then hit the up arrow and edit the beginning of the query leaving the WHERE intact. I also like adding redundant conditions to the WHERE so a typo in any single one of them won't sink me.

For the rare but critical manual SQL mod our common safety measure is to wrap every DELETE or UPDATE in BEGIN TRAN...ROLLBACK TRAN first. Run on test systems or snapshots multiple times, checking the result inside the transaction. Finally, change ROLLBACK to COMMIT only when you are positive all is well.

IIRC (without checking the manuals) data-definition commands might not be covered by such transactions: such as altering, dropping tables and possibly truncates.

Re: Type in the exact number of machines to proceed

#274
post #242
post #65

Earlier quoted context omitted.

Came here for this. A: “Passing control” B: “Taking control” A: “You have control” B: “I have control” This is how I remember it (6174, UH-1Y).

Rock climbing is remarkably similar. When a climber begins up a route the standard exchange with their belayer (the person managing the rope and keeping them alive in a fall) goes something like A: "Belay on?" B: "Belay on" A: "Climbing" B: "Climb on" Then the climber begins. It's interesting to me that highly regulated and totally unregulated activities have evolved extremely similar processes. I suppose having your…

"On belay?"

"Belay on"

Swapping the order of the words helps further.

Re: Type in the exact number of machines to proceed

#275

I've seen this called "pointing and calling" [1], Japan's train drivers use the technique to force themselves to perform actions and take notice of the current environment. I personally took it to heart, it's a good system for forcing a cache miss in the brain - make sure you're on "database production" or "database localhost" etc. [1] https://en.wikipedia.org/wiki/Pointing_and_calling

I have had many disasters in my software career because I jut wantonly hit "Y" without thinking about it.

I have noticed, since learning to cook at a professional level in the kitchen, that I point and call out a lot more in my other activities too. "From hot behind" and "knife" and "oven is over temp" to "Saw blade is live" and "circuit is live" in the workshop to "production server" and "erasing records" in database maintenance. Some days I feel like Sigourney "I have one job damnit" Weaver in Galaxyquest. It's a useful stop-think-go sanity check.

Re: Type in the exact number of machines to proceed

#276
post #71
post #62

I have a habit of creating cli tools, which potentially do dangerous things, to default to dry-run mode. For example, instead of the typical `--dry-run` or `-n` option, my scripts instead had a cheesy `--do-it` to be non-dry-run. It is annoying as hell to my colleagues, but saved the day many times.

I did this with "--im-not-scared" for production mode :D

We had one that required "BADIDEA" to run

Re: Type in the exact number of machines to proceed

#277

Reminds me of the proposal to keep the nuclear launch codes inside the body of an innocent volunteer, so the President would have to kill the person to get the codes. https://boingboing.net/2015/12/11/proposal-keep-the-nuclear-...

I've never understood this idea. If you believe we should never use nuclear weapons, then don't have them at all. If you believe there is a case where it may be moral and rational to use nuclear weapons, why would you want to put a potential barrier in the way of their use? You could have a situation where everyone was agreed to use them but the president was physically unable to harm the aide to use them. You can kn…

> If you believe we should never use nuclear weapons, then don't have them at all.

Tell that to Russia. In the short amount of time only the USA had the bomb the USA bossed them all over with threats of using it.

Re: Type in the exact number of machines to proceed

#278
post #62

I have a habit of creating cli tools, which potentially do dangerous things, to default to dry-run mode. For example, instead of the typical `--dry-run` or `-n` option, my scripts instead had a cheesy `--do-it` to be non-dry-run. It is annoying as hell to my colleagues, but saved the day many times.

A coworker of mine would write all his bash scripts to echo out the commands it would run, and then to actually run it he would pipe it to bash. This way he could inspect the commands to make sure they were correct before running them. Something like: ./dangerous-script.sh $args | bash

[deleted]

Re: Type in the exact number of machines to proceed

#279
post #62

I have a habit of creating cli tools, which potentially do dangerous things, to default to dry-run mode. For example, instead of the typical `--dry-run` or `-n` option, my scripts instead had a cheesy `--do-it` to be non-dry-run. It is annoying as hell to my colleagues, but saved the day many times.

A coworker of mine would write all his bash scripts to echo out the commands it would run, and then to actually run it he would pipe it to bash. This way he could inspect the commands to make sure they were correct before running them. Something like: ./dangerous-script.sh $args | bash

Is your coworker Willard Van Orman Quine?

Re: Type in the exact number of machines to proceed

#280
post #166

Earlier quoted context omitted.

Re: Beards, color of: Mine started turning grey in my mid 20s. Could be related to me doing the electricians equivalent of deleting production DBs. I've drilled through the comms cable to payment terminals during opening hours. I've run over a copper gas line with a scissor lift. And yes, I've cut live 230V cables with hand tools. That sinking feeling in your stomach you get immediately after doing something bad - it…

This reminds of a quote from, I think, Discworld. > You're a survivor. > But I've nearly died, dozens of times. > Exactly.

Sounds like Rincewind. See also the octogenarian barbarians who are so deadly precisely because they've had a lifetime of experience of not dying.
Post reply on HN