Entrepreneur Geek

Nirav Mehta on life, technology and future

Archive for the ‘tips’ tag

Finding number of lines in files recursively

without comments

I wanted to find the number of lines from a set of files – spread out in nested directories. The shell command “wc” is best for finding number of words / lines in files but it does not have an argument for recursive searching.

Here’s a quick shell command sequence that will find you the line count from all files in a directory – recursively.

find /topleveldirectory/ -type f -exec wc -l {} \; | awk '{total += $1} END{print total}'

Replace “/topleveldirectory/” with your directory of choice. Leave it as “.” to find from current directory and below.

Found on Unix.com

Written by Nirav

December 25th, 2009 at 10:07 am

Posted in Apple, GNU/Linux

Tagged with , ,

Coding Clean and Semantic Templates

without comments

If you are the guy who uses<div> tag for everything, this post is for you. It focuses on how you can write clean HTML code by using semantic markups and minimize the use of <div> tag. Have you ever edited someone’s templates, don’t those messy tags drive you crazy? Not only writing clean templates can benefit yourself, but your team as well. It will save you time when you have to debug and edit (particularly the large projects).

This post is a collection of some simple yet effective techniques. Read all tips over on Web Designer Wall.

Written by Nirav

December 17th, 2009 at 10:56 am

Thunderbird Productivity Tip: Folder Views

without comments

I was surprised when I discovered this feature! It helped me focus on relevant emails in Thunderbird. All I had to do, was click on two arrows! Ok, let me get to the point!

Thunderbird shows All Folders by default. But there are two arrows next to “All Folders” that allow you to navigate between All, Recent, Favorite and Unread folders. Keeping my view to show only Recent folders reduces a lot of eyeball movement and helps me stay focused! Here’s the “before and after” view of my folders!

BTW, another tip! Use Vertical View Layout for message display. The three pane view with folders on left, message list in center and message content on right. This works super especially in wide screens.

Written by Nirav

November 10th, 2008 at 3:11 pm

Bathroom Manners you never paid attention to

with 2 comments

Men, make sure to lift the toilet seat before urinating; if you are concerned about the sanitary conditions, you can use your foot to gently lift the side of the toilet seat up or down.

If you think that’s funny, think again! That’s one of the bathroom etiquettes you should follow. Adam Lowe runs a podcast – Modern Manners Guy on Quick And Dirty Tips. He has covered bathroom manners in good length in one of the podcasts. It’s definitely worth a listen / read. I not only learned some, but also had a good time reading them! I have now subscribed to the transcripts as RSS!

And while we are on the topic, a couple of images on the topic!

Don\'t squat on the toilet seat!

Don’t Squat On The Toilet Seat, a poster in Bali (From: Travelogue Bali 2003)

Toilet Manners in Indian Railways

A notice about Toilet Manners in trains of Indian Railway (From: Numbered Accounts)

Written by Nirav

June 11th, 2008 at 2:44 pm

Posted in Misc, Recommended Reading

Tagged with , , ,