Entries from December 2007 ↓

Good reads for the last day of the year!

It’s the last day of 2007, and everyone is busy writing 2008 predictions, or celebrating. Since I am busy celebrating, I will rather point to two good reads for this last day of the year!

I know, I should include more links.. But we have a year end party in the office, and I want to get back to it ;)

 

10 Resolutions to boost your business

It’s New Year around. And it’s time to make some new resolutions!

Read an interesting article from Miles Burke on SitePoint about 10 Resolutions to boost your business. All of them are true! Many would be what you already know! But we often miss them in the daily chores!

Here’s a summary:

  1. Start setting goals.
  2. Ask a client for a referral.
  3. Focus on profit, not turnover.
  4. Learn something new about business.
  5. Take time for yourself.
  6. Create products that generate income.
  7. Delegate effectively.
  8. Focus on client service.
  9. Take time to wander the Web.
  10. Build rock-solid procedures.

 

Search and Replace Recursively using sed and grep

I have done this so many times, still I find a new problem doing recursive search and replace each time! Here's one small shell script that puts the issues I had on the Mac doing search and replace on a directory recursively.

Save the file as rpl.sh, chmod it 755, and execute it like:

CODE:
  1. ./rpl.sh folderContainingFiles/ oldText newText

Does the job for me! This could be done in a single line, I got some ideas of using xargs etc, but all that did not work on my Mac (at least). So resorting to this.

CODE:
  1. #!/bin/sh
  2. grep -rl $2 $1 |
  3.  while read filename
  4.  do
  5.  (
  6.   echo $filename
  7.   sed "s/$2/$3/g;" $filename> $filename.xx
  8.   mv $filename.xx $filename
  9.  )
  10.  done

And yes, if you are going to use this, take a little time and do some argument checking before passing them around! Unless you think only a God user like you is going to use it!

 

Men & Women - Thinking and Speaking

Men think to organize their ideas. Women speak their ideas to organize them!

 

Merry Christmas

Merry Christmas