Psychology - A needed skill for Effective Leadership

Psychology - A needed skill for Effective Leadership

Psychology is a required skilled required for People who aspire to be leaders or people who claim to be leaders.

Evaluate your Leadership Skills

It is my personal experience, many people in leadership positions lack this skill. It becomes more apparent that people in Leadership role ask themselves the following questions

1. Have you asked people you mentor time to time - How are they doing? Are they doing good at professional or personal life?

2. Have captured every opportunity to appreciate them for doing anything good?

3. Have you been candid to give very very specific feedback for good and bad observations about them?

4. Do you remember on the top of your mind, what their aspirations are and where are you with helping them reach there?

5. Have you developed a relationship with them, where they are free to let off their steam(anger, frustration) at you? Believe me this is also one of the responsibilities when you lead people

6. Can you describe your people uniquely in a creative and appreciative manner at spur of the moment, say you are introducing them to others?

7. More Important, Do you?

8. Have you taken time to write a truthful recommendation for them?

9. Do you respect people, Who do what is asked of the? They may be rated as average in their appraisal or would not get highest of raises. But do you acknowledge and respect their wish to live life in that manner

10. Do your people feel like sharing good things in their life? Do they come and share things with you themselves?

Now these are only few of dozens more questions you should ask yourself, if you call yourself as a leader.

Things to do for becoming a better leader

If you want to become a better people's person, here is what I would really recommend

1. Be able to uniquely and creatively introduce your people to people they don't know. The quality of how you introduce your people actually shows, how much respect and admiration you have for them. Practice, Practice and Practice

2. Be sure you stop and talk to your people regularly, more important stop and listen to them more. Talks which happens in corridors, near coffee machines are more important than what goes inside a meeting room.

3. Take very opportunity to appreciate, especially personal things. Some one is wearing a good shirt and really looks good in it, appreciate, you observe their attitude towards life, appreciate it. Its important to catch the smaller things than the larger ones. If you have difference of opinion or dislike a person, especially find things to appreciate.

4. Instant rewards, could be anything. Any Rewards and Acknowledging itself is one of the biggest motivator, even more than money. Treat your people, if needed spoil them. Remember everyone needs to feel special, cared for. Do that much and people will shower you with their trust, hardwork and love. I have seen it first hand, when this happens, being around such people itself is a big reward in life

5. Always remember conversations you had with people. Even if you can't do much about it. Just recalling them and stating you remember and have taken a small step towards itself helps. Nothing is more satisfying when I know my mentor remembers what matters to me.

6. Earn Respect by being good at what you do. If you are a leader who wants to gather people around and make them sit around in professional world, All the best. People in the professional world want a leader who can point to a place and say “That’s where we want to go”. That’s the nature of professional world. People in Spiritual world would say otherwise “Where are you going? sit here and be still” and yes that is right for them.

Well there are dozen more things I can write.

So where does Psychology come into picture here?

Understand Circles

Psychology wise the basic thing in all above is Circle of influence/ego. In Psychology Ego is used in the rawest form, so if you don't like it use a nicer word instead. We have layers of circles around us.

1. Thoughts

2. Body

3. Family

4. Friends

5. Works People

6. Religion/Cast/Region/Classes/Jobs

7. State

8. Country

9. Continent



Human Nature

Human being would in general works towards

1. Attracting people within their circles by providing more

2. Making people jealous outside their circle

Take a moment and think about it, no matter how raw it may sound, recollect your past around the above statement

Entering People’s Circle

The key is you enter people's circles subconsciously not consciously. That is why most people do not get why someone else is being more popular or liked than themselves. More true when you want to be in the circle of your boss, or you are in a leadership position and you are clueless of why people still like their old mentors or other mentors than you.

The easiest and fastest way to become part of any one's circle is

1. Smile and Eye Contact

The moment you see someone, your instinct or subconscious mind makes a decision whether you like him/her. Then your conscious mind finds logical reasons to back that. We are not as logical as we appear

Hence consider a Smile and Eye Contact as cheat codes, use them all the times.

2. Body Contact - Shake hand, a pat on the back.

Again a Shake Hand or a Pat on back with colleagues go long way.

Let me give a non work example, especially for guys. If an average girl hits you in fun, when  you tease her, that relationship/friendship suddenly becomes very important.

But a Body contact has to be appropriate otherwise it would give you exact opposite results.

3. Appreciate, Appreciate and Appreciate

