Earlier quoted context omitted.
Once I wanted to do `rm -fr *~` to delete backup files, but the `~` key didn't register... Now I have learnt to instinctively stop before doing anything destructive and double-check and double-check again! This also applies to SQL `DELETE` and `UPDATE`! I know that `-r` was not neccessary but hey that was a biiiig mistake of mine!
One time I was debugging the path resolver in a static site generator I was writing. I generated a site ~/foo, thinking it would do /home/shantaram/foo, but instead it made a dir '~' in the current directory. I did `rm -rf ~` without thinking. Command took super long, wondered what was going on, ctrl-c'd in horror... that was fun.
The day I locked everyone out of the company intranet
121–130 of 130 posts
Re: The day I locked everyone out of the company intranet
#122Re: The day I locked everyone out of the company intranet
#123Earlier quoted context omitted.
One time I was debugging the path resolver in a static site generator I was writing. I generated a site ~/foo, thinking it would do /home/shantaram/foo, but instead it made a dir '~' in the current directory. I did `rm -rf ~` without thinking. Command took super long, wondered what was going on, ctrl-c'd in horror... that was fun.
I’m really curious: without cheating by using the GUI, what would be the proper way to delete such an obnoxiously-named directory? Would “$PWD/~” work?
rm ./~ is likely the easiest.
Another option, shell dependent, would be to turn off shell globbing.
The `GNU` version of `find` has a `-maxdepth` option so
find . -iname '~' -maxdepth 1 -exec rm {} \;
would work, but I don't like relying on `GNU` extensions.
Re: The day I locked everyone out of the company intranet
#124Decades ago my ex colleague was supposed to enter a command handwritten on a piece of paper saying "rm -rf /var/log/blah/ " which she typed in as "rm -rf /var / log/blah / ". Everyone knows it's awesome to insert white space to increase legibility. It was a production database server.
That’s an insane command to pass to an untrained person on a piece of paper to type into the terminal of a production server.
Re: The day I locked everyone out of the company intranet
#125Re: The day I locked everyone out of the company intranet
#126My manager had got me to look at backups.. but for cheap. I decided on bacula - I had the clients installed on all the computers in the office, and it worked for some small tests. My manager decided we would try this with a USB drive attached to one of the servers (somehow this didn't seem like a bad idea). In the morning, very uncaffinated he sent me to the other site - an unmanned basement office with the servers.…
Not only an USB (1?) could cause it but also a cifs transfer over a 100 Mbps link.
Re: The day I locked everyone out of the company intranet
#127I was working on an old old old "ERP" system written in D3 PICK. It's a database, programming language and OS all in one with roots in tracking military helicopter parts in the 1960's. I was working on it in the mid-2000s. It had SQL like syntax for manipulating data, but it was interactive. So you would SELECT the rows from the table that you wanted, then those rows would be part of your state. You would then do UPD…
Re: The day I locked everyone out of the company intranet
#128Earlier quoted context omitted.
Once I wanted to do `rm -fr *~` to delete backup files, but the `~` key didn't register... Now I have learnt to instinctively stop before doing anything destructive and double-check and double-check again! This also applies to SQL `DELETE` and `UPDATE`! I know that `-r` was not neccessary but hey that was a biiiig mistake of mine!
For entirely critical systems, I by now rather generate a reviewable script and run that. Something along the lines of: find /backups/ -mtime '-30' -printf 'rm -f %p\n' > very_scary_deletes.sh This gives you a static script with a bunch of rm's. You can read that, check it, give it to people to validate and when you eventually run it, it deletes exactly those files.
Another way is sometimes: `echo *.txt~` and when you like the result, replace `echo` with `rm`.
Re: The day I locked everyone out of the company intranet
#129Earlier quoted context omitted.
For entirely critical systems, I by now rather generate a reviewable script and run that. Something along the lines of: find /backups/ -mtime '-30' -printf 'rm -f %p\n' > very_scary_deletes.sh This gives you a static script with a bunch of rm's. You can read that, check it, give it to people to validate and when you eventually run it, it deletes exactly those files.
That's clever, only do really dangerous things if you have a way to carefully review the steps. Another way is sometimes: `echo *.txt~` and when you like the result, replace `echo` with `rm`.
Re: The day I locked everyone out of the company intranet
#130Earlier quoted context omitted.
I’m really curious: without cheating by using the GUI, what would be the proper way to delete such an obnoxiously-named directory? Would “$PWD/~” work?
A few ways. rm ./~ is likely the easiest. Another option, shell dependent, would be to turn off shell globbing. The `GNU` version of `find` has a `-maxdepth` option so find . -iname '~' -maxdepth 1 -exec rm {} \; would work, but I don't like relying on `GNU` extensions.