Tuesday, August 30, 2016

Upgrading RTC client to version 6.0

Disclaimer: The content of this post is neither approved nor endorsed by IBM.

We use Rational Team Concert (RTC) as code repository for our product.  RTC server that we use was upgraded to version 6.0
I was using RTC clients 4.x which stopped connecting to RTC server.  I found, RTC server 6.0 does not have backward compatibility for 4.x  So I had to upgrade RTC clients from version 4.x to version 6.0

I downloaded RTC 6.0 client RTC-Client-Linux-6.0.zip from where it is available for use within IBM.
You could download it from IBM Jazz web site, here

I unzipped it in directory /opt/IBM/RTC-Client-6.0/

# pwd
# mkdir RTC-Client-Linux-6.0
# unzip RTC-Client-Linux-6.0.zip  -d RTC-Client-Linux-6.0/

I modified .bashrc file to point to /opt/IBM/RTC-Client-6.0/
I used vim and added lines listed below to .bashrc

export PATH="/opt/IBM/RTC-Client-6.0/jazz/scmtools/eclipse:/opt/CollabNet_Subversion/bin/:$PATH:~/bin"
export LD_LIBRARY_PATH="/opt/IBM/RTC-Client-6.0/jazz/client/eclipse/jdk/jre/bin:$LD_LIBRARY_PATH"

I logged out and logged in again so that the updated .bashrc came into effect.

Now I could login using `scm login` CLI.
For example,
`scm login  -u jdoe  -n SONAS  -r https://hostname:12443/jazz  -c`

Tuesday, April 19, 2016

How do I check if a particular Python package is installed or not

How do I check if a particular Python package, say mordor, is installed or not?

Firstly, check if pip (package manager) is available in your machine.
Using pip, check if the required package is installed or not.

# pip list | grep mordor

If mordor package is not present, I could install it using `pip install Mordor`

# pip install mordor
Collecting mordor
  Downloading mordor-1.1.tar.gz
Installing collected packages: mordor
  Running setup.py install for mordor ... done
Successfully installed mordor-1.1

What if my machine is not connected to the Internet?  `pip install mordor` fails for me.

# pip install mordor
Downloading/unpacking mordor
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement mordor
No distributions at all found for mordor
Storing complete log in /root/.pip/pip.log

So I have to download the tar.gz file of this package from pypi.python.org
In case of mordor package, the file I am looking for is https://pypi.python.org/packages/source/m/mordor/mordor-1.1.tar.gz

After copying the tar.gz file (mordor-1.1.tar.gz in this case) to the machine, I untar-unzip it.

# tar -zxvf mordor-1.1.tar.gz

I installed the required package using `python setup.py install`

# cd mordor-1.1
# python setup.py  install
running install
running build
running build_py
creating build
creating build/lib
copying src/mordor.py -> build/lib
copying src/ordor.py -> build/lib
running install_lib
copying build/lib/mordor.py -> /usr/lib/python2.6/site-packages
copying build/lib/ordor.py -> /usr/lib/python2.6/site-packages
byte-compiling /usr/lib/python2.6/site-packages/mordor.py to mordor.pyc
byte-compiling /usr/lib/python2.6/site-packages/ordor.py to ordor.pyc
running install_egg_info
Writing /usr/lib/python2.6/site-packages/mordor-1.1-py2.6.egg-info
# pip list | grep mordor
mordor (1.1)

Here I did not talk at all about dependencies.  While installing a Python package, you may run into a situation where dependencies are missing.  So you have to first install all the dependencies, and then install the package that you wanted.

Wednesday, April 13, 2016

How to save $$$ by using open source software instead of proprietary software

In March 2014, a storm happened in our office.  Some 50 folks were given marching orders.  From being laid back and overstaffed, our office floor was suddenly "awakened" and short-staffed.  Some folks had seen their "moment of truth".  For me, I was told to take some new tasks.  Tasks that my team members were "supposedly" doing.  And also an additional role in the security team of our products, SONAS and V7000 Unified.  I am always ready to take new tasks.  Being an evolved Aquarian, I welcome change.

The new role in the security team of our products, I started it in my natural style, taking the bull by the horn.  I strongly believe that's what works in a stormy weather.  My method was to question everything.  Review everything, and replace / adjust what is appropriate.

As part of this security role, my colleagues used to execute a security scan of our products on periodical basis, using Nessus.  Nessus is a proprietary comprehensive vulnerability scanner.  I studied this task in the same manner - question everything.  I found OpenVAS, a framework of several services and tools offering a vulnerability scanning and vulnerability management solution.

I did not use Nessus at all.  I told our admin folks not to continue the paid user account that was being used for executing vulnerability scans using Nessus.  I started using OpenVAS.

From the OpenVAS web site, I downloaded an image that contained a ready to use Virtual Machine, along with with OpenVAS.  I prepared a virtual machine in my laptop.  It was easy.  I like the idea of providing an image that I could download and start a virtual machine that has OpenVAS installed.

In the scope of my projects, both Nessus and OpenVAS are vulnerability scanners.  Both work on the principle of scanning the product for presence of known security issues.  I did not do a deep study to determine which one is slightly better than the other.  I did not have that luxury of time.  More important was to get the job done, in time, and with minimum money spent.  In my limited study of Nessus and OpenVAS, I found Nessus has a richer GUI than OpenVAS.

What was the benefit of using Nessus?  The centralized IBM team was managing Nessus server.  At the cost of project money.  I decided to put some effort to setup OpenVAS, maintain it, and use it.  I saved on the project money that was spent for Nessus user account, and hardware in the lab from where security scan was initiated.

What is the benefit of using OpenVAS?
* No need to purchase software or any licenses
* No additional hardware needed.  OpenVAS is running in a virtual machine, which is running in my laptop
And the cost associated?  The effort required to setup and maintain OpenVAS running in a virtual machine.  Considering benefits vs the cost associated, this is a good bargain.

What did I miss?  Nessus seems to have a richer GUI than OpenVAS.  I am willing to miss a better user experience, for saving some $$$ from my project budget.

In my opinion, rather than which vulnerability scanner is being used, what is important in the scope of my project is identifying the optimal frequency at which scan should be done, and doing it.

Checking the product using a vulnerability scanner during development phase is important.  But this has a limited value.  Vulnerability scanners check the product against known security issues.  They can not find security issues that are not yet recognized.  Recognizing security issues is done by skilled humans, by looking at code (for example, Bar Mitzvah attack), by applying new ideas (for example, slowloris) etc.  Then these vulnerability scanners update their "signatures" to detect the new issue.

So, checking the product using a vulnerability scanner during development phase should be done.  This ensures that we are not shipping our product with any of the known security issues.  But this does not guarantee our product is 100% secure at the time of release.  There could be security issues present in our product, resulting from unsafe code.

If you are not sure about which vulnerability scanner to use, a good idea is to use two vulnerability scanners and compare the results.  In my project work, I did not have the luxury of using two vulnerability scanners and comparing the results.  So I chose one and used it, with awareness of the situation and the possible outcomes.

Please note : thoughts expressed here are my own, and not necessarily of my employer.

Saturday, January 30, 2016

Words of wisdom from a fellow amateur athlete to another

One of my fellow amateur athlete friend asked me advice for improving health and endurance.  Here's all that told.

Before I repeat my narration, here is a disclaimer.
  • The views and opinions expressed in this article are those of my own and do not necessarily reflect the official positions of the individuals I consider to be my Gurus, or of anyone else.
  • I am getting along in years, what I mention here seems appropriate for my age.  When taken AS-IS, it may not be appropriate for your age.
  • These tidbits are jumbled.  Please do not apply them in this sequence.
  • Folks interested in what exactly is applicable for them should do some self study around what I say here.
  • Do I follow all that I preach?  No!  But who said I am preaching.  Certainly I am not.  This is a dialog between a fellow amateur athlete and another.  Read on if you are still interested.

Regular jogging or running will not get you rid of your upper tummy.  It is certainly helpful for reducing fats from your overall body.  And also fats from your lower tummy.  For reducing upper tummy you must do those specific exercises.

Long distance running does not guarantee reducing your weight.  You may be surprised to see your weight will more-or-less remain the same even when you are regular with long distance running, even for a year or more.  Be aware that you are slowly replacing fats in your body with muscles.  Nevertheless, I like what Rujuta Divekar said - Never let the weighing scale tell you how to feel about yourself today! ;)   She summed it all very well in one line.

Do not expect results in a few days.  Or in a couple of months.  Be patient.  You must be consistent for a longer period of time.  A year or so.  When you will compare your health and endurance with how it was a year ago or a couple of years ago, you will be surprised to see the changes!

This is a misconception - eating less will reduce your weight.
We should eat in proper quantities.  What matters more is what we eat.  And how we eat our meals.  And does our daily routine have enough physical activities for consuming what we intake.

We should have sumptuous breakfast.  For breakfast we should have food that is relatively difficult to digest.  Such as dry fruits and eggs.  Fruits should be eaten in the breakfast.  Fruits should not be eaten during dinner or after dinner.

We should have lunch in normal portion.  Lunch should be smaller than breakfast.

