Monday, November 25, 2013

Missing something.h file while compling/installing a package in linux

This error can be remove just by installing development  package of that particular package.

Wednesday, November 20, 2013

What is REST

Dear All,

Here is a brief explanation about REST(REpresentational State Transfer) as per my understanding.

We have been using Web for years where we fetch/create/update some data using GET,POST or PUT methods. These methods are quite generals and can be applied on almost any resource available over Internet.The REST says that the same idea on which Web works cab be applied between machine to machine interaction. But REST is not limited to these operations only.

In other way, we can think of each Web applications as a state machine having some business logic to make state transitions of the resources. The idea of REST is to map each state transition onto some request to a resource and provide clients with links representing transitions available in the current state. Thus it models the state machine via representations and hyper links. In this way we can think of REST as replacement of RPC(remote procedure call). The advantage of REST over RPC is that REST provide loose coupling where as RPC is tightly coupled. In case of REST client just require a URL(i.e. location of resource) along with some arguments just to specify the next desired state  while in case of RPC, the client must have full domain knowledge of server side.

A good of example of REST is opening a bank account. For opening a bank account you usually go through following process,

1. Go to the bank fill a form and submit to clerk at counter no 1.
2. The clerk will check the form and give a slip back and instruct you to go counter no 2(may be the cashier)
3. Give money to the clerk and clerk will give a slip and instruct you to go the counter no 3
4. At counter 3 clerk sees your slip and give you a passbook.

Here if we replace bank clerk as servers,forms as request and slips as a states of a operations, we can think of a distributed application using REST principle.One more thing here which needs to be mentioned that servers may be in different management domain located far away from each other. In this way, we can have a distributed application involving computation among several heterogeneous machines.

A second example which is a hypothetical but more useful and practical.
Suppose you refrigerator is connected to Web and find that its Milk inventory is low. Now it can to a grocery server located somewhere end of the world. That grocery gives it the local grocery address in form a response containing local grocery store URL. The refrigerator now goes to local store and enquire about milk. The store gives it a number of options probably a list of different milk brands. Now refrigerator choose a milk brands and quantity, the store diverts refrigerator to go to a payment gateway and pay money. After paying money, the gateway may divert refrigerator to the store. Now store confirm order after which delivery may follow. Here a number of state of the same operation(ordering a milk) is involved. If you see closely no server has to remember the all the state. This in compliance with Web which is also stateless.

Here are quick summery of all the above discussion:

1. Web is already is using REST principle.
2. REST  eases communication among machines rather than between machine and human.
3. It is the success of Web that had led people think to extends Web principle and develop REST.
4. REST makes your client as well as server side development quick,easy,scalable,fast and reusable.
5. REST says nothing about technologies involved but since it is inspired by HTTP the obvious choice is HTTP.
6. REST models things as real worlds works in day to day life.


Thanks and Regards
Lalit Patel

Tuesday, October 1, 2013

Sendto Failed Operation not permitted error

Usually this error happen when you firewall is blocking your application.

Wednesday, September 11, 2013

using iperf for monitoring end to end throughput

Dear All,

Sometime we need to monitor end to end throughput. Iperf utility comes very handy in these scenario. So how to use iperf. First install iperf  after downloading rpm from this link

Just use the following command to installed

rpm -ivh iperf.rpm

Now you will get bin file iperf

use following command to check throughput

i) At server side

iperf -s   

ii) At client side

iperf -c

For increasing window size use following command

iperf -c -w 40960

For finding throughput in both direction us following command

iperf -c -r

Sunday, September 8, 2013

Auto-negotiation fails between links having Fiber SFP connector interface

Dear All,

Last day I had a big headache because of the above mentioned problem. So always try to avoid putting the interface in auto-negotiation mode.

Monday, August 26, 2013

Lets use Python or Ruby

Hi All,

I suggest everybody to use Python or Ruby for programming everything because python/ruby require less code which in turn means less chances of bug. Yes Python is little bit slower than C but that can be compensated by using a high end server class machine.

Wednesday, August 21, 2013

Where to put index in a database

Hi All,
Index are used for faster searching. Just as in Books, index helps us to find a topic fast. Similarly we use index on a database table to make our query fast. Now the question is on which column we should put index. Answer is quite obvious from book example. We should put out index on the column which is used for searching. Suppose you have a employee table with  columns as employee_id,name,email,salary,address,last_updated etc. Now if you frequently query employee table as "select * from employee where name='x'" then you should be put index on column "name".