June 2006

Command line clipboard manipulation in Mac OS X

I wanted a good utility to manipulate the system clipboard from the bash shell. Turns out OS X has this really cool ability built-in. Two commands, pbcopy (copy TO clipboard) and pbpaste (paste FROM clipboard) do the job admirably. So this post was typed in good old Vim and saved. After that, cat blog.txt | pbcopy and I was able to easily paste it into wordpress.

Although iTerm has the ability to copy to the clipboard with selected text and Cmd+C, this inserts linebreaks in paragraphs in a nasty fashion.

Apparently, it’s reasonably simple to have this ability in KDE as well, or so this page suggests. Anyone know how to do this under Gnome?

[Update: Here's a python script to achieve this - works in Ubuntu and I guess, should work anywhere]

mac
tech

Comments (0)

Permalink

The great Indian landscape

img_3691

img_3732

It stretches as far out as the eye can see. Expansive plains, or humbling mountains. Refreshingly green, or majestically arid. Devoid of human touch, or dotted with huts and farms. Seen in an instant as it passes by, or soaked up over hours by those who sit and stare. And never forgotten.

Silent. The occasional call of a country bird or the roar of a passing vehicle only serve to define the silence. And still. Leaves rustle, and in the distance a farmer and his cows plough a field. Just reminders of stillness. In hundreds of years past, invaders have conquered, cities have sprung, life has changed for a billion people. And here, a few blades of grass have been bent.

It is the stillness - and the silence - which speaks there. And that is why I go. They speak with gentleness, and a haunting surety. They don’t just tell you their story. They tell you that their story is also yours. Just one that is forgotten - in the numerousness of activity filled moments with which you define your life. And they bring you back to the only moment that matters.

The present.

[Just reminiscing about the road trip that I wrote about earlier. All the photos have been uploaded to Flickr.]

india
photos
travel

Comments (1)

Permalink

Installing Ubuntu

I installed the latest version of Ubuntu Linux 6.06 recently. Partly because of the hype, and partly because I was getting slightly irritated/bored with the Fedora installation on my desktop. And partly, I guess, I was due a new OS install sometime soon. I considered installing Windows Vista (whose public beta is available from Microsoft), but I decided to leave that for another day and do something actually useful.

My first priority was to try and ensure that my current Fedora bootloader handled the job of load Ubuntu also. I was assured that there is an option during the Ubuntu install (which proceeds after booting up to a Live Ubuntu system). However, it was either not there or I missed it - and I only realized it after the progress indicator told me it was installing the bootloader. At that point I got ready to take out my Fedora DVD and reinstall GRUB, but to my pleasant surprise, the Ubuntu installer had detected my old Fedora as well as my Windows installation (something even a newer Fedora system doesn’t do). Thumbs up.

I have a separate /home partition on my Linux disk and I use it for all my installs and Ubuntu was no different. However, here I ran into a bit of trouble. Fedora (and every other Linux distro I’ve known) by default gives a uid of 500 to the first user. Ubuntu, however, gives 1000. Consequently, I wasn’t able to login to Ubuntu at first. It would log me out immediately after I typed in my password, complaining that it couldn’t access $HOME. Strangely enough, after I rebooted into Fedora, Fedora gave me the same error. I would assume at least one of the two systems would be functional. In any case, the whole thing was fixed by first logging in as root to Fedora and doing chown -R on my home directory. Then logging into recovery console of Ubuntu (which logs you in as root) and changing the uid and gid of the default user to 500. That allowed me to login to Ubuntu, but I guess due to my home directory being inaccessible earlier, Ubuntu couldn’t configure gnome to its liking. I was only mildly surprised, therefore, to be greeted by two completely blank panels upon login. Wasn’t too hard to add the usual stuff to them though.

I was able to install the nvidia drivers with help from here, except the last command sudo nvidia-glx-config enable gave me an error and I had to manually edit a line in my xorg.conf as a result. My widescreen LCD monitor wasn’t detected by Ubuntu which I thought was strange considering Fedora detects it, and I couldn’t find a Monitor configuration option in Ubuntu where I could specify my monitor resolution. So I just copied over my monitor settings from Fedora’s xorg.conf, and that finally got me a native 1680×1050 resolution instead of 1024×768 which, trust me, looks really ugly on a nice 20″ widescreen.

From there on, things got quite smooth. This is a brilliant starter guide for Ubuntu with which I installed a ton of software from VLC media player to Java to Azureus to gcc in a flash. Ubuntu’s repos seem to be doing a real good job, and the apt-get package management seems to work well. This page is a good primer on apt-get and dpkg for newbies to Debian-based distros. Sadly enough, they still haven’t got Vim 7.0.

I tried to compile vim 7.0 from source, but strangely enough, it complains at the ./configure stage that the ncurses library is missing. libncurses exists in Ubuntu, but in /lib and not /usr/lib, however adding /lib in $LD_LIBRARY_PATH did not help. Thankfully, Google came to the rescue and I found a set of .deb packages here. Before I could install these, though, I had to install libruby1.8, and to install that, for some obscure reason, I had to uninstall the old version of vim pre-installed with Ubuntu. However, I finally got Vim 7 working to my satisfaction.

An oddity about the Ubuntu install is that the base system is quite scanty in terms of many power tools that linux/unix people would want to use; which I guess is in keeping with the idea that Ubuntu is meant more for the average desktop user than the power user. However it’s mostly a snap to install whatever you want using apt-get. The things I had to install right away were an SSH server/client, LaTeX, build tools (gcc et. al.) and the like.

So far, it seems quite a friendly and responsive system. I begin to see why there are people out there who are switching from Mac OS X to Ubuntu. Though I won’t be doing it anytime soon. I’ll probably switch over to Ubuntu completely on my desktop, but I still love my Powerbook way too much to give it up.

linux

Comments (2)

Permalink

Malshej Ghat road trip

Took a delightful road trip to Malshej Ghat on Sunday. The road was good all the way, which was a very pleasant surprise. It was also immensely green nearly all of the way, which was even better.

Road

As you can see, roads in rural India have to be shared by certain VIPs. In my opinion though, that only adds to the charm.

Ghat View 1

Malshej is at an altitude of about 3500 feet, so as we approach the western ghats, the views of the hills got quite scenic.

Road between cliffs

Once on the hills, the views of the cliffs and ghats was breathtaking.

Ghat view 2

There isn’t much at Malshej right now, a couple of resorts, one belonging to MTDC and one private resorts. Not much in the way of facilities, and prominent notices disclaim any responsibility if power goes out. One of the hoteliers told us that at one point, the resort was without electricity for nine days.

The bright side of course, is that the place is quite untouched, and relatively unpopulated by tourists. There are quite good trekking routes, I’m told. Unfortunately, this was just a day trip with family so I couldn’t go. The views from the MTDC resort (which is at a high point) of the valley at Malshej were quite good.

Malshej Ghat valley

We went onward to Shivneri Fort, which was the birthplace of Shivaji. Going there was good fun - we did some rock-climbing partway up to the fort (you can go up via steps also).

Shivneri Fort view

More snaps on Flickr when I get back to Singapore.

india
travel

Comments (4)

Permalink