Dinner should be smaller than lunch.  For dinner we should have rice.  Chapatis, bread etc. (that are made of wheat) are good for lunch.  These are golden words from Rujuta Divekar in one of her articles - Put rice on your plate: Eat rice, especially for dinner. Easy on your stomach, rice promotes the growth of gut-friendly bacteria, has fat-burning and anti-anxiety properties and also allows for better assimilation of Vitamin D. And remember, we need ‘optimum fibre’, not ‘high fibre’, so choose hand-pounded or single-polished white rice over brown rice.

I avoid to sleep right after dinner.  So we have dinner around 8 PM.  A margin of two hours between dinner and sleep is needed for food to digest properly.

What should you eat for breakfast and for lunch and for dinner?  I try to follow this formula I learned from Rujuta Divekar - do not eat food for which you see a lot of advertisements.  Eat food that your grandmother recognizes.

We should not fluctuate our sleep pattern.  It affects our workouts and our health.  For years I "adjusted" my sleep durations and timings.  Being aware, now I attempt to be consistent.

If you are working in a night shift, I say you are killing your health on a slow track.  You should quit and get a regular shift job, even if it is a less paid.

We should avoid all electronic screens after dinner or for three hours before going to sleep.  No laptops, no smartphones, no TV.  Because watching these screens tricks our body to believe that daytime is still going on.  So our body does not recognize it is now night and time to sleep.  I do not remember from where I learned this.

I said no TV!  Am I nuts?  Gee, this is different topic altogether.  Our home has no TV.   Okay, we do have a TV, but no satellite dish connection.  We only have a DVD player attached.  So we rarely watch TV.  For years.  I know it is difficult to start.  But try it.  You will thank me.

Okay, back to our original subject.  Cross training really helps.  What is this cross training?  Cross training is sometimes doing a workout that is not your main workout.  It is effective for improving fitness performance in our main sport.  It provides time to muscles in our body for recovering.  We use different sets of muscles for different activities.  After a workout, we should provide enough rest to muscles.  So for a futsal player, cross training could be slow running, sprints, circuit training, stretching and flexibility routine, all once a week.  May be swimming and cycling.  There is no universal formula that suits all.  You should experiment and find what suits you.  Do consider your age and your daily routine.  I tend to incline towards training less rather than over-training and sometimes acquiring injuries out of it.

These days my week consists of one slow and easy run, one hill run, and one game of futsal.  Sometimes hiking instead of futsal.  During weeks when I do a long run, I skip futsal and hiking.  So if you ask - what is the primary sport for me and what are the cross trainings?  I wonder as well.  I am an amateur athlete.  I keep switching between futsal, long distance running, and hiking.  This is what suits me.  Our original aim is to stay healthy, have endurance, and have fun while doing it.  So why to keep pushing with workouts that do not suit?  I must be missing some benefits that I would get if I add more variety, say swimming or cycling or badminton or tennis.  Okay.  I follow my objective in my own way.  You find your objective and apply your own way to it.  Right, one size does not fit all.  Everyone loves their own tune and plays their own fiddle in whatever way they like.

Should you run on a treadmill or on roads?  If you are going to start jogging or running, in the beginning you should use a treadmill.  If you are consistent, you would come to a point where you would want to go out and run on roads or in gardens.  I personally prefer running in gardens instead of on roads.  I know almost all long distance runners hate to run in loops.  I have no trouble running thirty loops in a garden.  I happily keep the count.

If you are beginning jogging or running, which running shoes should you buy?  I say don't get into a habit of spending big money.  For a 3 km run or jog, your existing sports shoes are good enough!  Consider buying sports shoes only after you become consistent with running.  Consistent here is a period of at least six months.  Before that period, if your existing sports shoes give way, you'd buy running shoes anyway :-)
Now I am an amateur long distance runner for more than three years.  These days I have a pairs of Merrell Men's Trail Glove Black and Crimson Gore-Tex Running Shoes and a pair of Merrell Men's Allout Fuse Carbon and Lantern Running Shoes.  Both pairs are UK size 9.5  This size fits me perfectly.  I'd repeat what I have read - please don't be loyal to a brand.  Buy and use what suits you.

And what device should one use for tracking the runs or workouts?  I have no suggestion in this case.  I am a free runner.  I do not use any tracking device.  I listen to my body.  And my body listens to me.

I found this excellent wikihow article - How to Begin Running

Another fantastic article I found in Merrell blog is - 11 Things the Mountain Teaches You

We should drink plenty of water.  Particularly during first half of the day.  I avoid drinking too much water during evenings.

Should we have energy drinks instead of water?  If you are referring to canned high energy drinks that are sold besides alcohol, holy s__t, no.  If you are referring to Enerzal or sports drinks such as Gatorade, then you are on the right track.  Enerzal or Gatorade replenishes what is lost from the body in a workout, quantities of potassium and sodium.  In my opinion, having Enerzal or a sports drink before, during, and after a workout does help.
Someday I want to follow what I have learned from Rujuta Divekar - go natural - replace Enerzal and Gatorade with natural tender coconut water and cold pressed sugarcane juice.  Today I am not there yet.

