A twinkie? What's that?

Hostess Twinkies

Today being Valentines Day, I stopped by the store on my way home to buy Shauna a card and a small gift. Back when we were dating by mail many years ago (more than one decade, but less than two when I was working at First Interstate Bank in Las Vegas) I once sent Shauna a card that said:

You are the twinkie in my brown bag lunch of life

She thought that was a very sweet thing for me to have said. So from time to time I'll buy her a twinkie as a reminder that she still is the twinkie in my brown bag lunch of life. (Tonight I bought a twinkie and a card! And even asked for a paper bag at checkout instead of a plastic one. I'm such a romantic...)

So this evening as we were getting read to have dinner Meghan and Caleb saw that I'd given her something and they asked "what did Dad get you?" "A card and a box of twinkies—you can have one after dinner." "A twinkie? What's that? What's a twinkie?"

I guess Hostess would probably be very disappointed with our parenting skills. Me, I'll just attribute our children's ignorance to a profound lack of TV watching.

— Michael A. Cleverly

98 comments | Printer friendly version

Protecting Windows users with hard links

A friend of mine was called in to a small architectural firm that he'd done some consulting work for in the past because of a delicate situation. It seems one of their employees had been clicking & dragging in Windows and had mistakingly trashed a lot of the companies project files that were shared via Samba from a Linux server. Oops.

Turns out the company doesn't have any recent backups because the employee who had been responsible for making backups had died (unexpectedly) of a heart-attack last year. Double oops. :-(

My friend was able to recover a lot of their data by using The Coroner's Toolkit, but it was a fairly tedious process. One would have hoped this company had learned their lesson...

But a few days later someone else accidentally deleted other files. Triple oops.

When I heard this story I asked "gee, what's it going to take to keep these guys from repeatedly shooting themselves in the foot?" My consultant friend could stand to make a pretty penny undeleting files for them, but obviously all parties involved could make better use of their time.

So I said "hey, you know... in Unix a file isn't deleted until it's hard link count goes to zero." Suddenly an obvious solution materialized in my mind. Write a program that monitors a particular set of directories. For each unique file it finds make a hard link to it in another location. (The only caveat being that hard links cannot span partitions or file systems.) If you built up a database of known files you could easily determine which files had been deleted and easily restore them by making a hard link back.

This solution seemed particularly elegant in that you could also track when a file had last been seen and then, if it hadn't been restored in a certain time period, delete the "backup" hard link, thus freeing the disk space. If this architectural firm had this type of system then my friend could quickly restore files for them in a matter of seconds as long as they noticed their mistake within (say) a month.

So at this point it was pure vaporware. (There may well be utilities out there, commercial or OSS that do this, but I've never actually looked for them.) I was just thinking outloud.

Next thing I knew a day or two later I got a call: "the company wants to buy this software. They'd be willing to pay $495 for it if you can create it quickly." I said OK as long as I got to keep the copyright.

Wow. My first contract for pure vaporware!

So last Saturday I wrote fguard (short for file guard). It was a 500-or so line Tcl script that uses the Unix find and ln (for a lot of the heavy lifting) and keeps a database of known files in sqlite. Two cron jobs later (one to do daily scans, and another to expire deleted files after they've gone thirty days without being restored) and the company should feel less pain next time they shoot themselves in the foot.

At this point I should probably write take the time to write documentation and release it (if there's interest; it's really such a basic idea...)

— Michael A. Cleverly

103 comments | Printer friendly version

Ten tips on writing a book from a 3rd-grader

Last night Shauna & I discovered a page of notes that Meghan had written for herself last Wednesday when we'd gone to the Utah Sports Hall of Fame award dinner to see Shauna's father receive that organizations Distinguished Service Award.

Meghan signed her name at the bottom and dated it "Wed. 2-23-06 [sic] @ Grandfather Cleverly's house." A postscript reads "Note: use while writing" and another "I was doing this while Grandpa wrote the book `Dorothy'."

I'm probably just a proud parent, but this seems like good advice to remember regardless of age. What follows is Meghan's advice retaining her original spelling and punctuation but presenting it in a numbered HTML list:

  1. Think about what you know.
  2. Take your time as you write.
  3. (Don't hurry through it. :-)
  4. From time to time review what you have written.
  5. Make sure you spell words correctly, your sentences make sense.
  6. Make sure you use the right punctuation.
  7. Beginning of setence should start with a capital, your proper nouns are capitalized.
  8. Make sure there are spaces in between words and make sure you can read your writing.
  9. What you would usaly do is when you are finished with your book read through it and think what it is about then name your book. (You don't have to do it this way, but it is easier to do.)
  10. Let someone else read your work before you send it to the publisher.

— Michael A. Cleverly

110 comments | Printer friendly version

-> Next month (with posts)
-> Last month (with posts)