Internet of Things – Good, Bad, and Ugly!

First things first – Please stop calling it IoT. It’s Internet of Things.

By 2020, 4.9 billion ‘Things’ will be connected and will be in use. That’s4,900,000,000 Things! [1]

It’s a well-established fact that Internet of Things is the most hyped term right now[2]. But little do people know it has been here for a while. It was called M2M [3] orMachine to Machine communication. Still used in industries all over the world.

Now, with exponential growth of devices connected to the Internet, Internet of Things brings hope, concerns, fear, and skepticism. And it boils down to this – Is it all really worth? What about privacy? Or maybe, What about trust?

If you ask me, My answer is YES! It is worth it. But with trade-offs (in the short term future). In long term, we will all adapt to it like we have always. And it will be a normal part of life.

The Good

The best thing I like about Internet of Things is that it enables connectivity. It allows more ways and more things to be connected. Which is good. Imagine a world of connected machines. All of them sharing information and making intelligent decision on their own. Sounds like machines from Matrix or Terminator? I beg to differ.

An example could be, a city with cameras installed on major highways. And these cameras feeding videos/images to a centralized processing unit. This unit, processing all the data, understanding bottlenecks, accidents, etc. And rerouting traffic by sending routing information to traffic lights ( machines again ). I don’t see any evil in this.

The Bad

Now, a lot of people are concerned about Internet of Things. And one of the major question people ask is: “What about my Privacy?”

Well, If you are reading this article, it means you are online. Which means that you have already kissed your privacy goodbye! Little harsh? yes, but its true. If you are online, everyone knows about you. Specialists know about your bank accounts, passwords, social security numbers, etc. Heck, Target already knows that your daughter is pregnant [4].

Your privacy is already blown. Mine too. In my case, I care less. So, its all cool with me. You should also calm down. Like I said, we (Homo Sapiens) will adapt. We always have.

The Ugly

Honestly, I can’t find anything to classify it as ugly for Internet of Things. Few say that Skynet will become a reality. Well, I don’t know.

The Future

All the hype around Internet of Things is good. It’s making us explore more and create new ideas. But the actual benefit will not come from Internet of Things alone, It will come from technologies and platforms that will result from Internet of Things.


This article is a repost from:


How Social is this URL?

At the place where I work, we do a lot of research about a brand before pitching an idea to them.

One of the key metrics that we present to our clients is the social reach of their products, websites etc. It’s a simple metric that tell you a lot about the health of a brand.

But lately, I noticed that whenever a person in our office had to get these numbers, he/she had to ask someone from tech team to get it for him/her. This is a time consuming process, plus it wastes a lot of time of my tech resources. Solution? Spend 1 hour to build a simple tool and save numerous hours that are wasted on digging up these numbers.

So I built this tool: Shared Count. Its a very simple tool that asks you for a URL and returns various social counts for it. Sure tools like these exists. Why I created this? Because, other tools don’t have a good UI. Mine has. At least it’s better in my view. Plus, I will have control over it. I can modify the code at will. Include/exclude features or supported websites.

I have released its code as open source. You can check it at Github. Fork it, Modify it.

Validating URLs

How many times have you struggled with URL validations? I have struggled a lot. Damn, those stupid regex(s). Well regex as a tech is not stupid, it’s awesome. but when u have a 10,000 regex expressions to choose from? and on the top of that every regex gives different result.

When I faced this challenge, I tested more than 80+ regex expressions, obviously not in a day :P. Then had to settle with a regex which had a least probability of producing -ve results.

Obviously as a programmer, I wanted better alternative. And I stumbled upon PHP filters. Well, it can be used for other things than validation as well such as sanitization, etc.

Why I would like to use filter_var instead of my or anybody else’s regex. Simply because, regex used in filter_Var are well tested and produce far less -ves. Moreover, being a native function, it produces results faster.

As far as my Codeigniter Application is concerned, I have extended the Validation library:

And I am all set *grins*.

Semantic Experiment

With social media growing like hell, There’s a wealth of information available over Internet. Be it a company, or a brand or even me for that matter, everybody is talking about everyone.

Put simply,

If you exist in the ‘real’ world, I am talking about you!

Well, this post is not about Social Media or it’s impact or whatever. I am a programmer for god’s sake! It’s about what you can do about this information and how to analyze it and an approach I would be using. Seems Interesting, eh? Yeah it is, but you see, now arises a problem!

The Problem

It’s information out there not just data, you Moron! 😀 If you want to get some knowledge, you have to work on information. Remember classic (data -> information -> knowledge) rule! It applies here.

Short answer: Take advantage of others and use their system to do the tough part on your behalf. There are a lots of systems that are available online for use. For eg. you can use OpenCalais to semantically analyse information to get knowledge. And/or you can use systems like Social Mention to get the popularity index for a ‘Information’.


I am currently working on a system which does this kind of processing and the system is working perfectly so far. I can’t give out techs or specs about it. Yeah, I could land up behind bars for doing that! 😛

I am still working on it and discovering a lot of things everyday. I’ll post hows and whats of it when I am done building it.

Codeigniter 2.0

So finally Codeigniter 2.0 is here. With 2.0 a lot has changed. Primarily, Ellislab split up CI into two branches, Reactor and Core.

As they say,

CodeIgniter Core
Core is a slow-moving branch that will be used as the base for EllisLab commercial products such as ExpressionEngine and MojoMotor. It will continue at a similar pace that CodeIgniter has in the past and will be useful for large commercial applications that require the upmost in stability and backward/forward compatibility at a pace more typical of SLA backed Enterprise products. Core is publicly available with tagged downloads at BitBucket.

CodeIgniter Reactor
Reactor is a community driven branch of CodeIgniter that will enable faster adoption of the best community submitted code to the framework. This means the community can create a fork of the project on BitBucket and contribute bug fixes, new features, documentation improvements, etc and have it reviewed by a code-review team called Reactor Engineers. These Engineers are primarily responsible for driving the development of the framework.

In simple words, Reactor will be managed by community + Ellislab and Core will be managed solely by Ellislab.

Some interesting things I liked,

  • Support for PHP 4.x is gone
  • Application Folder now sits outside System folder
  • CLI support (I am still trying to figure it out)
  • Full Query String support
  • memcache and APC support

Also, Ellislab has changed the file structure a lot. Check out change log to know more.

In all, new version seems interesting. Though moving 1.7.x apps to 2.x is not easy. Since, Plugins have been deprecated, you will need to convert plugins either into libraries or helpers. Also, some of the libraries may not work with 2.x.

The only thing that is making me doubtful is why CI has been split up into 2 branches? Is Ellislab trying to make money by creating an Enterprise version? I hope they don’t.

Permanent 301 redirection of non www domains to www domains

How to redirect your domain to domain with www prefixed

redirection of your domain ( name to is very useful and must be done. Reason for this is that when you have a non redirected domain name then search engines will see and as two separate websites. Hence you will lose much of the website traffic due to this.

One of the simplest solution for this is to add a .htaccess file and permanently redirect your domain name to www prefiixed domain name. Here’s how to do it step by step:

  1. Create a file with name ‘.htacess’
  2. Add the following code to it:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^$ [NC]
    RewriteRule ^(.*)$$1 [L,R=301]
  3. replace the ‘’ with your domain name
  4. upload this file to your web servers root folder

Thats it. You are done. You can check the redirection by typing your domain name in the browser without www prefix.

Note: Above told method only works for apache web servers. For IIS servers I recommend reading

Hope this tip will help you! cheers!

A Better Programming Stack!

We all programmers always try to find ways to do work more quickly and efficiently. Ask any programmer and he’ll say that “I have to write code again and again for so many things! I hate it!”. I am not talking about using for loops and functions here. I am talking about database connectivity, cross platform compatibility. I am talking about Frameworks!

In this post, I will try to emphasize on the benefits and usefulness of using development framework and how to update your development stack to next level. In short, this post is meant for those LAMP developers who still are using core PHP/CSS and HTML for development.


Frameworks for LAMP has been around for some time now and have evolved a lot. According to wikipedia

software framework, in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined API, yet they contain some key distinguishing features that separate them from normal libraries.

PHP Frameworks

There are a lot of php frameworks to choose from, But I suggest CodeIgniter to beginners.

CodeIgniter - PHP Framework
CodeIgniter - PHP Framework

Why is it best? because it’s really easy to install and learn. Requires minimal configuration and it’s ready to use in 3 minutes. It supports all major databases. All you have to do is call it’s API and it’ll automagically generate SQL queries according to database used. It’s also supports XSS filtering, also has form validation class etc. etc.

It’s also extensible. You can create your own library classes and extend it’s core. There is an extensive documentation which covers each and every aspect of codeigntier.

Home Page:

Other Frameworks to look at

CSS Frameworks

I can list you more than 10 useful CSS Frameworks, but the one that’s very popular and my personal favorite is: BluePrintCSS.

BlurPrintCSS - CSS Framework
BlurPrintCSS - CSS Framework

CSS framework allows you to quickly create websites. This one in particular offers you a grid, typography, forms and even a print css. It’s cross browser compatible so you don’t have to worry about cross browser compatibility. All you have to do to use it is to include screen.css and that’s it. And obviously you’ll have to learn it’s classes though 😉


Other Frameworks to look for

Javascript Frameworks

Javascript frameworks are awesome tools which let you do all kind of animations on the fly, you can also do ajax painlessly.

My personal favorite is: Jquery

Jquery - Javascript Framework
Jquery - Javascript Framework

If you ask me, which framework will win the JS Framework war, I’ll bet on Jquery. It’s so much fun and easy to use. You’ll never look back after using this. I bet you!

Other Javascript Frameworks to look at

Well I think that will be all to get you guys started! If you think I missed out something then do let me know! All comments are welcome