This is the third secret. Everyone has a circle of Ego/Self Esteem, they will open doors to people they agree with. Most people think very highly of themselves (no matter what), that is the human nature. Agreeing with specific traits of a person, results in them subconsciously opening the doors to their circles.

  Simple examples to help you out

  1. That Shirt looks good on you

  2. Someone’s all Happy today

  3. You two did a good job making that Good Looking Kid. (Always works for new parents, and believe me all babies are adorable)

  4. I really appreciate you being so upbeat despite all the trouble in your life.

  5. I dig the way you can be so consistent.

If you want to Guys, you will always find a way.

Many people who are angry about someone, will react to this advice saying I can not do “Kiss Ass”.

People who feel this has two issues

   - They have not clearly understood the advice. The advice is be true of what you appreciate. Find things that you could appreciate

   - They have people issues themselves. Their personal feeling are troubling them. They need to vent it out but not at anyone’s else expense.


Be Illogical with People, Be Logical with machines. Highly Logical People are

  1. The most boring

  2. The saddest

  3. and the most unhappiest

people in the world. People work at subconscious level. Logic does not work all that good at Subconscious level.

Be fun, open, transparent and more real. And knowing the above science you can be easily be part of anyone’s circles (if you wish so). For me this is very natural since I have practiced this for many years now.

All this becomes apparent to you if you study psychology and people around you. Easiest way is to be aware of how you feel and why you feel that, that itself is sufficient to learn psychology. Just be true to yourself when you do that, that is the trick.


Having said that, being Human’s we are not meant to be perfect. Our Perfection is in our flaws. You will not want some people to be part of your circles at all. Its fine, but understand that their is a scientific reasons for this.

Arduino Uno Self Balancing Robot

Arduino Uno Self Balancing Robot

This is an preliminary design for my Arduino Uno Powered Self Balancing Robot. This Robot is built using Arduino Uno R3 as its main micro controller.

[singlepic id=89 w=320 h=240 float=]

The concept behind the Robot is simple.

[singlepic id=90 w=320 h=240 float=]

Its got only 2 wheels. The Robot needs to balance itself constantly and navigate itself around. This is much like how a Segway works.

The Body of the Robot is made of Lego NXT blocks. It uses two "hs-311" servo motors, these are full rotation servo motors.  These are mounted on Lego Frames using HSK311CR NXT mounting kit from The concept is very simple Arduino Uno will motor whether Robot is falling forward or backward and send commands to the Servo Motors to go forward and backward to compensate. In reality the Robot is constantly falling and compensating for the fall.

Arduino relies on a 3 axis sensor to know whether its falling forward or backwards and calculates how much to move forward and backward.

Apart from this the Robot has eyes using Ultra Sonic Sensor. These enable the Robot to see few inches ahead (in theory) and know if something is blocking its way and if so, it will change its path.

[singlepic id=91 w=320 h=240 float=]

Disclaimer - The Robot is under construction, the above theory would be tested and modified as it is built and running.

Component list -

The Robot is build using

- Lego Technic/NTXT Blocks - 2 Full Rotation Servo Motors (HS-311) which plugs into Motor Shield directly - NXT Mounts for Servo Motors ((HSK311CR from  - Enables Servo motor to be put in Lego Blocks - Enables Servo motor to rotate Lego Wheels - Arduino Uno - Arduino Groove Sensor Shield for Uno - Arduino Servo Motor Shield - 3 Axis Gyroscope Sensor which works with Groove Sensor Shield - Ultra Sonic Sensor which works with Groove Sensor Shield - Temperature & Humidity Sensor which works with Groove Sensor Shield


First 3D Print using Cubify Cube (2nd Generation) 3D Printer

This is my second 3D printer. This time I ordered a professional and easy to use 3D Printer. Cubify Cube 2nd Generation 3D printer, which costed roughly $1300. [singlepic id=94 w=320 h=240 float=]

The Object being printed comes with the 3D printer in an USB stick. What I loved about this Printer is you can print using USB stick. What I did not like so much is very simplified Software with not many options.

[singlepic id=92 w=320 h=240 float=]

Enjoy the Video.



Linkedin Graph Search using Neo4j - Work in Progress


Facebook Graph Search is nice, it still lacks many desirable features, but its a good start. While its good to find Friends who went to same school, or lived in same city, or have same interests, the real power of Graph Search would be when it is applied to site like Linkedin.

At the time of writing this blog, I will be honest, i have not done research of any similar tools already present for LinkedIn. I am more interested in understanding Graph Database and how to create my own Facebook Graph Search.

Special Note *

This is a work in Progress and this blog was written to capture my thinking at this point of time. So far I have written a Node Script to pull data from Linkedin and currently working on loading the data into Neo4J

Step 1 - Pull Data from LinkedIn

If we have to pull basic data about a person or his/her connection, it would appear somewhat like the following.

    firstName: 'Rohit',
    headline: 'Director of Engineering - New Technologies',
    id: 'ovX6AJPGnk',
    industry: 'Information Technology and Services',
    lastName: 'Ghatol',
    location: {
        country: {
            code: 'us'
        name: 'Houston, Texas Area'
    numConnections: 500,
    numConnectionsCapped: true,
    positions: {
        _total: 16,
        values: [{
            company: {
                id: 65662,
                industry: 'Computer Software',
                name: 'Synerzip Softech',
                size: '201-500 employees',
                type: 'Privately Held'
            id: 27449797,
            isCurrent: true,
            startDate: {
                month: 7,
                year: 2008
            summary: 'Define Technical Direction of the Company. Develop key skills for bleeding edge Technology and lead the clients/prospects on choices on Technology and Architecture Front.\n\nCreate more leaders in the Organization to expand the Company',
            title: 'Director of Engineering'
    siteStandardProfileRequest: {
        url: '**&trk=******'


Step 2 - Present Data in Graph Database

The above data is very rich, cause it had relationship with in itself. And think about now adding all your connections in that as well.

In a Graph Database like Neo4J, You have Nodes and Nodes are connected by Relationships. Both Node and Relationship can have properties.

Here is a rough representation of People, Industry, Company, 500+ Group etc in a Entity like Diagram. (Note Entity like diagrams can not represent Neo4J structure as Relationship also have properties)

[singlepic id=75 w=800 h=600 float=]

Current Progress

While the above relationship is ideal, so far I am able to load up some 30-40 connections with following relationship

[singlepic id=78 w=400 h=300 float=]

Neo4j Dashboard

[singlepic id=76 w=800 h=600 float=]

Neo4j Data Browser

[singlepic id=77 w=800 h=600 float=]


Please note while we loaded the information in Neo4J we used some indexes to make it easier for us to fetch data back.

There are two indexes for 2 different type of nodes

  1. industry - As the name suggests it indexes industry by its name
  2. person - As the name suggests it indexes a person but by its id

There is another index for relationship, we call it

  1. knowledge

In short think of this as follows in simple english (although it would have been better if we called it belongsTo. :)


[singlepic id=79 w=800 h=600 float=]

Step 3 - Run Queries on Neo4J Using Cypher

Now that partial data is loaded we can run some basic cypher queries on Neo4j. Since we don't have all relationships we can only do so much.

Basic Queries

Search for the Industry

[singlepic id=80 w=800 h=600 float=]

Advanced Queries

Search for all person belonging to "Information Technology and Services" Industry

[singlepic id=81 w=800 h=600 float=]

Search for all person belonging to "Information Technology and Services" Industry who have less than 200 connections

[singlepic id=82 w=800 h=600 float=]

Search for all person who belong to same industry which "Rohit" belongs to

[singlepic id=83 w=800 h=600 float=]

Search for all person who belong to same industry which "Rohit" belongs to and have 500+ connections

[singlepic id=84 w=800 h=600 float=]

Future Possibilities

Now if we are able to get the following graph loaded into Neo4J even for one person the numerous possibilities of traversing the graph open up. Add to it if we are able to capture information in Neo4J not from one person but from an Organization perspective, the power of Graph Search will open new frontiers.

[singlepic id=75 w=800 h=600 float=]

Remember, this is only partial data loaded from Linkedin. Imagine if we are able to load a detailed profile (breaking it down into further relationships) and augment by adding other information to this Graph e.g

  1. Blog Feeds
  2. Twitter Feeds
  3. Facebook Feeds
  4. Yammer Feeds
  5. etc

some how managing relationships between them.


Disclaimer * - While I say the above about doing this on an Organization level. This is simply a what if scenario to see what can be done. The intension of this blog post is not to call an all out war on privacy and morality :).

Any one's who name appears in this blog is result of Linkedin Connections. If any one has any objections about it, please feel free to contact me and we will works things out.

Getting started with deploying SPA, Node and Mongo Apps on Heroku - Developer Focused


First of all this blog is developer focused, hence I avoid going into details like Heroku for production. The purpose is to help developers quickly deploy apps on heroku for testing

What is Heroku?

Heroku is a Cloud Application Platform. It enables you to quickly and painlessly deploy your Applications on the cloud.

[singlepic id=59 w=800 h=600 float=]

Heroku supports following languages

[singlepic id=63 w=600 h=400 float=]

Why use Heroku?

In today's world a developer's Resume is really the following

Linkedin Profile Pointing to the following

    1. Your Opinions - e.g Blog
    2. Your Ideas - e.g Twitter
    3. Your Skills and Accomplishments as Ployglot programmer- Series of Hosted Applications on the cloud
    4. Online Source Code e.g
    5. Online Forum Activity and Scores e.g StackOverflow
    6. Online Presentations e.g Slide share
    7. Online Videos e.g Youtube

Now lets focus on the part in Red - Series of Hosted Applications on the cloud

A Developer writing, testing and showcasing application on the cloud has to as easy as he/she does this on his/her laptop. And Developers love

  1. Free Quotas on Servers, Database and Hosting
  2. Command line tools to work on cloud as they are working locally
  3. Popular AddOns e.g for Node easy and ready addons like Mongo, Redis, etc makes lot of sense
  4. Use known tools to deploy the app

Well Heroku is built thinking about all these things.

Getting Started Guide Available for Popular Languages

[singlepic id=62 w=600 h=400 float=]

Command Line Tool Available to deploy apps and check logs and status

[singlepic id=60 w=600 h=400 float=]

Easy to Add Free Quota based Addons

[singlepic id=61 w=600 h=400 float=]

How to use Heroku?

Enough of Bluff, now lets move to Stuff


  1. Create Heruko Account & Install Command Line Tool
  2. Clone existing Node, SPA (Single Page Application - HTML/JS), MongoDB locally
  3. Run the existing Node, SPA, MongoDB Application locally
  4. Run the existing Node, SPA, MongoDB Application locally using Heroku
  5. Run the existing Node, SPA, MongoDB Application on cloud using Heroku

Lets get Started

Create Heruko Account & Install Command Line Tool

Step 1

Goto and sign up

Step 2

Install Heroku Toolbet from

Step 3

Ensure Heroku is properly installed by trying heroku tool on command prompt

$> heroku

Clone existing Node, SPA, MongoDB locally

SPA stands for Single Page Application typically built using HTML5, JavaScript and CSS3

We will refer to an already existing Todo MVC from this source -

* Todo MVC - An App which demonstrates how to create a simple Todo App, in various technology stacks. This is the new Hello World


  1. git command line client is installed
  2. node and npm are installed
  3. mongodb 2.4.x downloaded, unzipped and in path
  4. configure git and npm to work around any firewall restrictions you have

Step 1

Clone the example from github

$>git clone

Run the existing Node, SPA, MongoDB Application locally

Step 1

Start your mongodb database


Verify whether mongodb is running by trying following command on a different command prompt


* mongod is the mongo daemon/server and mongo is the client to connect to the server to try few mongo commands. Do not close the command prompt running mongod

 Step 2

Fetch all the dependencies

$>cd node-backbone-mongo

Download all dependencies

$>npm install

Step 3

Start the application

$>node app.js

Open Browser - http://localhost:3000

[singlepic id=64 w=800 h=600 float=]


Run the existing Node, SPA, MongoDB Application locally using Heroku

Step 1

Login into Heroku using command prompt tool

$>cd node-backbone-mongo

$>heroku login

Step 2

Create Application on Heroku Cloud using command prompt Tool

$>cd node-backbone-mongo

$>heroku apps:create todomvc-trial

* the app name is unique across heroku, try some other unique name

Step 3

Create a Procfile

$>cd node-backbone-mongo

$>echo "web: node app.js" > Procfile

* Basically use any text editor and create a Procfile with following text

web: node app.js

Step 4

Run App locally using Heroku

The tool heroku uses to run the app locally is called as foreman and the it reads the Procfile to find out what it needs to run

$>cd node-backbone-mongo

$>foreman start

Start browser - http://localhost:5000/

[singlepic id=65 w=800 h=600 float=]

Run the existing Node, SPA, MongoDB Application on cloud using Heroku

Lets first of all foresee what problems we will face if we run this application as it is on Cloud

  1. It assumes there is a MongoDB server running on localhost at predefined port
  2. It assumes it will run on port 5000 - Not to a good port to run web app on

For here onwards there are 3 steps

  1. Add a Mongo DB add on to your Heroku App
  2. Make Code Changes to get correct MongoDB Url and Port Name while running App on the Cloud
  3. Push the App to Heroku (we are running it locally so far)

Add a Mongo DB add on to your Heroku App

Heroku has concept of add ons, which you can add to your existing apps. We will see how to add these from Command Prompt

Step 1

Find the Addon and Command for it

[singlepic id=72 w=800 h=600 float=]

[singlepic id=71 w=800 h=600 float=]

[singlepic id=70 w=800 h=600 float=]

Step 2

Run the Command

$> heroku addons: add mongolab

[singlepic id=69 w=800 h=600 float=]

Step 3

Verify the effects of the Command

[singlepic id=68 w=800 h=600 float=]


You can proceed and look at the database if you want

[singlepic id=67 w=800 h=600 float=]


Make Code Changes

We need to make code changes so our Application use the correct information for the following

  1. Which MongoDB to connect when on cloud and when running locally
  2. Which Port to run the Web Server on when on cloud and when running locally

Lets Open app.js and see what code we need to change

[singlepic id=73 w=800 h=600 float=] Orignal Code

var port = process.env.VCAP_APP_PORT || 3000;

  var services = JSON.parse(process.env.VCAP_SERVICES);
  var dbcreds = services['mongodb'][0].credentials;

  mongoose.connect(, dbcreds.db, dbcreds.port, {user: dbcreds.username, pass: dbcreds.password});
  mongoose.connect("", "todomvc", 27017);

Modified Code

Heroku has concept of Environment Variables. You need to see things as follows

  1. When you are running app locally using foreman, your code will have access to locally declared environment variables. e,g Port and Mongo DB Urls can come from environment variables or can be hard coded (as we have done)
  2. When you are running app in the cloud using heroku, its running on a server which has its own set of Environment variables. When we added the Mongo DB AddOn, heroku added an Environment variable named "MONGOLAB_URI"

JavaScript has a very easy way of doing if else (for fallback scenarios)

var port = process.env.PORT || 5000; really means if you can find process.env.PORT value (in short read PORT environment variable) then use if , if you don't find it then fallback to 5000

So on the cloud port is 80 and on your local machine it is 5000

Same thing applies to uristring, locally it falls to a locally running mongodb, on the cloud it uses one of the Add On Mongo DB (provided you have added them)

var port = process.env.PORT || 5000;

var uristring =
    process.env.MONGOLAB_URI ||
        process.env.MONGOHQ_URL ||

mongoose.connect(uristring, function (err, res) {
    if (err) {
        console.log ('ERROR connecting to: ' + uristring + '. ' + err);
    } else {
        console.log ('Succeeded connected to: ' + uristring);

* MONGOLAB_URI and MONGOHQ_URL - Well Heroku provides two addons for Mongo DB, depending on which one you choose heruko will declare one of the above Environment variable on the server/cloud machine where it runs your code


Push the App to Heroku

Now the final Step make this app run on the cloud. Well this part can not get any simpler

Heroku pushes code from local machine to its cloud using git mechanims. Its like checking in your code and the server checks it out and runs it (like Continuos build cycles)

Got thing with source code versioning tools like git is that it is a 2 step process

  1. Local Commit for tracking
  2. Push Changes to Remote Repository

Now we said Heroku uses git for pushing code to the cloud, this means your code has to be in a git repository

  1. Either Locally declared git repository
  2. OR cloned git repository as we are doing


First step carefully read the following part


Recall We did git clone from github

Unlike SVN or CVS, in git, we clone the entire repository on client machine and all the code, history is available. These cloned repository know where they can push changes, in this case the original github repository

Further Recall we did $>heroku apps:create

When we did $>heroku apps:create, it added a remote repository entry in our local git repository (to be precise with the name heroku)

Now when you commit changes locally and the local git repository goes out of sync (or advances) we have an option of pushing those changes to not only the

  1. Original github repository where we cloned from
  2. But also to Heroku cloud

Actual Steps to push code to Heroku

We have made code changes in app.js

Step 1

Commit changes to local repository

$>git commit -a -m "Code changes to make code run on Heroku"

Step 2

Push changes to Heroku

$>git push heroku master

You will see a long log here, which will show you what Heroku is doing on the server when it receives the latest code

Step 3

Access the App running on the cloud

$>heroku open

[singlepic id=74 w=800 h=600 float=]


Quick Recap

Following are the commands we used

$>git clone

$>heroku login

$>heroku apps:create todomvc-trial

$> heroku addons: add mongolab

$>git commit -a -m "Code changes to make code run on Heroku"

$>git push heroku master

Special Notes

In case you want to link an existing code (which is part of some git repo) with already existing heroku app, you can do the following


$ heroku git:remote -a todomvc-trial