Take a peek inside .jar files!

jar tf is a very useful command if we just want to peek into a jar. For example, I had a recent requirement of scanning several jars to look for Hibernate *.cfg.xml files. Naturally, it would have been tedious had I had to open each jar to check. The following simple script (using jar tf) came to the rescue.

for f in `find . -name '*.jar'`;do echo --$f--;jar tf $f | grep -n cfg.xml;done

Terminal within Eclipse

Every now and then I had this urge to have a tool which would save me from switching over to Terminal from Eclipse and vice-versa. A nifty little Eclipse plugin called elt came to the rescue!

elt

elt gives me the flexibility to execute frequently used console commands — thus saving me a lot of finger twitches. ;)

A good introduction is provided here.

Connecting from Amazon AWS EC2 to RDS

While preparing to deploy a Java-based application on Amazon, I encountered a strange error — the EC2 instance was not able to access the RDS instance.

I looked into various forums, and many indicated that the only option is to allow this is by adding the public IP of the EC2 instance as an “authorized IP” (CIDR/IP) in RDS instance’s security groups. I wanted to avoid that, as this did not seem right.

Tried out various combinations, and finally, (with some background from one of the posts), things got working:

I got a whiff of what could be wrong here. Turns out, EC2 instance’s security groups have to be added in the ‘default’ security group in the RDS instance, for it to allow traffic from EC2. We need to select the ‘Connection Type’ as ‘EC2 Security Group’ which would populate the active EC2 instance security in the ‘details’ cell — which then then be authorized.

amazonawsOnce the above is done, use the public IP of RDS instance to connect. For instance, for MySQL, I used the following string:

mysql -u admin -p -h xxxxx.yyyyy.rds.amazonaws.com

and Voila! I got through!

DB course

Over the past few weeks I’ve been taking a database course, and I must say, it’s well-worth the time (whatever meager amount) I’m able to invest.

Thanks to Sri, and his persistence on us taking it.

I have taken a so-called DBMS course in academics twice, but never have I had the perspective as this course has given me. Thank you Prof. Jennifer Widom and the team of Stanford University who’ve taken efforts to come up with such a course and have had a vision of the larger good.

I would highly recommend it to all the software engineers, especially those from India.

Here’s the link for the ongoing class.

Ubuntu 12.04 missing ‘Open In Terminal’

So I gave in to the whims and fancies of Ubuntu 12.04, after spending nearly 4 months with CentOS 6.3. And then my project changed, and over this period of 4 months I realized that I have spent a significant time on getting a few basic things to work on CentOS. It wasn’t worth it.

A real irk for me was getting Eclipse (Juno) to work with any of the SVN plugins (Subversive or Subclipse) on CentOS. Even when somehow it did work — it was pretty messy. Every check-in/check-out was a pain.

Anyway, so what more opportune a moment, than doing it when the project got changed. Ubuntu, as always, was a delight. Although its tough to ignore how several features of OS X have found their way into Ubuntu. But it’s mostly good features, so, who cares!

I’m still trying to get used to the departure from the traditional Ubuntu that I was used to — my last encounter with it was maybe more than an year ago. While I loved how the interface has been revamped to allow for better usage of screen real estate — I already started missing a few features of the old Ubuntu.

One of them was ‘Open In Terminal’ from context menu which was very handy. However, I took care of it today, thanks to a post on askubuntu. So, no more qualms (at least as of now).

Trysts with a “Legacy” keyboard

Everybody loves mechanical keyboards! Ah! the satisfaction of the “click” on each keypress is indeed alluring. Sorry for sounding more poetic than needed, but, I guess, you get the drag.

In my quest for finding a good, in-house keyboard for the Raspberry Pi * (RPi); I dug into my electronics junk and got hold of my old TVS Gold mechanical keyboard.

TVS Gold Mechanical Keyboard

It might not mean anything to the techies of today, but in our times, early 2000s, it was the keyboard to have. There were of course plenty of soft-touch keyboards (Samsung and the likes), but TVS Gold stood out as being the most reliable, robust and pleasant keyboard to have.

As much as I would have liked to use it, I was taken aback by the discovery that it has a 6-pin serial port interface. That came as a rude shock because I was so looking forward to use it with the RPi. Some googling got me a very discouraging responses like “get a new keyboard man!” from various forums.

However, I have decided not to give up that easily! Various forums and sites also led me to believe, that the biggest bottleneck (pardon the paradox), in using such legacy keyboards via a USB interface is the amount of power they draw. Since I have been (had to be) obsessed with externally powered USB devices (USB hubs), I have decided to give a shot to the probability of powering this keyboard externally.

So, expect a follow-up post soon on how it goes. I so so want to get this working!

* I got my Raspberry Pi a few weeks back and have been mostly involved in finding low-cost solutions to various interfaces for it.

Update: Unfortunately, even with external power supply (5.5V@0.5A), I could not get the keyboard to work with Pi. Once in a while it responds, but, in no way can it be called usable. Damn!