February 2008

Simple script to compare files in two directories..

Here’s a small script to compare the files in two different directories on a Linux machine. The script uses MD5 checksum to compare the files.

#\!/bin/bash
prefix1=“/usr/directory1″ # First directory without trailing /
prefix2=“/usr/directory2″ # Second directory without trailing /
find \-L “$prefix1″ \-type f \| while read filename; do
name=“${filename#$prefix1*}”
sum1=“$(md5sum \-b ”$prefix1$name“)”
sum2=“$(md5sum \-b ”$prefix2$name“)”
if \[ “${sum1% \*}” = “${sum2% \*}” \]; then
echo “ok: $prefix1$name”
else
echo “not ok: $prefix1$name”
fi
done

Excerpt from Jane Austin's Pride and Prejudice

As I was browsing the channels during some late night TV, I ended up watching the end of BBC’s Pride and Prejudice production. I believe this is one of the best productions of Pride and Prejudice. Here is a literal copy and paste from one of the last scenes in the book. Lizzy is asking her father’s blessing for her wedding with Darcy.

Her father was walking about the room, looking grave and
anxious.  "Lizzy," said he, "what are you doing?  Are you out
of your senses, to be accepting this man?  Have not you always
hated him?"

How earnestly did she then wish that her former opinions had
been more reasonable, her expressions more moderate!  It would
have spared her from explanations and professions which it was
exceedingly awkward to give; but they were now necessary, and
she assured him, with some confusion, of her attachment to
Mr. Darcy.

"Or, in other words, you are determined to have him.  He is
rich, to be sure, and you may have more fine clothes and fine
carriages than Jane.  But will they make you happy?"

"Have you any other objection," said Elizabeth, "than your
belief of my indifference?"

"None at all.  We all know him to be a proud, unpleasant sort
of man; but this would be nothing if you really liked him."

"I do, I do like him," she replied, with tears in her eyes,
"I love him.  Indeed he has no improper pride.  He is perfectly
amiable.  You do not know what he really is; then pray do not
pain me by speaking of him in such terms."

"Lizzy," said her father, "I have given him my consent.
He is the kind of man, indeed, to whom I should never dare
refuse anything, which he condescended to ask.  I now give it
to _you_, if you are resolved on having him.  But let me advise
you to think better of it.  I know your disposition, Lizzy.
I know that you could be neither happy nor respectable, unless
you truly esteemed your husband; unless you looked up to him
as a superior.  Your lively talents would place you in the
greatest danger in an unequal marriage.  You could scarcely
escape discredit and misery.  My child, let me not have the
grief of seeing _you_ unable to respect your partner in life.
You know not what you are about."

Elizabeth, still more affected, was earnest and solemn in her
reply; and at length, by repeated assurances that Mr. Darcy was
really the object of her choice, by explaining the gradual
change which her estimation of him had undergone, relating her
absolute certainty that his affection was not the work of a
day, but had stood the test of many months' suspense, and
enumerating with energy all his good qualities, she did conquer
her father's incredulity, and reconcile him to the match.

"Well, my dear," said he, when she ceased speaking, "I have no
more to say.  If this be the case, he deserves you.  I could
not have parted with you, my Lizzy, to anyone less worthy."

Simple pleasures in life : Getting a shave in India

If you have ever traveled to India, you would have noticed the omni present “Hair Styling” saloons. They vary from a guy sitting under the shade of a tree to pretty expensive “A/C” saloons. Most people in India (esp. the older generation) get their facial hair groomed at these saloons. I took the opportunity of my visit to India, to go to a saloon.. Here is how a shave goes 🙂

  • Rough massage on the  face with hot water mixed with some lime.
  • Slap on some shaving cream (you don’t want to know which brand) and whip up an awesome forth..
  • Open an old fashion shaving blade. In the old days, one blade was used for multiple people. Thankfully, they switch the razors for each person now :)..
  • Shave twice for an ultrasmooth finish. I don’t care what razor you use (tri blad, quad blade or the new 5 blade razors), you cannot get the same finish as an old fashioned shaving blade.
  • Slap on tons of facial cream all over your face.. I managed to glimpse at the cream and it looked like Nivea, but was spelled Nyvea.. Again, don’t pay attention to the brands 🙂
  • Nice massage of the face with the above mentioned facial cream.
  • Spray of cold water on the face.
  • Rub all the nicks (and there will be plenty 🙂 ) with some old fashioned aftershave cake.
  • Another dash of cold water on the face.
  • Wipe face with a warm towel..

The charge ranges anywhere from Rs. 20 – Rs 100 (~$2) and you come out of the saloon feeling like a million dollars :).. I will try to get some pictures next time..

2008 SuperBowl : Well worth the hype..

The NY Giants put on another exciting show tonight. I usually support the underdogs, and this was a case of the underdogs playing their heart out and winning the game. If I take data from the Superbowl party, I was at, as the sample data for how many people favoured the Patriots vs. the Gaints, I think 80% of the country is pissed off now that the Patriots lost..

Final Score : 17 Giants – 14 Patriots

I kept saying this line from the movie, The Replacements , throughout the superbowl party “Heart.. miles and miles of heart”.  That’s what it seemed the Giants had today. Congratulations to Eli Manning, on coming out of his elder brothers shadow and on being given the MVP award for the 2008 Superbowl..