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: https://www.linkedin.com/today/post/article/internet-things-good-bad-ugly-neeraj-kumar?trk=prof-post

 

Force a page to load inside Facebook Canvas

As a Facebook apps developers, quite a few times you may have encountered a situation where you had to make sure that a page loads inside Facebook’s App Canvas.

There are couple of ways of doing this, but I found this one most easy to use:

How it works:

1. This code on page load will check whether the referrer was Facebook or not. This is done because, when a app loads in Facebook canvas, Facebook makes a POST request to the default page.

2. If the request was from Facebook, nothing happens. If it was not, then it redirects the browser to the app url.

Thats it. Its that simple.

My two cents on future of social media – Breakup story of Facebook and Eat24

I have a habit. I read a lot. And my primary medium for reading is Internet. So whenever I come across something nice, I share it with colleagues, friends.

The other day, I came across an article from Eat24. A breakup letter to Facebook. Amusing indeed, I must say. So I sent it to my colleagues. And I received an email back with an opinion.

This is good stuff. Makes me think that Facebook is not the future. I could be wrong though. But the fact that it’s changing so much, people not getting updates from the pages they like, and brands having to spend so much money to get some likes, it’s getting overbaord. Brands might just give up and decide to switch away. Which brings us to the fact that an external property, which is self sufficient, is essential. Plus Facebook needn’t necessarily be the most important social network around but more importance must be given to Twitter since it is more ‘real’ and all content goes out to everyone. Plus other social networks like Insta, Google+ maybe? But the burning question remains, what is the next Facebook, if there is any?

Little unformatted, I know. But good points I must say. I already have been thinking about it a lot lately, And this was just the opportunity I needed to tell people my perspective.

So here are my two cents:

Facebook IS NOT the future.

I could be wrong though.” – no you are not wrong.

But the fact that it’s changing so much, people not getting updates from the pages they like, and brands having to spend so much money to get some likes, it’s getting overbaord” – Facebook is now a public company. And like any public company, they need to make more money. And with such a big user base, Its a very attractive place for marketeers. Plus, see how hard Facebook is trying to break into mobile sector. And like any pubic company with a lot of money, you buy other companies to make more money.

Brands might just give up and decide to switch away” – This will not happen till the time people won’t stop using Facebook. Which is not going to happen, at-least, in near future. but its imminent. They will have to come up with more features, or innovation to keep their user base active.

Plus Facebook needn’t necessarily be the most important social network around but more importance must be given to Twitter since it is more ‘real’ and all content goes out to everyone. Plus other social networks like Insta, Google+ maybe?” – I think answer to this question lies in the another question, where is your TG? If majority of your TG is on Facebook, then it makes perfect sense to spend more on targeting people on Facebook. For some, Twitter will make more sense. For a photographer, Instagram may be more important.

But the burning question remains, what is the next Facebook, if there is any?” – I think instead of asking this question, one should ask, What’s next for Facebook? And I think there is going to be no next Facebook in terms of an idea similar to Facebook. In terms of money, of-course there is going to be next Facebook sometime again, maybe in next ten years? And at the rate the tech changes and new tech evolves, its really hard to predict what is going to be the next big thing.

If you ask me, the future lies in mobile technologies, not cellphones necessarily but in high end, extremely immersible user experiences, Voice controlled systems backed by AI. If I have to coin a term, I would say smart electronics.

Come may agree, some may not. If you ask me, this is the future.

We are still living in 90s

As soon as I began reading this article, It immediately reminded me of a person I had to deal regarding a security audit.

I was working on a web application written in PHP/MySQL. We had to deploy it in a scalable infrastructure and with the kind of money being poured into marketing it, It was supposed to generate a lot of traffic. Which it did.

We were obviously concerned about the security too. We hired a company to do that for us. It was all good till the time the guy asked us to give them FTP details of the server. Asking for FTP details was still alright. Only our servers did not have FTP. Why? because we hosted it on Heroku. A scalable infrastructure, you know! Heroku, Cloudflare, S3 etc.

And if you know how Heroku works, It does not give you a static IP address. Instead you use a cname record. I had such a hard time explaining this to him and his the audit team.

I spent four days fighting with them and trying to explain them why it’s not possible and what infrastructure we are using. Once, I even bluntly dared them to break into the system if they can. Futile attempts.

Anyways, This is one of the responses I received from this guy:

We were trying to identify the IP address associated with this url required for performing the server pentest. We tried the nslookup command for identifying the IP associated mapped to this URL. However, we get a different IP address every time we use nslookup to find the IP.

Isn’t it how Heroku is supposed to work? I also shared few links from Heroku’s user guide, in an attempt to appease his confusion. He still did not listen or even agreed. All he wanted was the FTP access. No matter what.

I had to take a decision. Either fight with these guys, or move the servers. I decided to change the servers to AWS. I did that because we could not afford to delay the launch of the app.

But one thing is for sure, There are a lot of people still around living in their own la-la land of 90s. They don’t understand how technology moves and evolves. On top of that, these people are never ready to even learn or listen to you.

I agree, I succumbed to the circumstances. but I did learn a thing or two.

Scraping html content rendered by Javascript Plugins

Be hold warrior, we are going past the gates of unknown.

All of you at times, I am sure, must have scraped a web page using your favourite programming language. It’s pretty straight forward. Just load the page and run a regex. Some sage individuals would prefer parsing the DOM instead.

But what about the plugins that are dynamically rendered by Javascript?

Don’t fret! Here’s how you can do it:

1. Goto the plugin’s page.
2. Select the plugin you want to scrape content from.
3. It will give you a Javascript code.

