Wednesday, January 28, 2009

Finding stuff in Unixland with Grep or Find

Sometimes you need to find something somewhere in your filesystem. Forget where thought. You remember it was in a PHP file somewhere, though.

The classic way I was taught was with a find -exec {} command:

find . -name "*.php" -exec grep -H "title phonetitle" {} \;

But, in reading the man page for grep, I see it has a -R option, for recursive. So, which is faster? Find or grep?

First, the classic find -exec command. I've suppressed the output from grep for clarity:


[buzzaboutwireless@ad cms]$ time find . -name "*.php" -exec grep -q "title phonetitle" {} \;

real 0m0.657s
user 0m0.182s
sys 0m0.487s


Now, for the recursive grep:


[buzzaboutwireless@ad cms]$ time grep -Rq "title phonetitle" .

real 0m0.251s
user 0m0.083s
sys 0m0.165s


Way faster. Neat. Less typing too.


Next: To prove black is white. I'll just remember to watch out for the zebra crossings.

Tuesday, January 20, 2009

Stop Foreclosure Scam

Two men convicted in Kansas foreclosure scam - Kansas City Star:

"The government accused the men of persuading people behind in mortgage payments to pay a monthly fee to stop foreclosure proceedings.

Under federal law, a bankruptcy filing triggers an automatic freeze on foreclosure sales."

Always wondered how many of those ads you saw were just wrappers around a bankruptcy filing. Now we know at least one was...

Saturday, January 10, 2009

Heck of a Good Deal!


Got an offer in the mail today where I could earn up to $200 a year back on my purchases.  Pretty good deal - and as an incentive, they gave me two checks for $5.00 each - so up to $210 the first year, and I'm $10 up right out the gate!  Nice deal!

Check the fine print though - by cashing the checks, you agree to be enrolled in two different 'savings' programs, at an annual cost of $120 per year, per program.

So, the net savings by enrolling is this great deal?

$100 savings, program 1
$100 savings, program 2
-$240 membership fees
--------
-$40 cost out of my pocket, just so I can 'save' some money.


Oh, I forgot to mention the free week of Jazzercise lessons they'll throw in.

Seriously.

Reading the fine-fine print, turns out to get this $200 back, you have to save all your purchase receipts, and mail them into a special PO box one time per year.    Very nice.  How kind of them to only require a single mailing per year of receipts.

So, just for some Googlefodder:  Buyers Advantage is a SCAM.  Just for Me is a SCAM. Ripoff.  Complaint.  HSBC.  M. Tremaglio. 

Monday, January 05, 2009

Izza Dog!

Saturday night, Alec and I went to see Marley and Me - a movie about the worlds worst dog. Last week, we had decided that we didn't want to get a dog right now. Ok, well, I decided.

After seeing the movie - what'd we decide to do? Get a dog. Went to The Pet Connection in Mission KS to see who was there and they had a pair of 7 month old black lab mix puppies. One of them is home with us now.

His name is either 'Sam' or 'Doc'. He came from the shelter as Sam, and for a couple of hours we tried out Doc. Doc is too close to Dog, though...

Bizzare situation - they were raised in Osceola, MO at the shelter. Dropped there as 8 week pups. How they could fail to adopt a lab puppies I don't know, but my good fortune (?). So, Sam (or Doc) is effectively a blank slate. No bad experiences, no real training either. And he's never seen stairs. Will not go up or down the stairs in the house for love or treats. Sigh.

Should be an interesting time. He does sleep well in his kennel fortunately. And the cats are doing just as I hoped they would - Kiki is hiding all day and Random just looks at the dog like a disease. Sam looks at the cats no differently than furniture, so that's good so far. Not letting him roam alone in the house for a few months though.




Saturday, January 03, 2009

Be Happy

From a Slashdot post of all places:
One of the best and most lasting ways of becoming happy is to surround oneself with people that makes you feel happy. If the people around you do not make you happy, it's not their fault. You're responsible for your own happiness. You choose them. Choose people that makes you feel happy.

Friday, January 02, 2009

Fail

 New year, time to check the finances. Epic Fail.   I've seen worse, but not by much.