<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohd Irtefa on Medium]]></title>
        <description><![CDATA[Stories by Mohd Irtefa on Medium]]></description>
        <link>https://medium.com/@irtefa1?source=rss-422736da92fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DZCFmZx7CkJWimhqTYxNrg.jpeg</url>
            <title>Stories by Mohd Irtefa on Medium</title>
            <link>https://medium.com/@irtefa1?source=rss-422736da92fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:07:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@irtefa1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To Survive An Economic Nuclear Holocaust As A Founder]]></title>
            <link>https://medium.com/@irtefa1/how-to-survive-an-economic-nuclear-holocaust-as-a-founder-7279c9b8f5cc?source=rss-422736da92fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/7279c9b8f5cc</guid>
            <category><![CDATA[recession]]></category>
            <category><![CDATA[founders]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[paul-graham]]></category>
            <dc:creator><![CDATA[Mohd Irtefa]]></dc:creator>
            <pubDate>Thu, 28 Feb 2019 22:03:06 GMT</pubDate>
            <atom:updated>2019-03-01T01:19:07.470Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Lessons From Paul Graham On Starting A Startup During Recession</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tfITs-8teqM19WOJ" /></figure><p>Shit hit the fan when <a href="https://en.wikipedia.org/wiki/Bankruptcy_of_Lehman_Brothers">Lehman Brothers collapsed</a>. It was 2008, and the global economy was in shambles. Many entrepreneurs were afraid to start something new. <a href="http://www.paulgraham.com/bio.html">Paul Graham</a> wants you to believe that a recession is a fantastic time to start a company. He wrote an essay in 2008 to lift entrepreneurs up and inspire them to start something new. I wonder if this was due to a drop in applications to YC during the financial crisis. Or was it purely altruistic? Maybe Paul was spreading the general knowledge on how to assess the financial crisis and not get in your way of starting a company. I took away from his post three key lessons which apply perhaps even more in 2019 than they did a decade ago.</p><h3>‘Now’ is ALWAYS the perfect time to start a company</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K4Gjp-fIMxCdT3Ei" /><figcaption><a href="https://en.wikipedia.org/wiki/Paul_Allen">Paul Allen</a> and <a href="https://en.wikipedia.org/wiki/Bill_Gates">Bill Gates</a> pose for the camera on October 19, 1981, surrounded by PCs after signing a pivotal contract with IBM (<a href="https://en.wikipedia.org/wiki/Microsoft#cite_note-Allan_2001-15">source</a>)</figcaption></figure><p>In 1974, <a href="https://en.wikipedia.org/wiki/Micro_Instrumentation_and_Telemetry_Systems">MITS</a> a company based out of New Mexico, Albuquerque launched the first home computer kit, <a href="https://en.wikipedia.org/wiki/Altair_8800">Altair 8800</a>. It was the first commercially successful computer and sold a thousand copies in the first month.</p><p>The Altair was built on top of the same CPU, Intel 8080 that Bill Gates and Paul Allen were <a href="https://www.youtube.com/watch?v=pqAg0GJLPGk">planning to</a> write software for. Bill and Paul thought, they could either wait to build their own computer and software on top of it or they could take advantage of Altair’s success.</p><p>Paul reached out to MITS about building an interpreter for the BASIC programming language for the Altair. MITS agreed and on July 1st, 1975, Microsoft released the first version of the Basic interpreter for the Altair . This was Microsoft’s first product that helped them get into the software industry.</p><p>The Altair BASIC was popular among hobbyists which attracted IBM’s attention which in turn led to Microsoft getting a contract from IBM to build an operating system for their PCs. They end up building MS-DOS which eventually becomes the most dominant Operating System in the industry and the rest is history.</p><p>When you look back, Bill and Paul did not start with MS-DOS. They started with Altair Basic that got them the attention. Had they waited, they wouldn’t have attracted IBM’s attention.</p><p>Don’t wait for the perfect moment. When you have an idea, act on it!</p><h3>There are fewer competitors during a recession</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*MhRzlGZD3v_v7nK0" /><figcaption>Business Establishment in USA (<a href="https://www.bls.gov/bdm/entrepreneurship/entrepreneurship.htm">source</a>)</figcaption></figure><p>When the stock market goes down, the natural intuition is to sell; to cut your losses. But, as any investor knows, that isn’t a path to getting rich. In fact, you can’t get rich betting with the masses. You need to swim against the current.</p><p>Startups are similar. During a bubble, not only do people start more companies, VCs tend to invest more as well. When times are bad, people start fewer companies. Investors invest in fewer companies. Therefore, the competition is not as fierce as during a bubble.</p><p>You can use this to your advantage by starting a company when the economy is bad and avoid competition.</p><h3>Be a Cockroach</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*K-Co25uAHOqCnksIZ0RT4A.png" /></figure><p>Investors want their companies to be recession-proof. You should always run the company frugally regardless of it being in a recession or not.</p><p>Amazon’s stock hit rock bottom during the dot com crash. Each share of their stock was valued at $10. They survived the dot com crash and are doing very well today because Jeff Bezos operated the business frugally (among other reasons); today, their stock is valued at more than $1500.</p><p>Cockroaches are incredibly resilient and can even survive a <a href="http://www.discovery.com/tv-shows/mythbusters/mythbusters-database/cockroaches-survive-nuclear-explosion/">nuclear explosion</a>. Being frugal or as Paul likes to say “a cockroach” can survive through the recessions even if they are losing customers. In his words “the cheaper your company is to operate, the harder it is to kill”.</p><h3>Conclusion</h3><p>At the end of the day, it doesn’t matter if the economy is bad or good. But if you want to improve your chances, start a company when the economy is down.</p><p>Go read the <a href="http://www.paulgraham.com/badeconomy.html">original essay</a> that Paul Graham wrote.</p><p><em>Thanks to </em><a href="https://twitter.com/zackbloom"><em>Zack Bloom</em></a><em> for giving me feedback and always encouraging me to produce better work.</em></p><p><em>Thanks to </em><a href="https://twitter.com/mohd_irteza"><em>Irteza</em></a><em> for helping me put the finishing touches and </em><a href="https://twitter.com/LakeAustinBlvd"><em>Sam Rhea</em></a><em> for proofreading this blog post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7279c9b8f5cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I made a Home Alarm using Google Cloud & Twilio]]></title>
            <link>https://medium.com/@irtefa1/how-i-made-a-home-alarm-using-google-cloud-twilio-c7cb78f6b929?source=rss-422736da92fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7cb78f6b929</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[twilio]]></category>
            <category><![CDATA[google-cloud-vision]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mohd Irtefa]]></dc:creator>
            <pubDate>Sat, 17 Jun 2017 17:56:32 GMT</pubDate>
            <atom:updated>2017-06-19T00:33:27.822Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern Home Alarm systems can cost anywhere between $15 and $40 per month e.g. <a href="https://www.adt.com/home-security">ADT</a> starts from $36.99/month and can go up to $52.99/month. Depending on your budget, this can easily get pretty expensive depending on the size of your home.</p><p>I decided to build something cheaper and this is how you can make yours too:</p><ul><li>Use a cheap camera (Pi Camera) or old Android phones to stream video.</li><li>Convert the stream to images and store them in a Google Cloud Storage bucket.</li><li>Use a Google Cloud Function to process the image when the camera uploads one.</li><li>Process the image using Google’s Cloud Vision API to detect faces.</li><li>Send an SMS/MMS to your phone using Twilio’s REST API if the function detects faces.</li></ul><p>This is what it looks like when everything is put together:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*UYRv-tSiIozgADlp7sWDOg.png" /></figure><p>In the next few sections we will go into detail on how to build this system.</p><h3>Video</h3><p>I used an Android phone to capture video. I wrote a simple app that streams the video and converts the content to static images. This allowed me to upload the images to Google Storage bucket and perform face detection on them. You don’t have to send all the frames that are being captured by the camera. You can send <em>one image every second</em>.</p><p>Alternatively, you can use a Raspberry Pi with a Pi Camera to do the same thing.</p><h3>Storage</h3><p>Now that the camera is capturing images. We need to upload the images somewhere for our system to process them. Let’s go ahead and enable API and Billing for both Cloud Storage and Cloud functions.</p><p>Once you have enabled the API and Billing, create a bucket on Google Cloud Storage. I called mine “intruder-pictures”. Your camera/Android app should be sending images to this bucket. This is what my bucket looks like (I manually uploaded a few images to test).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kiGs7Sk2-y_8BDDT9YSKbw.png" /></figure><h3>Cloud Function</h3><p>Once you have created your bucket, you will create a Google Cloud Function. When you create that function it will ask you to put the trigger type. I put “Cloud Storage bucket” and for the Bucket name I put “intruder-pictures”. This means that whenever there is a picture getting uploaded into the “intruder-bucket”, our Google Cloud Function will get triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*NjaBsWtJ9cIAIopX78gPxQ.png" /><figcaption>This is what my ‘Trigger’ in Cloud Function looks like</figcaption></figure><p>To keep things simple, I wrote most of the code on the inline editor. At the time of this writing, only node.js was available to Cloud Function users.</p><p>My package.json looks like this:</p><pre>{<br> “name”: “intruder-detection”,<br> “version”: “0.0.1”,<br> “dependencies”: {<br> “<a href="http://twitter.com/google">@google</a>-cloud/pubsub”: “0.10.0”,<br> “<a href="http://twitter.com/google">@google</a>-cloud/storage”: “1.1.0”,<br> “<a href="http://twitter.com/google">@google</a>-cloud/vision”: “0.11.2”,<br> “twilio”: “3.3.0”<br> }<br>}</pre><p>Now that you have all the required packages, let’s get started with the implementation. Import all the packages that you need</p><pre>// Get a reference to the Pub/Sub component<br>const pubsub = require(&#39;<a href="http://twitter.com/google">@google</a>-cloud/pubsub&#39;)();<br>// Get a reference to the Cloud Storage component<br>const storage = require(&#39;<a href="http://twitter.com/google">@google</a>-cloud/storage&#39;)();</pre><pre>// Imports the Google Cloud client library<br>const Vision = require(&#39;<a href="http://twitter.com/google">@google</a>-cloud/vision&#39;);</pre><p>The first thing you need to do is identify that an image is getting uploaded. Thankfully, the trigger will automatically do it for you. So, all you need to do is invoke the Cloud Vision API.</p><pre>// Instantiates a client<br>const vision = Vision();</pre><pre>/**<br> * Triggered from a message on a Cloud Storage bucket.<br> *<br> * <a href="http://twitter.com/param">@param</a> {!Object} event The Cloud Functions event.<br> * <a href="http://twitter.com/param">@param</a> {!Function} The callback function.<br> */</pre><pre>exports.processIntruderImage = function(event, callback) {<br>  console.log(&#39;Processing file: &#39; + event.data.name);<br>  let file = event.data;<br>  return Promise.resolve()<br>    .then(() =&gt; {<br>      if (file.resourceState === &#39;not_exists&#39;) {<br>        // This was a deletion event, we don&#39;t want to process this<br>        console.log(&quot;Deleting File&quot;);<br>        callback();<br>      }</pre><pre>      if (!file.bucket) {<br>        throw new Error(&#39;Bucket not provided. Make sure you have a     &quot;bucket&quot; property in your request&#39;);<br>      }<br>      if (!file.name) {<br>        throw new Error(&#39;Filename not provided. Make sure you have a &quot;name&quot; property in your request&#39;);<br>      }</pre><pre>      file = storage.bucket(file.bucket).file(file.name);<br>      detectFaces(file, callback);<br>    })<br>    .then(() =&gt; {<br>      console.log(`File ${file.name} processed.`);<br>      callback();<br>    })<br>};</pre><p>If “faces.length” is greater than zero, then we can assume that there’s something fishy going on at home (assuming that no one should be at home at this time).</p><pre>function detectFaces(file, callback) {<br>  vision.detectFaces(file)<br>    .then((results) =&gt; {<br>      const faces = results[0];</pre><pre>      // If you upload an image with a face on it, this should &gt; 0<br>      console.log(faces.length);<br>    })<br>    .catch((err) =&gt; {<br>      console.error(&#39;ERROR:&#39;, err);<br>      callback();<br>    });<br>}</pre><h3>Send SMS</h3><p>Let’s add some code to send us a text if the there are faces in the image. In this case, I added Twilio to send my phone a text message about the intruder. You can use <a href="https://www.twilio.com/docs/api/rest/sending-messages">Twilio’s REST API</a> to do this.</p><pre>function detectFaces(file, callback) {<br>  vision.detectFaces(file)<br>    .then((results) =&gt; {<br>      const faces = results[0];</pre><pre>      console.log(&#39;Faces:&#39;);<br>      console.log(faces.length);<br>    <br>      // Twilio Credentials <br>      var accountSid = &#39;XXXX&#39;; <br>      var authToken = &#39;XXXX&#39;;</pre><pre>      //require the Twilio module and create a REST client <br>      if (faces.length &gt; 0) {<br>        var client = require(&#39;twilio&#39;)(accountSid, authToken);</pre><pre>        client.messages.create({ <br>            to: &quot;XXXX&quot;, <br>            from: &quot;XXXX&quot;, <br>            body: &quot;There is someone at your door!&quot; <br>        }, function(err, message) {<br>            console.log(message.sid); <br>            callback();<br>        });<br>      } else {<br>       callback();<br>      }<br>    })<br>    .catch((err) =&gt; {<br>      console.error(&#39;ERROR:&#39;, err);<br>      callback();<br>    });<br>}</pre><p>Now, if you upload an image to your bucket, and if the image has faces, Twilio should send you an SMS!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*vwfH__rK19RXXko3RvgfmA.png" /><figcaption>Twilio just sent me a text saying “There is someone at your door!”</figcaption></figure><p>Awesome! Right?</p><p>Not so fast.</p><h3>Caveats</h3><ul><li>Intruder detection does not work if the camera only sees the back of a person.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_CTVS62jcQTklNKVJ7b3uw.jpeg" /></figure><ul><li>It takes quite a while for Cloud Vision API to process the image. When I uploaded the image above (the front facing image), the API took almost 4 minutes to process.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*l4VGviPglrntEd9iGTvSXA.png" /></figure><p>Another weird part was, it took almost 4 minutes to process the image. If you notice carefully, the log that says how long the function is going to take is at <em>20:52</em> but the actual function gets executed at <em>20:56</em>. By 4 mins the intruder would have burgled and already left the apartment! The good thing is, your camera is capturing all the images so they should be in your google cloud storage bucket. Additionally, you can also send the image via Twilio in MMS format. Yay!</p><h3>How much does this cost?</h3><p>Let’s calculate the monthly cost for our implementation. To keep things simple, let’s assume the following:</p><ul><li>We are sending an image every second when the camera is on.</li><li>The person who is using this is only gone from 9am to 5pm which translates to 8 hours * 30 days = 864,000 seconds (We are going to include weekends).</li><li>In one month we are sending 864,000 requests / images.</li></ul><p>We have to pay for the following components:</p><p><strong>Google Cloud Storage:</strong> If we assume that each image is 100KB and we are sending 864,000 images, we are storing 0.864GB of images per month. <a href="https://cloud.google.com/storage/pricing">Cloud Storage Pricing</a> says that this should be pretty cheap i.e. less than $0.02! You can cut this cost even further if you purge all the images at the end of each month.</p><p><strong>Google Cloud Function: </strong>First 2 million invocations are free every month according to the <a href="https://cloud.google.com/functions/pricing">pricing plan</a>. We are making 864,000 invocations. So, we can use this for FREE.</p><p><strong>Cloud Vision API: </strong>According to the Cloud Vision API <a href="https://cloud.google.com/vision/docs/pricing">pricing page</a>, its $1.50 for 1000 up to 5,000,000 units. Here, it gets a little confusing. The first 1K requests are free but every 1K request up to 5 million requests costs $1.50. That means, we have to pay 864K * $1.50 = $1294.5. This is incredibly expensive!</p><p><strong>Twilio API: </strong>Hopefully, you won’t get burgled more than once per month :). Based on Twilio <a href="https://www.twilio.com/sms/pricing">pricing</a> it will cost you about $1/month.</p><h3>Final Thoughts</h3><p>This is clearly not a comprehensive solution but can give you a lot of ideas on how to build a home alarm system . Its also a fun hackathon project. One of the biggest problems with this system is it’s lack of ability to detect intruders when they are not facing the camera. You can solve this by installing a camera on all walls of a room. But it’s useless if the intruders are wearing masks (maybe, I didn’t try). Another solution could be measuring the difference of consecutive images. The difference could be measured by checking what objects are present on the image and comparing it with the previous image. This is also going to be a lot cheaper than using the Google Cloud Vision API.</p><p>In the beginning of this post I said I wanted to build something cheaper, which I definitely didn’t. Is it robust? Probably not. For me, the more important reason was to solve this problem by leveraging novel cloud technologies and having fun while doing it. Hopefully, this post was helpful and people can find cooler ways to play with Google’s Cloud offerings. What have you made with Google Cloud or AWS? Comment below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7cb78f6b929" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Am Going Back to Gmail]]></title>
            <link>https://medium.com/@irtefa1/i-am-going-back-to-gmail-9e99dd1727d7?source=rss-422736da92fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e99dd1727d7</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[inbox]]></category>
            <dc:creator><![CDATA[Mohd Irtefa]]></dc:creator>
            <pubDate>Wed, 04 May 2016 23:41:44 GMT</pubDate>
            <atom:updated>2016-05-05T00:27:58.890Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.google.com/inbox/">Inbox</a> from Google is a pretty cool product with its nifty features. Its great when you are using a single email account but it gets difficult to use when you have multiple accounts.</p><p>This is what Gmail looks like when you have an unread email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*uZidFwxw4M3YderEQwV8rA.jpeg" /></figure><p>Its pretty clear that the email account at the bottom has one unread email. This is what it looks like on Inbox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T3BeFgJUfkEmEi-tAscRcw.jpeg" /></figure><p>What’s the problem with this? I have to check all my email accounts to see which one has an unread email. When you are at work receiving a barrage of emails, its very important for the app to signal which of your multiple email accounts have unread emails and how many!</p><p>Google, please fix this. This will save a lot of time for the users. Maybe I will come back to you once this is fixed ;)</p><p><strong><em>Disclaimer: </em></strong><em>This is for Inbox and Gmail on iOS</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e99dd1727d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>