Take that code and implement it on a page. Now open the webpage you just created. It will render the plugin as expected. But here’s the trick. All of these (most, if not all) plugins shoot an XHR request to pull content from their servers. This is where you need to dive into the Inspect Element/Firebug etc.

Open your developer tools’s window. And goto the network tab. Reload the page and look for the XHR requests being made. If you look close enough, you can zero down on to the XHR made by that plugin. Copy that URL and paste that in another window.

Voila!!

You now have the data that was rendered by the plugin. Though the data format returned will depend on the implementation of the plugin’s website. but you will have data in some format which you can process.

Using Composer with Codeigniter

So you want to use composer in your next Codeigniter Project?

Well here’s how to do it:

1. Download and install Codeigniter

2. CD to project directory and install Composer
curl -sS https://getcomposer.org/installer | php

3. Create a composer.json file in your project root and define dependencies
{
"require": {
"monolog/monolog": "1.2.*"
}
}

4. Install Dependecies
php composer.phar install

This will create a vendor directory in your root folder of your project.

5. Add autoload.php to your Codeigniter’s index.php before require_once BASEPATH.’core/CodeIgniter.php’;

include_once './vendor/autoload.php';

Thats’s it. Now you can use your newly installed libraries in CI. Have fun!

Codeigniter is not dead! And yes, Laravel is sexy!

Everywhere, everyone is saying CodeIgniter is dead! CodeIgniter is not dead so shut up!

That’s being said. Lately I have been exploring a lot of new things, new for me. I learnt composer. I have ported a library as a composer package which I use in my company. Learnt nodejs. And started exploring ExpressJS.

Then I bumped into Laravel. The sweet little thing that is gaining a lot of traction these days. and which is giving a lot of heat to CodeIgniter is dead argument. Well I beg to differ. CodeIgniter is not dead.

First of all let me tell you from my experience. CodeIgniter is a boon for those developers who want to dive into MVC and PHP Frameworks. CodeIgniter is dead simple to use. Install it and start using it right away. Laravel fans will argue that same goes for Laravel. But you see, for using Laravel properly, you need to know how to use Composer and some other little things.

The beauty of CodeIgniter lies in it’s simplicity. You don’t need to define routes for starters. unzip the code, create a new Controller and there you go.

No doubt Laravel is awesome. I liked Laravel too. I am going to ditch CodeIgniter pretty soon. but not because it is dead. But because, Laravel is built on top of good programming patterns and concepts. Dependency Injection is exactly how you should write your code. Every Class should only know what is happening inside it. Nothing more. You should be able to change dependencies on the fly. Move to other Database with one line change.

But still, there are a lot of apps I have built that are built using CI. And there are a lot of websites that are built on CI out there. There are millions of websites out where built on top of CI. So it’s not going anywhere. CodeIgniter will stay for a little longer.

Yes, CodeIgniter is not dead. But at the same time, Laravel is pretty sexy too!

Y U NO ADD MY ICONS, PhoneGap!

So, I have started playing with PhoneGap at last. I find it a little funny though, how we developers/programmers can trick no-tech guys. I mean its just a web browser which is launched in full screen mode.

Anyways, PhoneGap is bloody easy to work on. If you are a good web developer, you can create and release an app in under two mins, Literally!

I have been monitoring PhoneGap since it’s inception. But stayed away because it was in beta. With version 3.0.0 they have labeled it stable. I beg to differ. It’s nowhere close to stable. Maybe that was too harsh. Actually, Its not that stable is the correct way of putting it. There are bugs:

First, I installed it on my MAC. Created an app. Changed config.xml to pick up icons that I created. I compiled it and installed it on my device and BAM! My icons were nowhere. PhoneGap didn’t pick up my icons. Instead, it installed default icons. Natural Instinct? I searched! And after a lot of searching I saw I wasn’t the only one facing this issue. As a good programmer, I wanted to log it as an issue, but someone else already did. So, it’s ok!

Second, I installed PhoneGap on my Ubuntu Machine. Created a new project. opened up the www folder and all I could see was index.html and a config.xml file. The file structure and files that PhoneGap builds is completely different on different OS. I didn’t try it on my windows machine though.

So far it’s the experience is okish. I can create apps, beautiful apps. All hail to HTML5 and CSS3. But it would be great if PhoneGap could keep the file structure similar on different OS. Otherwise, whats the point of being a cross-platform development framework.

I hope they fix these soon!

Travel and Travel often!

Yesterday, I received an invitation from Medium. I was wondering whether I will post again or not. And here I am!

What inspired me today, besides Medium’s excellent editor, a video. A video which mad me happy and sad at the same time. Check it here. A colleague sent it to me. The timing was bang on. I was thinking about my cancelled plan. The last trip I wanted to go for. My yearly ritual to Himalayas. Didn’t happen this year.

Somehow this video shook me from the inside. It made me realise that working your ass off will only get you money ( yes some happiness too, but temporary happiness ). Day by day, I am becoming mundane.

Maybe its a hint, maybe its not. What I do know is, I will travel more often from now on. Even if its a weekend getaway, I am going to pick up my bike and head in a direction.

Google Plus Project Invites

I’ll keep this post short and straight!

If you are one of those who are still not allowed to use Google+ Project, then you can use following method to get/send an invite:

If  ‘A‘ is a guy already using Google+ and ‘B‘ who wants to use Google+, then:

  1. Ask A to add B as a Gtalk contact.
  2. Ask A to create a new circle and add B as a contact in that circle.
  3. Then, A should update a status message in his stream marked to the newly created circle with B as a contact in it (as you do on Facebook using lock icon for lists).
  4. After the message has been posted, the B will receive an email which acts as an invitation email.
  5. That’s it! Enjoy!

This method worked for me. Let me know if it works for you as well or not.