Monday, March 31, 2014


ngrep is the packet capture tool I always wanted. I always found tcpdump and wireshark etc too intimidating. ngrep prints everything it capture on stdout and like any other command line tool on *nix, the output can be further piped into other tools like grep, awk, sed or cut. Let me show a few examples

1. Capture all requests on port 80
sudo ngrep -q -W byline '' 'dst port 80'

2. Capture all http get requests on port 80 and headers

sudo ngrep -W byline -q -t '(^GET .* HTTP)' 'port 80'

3. Capture all GET requests on port 80
sudo ngrep -W byline -q -t '(^GET .* HTTP)' 'port 80'|grep -E '^GET /.*' 

4. Capture all GET/POST requests and responses (not in sync)
sudo ngrep -W byline -q -t '(^GET .* HTTP)|(^HTTP/1.1)'|grep -E '^(HTTP/1.1)|(GET /)' -B1

Thursday, March 27, 2014

Dilemma of growth vs environment

All the industrialised countries managed to kill their environment for growth and then are going back to environment after they have reached a state where they can afford to think about environment. Saving forests at the cost of nutrition, health care, immunisation, jobs, education, roads, electricity, clean drinking water etc cannot be justified. It is very easy for us to sit in our cozy offices/homes and comment about saving environment.

Forests have become breeding ground for maoists who continue to make sure people in those areas live in extreme poverty and continue supporting maoism. People are opposing nuclear plants after getting influenced by Greenpeace. How many people died in Fukushima outside the plant ? None! Millions die everyday due to lack of medicines, healthcare, clean drinking water and all this cannot be delivered to people with energy. We have an option of either using nuclear energy which is relatively clean or use thermal which is heavily polluting. We do not stop flying just because a plane crashed.

Similarly, we enforce coastal regulatory zones (CRZ) in cities like Mumbai and do not allow to build drains and water treatment plants as these will result in some mangroves getting cut. In Mumbai, metro line 2 is not being made as the coach depot has green hurdles. What is the use of CRZ in Mumbai ? People say that mangroves help Mumbai from flooding. Why not just make sure we have enough infra to take care of storm water? Other large cities manage it. I am sure Mumbai can manage without mangroves too.

I don't think we can continue to live in these city villages & forests and dream of growth. We cannot have both at the same time.

Thursday, March 06, 2014

Bitcoin is #fail and how RBI was right about it

Bitcoin bank closes down after $600,000 hacker theft

Bitcoin Singapore CEO suicide

MtGox continues to crumble, Flexcoin and Poloniex hacked, ZeroBlock gets RTBTC

And here is RBI's advisory released on 24th Dec, 2013 and I quote:

  • VCs being in digital form are stored in digital/electronic media that are called electronic wallets. Therefore, they are prone to losses arising out of hacking, loss of password, compromise of access credentials, malware attack etc. Since they are not created by or traded through any authorised central registry or agency, the loss of the e-wallet could result in the permanent loss of the VCs held in them.
  • It is reported that VCs, such as Bitcoins, are being traded on exchange platforms set up in various jurisdictions whose legal status is also unclear. Hence, the traders of VCs on such platforms are exposed to legal as well as financial risks
The second point came into play as Mt.Gox the biggest bitcoin exchange was hosted in Japan and users in USA etc have no direct legal overreach to it.

At today's value of bitcoin of $668, the value of stolen 800K bitcoins is more than 500 million dollars!