5 ms·
This kind of tool needs context awareness to be useful. After the first 30~40 times you’re asked if you want to delete these pods, solving the question coming
by makeitdouble 4y ago
This kind of tool needs context awareness to be useful.
After the first 30~40 times you’re asked if you want to delete these pods, solving the question coming next becomes automatic. If you’re in a “I’m on my dev env, nothing bad can happen” mindset, that prompt won’t get you out of it, it will just be a tedious step, we’ve seen that time and time again.
It becomes a lot more interesting if it can ask “you’re going to delete from the cluster prod, do you really want to ?” and only do so for production.
Same for “rm -f” really, if it can confirm before you’re deleting a tree of thousands of file, and not when it’s 3 empty directories you created 3 min ago.
- rootw0rm 4y agomy main response to this HN submission was lolwtf. but your more measured response is valuable. this tool with context could actually be pretty cool.
- eladkaplan 4y agoI agree that the context will be better and I'm planning to add it in the next releases.
- davedx 4y agoWhen I used to admin Windows servers we had production’s desktop background set to red, that worked well, especially when you had multiple remote desktop sessions open. Wonder if that’s doable for non-GUI enabled Linux servers
- t-3 4y agoThe standard way is to set PS1 (the commandline prompt text) to indicate the environment. With escape codes, you can pretty trivially get some flashing red text telling you to be careful.
- hobs 4y agoIf used properly the -Confirm parameter in powershell can also have you change the impact level in your environment and ask for confirmation on things that in dev would not be cared about. Also its underused but the just in time access stuff where you can grant users subsets of permissions (again, per environment) is also pretty impressive.
- formerly_proven 4y agoA not-so standard way is to output a banner via shrc (instead of putting it in the motd, which the ssh daemon will only output for interactive sessions) - which incidentally will also break pretty much all tools using SSH as a transport (scp, rsync, among others).
- linschn 4y agoI use the color of tmux's bar to the same effect.
- qalmakka 4y agoThat was also the case in very old Linux distros when you logged on X as root. I clearly remember something like Fedora or Mandriva doing exactly that - note that graphically logging in as root on a Unix system is not a great idea though, most GUI software isn't designed for it.
- 867-5309 4y agothe terminal background could be changed from black to red
- detaro 4y agoSuSE had bright red background with exclamation mark signs and bomb icons
- NathanielK 4y agoOther applications can do it too. I recall the Gnome file browser having a big red warning banner if you decided to launch it with gksudo.
- orev 4y agoIt’s pretty easy to insert colors into to prompt using conditional logic in things like bashrc. You can also add them to other system tools like ‘screen’ and (I assume) ‘tmux’. People can override them if they want, but it’s a good starting default (and people rarely override defaults on a fleet of servers).
- iso1631 4y ago20 years ago our live/test/dev solaris + linux environments had different coloured prompts (green/yellow/red) Hasn't really been best practice in many workflows to connect to servers at all for a decade
- yencabulator 4y agoMy prompt only includes username if it's not the usual one, and it's on an orange-red background if it's root. Similarly, my prompt doesn't include the host when I'm logged in normally, adds it when I'm in a shell via sudo/doas, and colors it when I'm logged in via SSH.
- deleted 4y ago[deleted]
- lamontcg 4y agoThis is the same logic as "sudo forces people to think about what they're typing", which it doesn't, it just makes you type sudo and your password really quickly and equally mindlessly.
- iso1631 4y agosudo sticks what you're doing in your auth.log file which is fired off to your syslog server, so you've got a chance of knowing how you messed up, or who else messed up
- lamontcg 4y agowe solved that at amazon by patching bash and tcsh to send logs to syslog (honeypot patches).
- Kaze404 4y agoIt does once you get past using sudo as second attempt at running a command that failed for a reason you don't understand.
- lamontcg 4y agoNo it really doesn't, you just get quick at typing "sudo shutdown -r now" and typing your password quick and when do that it on prod it is just as mindless as "shutdown -r now". You can't make people think via extra steps.
- Kaze404 4y agoSurely that's just your view on it? I've been using Linux since I was a kid and it's definitely not how I or the people I know use sudo. Lol
- a-dub 4y agoi think a better approach might be to wrap destructive actions with preview functionality that is carefully tuned to summarize succinctly what is unique about resources that are going to be deleted along with the cardinality of the operation.