News for hackers. Stuff that matters.
Re:My 10 UNIX Command Line Mistakes by chalst on Sunday February 27, 2011 @11:26AM (#2268120)
I wanted to shutdown VPN interface eth0, but ended up shutting down eth1 while I was logged in via SSH

Not done that exact one, but I've added firewall rules that cut me out in exactly the same way.

Another favourite is typing "shutdown -h now" into the wrong terminal: I know a few people who have admitted to doing that.

Re:My 10 UNIX Command Line Mistakes by kree10 on Sunday February 27, 2011 @01:42PM (#2268486)
I always hated remote firewall changes. I usually had two terminals open. In one, I'd run my "cya" script that slept for a minute, restored the old firewall rules, slept another minute, then did a reboot. In the other terminal, I'd run the new firewall rules. If I didn't screw up, I'd go back to the other terminal to stop the "cya" script. If I did screw up, the worst case was a few minutes of downtime that I'd hope nobody would notice.
Re:My 10 UNIX Command Line Mistakes by gnosis on Sunday February 27, 2011 @04:32PM (#2269033)
You could also just save the current firewall config, and then have the script restore the saved config after a minute. No need to reboot.
Re:My 10 UNIX Command Line Mistakes by kree10 on Sunday February 27, 2011 @07:14PM (#2269416)
The script was: sleep 1 minute, then restore rules, sleep 1 more minute, then reboot. That first rule restore was so I could conceivably get things back in order before the reboot. I had the final reboot there in case the new firewall rules somehow killed my ssh session. This never happened, and I might have been able to ssh in again at that point, but I wasn't going to count on it.
Re:My 10 UNIX Command Line Mistakes by Dobbs on Sunday February 27, 2011 @06:44PM (#2269363)
I use either `at(1)` or a 5 min cron job that restores the firewall rules.
Re:My 10 UNIX Command Line Mistakes by lamby on Sunday February 27, 2011 @01:54PM (#2268523)
> Another favourite is typing "shutdown -h now" into the wrong terminal: I know a few people who have admitted to doing that.

http://packages.debian.org/sid/molly-guard is a good remedy for this :)

Re:My 10 UNIX Command Line Mistakes by xiongchiamiov on Sunday February 27, 2011 @08:57PM (#2269704)
Another favourite is typing "shutdown -h now" into the wrong terminal: I know a few people who have admitted to doing that.

I do that less now that the machine's hostname is prominently displayed in my prompt.

Re:My 10 UNIX Command Line Mistakes by code_duck on Sunday February 27, 2011 @11:13PM (#2270009)
Guilty of "Typing UNIX Commands on Wrong Box" here.

I thought I was logged into my home server. Turns out I shut down the main web server. Oops!