From a day prior to a marathon, I start drinking Enerzal or Gatorade instead of water.  Like carb-loading, I do salt-loading.
Yep, buying more Gatorade liquid required more money.  So I have bought packs of Gatorade powder.  Gatorade powder from one pouch makes one bottle of Gatorade liquid.  This is cheaper than buying Gatorade liquid.  Sometimes I want it strong so I put powder from two pouches in one Gatorade bottle.  And I do like to experiment.   Once I bought Nesquik chocolate flavored powder from Amazon for my daughter.  The seller sent pineapple flavored powder instead.  My daughter hated the pineapple flavor from the moment we opened the packaging.  I liked it as a replacement of Gatorade.  So I kept it for myself.  Not just me, everyone in my weekend futsal club enjoyed the taste.

After a workout (such as a game of football, running, jogging, swimming, cycling) we should have some food within 30 minutes.  Our body needs it.  Not eating for a long time after a workout is bad.  Thank you Rajas Borwankar for this useful advice.

Before a workout, we should have one or two bananas followed by a sip or two of water or Enerzal or a sports drink such as Gatorade.  Doing a workout with empty stomach is not good.  Bananas contain magnesium, bananas are available all year, and they are relatively cheap.  So bananas are good to have before a workout.
But bananas are difficult to carry on a sports trip or on a hiking.  I carry a jar of mixed dry fruits instead.  Expensive than bananas, but are easy to carry and good source of energy.

I do not buy sports energy bars that are available in the market.  They are expensive.  For me, most of them are tasteless and hard to swallow.  With same money we could buy plenty of bananas.  Or a good amount of dry fruits.

I do not buy the packets of mixed dry fruits from stores.  They are relatively expensive.  And you don't get to choose what exactly you want.  I prepare my own trail mix.  I learned this from the Merrell blog.  I prepare a mix of cashews, dried berries, walnuts, etc.  Sometimes I mix brazil nuts, hazelnuts etc.  Depends on how much money I want to spend.

If you are past your prime age, say you are 35 or more, your body needs more rest to recover after workouts.  Every alternate day is a rest day for me.  You don't agree?  All right, you do what suits you.

Should you do workouts in the mornings or in the evenings?  I say mornings.  Are you concerned of burning out from the morning workout and then lacking energy for the rest of the day?  I'd say the equation you have right now is not in balance for you.  Why not try reducing your workout.  If your daily routine leaves you with no choice other than a evening workout, okay, an evening workout is better than no workout.

What if I decide to ride cycle to my workplace?  Oh, if you are living in a city that is cycle-friendly, (such as Mainz, Germany) this is an excellent choice.  All Indian cities today are not at all cycle-friendly.  Air pollution levels are also alarming in Indian cities.  I live in Pune, India.  I never want to take the heavy risk.

Over the years, certain lifestyle trends evolved for me and my family.  As per our capacity of understanding the world around, we made our choices.  Choices that we thought would improve our health and endurance.  This article is more-or-less a narration of some of them.  Oh yeah, The Architect said correctly, the problem is choice.  In one discussion Neo asked The Oracle, "But if you already know, how can I make a choice?"  The Oracle replied, "Because you didn't come here to make the choice. You've already made it. You're here to try to understand why you made it."

Last important advice - we should help our fellow amateur athletes in whatever ways we could.  I learned this from Michael Francis of The Pune marathoners Club.  Michael, thanks a zillion for all you do in Pune.  We are indebted to you.
Gee, you happen to be a professional athlete?  So you have slightly different goals.  You know what role you are in.  And yes we all know - what goes around, comes around.  :-)

Tuesday, July 7, 2015

How do I extract files from ISO

I had created .iso file.  Then I wanted to check if a particular file is included in this image.

In the Windows world, a third party software is required to do this.  Linux has built-in support to do this.

I created a directory in which to mount the image.
mkdir /mnt/iso-check/

Then mount the .iso file.
mount -o loop  /disk1/iso/SONAS-  /mnt/iso-check/

Now I could traverse to /mnt/iso-check/ and check that the required file is in there or not.

After I am done with whatever I was looking for, I unmounted the image.
umount /mnt/iso-check

Monday, April 21, 2014

How do I calculate sum of a column of numbers

I executed a command at a Linux machine, and it produced a long output.  I did the filtering, and now I have a column of numbers.  Now, how do I calculate sum of these numbers?  If you have awk available at your machine, here's how to do it.

$ your_long_list_of_command | awk '{ sum+=$1 } END { print sum}'

Wednesday, January 5, 2011

Sorting techniques in Perl

Check out this SlideShare Presentation: