Kris ([info]hutta) wrote,
  • Music: Simon & Garfunkel - A Simple Desultory Philippic (or How I Was Robert McNamara'd Into Submission)

Well, Fuck.

I decided to go home for lunch yesterday. While I was there, I decided to quickly try to clean up the directory the hutta.com website sits in. To get to the point, I deleted all of my livejournal tools. The gender tool, the word count, the friends quiz, the friend fusion and most upsettingly, the haiku finder.

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 dj
The 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.

  • Post a new comment

    Error

    Your reply will be screened

    Your IP address will be recorded 

  • 80 comments
Previous
← Ctrl← Alt
  • 1
  • 2
Next
Ctrl →Alt →

[info]babimac

April 8 2004, 13:11:18 UTC 8 years ago

I decided to go home for lunch yesterday.

now see, that's where you went wrong...

[info]evel66

May 9 2005, 02:54:37 UTC 7 years ago

Hahaha I totally agree there.

[info]pankof

5 years ago

[info]hoodedmongoose

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 ;-)

[info]komradery

April 8 2004, 19:05:14 UTC 8 years ago

Okay, I'm....pissed. Get them back up dammit! I wanna see how masculine my journal is!
Toodles!
~Komrade

[info]tiedyedsmurf

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!

[info]ferretsnax

July 1 2004, 01:42:19 UTC 7 years ago

Re: oh fucks that sucks

great icon!

[info]restoredhealth

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.

[info]veiledexistence

April 9 2004, 04:49:17 UTC 8 years ago

FIX IT FIX IT FIX IT FIX IT FIX IT FIX IT FIX IT FIX IT FIX IT ...


....


..

FIX IT FIX IT FIX IT

[info]incubus_junkie

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 NOW

[info]lifftchi

April 9 2004, 06:19:27 UTC 8 years ago

heh. Sorry to hear it. Unix lets you shoot yourself in the foot very efficiently.

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.

[info]hutta

April 9 2004, 06:30:39 UTC 8 years ago

Fixed, thanks.

I'm surprised Safari was hiding that from me. I normally do my testing under Mozilla (FreeBSD).

[info]lifftchi

8 years ago

[info]hutta

8 years ago

[info]jgarland79

April 9 2004, 20:20:36 UTC 8 years ago

Doh!

http://freshmeat.net/projects/recover/

[info]hutta

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.

[info]tehh4x0r

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.

[info]hutta

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.

[info]raindrift

8 years ago

[info]hutta

8 years ago

[info]maximill

April 10 2004, 10:22:36 UTC 8 years ago

that fuckin sucks and i hope you'll be able to fix it. i only discovered all these tools about a month ago and they're fuckin badass, so thanks for all your work!
this:
http://www.livejournal.com/users/maximill/30198.html
was classic! thanks man

[info]chrisdawg

April 10 2004, 11:32:29 UTC 8 years ago

Shame.

Good luck in getting the tools up and running.

[info]oh_la_la

April 10 2004, 13:35:06 UTC 8 years ago

i'm really sorry,
that must be a huge bummer.
{a random person
who randomly found
you}
oh, and hello :)

[info]flesh_removed

April 10 2004, 21:45:45 UTC 8 years ago

good luck with that. hah, i feel kinda dumb cause i could barely follow what you were saying in that entry. now you can laugh, too!

[info]jo_an_na

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...

[info]silverdragonia

April 11 2004, 20:18:23 UTC 8 years ago

good luck with fixing it and thanks cuz those tools are freakin great xD

[info]asirsephora

April 12 2004, 00:06:01 UTC 8 years ago

*sheds a little tear*

[info]icouldbeasleep

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.

[info]hutta

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?

[info]flamewing

April 12 2004, 13:46:30 UTC 8 years ago

that's a bummer about loosing all of the tools. Thanks for the look into the workings of Unix commands though...I learned something about them. What OS are you running?

[info]hutta

April 12 2004, 14:13:12 UTC 8 years ago

FreeBSD. The shell (where the magic happened) is bash 2.

[info]flamewing

8 years ago

[info]162

April 12 2004, 17:30:40 UTC 8 years ago

:( Noooo!
Get them back up! I cannot live without my irritating memes!!!

[info]afootatcirclek

April 13 2004, 03:27:46 UTC 8 years ago

damn...i wanted to see how feminine those rating communities are..

oh well. youre forgiven

[info]hobbledehoy

April 13 2004, 12:09:26 UTC 8 years ago

your 'other things to do' are first-rate. thanks for using that space for good things.

[info]jamison3star

April 13 2004, 13:24:14 UTC 8 years ago

Make Them Live!!
(another random person who stumbled over the word count on a friends journal and was incredibly saddened by it's death)
soooo helloo thar

[info]hutta

April 16 2004, 16:28:06 UTC 8 years ago

Okay, the Word Count is back up... Knock yourself out:

http://hutta.com/lj/toys/livejournal/wordcount/

[info]radhanicole

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.

[info]switchknife

April 13 2004, 16:57:27 UTC 8 years ago

Ow, damn it, I can relate to the pain. But chill out and don't overwork yourself. (I'm probably the only person to say that, but...)

Destructive living room soccer is good.

[info]wellgull

April 13 2004, 21:55:48 UTC 8 years ago

Well... we've all done a rm -rf somewhere we shouldn't have. At least you weren't in / right?

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...
Previous
← Ctrl← Alt
  • 1
  • 2
Next
Ctrl →Alt →
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…