fix #29

- fix ubuntu support
- tested on ubuntu 14.04 and 12.04
- fix centos support
- tested on centos 6.5
the result is always != 0 even when it is ok, instead. I will try to find the reason