Sunday, July 05, 2009

Mac Quick Look tips

Some cool tips for mac I learned today. Mac has a cool quick look utility which is used for quickly looking at any file. This saves the time to open an application. For example, to quickly look at pdf file, I could go over the file in the Finder and press 'Space', and the file shows in a very fast viewer.
What makes it more interesting is that there is a command line utility 'qlmanage' which can be used for viewing files from command line in Terminal. This is very useful when modifying pdf files from command line and then viewing them. Interestingly, writers of Quick Look feature wrote the qlmanage utility to debug their program.
I use a small alias to open this program quickly.
alias ql='qlmanage -p "$@" >& /dev/null'

See this link for more information.

Saturday, July 04, 2009

Mac terminal

I recently got my new Macbook Pro and have become a mac fan. The interface and the hardware are just amazing. Switching from windows and linux which I used for more than 12 years.
I am currently setting up my mac and installing lots of software. Here is the list of software that I have installed so far:
1. Xcode: A must for any non-dumb user.
2. Gimp: Took a lot of time
3. Gnuplot
4. Tetex: For paper writing stuff
5. Picasa: Can't escape the familiarity with this cool software.
6. VLC media player: For all those .wma files
7. Skype
8. Gvim: My favorite text editing app

I have this problem with the mac terminal that it would not load .bashrc at the startup. I would have to manually type 'source ~/.bashrc'. I found the solution to this problem today.
Basically, Mac OS uses bashrc from /etc/profile. So it has to be told to also include things
from ~/.bashrc. For this, the command did the job:
[ -r $HOME/.bashrc ] && source $HOME/.bashrc
I found this info on: