Thursday, November 08, 2012

Auto bookmark using greasemonkey

Ever thought of automatically bookmarking URLs? If you know greasemonkey like me, you would have thought that is should be super easy using javascript and someone would have already done it. But  I did not found anyone on the internet which has created this auto-bookmarking but indeed it was too easy and that might be one of the reasons why no one has done it :). Anyway I did it as I like doing easy things.

Why do you need to automatically bookmarks URLS?
If you are working as a software and your lab has tons of servers which host Apache and you need to access them every time using some crazy ip address which you do not remember. But interestingly the name of the webserver is on the webpage (which I was able to access using javascript document.getElementById)

You can find the scripts at

Monday, November 05, 2012

Whole grains, Carbohydrate - Dietitian Diary - 2

I meet my dietitian for the second time. My primary goal for meeting the dietitian was to make diet changes for my hypertension and hypertriglyceridemia.

For hypertension, suggestion is to reduce the salt. For hypertriglycerdemia, suggestion is to reduce carbohydrates.

Today my dietitian talked about 1. Whole Grains and 2. Carbohydrates.

Whole Grains contains barn, germ and endosperm. Barn and germ are the healthy things and endosperm is the unhealthy. Enriched grain is the one which contains only endosperm.

Whole Grains example are Oat, Brown Rice
Enriched Grains example are: Cereals, White Rice.

Carbohydrates are primary too types 1. Simple and 2. Complex

Simple carbohydrates are made of one or two molecules and are very easily absorbed by your body. They do not contain much nutrient but are good sources of energy. Different sugars - Sucrose (table sugar), Fructose (fruit sugar), Glucose (blood sugar), Maltose (grain sugar), Lactose (milk sugar).

Complex carbohydrates are made of many molecules and may have branches or they can be more like a  spider web. Your body takes time to absorb them.

Examples of carbohydrates.

Potatoes and peas are starchy and are not good for the hypertriglycerdemia. If you want to eat potato, eat it with the skin which has large amount of fibers.

Sunday, November 04, 2012

What is in your spring mattress?

Ever wondered what is in your spring mattress. I think I made a mistake buying a spring mattress (my personal decision). I wanted to buy a  mattress for 200 $$ and was able to find a 8 inches spring mattress which was easily transportable. But I could have got a foam mattress for 200 $$ although less inches. But a 4 inches will work as well as 8 inches if you are using the wooden base. Although one of my friend is using the foam mattress without any base and he is doing good. Anyway back to post topic of what is inside your spring mattress, just spring, but you never think how bad and uncomfortable they will be until and unless you really see them. When you see them it is clear that your body skeleton can never be straight on these springs. When I was buying the spring mattress I was not aware how the internal looks like. So I am putting the pictures of internals of my spring mattress for benefit of others:

This is the springs inside the bed..this is expected for the spring bed.

Here is how the bed looks like without the top bed foam (or whatever it is called). There are some 600 springs. This was the new iCoil technology as told by the mattress seller.  But I am pretty sure you cannot keep your body skeleton straight on these 600 springs. I will prefer to buy the foam mattress. 
After ripping the bed I am able to use the foam top on the wooden frame I have and it works great and better than the spring mattress.

My "Art Institute of Chicago" Visit

"Art Institute of Chicago" is really huge. I was just able to spend near to an hour to visit this place. But you can easily spend and enjoy looking at the place for an hours even if you do not understand anything about paintings and sculptures. The institute gives you a flyer which has "What to see in an Hour" which is overwhelming but doable in a hour. Jut keep following the flyer. You might end of taking a little more than a hour. May be 1 hour 15 minutes.

This is what I did. In addition to flyer suggestion, I also went and saw the picture of Swami Vivekananda as Chicago is the place where Vivekananda gave his famous speech introducing Hindu religion to the world.

* Swami Vivekananda. He introduced Hinduisum to the world in Chicago
Swami Vivekananda

George Seurat's A Sunday on La
Grande Jatte - 1884

* George Seurat's A Sunday on La Grande Jatte - 1884. Seurat took 2 years to paint this picture. Seurat contrasted miniature dots of colors that, through optical unification, form a single hue in the viewer's eye. Try to see the colors in the painting.

Mask - Mukenga
* Mask weared during funeral by elite members of the society.

Seated Buddha

* Seated buddha.

Grant Wood's American Gothic
* American Gothic

Pablo Picasso's - The Old Guitarist

* Picaso Pablo picture.

My "Field Museum" Visit

The Field Museum at Chicago is massive and you can easily spend a day exploring it. I visited Chicago and was able to spend 2 hours exploring it. This is what I did:

* Enjoyed the underground adventure where they show what is happening inside the soil.
* Enjoyed the ancient Egypt exhibition where they showed the mummies and everything Egypt. There is also an window inside Egypt exhibition where they showed the heart weighing ceremony. Ancient Egyptian believed that after death you travel to an afterlife where you lived upto eternity. But you were allowed to enter the afterlife only if your heart was lighter than a feather. If you heart was heavier than Ammut (Egyptian god with crocodile face) will eat you up. So Egyptian did all good things to keep their heart light..
* After that we clicked photo in front of Sue. Largest preserved T-rex.
* After that few more exhibitions. We were actually trying to find the exit :). Field museum is huge, did not I told you that.

My "Adler Planetarium" Experience

Adler Planetarium is located in Museum Campus in Chicago. I visited Adler Planetarium and this is what I did:

* Galileo Cafe. Food was ok but view from there was awesome.
* After food, we went for a movie (movie is what planetarium is all about). We saw "Welcome to Universe" which shows how the earth and our galaxy looks like when viewed from space. The show kept us taking to different distances in space. How the earth looked like from a satellite, from moon, from far away in Milkyway and from far far away in space (yeah you will go other galaxies). It is amazing to think that how small we look from space. As said by Apollo 8 and 13 astronaut Jim Lovell "The fact that just from the distance of the Moon you can put your thumb up and you can hide the Earth behind your thumb", you will see the same happening in the movie and make you feel how insignificant we and our problems are.
* We went to the Atwood experience which was amazing. Atwood is the oldest Chicago planetarium. In short, they put you in an empty and dark globe from where you can see the stars and different constellations. It was amazing to know about the constellations and know about their Greek mythology. The brightest star is the Sirius. The small dipper and big dipper are the easiest one to guess. I will say to learn a little bit about the constellations before you go for your Atwood experience.
* We also took pictures of Jim Lovell statue covering the earth with his thumb which was fun.

My "Shedd Aquarium" Experience

I went to visit Chicago and got a chance to visit "Shedd Aquarium". It was huge and we did not had much time. We spent near to 3 hours there. But it was amazing. The floor map which they gave us was little confusing as there are different levels and the map does not indicate that. If you are smart you will figure that out fast but if you dumb like me you will figure it out

This is what I did:

Rice Auditorium
* Abbott Oceanarium (Rice Auditorium) has Aquatic shows. So find about them online and make sure you attend that. Organize your trip around that. It happens at specific times. Rice Auditorium in built on Michigan Lake so from Rice Auditorium you can see Michigan lake and Adler Planetarium.
* Phelps Auditorium has a 4-D show which was also nice but if you have seen 4-D shows before , the experience will be OK. 4-D shows are getting boring now.
* Jellies exhibit is a must. Jellies are fascinating.
* Wild reef has fishes in a big aquarium which is surrounding you from front and top. No bottom and back side floating fish.
* Pritzker Caribbean Reef is also a big cylindrical aquarium but it is too crowded.There are always people standing around it and you can smell fish.
* Frogs near "Pritzker Carriben Reef" is a must. The frogs are so small that you can barely see them. Some of them are extinct or near-to-extinct species and are fascinating.

I was short of time so was not able to spend time on the "Amazon Rising", "Islands and Lakes" and "Rivers" exhibit and other small exhibits around "Pritzker Caribbean Reef". I would have also liked to take a stroll on the North Terrace and see the "Michigan Lake" but I wonder how to enter back into the aquarium once you go into the North Terrace.

We saw beluga whales, star fish, sea otter, penguins, fishes of all types, sharks, sea horse, frogs and lot of other sea animals.

My "Go Chicago Card" experience

When I bought "Go Chicago Card" before my vacations I thoughts that I got a loot. So many attractions in just 108 dollars was a deal. But now when I am done with my vacations, I can better compare the usage with the real deal. I bought a 3-day Chicago card for 108 dollars. I was travelling with my wife so for two person it costed 215.98. The card was valid for 3-days and I saw these in three days:

First Day:
* Skyline Architecture Tour [ Must]
* John Hancock Observatory [Must]

Second Day:
* Field Museum [ Must but needs more time]
* Shedd Aquarium [Must but needs more time]
* Adler Planetarium [Depends on you. For me it was Must but for others it was So-So]

Third Day:
* Willis Tower [Must]
* Grayline North Side Tour [So, So]
* Art Institute of Chicago[ Must but needs more time]

"Go Chicago Card 3-day" is great if you want to cover all the destination but do not have time. If you want to cover some, have time , and want to save money you are better off using "Chicago CityPass". And if you have both time and money, you can try "Go Chicago Card 5-day or 7-day".

Also realize that some of these attractions like Field Museum, Shedd Aquarium are free at some specific day for people living in Chicago. So just use the internet find what days are free.

Saturday, November 03, 2012

Four day Chicago travel

I visited Chicago for a four days (26Oct2012 - 30Oct2012) and it was really nice. Chicago is city in Illinois state of United States of America. It has great buildings. It has lot of interesting building made in direct architecture style like art deco and other styles. You will also hear name of Daniel Burnham - the Chicago city planner.

American Airlines:
RDU - ORD - FRI 26OCT - 0755 - 0900 - 90$ (including taxes)
ORD - RDU - TUE 29OCT - 0640 - 0920 - 90 $ (including taxes)

Since we were travelling on weekdays, we got a pretty good deal. Each ticket costed 180 $ (to and fro). For both of us, we paid 363.20 $. I still need to earn miles for the miles I spend on American Airlines Advantage program.

Ramada O'Hare (Elk Grove Village)
FRI OCT26 3:00 PM - TUE OCT29 12:00 PM - 169.15 (including taxes).
Hotel was family friendly and safe. Free airport shuttle helped to save on the commute money. Although it was far from Chicago downtown. 20 minutes to Airport and then another 45 mins in CTA to downtown. But it was worth the money. If I had all the money, I would have lived at one of the hotels in Chicago downtown :).

General Tips:
* Walking is fun especially when you are near to Chicago River and know little bit about the building around.
* Do spend on attractions which needs a little extra. You will not be visiting Chicago again and some of those attractions are worth the money. If you have time and nothing else to do paying for the attractions make sense if they are within 10 $.
* If you are using "Go Chicago Card", the free entry is upto 5:00 PM so make sure that the attractions which takes less time are covered before the attractions which takes more time.

26Oct2012 (Original Plan)
0755: RDU airport departure
0900: Chicago O' Hare arrival
1000: Ramada O'Hare using airport shuttle
1130: Chicago O' Hare CTA station
1215: LaSalle CTA station
1200: Epic Burger 517 South State Stree, Chicago, IL, 60605
1230: Buckingham Fountain 500 South Columbus Drive, Chicago, IL 60605
1300: Millenium Park Welcome Center, Chicago, IL
1400: Chicago Greeter, 77 East Randolph Street Chicago, IL 60602
1900: Billy Goat Tavern, 430 North Michigan Avenue, Chicago, IL 60611
2000: CTA station.
2045: ORD CTA station
2100: Back to Ramada O' Hare using hotel shuttle

Changes in the Plan:
Chicago Greeter Walking Tour replaced by our own public art and architecture walk:
As said by Eisenhower plans are worthless but planning is everything so my original plan did not worked. Chicago Greeter is a free service which takes visitor for a free walk, this did not worked for us.    In place of "Chicago Greeter" from Chicago Cultural Center, we went on our own and did a public art and architecture walk as given in the Fodor's Chicago 2011 (borrowed from public library). The book walk was starting from "Chicago Art Institute" but since we had planning Art Institute for another day and we have already seen Millennium park (Cloud Gate, Jay Pritzker Plaza and Crown Plaza). So we started from the "Chicago Cultural Center"
* Saw "We Will", "Monument with Standing Beast" and "Freefrom" on Randolph Street.
* Then took a left turn on Lasalle Street
* Then took another left on Washington Blvd.
* On Washington Blvd. we saw "Unnamed Picasso Sculpture" and "Chicago".
* Then we took a right turn on Dearborn Street where we saw Chase tower, Four Seasons, Flamingo and the Town-Ho's Story. We also saw Monadnock.
* Took a left turn on Jackson Blvd and then one more left to State Street and then finally to Marshall Field or Macy.
* On State Street, we saw Reliance Building/ Hotel Burnham and Sullivan Center.

Billy Goat Tavern replaced by Pizzeria Uno:
We are Indians and I can eat chicken when it comes to non-veg and Billy Goat Tavern did not have any chicken. Although it was looking really like a tavern with customer indulging themselves in drinks and  cheeseburger. Forgot to tell I do not take hard drinks, so definitely not a dinner place for us. In place of Billy Goat Tavern we decided to walk to Pizzeria Uno on E. Ohio Street at walking distance. While walking to Billy Goat Tavern and then to Pizzeria Uno we enjoyed seeing the Chicago River, Wrigley Building and other buildings. and the Magnificent Mile. Yeah Michigan Avenue is called Magnificent Mile starting from Wrigley building and I thinking ending at John Hancock Observatory. Chicago River cross roads is a nice place for taking pictures. And you got to see all the skyscrapers.

Tips of the day:
* Order salads at Pizzeria Uno as the pizza takes time. Also be ready for 30 - 40 mins wait. Also remember this was not a weekday due to which less wait, else you may have to wait more. In case you are pressed for time, try Big Bowl or Pizzeria Due on the same street.
* But CTA 3 - day fun pass at the CTA station. 1 - day fun pass is not sold at the CTA stations. So make sure to buy it as soon as you see a Walgreens. Also remember 3 - day pass is good for 3 * 24 hours. So my 3 - day CTA pass ended on my fourth day morning. So in place of buying fourth day pass, I could have bough a CTA one way ticket which is cheaper than one day pass. But remember you need exact change for buying tickets from kiosk. Check CTA ticket for fare and carry exact change.
* Epic burger was a wonderful experience.
* Some suggested to look at the Hard Rock Hotel lobby and look at the marble used. We did saw the Hard Rock Hotel when we were walking on the Wacker drive.

0800: Start from Ramada OHare
0820: ORD CTA
0900: Chicago CTA station
0915: Navy Pier via CTA bus
0930: Stroll around and take pictures
1030: Architecture boat tours.
1200: Brunch at Billy Goat Tavern. Egg omelete which was bad.
1230: Start walking to John Hancock tower.
0130: Lunch at Signature Room at John Hancock.
0230: John Hancock Observatory
0400: Bus to Lincoln Park Zoo
0500: Bus back to Magnificent Mile
0530: Hershey's and Ghiradelli
0630: Dinner at Little Pompei on East Ohio Street.
0730: Grand Blue CTA station
0830: ORD CTA
0900: Back to hotel and sleep

Pompei on East Ohio is closed. Eat at other nice place. Explore upfront. We ate Do Kha which was Thai and not so nice (or may be we did not ordered right). You can explore Big Bowl which is again at East Ohio Street (where we eat on 29 as suggested by a friend). Walking is fun as you are walking near to Magnificent Mile. It is also safe as there are too many people on these streets.

* Make reservations for John Hancock otherwise forget it. You can also try the buffet as the ala-carte is expensive enough and adds up to the buffet price. Buffet was 20 $ per head when we visited and we ended up paying 38 include tip for the two for ala-carte.
* Lincoln Park Zoo has nice view of cit skyline near to "Farm on Zoo". Lincoln Park Zoo also has a Lincoln Park Conservatory nearby which we covered later on 29th and was fun.

0900: Started from Hotel OHare (Not possible to start early everyday)
0920: ORD CTA
1000: Jackson Blue CTA
1020: Field Museum by Bus
1030: Inside Field Museum. (saw underground adventure which was free with GO pass)
1230: Adler Planetarium Galileo Cafe (Food not good but view was awesume)
0130: Adler movie (Welcome to the Universe) at Grainer Sky Theater
0230: Atwood experience at Adler and learned about Constellations.
0300: Shedd Aquarium
0330: Shedd Aquarium Ocenarium Dolhin show.
0430: 4 - D movie (Ice Age) (We have to pay 4 $ per head for this one)
0530: Bus from Museum Campus to CTA Red station
0630:  Cermak Chinatown CTA station
0700: Lao Sze Chuan Chinese restaurant at Archer Avenue.
0800: Cermak CTA station
0900: ORD CTA station (Cermak is RED line so you need to change to Blue line)
0930: Sleep at the hotel.

* Enjoy the view at the Galileo Cafe. I have heard that Shedd's cafe also has a nice view. So one of them is a must
* Give tip at Chines Restaurant. They were picky on not giving tips. It is generally nice to give tip when you are travelling. You never know when you need to ask for help like "I forget my bag, have you seen it?". A small tip does not hurt.
* Enjoy the China town.
* Field Museum has specific place to eat called Siragusa Cente at the lower level. Field Museum is big so you cannot cover everything. Just choose few and enjoy them. Take pictures next to the Sue.
* Learn about the Constellations to make your atwood experience memorable. Learn about the dipper, the king and the sirius.
* Do see the small frogs which are extinct species in the Shedd Aquarium. They are so tiny that you can barely see them.
* Adler Planetarium takes less time than Shedd and Field. So Plan to cover it before you have time to enter one of the big attractions. This is related to my general travel tip.

