More Terminal tidbits

fs_usage – somewhat like Systinternals’ Filemon, this command shows you a realtime list of all the filesystem activities – like what files are being accessed on your system along with the names of the applications that are accessing them. If you are seeing a lot of filesystem activity but are not sure what is causing it this tool can help you narrow it down to a specific application. Run it as root (sudo) otherwise it won’t work.

You might also want to look at lsof.

pbcopy – reads from stdout and copies the output to clipboard. Similar to what clip does on Windows. e.g.

ls | pbcopy

will paste the output of ls to clipboard.

pbpaste – does exactly the opposite of pbclip, i.e. pastes the contents of clipboard to stdout which you can then pipe through other commands. e.g.

pbpaste | sort -r

open – finally a command that you can use to launch a file/application – e.g.

open .

will open the current folder in Finder.

Apple’s iMac announcement – India pricing and availability

Apple has priced the just-announced iMacs very aggressively in India. You still pay a slight premium over the US price, but unlike the iPods, it is a mere 8.2% in the worst case. Here is how the prices announced in India compare to what you’d spend in the US on the same machines:

iMac 21.5″ (MB950LL/A) 21.5″ (MC413LL/A) 27″ (MB952LL/A) 27″ (MB953LL/A)
$ 1,199 1,499 1,699 1,999
Rs. 64,900 79,900 89,900 106,900
$➙Rs. 59,950 74,950 84,950 99,950
Delta 4,950 4,950 4,950 6,950
% 8.26 6.60 5.83 6.95

Both 21.5″ iMacs sport a 3.06 GHz Intel Core 2 Duo processor and come with 4 GB RAM. The higher priced option (MC413LL) gets you a dedicated ATI Radeon HD 4670 with 256MB DD3 instead of the integrated NVIDIA GeForce 9400M. You also get a bigger hard-disk (1 TB instead of 500 GB).

The lower priced 27″ iMac (MB952LL/A) is basically the same machine as the higher priced 21.5″ iMac with a bigger screen. The higher priced 27″ option (MB953LL/A) gets you an Intel Core i5 quad-core processor and a better graphics adapter (ATI Radeon HD 4850 with 512MB of GDDR3 memory). The thing I really like about the 27″ machines is the fact that they now have a video input allowing you to use them as a external display.

The machines are expected to be available in 2 weeks’ time; except for the Core i5 iMac which might take till mid-end of Nov to arrive.

There is still no word on the pricing or availability of Core i7 variant – but then it is not something that Apple is selling as a ’standard’ option even in the US (you need to customize your machine to get it).

Enabling two-sided (duplex) printing on Mac

Recently while trying to print a web-page via Safari, I realized that the two-sided print option was disabled.

Two-Sided printing option is disabled

At first I thought it was something to do with Snow Leopard and HP’s printer drivers (the printer was an HP LaserJet P3005). However, even after installing the latest HP printer drivers the two-sided print option remained disabled.

It so happens that the printer driver was unable to automatically detect if the printer supports duplex printing and has to be “told” that the printer is indeed capable of doing so.

I went to System Preferences → Print & Fax. From there I selected the HP printer (the only one installed on my system). I then clicked the Options & Supplies button and in the resulting dialog, selected the Driver tab.

System Preferences → Print & Fax

The checkbox that marked this printer as a Duplex Unit was unchecked so I checked it.

The Duplex Unit checkbox

Next time when I tried printing, I got a Two-Sided checkbox. Also the Two-Sided drop-down, that would allow me to pick which edge I wanted to choose for binding, was also enabled.

Two-Sided printing (aka Duplex Printing) is now enabled

Snow Leopard: A Developer’s Delight

Snow Leopard, just like its predecessor Leopard, is a developer’s delight. It ships out of the box with (in no particular order):

  • ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
  • Python 2.6.1
  • perl, v5.10.0 built for darwin-thread-multi-2level
  • svn, version 1.6.2 (r37639)
  • Apache/2.2.11
  • PHP/5.3.0
  • Java SE 6 (javac version 1.6.0_15)
  • SQLite version 3.6.12
  • gcc 4.2.1

And then you can also install XCode 3.2 or download the iPhone SDK.

I wish Apple also bundled MySQL/PostgreSQL.

Once you’ve installed XCode, you should also be able to compile a lot of open source software. I had an issue while compiling erlang where during the ./configure stage things would hang with the message:

checking for unreliable floating point execptions…

but it turns out that I was using an old R11 release, downloading the latest R13B01 release from erlang.org fixed that.

There is always MacPorts for those of us who don’t want to tinker with configurations, makefiles and such.

For those of us wanting to stay as close to our Linux production environment as possible, there is always the option of using a Linux virtual machine.

Apple’s newest iPods (Sep’09 Edition): Disappointing India Pricing

iPod shuffle, iPod nano, iPod classic, iPod touch
The iPods announced by Apple on 9th September at their It’s Only Rock And Roll event will be available in India shortly. (Shortly being another 2-3 weeks; and definitely before Diwali – the holiday season in India). Here are the prices. As usual, we’ve put up a comparison with the US dollar prices which should help you decide whether to buy them in India or have that friend/cousin pick them up for you in the US:

[We use a pessimistic conversion rate of 1 USD = 50 INR ]

iPod shuffle 2GB shuffle 4GB nano 8GB nano 16GB classic 160GB touch 8GB touch 16GB touch 32GB
$ 59 79 149 179 249 199 299 399
Rs. 3,700 4,800 9,400 12,400 15,200 12,400 18,400 24,400
$ âž™ Rs. 2,950 3,950 7,450 8,950 12,450 9,950 14,950 19,950
Delta 750 850 1,950 3,450 2,750 2,450 3,450 4,450
% 25.42 21.51 26.17 38.54 22.08 24.62 23.07 22.30

The numbers baffle us as always – especially the price of the 16 GB iPod nano – we don’t see how a price margin of 38.54% over the US price is justified. The things absence of credible competition in the market does!