News for hackers. Stuff that matters.
Re:An administrator accidentally deleted the production data... by schlowmo on Wednesday March 23, 2016 @10:35AM (#11344808)
I think the "wrong shell incident" is quite common:

"Just need to load this dump to the testing database and I'm on my way to weekend...ok done...oh wait, if I look closer, this shell isn't the testing system...hell noooo, just nuked 8 hours of work each from 20 product managers."

Literally happend to me when I was a working student at a DAX 30 corporation. Never happend to me since then again.

Re:An administrator accidentally deleted the production data... by hollander on Wednesday March 23, 2016 @02:42PM (#11347097)
To prevent this I change the PS1 in the bash config. For servers I use a different prompt format.

For my local computer:

hollander@mypc 19:30:45 ~ >

For servers:

[hollander@server01 19:30:45 ~]

This all with coloring for name, servername, time and filepath, different for local computer and server. Root and username have different colors as well.

Re:An administrator accidentally deleted the production data... by noir_lord on Wednesday March 23, 2016 @03:49PM (#11347630)
Local's are green, staging is orange, production is bright red.

Saved me a whole bunch of times when tired.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @07:11PM (#11349087)
Can you paste in the shell codes you use?
Re:An administrator accidentally deleted the production data... by noir_lord on Wednesday March 23, 2016 @08:03PM (#11349449)
Red

export PS1="\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\h\[\e[m\]\[\e[31m\]:\[\e[m\]\[\e[31m\]\W\[\e[m\] "

Orange

export PS1="\[\e[33m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[33m\]\h\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[33m\]\W\[\e[m\] "

Green

export PS1="\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]\[\e[32m\]:\[\e[m\]\[\e[32m\]\W\[\e[m\] "

As always you can tailor them if you prefer different things to be different colors, I'm often lazy and don't change local machines to green but always change staging to orange and production to red.

Re:An administrator accidentally deleted the production data... by eric_h on Wednesday March 23, 2016 @11:40AM (#11345427)
It's common enough that I made sure our AWS boxes put the name of the current environment both in the bash prompt and rails console prompts (production is in bright red, staging is a nice soothing purple :).
Re:An administrator accidentally deleted the production data... by RockyMcNuts on Wednesday March 23, 2016 @12:38PM (#11345990)
I actually make a terminal-window-size PNG of 'PRODUCTION' and 'TEST' and set it as the background gif at like 10% alpha in the terminal windows, which also have different background colors.
Re:An administrator accidentally deleted the production data... by twic on Wednesday March 23, 2016 @08:23PM (#11349568)
I set the background colour in our team's shared iTerm config. Green for CI, blue for the test server, yellow for staging, and we don't have access to production!
Re:An administrator accidentally deleted the production data... by eric_h on Wednesday March 23, 2016 @08:43PM (#11349678)
The thing I like about our setup is that it's completely independent of individual developers' setups. Some of us use iterm, some of us are okay with terminal.app (iterm 2 ftw!). All of the backend capable folks (three of us) do have access to production, but we use it very responsibly (helped by the white on a red background production in the console prompt)
Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @12:55PM (#11346176)
Oh boy, is it ever. I once had a Linux gateway without X installed on it, and I ssh'ed into a remote billing server. A friend called to see if I wanted to go out for lunch so I issued the shutdown -h now command.

I was trying to work out why the system wasn't responding right at the moment when I realised I hadn't logged out of the ssh session.