0900: Starting from hotel
0920: ORD CTA
1000: Jackson Blue CTA station
1020: Reach Willis tower walking
1030: Reach the skydeck, take pictures, enjoy the ledge.
1130: Start walking to Marshall Fields
1200: Have lunch at Walnut Room
1330: Start walking to Palmer House,17 E Monroe Street, Chicago, IL.
1400: Take Gayline North Side tour.
1600: Go to Art Institute of Chicago
1730: Start walking to Magnificent Mile
1830: Marshall Field
1900: Dinner at Big Bowl
2000: Back to CTA Blue line Station
2100: ORD CTA
2130: Back to Hotel and Sleep

We were not able to go to Walnut Room for lunch and ate our lunch at Freshii at Palmer House which is were the Grayline tour starts. We though we will have our dinner at Walnut Room but Walnut Room was closed :(.

* Sample Frango mints at Macys. Remember to see the Macy's fountain.
* Do collect your 10% off coupon from visitor center at seventh floor at Macy's
* Reserve upfront for Walnut Room.
* Grayline North Side tour was OK but it cover Lincoln Park Conservatory which was nice.
* Art Institute of Chicago is big and you can easily spend 2 hours. Take picture of Swami Vivekanand. Chicago is the place where Swami Vivekanand introduced Hinduism to the Parliament of World Religion in 1893. Art institute also gives a flyer which tells what to cover in an hour but you should take 2 hours to do it as the institute and you will find so many things which you would like to see. Art institute have expensive painting of Picaso Pabalo and Von Gaugh.

0500: Start from Hotel
0640: Flight Starts from ORD
0920: RDU
1000: Back to normal life.

Money Spent on the trip for two person
* Flight: 363
* Hotel: 169.15
* Go-Chicago Card:215.98
* Commute: 40
* Ariport Taxi: 15
* Food, Food and Food: 250

Saturday, August 18, 2012

Interactive selection for ASCII lines using python

Recently I found this nice curses based directory bookmarking tool called cdargs.
I thought it will be nice to have interactive selection for the list. For my bash functions which shows list. Like I have a bash function which can show me a list of clearcase view and then I can choose one of them. That is all bash. But it would have been nice if the list was little interactive and I could have moved around. So I found curses to my help and found another nice tool called iselect.

Iselect does what I need but it does not show the line number like cdargs, so you cannot really select a line by pressing a number. I googled and realized that I can pretty much do the same stuff in python. Since there was no available open source python tool which I can customize to my need, I thought of writing my own. I call it pyselect. It is work in progress and tries to do things like cdargs and iselect. But more customizable and smaller, after all it is scripting in python.

You can checkout the git :

It is still a work in progress but does not look difficult till now.
The current version as of 18Aug2012, lets you interactively lines fewer than 30.

VIM: Cdargs

Cdargs is a curses based directory bookmarking tool. See

This works nice on bash but I wanted something like that to work with VIM. Tried NERDTree bookmarking but still wanted something like curses. Press a key a list is displayed where you can move around. Something like screen window list shown on pressing C-A+"

I found it that it was way too easy to integrate cdargs with vim using a vim function. The function is self-explanatory. Read the see links and you will be able to decipher the function.

" See
function! Cd()
    exe "!cdargs"
    let mydir = system("cat /home/jay/.cdargsresult")
    " See
    cd `=mydir`
" Alias to my function so you do not need to type call everytime.
command Cd call Cd()

There is also  VIM plugin which uses cdargs but it does not show the curses window. See:

Sunday, August 12, 2012

Check files taking up space

There are multiple way to check for files taking space.  Linux command du seems to be the best.
Here is the du command from the LinuxCommandOrg

du -s * | sort -nr > $HOME/space_report.txt

du also has option which can skip NFS mounted dir. See du man page.

Monday, August 06, 2012

Vim spell check with PHP not working

Vim 7.0 has on the fly spell check which can be enabled by using ":set spell". You may also want to use "sell spelllang=en_us" but ":set spell" just works fine for me.

But this on-the-fly spell was not working with my .php files which have the PHP start tags (less than question mark sign). Without the PHP start tags everything was fine.

Here is the workaround to highlight bad spelling in .php file with PHP start tags:

:set filetype=cpp
:set spell

You lose some of the php filetype goodies but now you have the spell check.

I also found that the php filetype was not working for me as the comments environment variable was getting set to HTML comment style (less than exclamation dashes and dashes greater than) .