Uncategorized

Places to eat : 90 Miles Cuban Cafe

If you are ever in Chicago and looking to get some great breakfast or good cuban sandwiches, try out the 90 Miles Cuban Cafe at 3101 North Clybourn, Chicago, IL 60618. I was looking for a place to get some brunch today and Rich recommended that we go to this cafe. I really liked the decor and the simple menu. The food was visually pleasing and tasty. Here are some pictures of the food (credited to Rich).

Rich’s Lechon (Roast pork, Romaine lettuce, grilled onions, sweet plantain, garlic sauce)

Janvi’s Cuban (Cuban ham, roast pork, swiss cheese, pickles, mustard) 

My Frita Cubana (Cuban hamburger, Romaine lettuce, tomato, shoestring potatoes)

And to top it all.. some Banana pudding

Live and Learn : Collar Stays

I just discovered that the plastic/metal thingys placed in men’s shirt collars to make them stand up are called collar stays :). I discovered that during a recent trip to Kohl’s.. Here’s how the conversation looked like

Me : hmm.. you know those things in the collar.. that make them stiff.. you know..those things!!

Clerk : What things?

Me : Well.. those things that are made of  plastic and white in color.. you know…those things.

Clerk : Oh..Sir.. “those things” are called “Collar Stays”

Me : Thank you.. I feel enlightened now 🙂

BTW.. IMHO.. every gentleman should have some spare collar stays in his kit. And you can get them for cheap on Amazon.

HOW TO : Perl subfunction to unmount a partition in Linux

For my record…here’s a snippet of perl code that can be called as a sub function to unmount a partition in Linux.  The magic is in the line “grep m{$mountPoint}, qx{/bin/mount}”, which essentially lets you check if the partition is already mounted or not.

sub UnMountVolume($)
{
    my $mountPoint = $_[0];

    print "Unmounting $mountPoint\n";
	# Check if the mount point exists
	if ( grep m{$mountPoint}, qx{/bin/mount} )
	{
		#Let's try to unmount it
		system("/bin/umount $mountPoint");
	}
	else
	{
		print "$mountPoint is not mounted, so didn't have to do anything\n";
	}
}

As with any perl code, I am sure there are a tons of ways to do this in a more efficient and “cool” way.

HOW TO : Find which interface a particular IP address is configured on

There are a ton of scripts to find how many IP addresses  are configured on a system, but I could not find one, whic would show me which particular network interface an IP address was configured on. Here is a one liner, that will give you this information in Linux

/sbin/ifconfig | grep -B1 10.10.10.10 | awk '{if (NR==1) print $1}'

The same script can be changes a bit to support other operating systems too. Essentially, I am doing a grep (search) of the output of ifconfig, which shows all the network information on the system for a particular IP. At the same time, I am using the -B1 option, which will show the line above the matching line. Finally, I am piping this to awk and printing the first row in the first column.

Travelocity down due to power outage..

Looks like Travelocity was down early today due to a power outage. Here is a screenshot of the site, right after they came up

According to Pingdom, the site was down for ~1 hour and 29 minutes. If they did come up at an alternate site, I personally think that is a pretty good response time. Running a high transaction web site (and one that is as complicated as Travelocity) is no easy feat and when you throw DR into the mix, it gets pretty nasty. The site is primarily hosted out of the EDS/Sabre/Travelocity datacenter in Tulsa, Okhlahoma.

HOW TO : Pass environment variables when using sudo

Say you need to sudo as a particular user and run a command and at the same time you need to pass an environmental variable to the command, you can do it by passing the command in doublequotes.

For example, I want to start Oracle while I am logged in as another user (vinay), I can start the database using dbstart by issues

"sudo su - oracle -c "dbstart /$ORACLE_HOME"

$ORACLE_HOME is an environmental variable listed under user oracle’s environment.

Needless to say, you need to ensure that you have sudo configured to allow your userID to su to oracle.

HOW TO : Block outbound e-mails in Postfix

I ran into a challenge at work, where we had to allow e-mail delivery for certain domains, but block all other domains. But at the same time, we had to ensure that the clients sending e-mails did not get a delivery error. We were using Postfix as the MTA running on Redhat Linux. Here’s how I resolved it

  • Edit the main.cf file (the default location is in /etc/postfix) and add “transport_maps = hash:/etc/postfix/transport” (without the quotes) to the file.
  • Create a file named “transport” in /etc/postfix, if it doesn’t exist
  • Add the following at the end of the transport file

DOMAIN1 :
DOMAIN2 :
* discard:

  • Run “postmap /etc/transport” to create a hash of the transport file
  • Run “service postfix restart” to restart the postfix service

This configuraiton will ensure that all e-mails address to DOMAIN1 and DOMAIN2 are delivered normally, but the rest of the e-mails are silently discarded.

Note : Ensure that you follow the syntax for where to place the : verbatim.