Unix systems allow you to create symbolic links; pointers from one directory to another. I had linked a directory called "dj" to my "lj" directory, where all of the livejournal stuff was. When I was trying to clean up, I happened upon the "dj" directory, and forgot it was a link. I remembered trying to get the tools to work with deadjournal, and thought I had just copied the "lj" directory to tweak it. What I had really done was to create the link, and started to make the detect what URL it was being accessed from, and automatically adjust its behavior.
Anyway, since I thought the "dj" directory was just an outdated copy of "lj", I decided to delete it. I tend to use tab completion in the bash shell habitually, even when it doesn't make sense. Here's what I should have typed:
/home/kgale/www/www.hutta.com/docs $ rm -rf djThe command "rm" is the delete (or "remove") command in Unix. I passed it the "r" flag (recurse into directories and delete everything in there, too) and the "f" flag (I know what the fuck I'm doing, don't ask me to confirm anything, no matter how stupid it seems). Instead of typing the last part, the name of the directory, "dj", I typed "d" and hit tab.
Tab completion lets you type the first part of a filename, then tab, and have the shell automatically complete it for you. This saves typing. In the case of a filename with two freaking letters in it, it doesn't save any typing at all. What it does do, though, is to add a "/" on the end of the directory name. This saves you typing if you want to refer to a file inside the directory, say "dj/index.html". The problem here is that the commandline became:
/home/kgale/www/www.hutta.com/docs $ rm -rf dj/Notice the trailing slash. This tells the shell that you're actually concerned with treating "dj" like a directory, and not like a regular file. For some reason, when dealing with symbolic links, this tells the system you're actually interested in deleting the directory that "dj" points to, not the link called "dj". This is nothing new to me, I've been a Unix admin for 6 years. Had I remembered (or checked) that "dj" was a symlink, I would have never used "-rf", to be sure that it wouldn't follow the link.
So there you have it, I'm a fucking dipshit. I'll be rewriting those tools this weekend, and I should probably be able to finish them if I can get some free time to work. This time around I plan on making them work with any number of livejournal clones (such as deadjournal, etc), and I'll have a pluggable system for adding new journal systems.
I could have started on this last night, but the az04 meeting turned into a weird game of destructive living room soccer, then a trip to a bar.
← Ctrl← Alt
Ctrl →Alt →
April 8 2004, 13:11:18 UTC 8 years ago
now see, that's where you went wrong...
May 9 2005, 02:54:37 UTC 7 years ago
5 years ago
April 8 2004, 16:02:10 UTC 8 years ago
Man, that sucks
Yea well, look on the the sunny side. It give you a chance to start your code from scratch, you know they say it takes 3 re-writes of a project to get it perfectly ;-)April 8 2004, 19:05:14 UTC 8 years ago
Toodles!
~Komrade
April 8 2004, 19:40:59 UTC 8 years ago
oh fucks that sucks
that explains it. good luck this weekend reworking them. and thanks for your time in making these tools for lj users, they're great!July 1 2004, 01:42:19 UTC 7 years ago
Re: oh fucks that sucks
great icon!7 years ago
April 8 2004, 23:06:37 UTC 8 years ago
I'm glad it was you
I thought it was me.....I just keep hitting refresh to no avail.April 9 2004, 04:49:17 UTC 8 years ago
....
..
FIX IT FIX IT FIX IT
April 9 2004, 21:03:15 UTC 8 years ago
that sucks major monkey testicles..but fix it fast
yes yes yes..i whole-heartedly agree..FIX IT AND FIX IT NOW8 years ago
April 9 2004, 06:19:27 UTC 8 years ago
Anyway, I think you should configure the server to send the document explaining this mishap as text/html, rather than text/plain . My browser (mozilla/linux) actually respects the mime type, making the document less-than-readable.
April 9 2004, 06:30:39 UTC 8 years ago
I'm surprised Safari was hiding that from me. I normally do my testing under Mozilla (FreeBSD).
8 years ago
8 years ago
8 years ago
7 years ago
April 9 2004, 20:20:36 UTC 8 years ago
Doh!
http://freshmeat.net/projects/recover/April 9 2004, 21:25:46 UTC 8 years ago
Re: Doh!
Not Linux, not ext2... But thanks.I could have grepped the raw disk device (I've done this years ago to recover some deleted ACME articles), then reassembled the files, but it really is best that I just rewrite. The new system is much, much better than the old.
April 9 2004, 20:40:59 UTC 8 years ago
hmmm
backup, backup, backup... At least you don't have to worry about some random Windoze virus eating up your server. Or the server going down every 20 minutes.April 9 2004, 21:28:23 UTC 8 years ago
Re: hmmm
Yeah, I had planned on making a cron job to tar up the whole web directory, but I never got around to it. I didn't realize I cared about any of the data. Because of this, I think I'm going to try to coin a new backup axiom:You should always set up your automated backups before you have data worth backing up.
8 years ago
8 years ago
8 years ago
April 10 2004, 10:22:36 UTC 8 years ago
this:
http://www.livejournal.com/users/maximi
was classic! thanks man
April 10 2004, 11:32:29 UTC 8 years ago
Shame.
Good luck in getting the tools up and running.April 10 2004, 13:35:06 UTC 8 years ago
that must be a huge bummer.
{a random person
who randomly found
you}
oh, and hello :)
April 10 2004, 21:45:45 UTC 8 years ago
April 11 2004, 15:18:28 UTC 8 years ago
Hmm...
All worked up to try the haiku finder and then ~bam~ you strike me down...April 11 2004, 20:18:23 UTC 8 years ago
April 12 2004, 00:06:01 UTC 8 years ago
April 12 2004, 09:27:52 UTC 8 years ago
No one ever told me...
that there was a haiku finder.Well on the bright side, at least you aren't Weird Al. His parents died of CO poisoning, y'know.
April 12 2004, 11:21:06 UTC 8 years ago
Re: No one ever told me...
Wouldn't it be disastrously hilarious if my parents had also died the same way?8 years ago
April 12 2004, 13:46:30 UTC 8 years ago
April 12 2004, 14:13:12 UTC 8 years ago
8 years ago
April 12 2004, 17:30:40 UTC 8 years ago
Get them back up! I cannot live without my irritating memes!!!
April 13 2004, 03:27:46 UTC 8 years ago
oh well. youre forgiven
April 13 2004, 12:09:26 UTC 8 years ago
April 13 2004, 13:24:14 UTC 8 years ago
(another random person who stumbled over the word count on a friends journal and was incredibly saddened by it's death)
soooo helloo thar
April 16 2004, 16:28:06 UTC 8 years ago
http://hutta.com/lj/toys/livejournal/wo
April 13 2004, 16:26:52 UTC 8 years ago
Shucks!
And I was truly looking forward to discovering masc or femme. Too bad for me.April 13 2004, 16:57:27 UTC 8 years ago
Destructive living room soccer is good.
April 13 2004, 21:55:48 UTC 8 years ago
Never mind the whiners ordering you to get stuff back online immediately, I mean you have a life to live and there is a world to save, right? That said, I am always idly curious as to whether the tool still thinks I'm female...
← Ctrl← Alt
Ctrl →Alt →