<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://nishantarora.in/feed.xml" rel="self" type="application/atom+xml" /><link href="https://nishantarora.in/" rel="alternate" type="text/html" /><updated>2023-06-19T13:05:44-06:00</updated><id>https://nishantarora.in/feed.xml</id><title type="html">Nishant Arora’s w3BL0G</title><subtitle>Full-Stack Tech Lead, Applied Researcher, CV/DL Practitioner</subtitle><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><entry><title type="html">Hosting A Twitter Bot with Google Apps Script</title><link href="https://nishantarora.in/Hosting-A-Twitter-Bot-With-Google-Apps-Script.naml" rel="alternate" type="text/html" title="Hosting A Twitter Bot with Google Apps Script" /><published>2020-07-23T02:30:00-06:00</published><updated>2020-07-23T02:30:00-06:00</updated><id>https://nishantarora.in/Hosting-A-Twitter-Bot-With-Google-Apps-Script</id><content type="html" xml:base="https://nishantarora.in/Hosting-A-Twitter-Bot-With-Google-Apps-Script.naml">&lt;p&gt;It's been an year again, since I last posted, and this is going to be my third year in a row, 
where I've been promising regular updates, but failed to do so. I should accept, articulating my thoughts 
in a post is harder than working on an interesting project (which thankfully I've been working on a lot.)&lt;/p&gt;

&lt;p&gt;2020 so far has been far from boring, each new day is worse than before and we still have half more to go. 
Hope everyone is staying safe and practicing Physical Distancing (I find Social Distancing to be a negative word)&lt;/p&gt;

&lt;h3&gt;Inspirartion&lt;/h3&gt;

&lt;p&gt;The project I am going to be talking about today has been on my backlog since 9 years, yes! nine!. This started back 
in summer of 2011 (my last year at university), Fuel Prices in Delhi were at an ATH, Twitter was the new trend in India,
and I wanted to build a Twitter bot which could post daily price changes on twitter, which People could follow and see
the change right in their feed. So what was stopping me from doing this then? well:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;At the time, petrol prices were deregulated but diesel was still set by the government and rarely saw fluctuations.&lt;/li&gt;
&lt;li&gt;There wasn't any reliable source of price information, let alone an API. Only news channels announced what the change was.&lt;/li&gt;
&lt;li&gt;Servers were expensive, even though I was using HostGator shared servers at the time to host wordpress and other PHP projects, running a regular cron had it's limitations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of these reasons, not having access to reliable information was the biggest bummer and this project was put on my 
backlog. I even had the account &lt;a href=&quot;https://twitter.com/FuelPriceHike&quot; target=&quot;_blank&quot;&gt;@FuelPriceHike&lt;/a&gt;
registered for posting this in 2011. The fuel prices settled a bit and rallied again in 2014, but I was busy with other 
stuff then and did not bother with this. Come 2020 and this weird thing happened, fuel prices crashed across the world 
but India being the anomaly, the fuel prices kept on rising. It was an outrage everywhere, everyone was posting on 
how shitty the times were and what needs to happen, etc.&lt;/p&gt;

&lt;p&gt;Wait a minute, I was reminded about this project I had planned almost a decade ago. Quick check on twitter and there it was,
still waiting for me to finish this, quick password recovery and I have control of it again. I seemed to have gathered 68 followers
randomly and At least a few hundered spammy events in my email to gain access to this account.&lt;/p&gt;

&lt;p&gt;So, three weekends ago I sat down and explored what options are available for me to run such a bot in 2020 and believe me when I 
say things have drastically improved. I can now theoretically host such a bot for free, run it regularly and visualize this data 
in a spreadsheet with just a couple of lines of JavaScript. University me would've been amazed if I were to tell him I won't 
be writing PHP anymore and I also won't be using MySQL to structure the data, heck I won't even need to pay for hosting anymore.&lt;/p&gt;

&lt;h3&gt;Implementation&lt;/h3&gt;

&lt;p&gt;There are four essential parts to this project:&lt;/p&gt;

&lt;h4&gt;Fuel Prices API&lt;/h4&gt;
&lt;p&gt;A quick google search, sends me to economic times and they seems to host latest 
&lt;a href=&quot;https://economictimes.indiatimes.com/wealth/fuel-price/petrol&quot; target=&quot;_blank&quot;&gt;fuel prices&lt;/a&gt;. 
Interestingly I can just scrape these values? but wait, they actually have an internal api they hit for 
&lt;a href=&quot;https://mfapps.indiatimes.com/ET_Calculators/oilpricebycitystate.htm?type=city&quot; target=&quot;_blank&quot;&gt;city&lt;/a&gt; and
&lt;a href=&quot;https://mfapps.indiatimes.com/ET_Calculators/oilpricebycitystate.htm?type=state&quot; target=&quot;_blank&quot;&gt;state&lt;/a&gt; prices.
Sweet, this is so easy now!&lt;/p&gt;

&lt;h4&gt;Hosting Data&lt;/h4&gt;
&lt;p&gt;Google sheets at this point is my goto spreadsheet app, so I wanted this there too. Interestingly I've worked with 
Apps Scripts a few times to add custom stuff to my sheet. I was pretty sure, I could fetch an html document with the script and 
parse json. In 2020, Apps Script runs on the new V8 environment, which means I can do pretty much anything node can do or 
something pretty close. You can access the spreadsheet that hosts this data 
&lt;a href=&quot;https://docs.google.com/spreadsheets/d/1fMASOyPWnOQyaNBg4SUwmtIW2C6uWEWIYrrTJq0HaI8/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. 
It is nothing fancy:&lt;/p&gt; 

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;+-------------+-----------------------+-----------------------+
| Date        | Destination_Commodity | ...                   |
+-------------+-----------------------+-----------------------+
| Desc Date   | Price &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;INR          | ...                   |
+-------------+-----------------------+-----------------------+
| ...         | ...                   | ...                   |
+-------------+-----------------------+-----------------------+&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4&gt;Writing the bot&lt;/h4&gt;
&lt;p&gt;This is where interesting things are happening, I discovered 
&lt;a href=&quot;https://github.com/google/clasp&quot; target=&quot;_blank&quot;&gt;Google's Clasp project&lt;/a&gt; It allows you build your appsscript project 
using your favourite IDE and transpile it to JS as need be. You can push and pull to your project like it were a git repo and now 
I can write custom build scripts to make it very simple to understand. The project can be found in 
&lt;a href=&quot;https://github.com/whizzzkid/fuelPrices&quot; target=&quot;_blank&quot;&gt;this repo&lt;/a&gt; and this is very much a work in progress.&lt;/p&gt;

&lt;p&gt;A quick `npm install` and `npm run build` will build the script in the `dist` folder ready for upload, 
`npm run push` pushes it to my Google Apps Script project (you can set that up easily by reading the getting started guide 
on the clasp project). The project is written using typescript and I use rollup to build one giant script which contains everything 
the script would need. The script is pretty straight forward and since I was going to use Google's custom types, static type-check 
helped me work faster.&lt;/p&gt;

&lt;p&gt;The only hiccup I had was how twitter wants me to sign 
&lt;a href=&quot;https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a/creating-a-signature&gt;every tweet&lt;/a&gt;
to validate my credentials. It's pretty awful and rememnants from oauth1a world. However once I had that figured, it was pretty straightforward.
The &lt;a href=&quot;https://github.com/whizzzkid/fuelPrices/tree/master/src/Twitter&quot; target=&quot;_blank&quot;&gt;twitter module&lt;/a&gt; is decoupled and can be 
used as standalone by anyone who plans to post tweets using Google Apps Script.&lt;/p&gt;

&lt;h4&gt;Running the bot regularly&lt;/h4&gt;

&lt;p&gt;This is not a complete step by any means, but you can use `Triggers` in your apps script project, to trigger a function based 
on time (amongst other things). For this reason I expose a function called `runner` as the last step of my script, I can call this 
whenever I need to fetch prices and post on twitter. I set the trigger to run every 30 minutes.&lt;/p&gt;

&lt;h3&gt;Future Plans&lt;/h3&gt;

&lt;p&gt;This was a very simple proof-of-concept and it establishes Google Apps Script as a really powerful tool for such tasks. I am still 
working on this and plan to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decouple API fetch mechanism, so in future I can plug in any other data source to fetch info.&lt;/li&gt;
&lt;li&gt;Complete the Unit Tests, custom Google Types and Methods need mocking and is PITA.&lt;/li&gt;
&lt;li&gt;Implement Github actions to push the build directly to my project on each commit.&lt;/li&gt;
&lt;li&gt;Implement insights like: Since when has this trend been happening, Sharing per destination graph, comparison of top N gainers/losers, etc.&lt;/li&gt;
&lt;li&gt;Interact with other similar tweets, responses, replies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I know this has been a text heavy post, but I would highly recommend checkout out the repo: 
  &lt;a href=&quot;https://github.com/whizzzkid/fuelPrices&quot; target=&quot;_blank&quot;&gt;https://github.com/whizzzkid/fuelPrices&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share your own AppsScript comments in the comments below!&lt;/p&gt;

&lt;p&gt;Stay Safe!&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="Labs" /><category term="Twitter Bot" /><category term="Google Apps Script" /><category term="Google Spreadsheets" /><category term="Google Clasp" /><category term="Twitter API" /><category term="Free Hosting" /><summary type="html">It's been an year again, since I last posted, and this is going to be my third year in a row, where I've been promising regular updates, but failed to do so. I should accept, articulating my thoughts in a post is harder than working on an interesting project (which thankfully I've been working on a lot.)</summary></entry><entry><title type="html">Building Your Own Camping Battery Pack From a Jump Starter</title><link href="https://nishantarora.in/Building-Your-Own-Camping-Battery-Pack-From-A-Jump-Starter.naml" rel="alternate" type="text/html" title="Building Your Own Camping Battery Pack From a Jump Starter" /><published>2019-07-01T23:00:00-06:00</published><updated>2019-07-01T23:00:00-06:00</updated><id>https://nishantarora.in/Building-Your-Own-Camping-Battery-Pack-From-A-Jump-Starter</id><content type="html" xml:base="https://nishantarora.in/Building-Your-Own-Camping-Battery-Pack-From-A-Jump-Starter.naml">&lt;p&gt;
    I went camping, a bunch of times in the last two years and recently got hold of an 
    airbed from a friend. You bet you need one of those on your next trip, the one I have comes 
    with a foot pump. It works!, however pumping 100-125 times for that perfect pressure is not 
    the most ergonomic experience. So I ended up getting an air pump which could be run off a 
    cigarette lighter 12v charger port in the car. It worked like a dream, till I ended up on a 
    camping site which was at least a 100mtrs away from where my car was parked. I could not 
    inflate and carry the bed in the woods. So I needed a camping battery pack, 
    &lt;a href=&quot;https://www.youtube.com/results?q=diy+camping+battery+pack&quot; target=&quot;_blank&quot;&gt;
        hmmm... I found plenty of DIY videos&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
    None of them fit my requirements, I wanted something light, cheap and easy to charge. These 
    do not fit the bill. I didn't want to carry around a lead-acid battery enclosed in a tactical 
    ammo box with buttons all around. It's heavy, hard to recharge, looks ugly, yuck!
&lt;/p&gt;
&lt;p&gt;
    So, what works for me? well, Ideally a power-bank which can output 12V power to connect car 
    accessories. I can theoretically connect three traditional mobile power banks to extract 12V of 
    power. Well ~15V, but this does not need to be accurate, DC circuits can be way simpler and 
    then I can always use &lt;a href=&quot;https://amzn.to/2Xj2paT&quot; target=&quot;_block&quot;&gt;L7812&lt;/a&gt; to regulate 
    power, which will be limited to 1.5A but do I need to bother with that.
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/type-s-specs.jpg&quot;
        alt=&quot;type-s specs&quot;&gt;
    &lt;i&gt;The Type-S Car Jump Starter Power Bank Specifications&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    I don't usually enter the automotive section at Costco, but this time I was there to check the 
    battery prices so that I can plan to build one of those ugly military battery cases. But I 
    spotted the &lt;a
        href=&quot;https://www.costco.com/Type-S-Lithium-Jump-Starter-Portable-Power-Bank-with-LED-Flashlight-.product.100425276.html&quot;
        target=&quot;_blank&quot;&gt;Type-S Car Jump Starter&lt;/a&gt; on clearance, for just &lt;b&gt;CAD $49.97&lt;/b&gt;. 
    This sounded promising. The more I read on the box, the more I was convinced this was what I 
    needed. If this thing can jump a car, this thing sure can power an air pump designed to run 
    from a car socket. This thing can charge over micro-usb, usb-c, has a flash light and is super cheap. If anything goes wrong, I can simply return it (I don't have a car to use it otherwise.)
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/type-s-proprietary-connector.jpg&quot;
        alt=&quot;type-s car jump starter power bank proprietary connector&quot;&gt;
    &lt;i&gt;The Type-S Car Jump Starter Power Bank Proprietary Connector&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    This thing comes with a proprietary connector, which connects to a voltage regulator which in
    turn leads to the alligator clips we find on the jump cables. So far so good. My initial 
    thoughts were to connect the alligator clips directly to the cigarette socket connector on the 
    pump, Center is positive, so simple. Whirrr... it ran and dead. I freaked out, it ran for a 
    couple of milliseconds and bust. I brought my nose closer to check if I burnt something, 
    nothing. I connected the pump to the wall socket and it was pushing air happily. Maybe the 
    power bank is dead, lemme charge this bad boy up. 
&lt;/p&gt;
&lt;p&gt;
    The next day, after almost 10 hours of charging, let's redo the experiment. Whirrr... bust and 
    beeping. The voltage regulator that comes with the pack does not like this load. Ok, enough 
    games with this thing, I just jammed in 16awg speaker wires into the positive and the negative 
    ends of the proprietary connector and just held the wires to the cigarette socket connector of 
    the pump and voila! this thing just works.
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-connector.jpg&quot; alt=&quot;The standard EC5 connector from Amazon&quot;&gt;
    &lt;i&gt;The standard EC5 connector from Amazon&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    Now, if you are an RC enthusiast like me, you would know this is so called &quot;proprietary 
    connector&quot; is a slightly modified &lt;a href=&quot;https://amzn.to/2xu51Ic&quot; target=&quot;_blank&quot;&gt;EC5 
    connector&lt;/a&gt;. I don't usually work with EC5's because they are a pain to solder and set right. 
    I cannot do anything about this one so I find the cheapest and fastest &lt;a href=&quot;https://amzn.to/2xu51Ic&quot; target=&quot;_blank&quot;&gt;EC5 connectors available with prime on Amazon&lt;/a&gt;. I would also need 
    one cigarette socket connector. Since the prices were same for with or without alligator clips, 
    I went with &lt;a href=&quot;https://amzn.to/2xtdpb6&quot; target=&quot;_blank&quot;&gt;this one&lt;/a&gt;. I always have a 
    soldering iron at home but if you don't, get a &lt;a href=&quot;https://amzn.to/2RSpoIt&quot; target=&quot;_blank&quot;&gt;soldering kit like this&lt;/a&gt; (it's usually on lightening deal.)
&lt;/p&gt;
&lt;p&gt;
    Two days and a prime order later, I have my supplies and I need to test fit the connector. If 
    you notice carefully, the proprietary connector's positive terminal is lightly rounded, nothing 
    a sharp blade or a file cannot handle. If you scrape it nicely it looks better, but mine looks 
    like: 
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-connector-to-proprietary.jpg&quot;
        alt=&quot;EC5 to Type-S proprietary conversion&quot;&gt;
    &lt;i&gt;EC5 to Type-S proprietary conversion&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    Now you can splice the cigarette socket connector ordered earlier in a way that the male end 
    of the EC5 connector is towards the cigarette lighter socket and the female end is towards the 
    alligator clips. It looks something like this.
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-male.jpg&quot; alt=&quot;EC5 male connector&quot;&gt;
    &lt;i&gt;EC5 Male Connector, include the fuse though&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    But if I were to redo this, I would cut it between the alligator clips and the fuse holder, so 
    that the fuse is always in circuit. The final product looks like this:
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-final-design.jpg&quot; alt=&quot;Final Design&quot;&gt;
    &lt;i&gt;Final design I came up with, but could've been better&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    To connect this to the power pack, just disconnect the alligator clips and Bob's your uncle.
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-ready.jpg&quot; alt=&quot;Ready for action&quot;&gt;
    &lt;i&gt;Our contraption ready for action&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    &lt;b&gt;Cost of Materials:&lt;/b&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://www.costco.com/Type-S-Lithium-Jump-Starter-Portable-Power-Bank-with-LED-Flashlight-.product.100425276.html&quot;
                target=&quot;_blank&quot;&gt;Power Bank&lt;/a&gt;: $49.97&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://amzn.to/2xu51Ic&quot; target=&quot;_blank&quot;&gt;EC5 Connector&lt;/a&gt; $1.60&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://amzn.to/2xtdpb6&quot; target=&quot;_blank&quot;&gt;Cigarette Lighter Battery Socket&lt;/a&gt;: $12.99&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Total: $64.56 CAD&lt;/b&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;b&gt;Features:&lt;/b&gt;
    &lt;ul&gt;
        &lt;li&gt;Comes with it's own carrying case.&lt;/li&gt;
        &lt;li&gt;Charging via USB-C/Micro USB.&lt;/li&gt;
        &lt;li&gt;10 AH capacity.&lt;/li&gt;
        &lt;li&gt;Built-in flashlight.&lt;/li&gt;
        &lt;li&gt;The contraption can be used to power accessories from normal battery.&lt;/li&gt;
        &lt;li&gt;The contraption can run accessories from the power pack.&lt;/li&gt;
        &lt;li&gt;I tried inflating and deflating the queen bed at least 3 times and the power indicator still showed 4 dots, I am not sure what to make of it, but this power bank is a beast.&lt;/li&gt;
    &lt;/ul&gt;
&lt;/p&gt;
&lt;center&gt;
    &lt;img src=&quot;/assets/post/ec5-place-order.jpg&quot; alt=&quot;order&quot;&gt;
    &lt;i&gt;Contraption that works really well&lt;/i&gt;
&lt;/center&gt;
&lt;p&gt;
    Lemme know what you think about this, also this is not a regulated 12v power supply. Running 
    most of the car accessories with a fuse in loop should work fine though.
&lt;/p&gt;
&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Can I make one for you?&lt;/h3&gt;
&lt;p&gt;
    Probably yes! I do have the remaining nine EC5 connector pairs. I do not however have the 
    cigarette lighter socket. So if you ask nicely and are patient with me, I can probably make one 
    (or more) and ship it to you. Send me an email and we'll discuss.
&lt;/p&gt;
&lt;br&gt;&lt;br&gt;
&lt;h3&gt;PSA: Amazon Sells the First Half of the Project Now&lt;/h3&gt;
&lt;p&gt;
    This is a fairly old project, I saw just the &lt;a href=&quot;https://amzn.to/2LtLZtU&quot; target=&quot;_blank&quot;&gt;EC5-Male-to-Cigarette-Socket&lt;/a&gt;
    on Amazon. You can use the same for half instead of this (you'll need to redo the connector though), but it's rated for only 15A 
    max load, while mine is 30A. Also, mine makes the contraption useful with a battery pack or a conventional lead-acid battery. 
    Furthermore it can be fuse protected, which can be helpful at times. The cost difference for the added functionality is less than $4.
&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="Hardware" /><category term="diy" /><category term="12v rechargable" /><category term="battery pack" /><category term="camping gear" /><category term="simple project" /><summary type="html">I went camping, a bunch of times in the last two years and recently got hold of an airbed from a friend. You bet you need one of those on your next trip, the one I have comes with a foot pump. It works!, however pumping 100-125 times for that perfect pressure is not the most ergonomic experience. So I ended up getting an air pump which could be run off a cigarette lighter 12v charger port in the car. It worked like a dream, till I ended up on a camping site which was at least a 100mtrs away from where my car was parked. I could not inflate and carry the bed in the woods. So I needed a camping battery pack, hmmm... I found plenty of DIY videos. None of them fit my requirements, I wanted something light, cheap and easy to charge. These do not fit the bill. I didn't want to carry around a lead-acid battery enclosed in a tactical ammo box with buttons all around. It's heavy, hard to recharge, looks ugly, yuck! So, what works for me? well, Ideally a power-bank which can output 12V power to connect car accessories. I can theoretically connect three traditional mobile power banks to extract 12V of power. Well ~15V, but this does not need to be accurate, DC circuits can be way simpler and then I can always use L7812 to regulate power, which will be limited to 1.5A but do I need to bother with that. The Type-S Car Jump Starter Power Bank Specifications I don't usually enter the automotive section at Costco, but this time I was there to check the battery prices so that I can plan to build one of those ugly military battery cases. But I spotted the Type-S Car Jump Starter on clearance, for just CAD $49.97. This sounded promising. The more I read on the box, the more I was convinced this was what I needed. If this thing can jump a car, this thing sure can power an air pump designed to run from a car socket. This thing can charge over micro-usb, usb-c, has a flash light and is super cheap. If anything goes wrong, I can simply return it (I don't have a car to use it otherwise.) The Type-S Car Jump Starter Power Bank Proprietary Connector This thing comes with a proprietary connector, which connects to a voltage regulator which in turn leads to the alligator clips we find on the jump cables. So far so good. My initial thoughts were to connect the alligator clips directly to the cigarette socket connector on the pump, Center is positive, so simple. Whirrr... it ran and dead. I freaked out, it ran for a couple of milliseconds and bust. I brought my nose closer to check if I burnt something, nothing. I connected the pump to the wall socket and it was pushing air happily. Maybe the power bank is dead, lemme charge this bad boy up. The next day, after almost 10 hours of charging, let's redo the experiment. Whirrr... bust and beeping. The voltage regulator that comes with the pack does not like this load. Ok, enough games with this thing, I just jammed in 16awg speaker wires into the positive and the negative ends of the proprietary connector and just held the wires to the cigarette socket connector of the pump and voila! this thing just works. The standard EC5 connector from Amazon Now, if you are an RC enthusiast like me, you would know this is so called &quot;proprietary connector&quot; is a slightly modified EC5 connector. I don't usually work with EC5's because they are a pain to solder and set right. I cannot do anything about this one so I find the cheapest and fastest EC5 connectors available with prime on Amazon. I would also need one cigarette socket connector. Since the prices were same for with or without alligator clips, I went with this one. I always have a soldering iron at home but if you don't, get a soldering kit like this (it's usually on lightening deal.) Two days and a prime order later, I have my supplies and I need to test fit the connector. If you notice carefully, the proprietary connector's positive terminal is lightly rounded, nothing a sharp blade or a file cannot handle. If you scrape it nicely it looks better, but mine looks like: EC5 to Type-S proprietary conversion Now you can splice the cigarette socket connector ordered earlier in a way that the male end of the EC5 connector is towards the cigarette lighter socket and the female end is towards the alligator clips. It looks something like this. EC5 Male Connector, include the fuse though But if I were to redo this, I would cut it between the alligator clips and the fuse holder, so that the fuse is always in circuit. The final product looks like this: Final design I came up with, but could've been better To connect this to the power pack, just disconnect the alligator clips and Bob's your uncle. Our contraption ready for action Cost of Materials: Power Bank: $49.97 EC5 Connector $1.60 Cigarette Lighter Battery Socket: $12.99 Total: $64.56 CAD Features: Comes with it's own carrying case. Charging via USB-C/Micro USB. 10 AH capacity. Built-in flashlight. The contraption can be used to power accessories from normal battery. The contraption can run accessories from the power pack. I tried inflating and deflating the queen bed at least 3 times and the power indicator still showed 4 dots, I am not sure what to make of it, but this power bank is a beast. Contraption that works really well Lemme know what you think about this, also this is not a regulated 12v power supply. Running most of the car accessories with a fuse in loop should work fine though. Can I make one for you? Probably yes! I do have the remaining nine EC5 connector pairs. I do not however have the cigarette lighter socket. So if you ask nicely and are patient with me, I can probably make one (or more) and ship it to you. Send me an email and we'll discuss. PSA: Amazon Sells the First Half of the Project Now This is a fairly old project, I saw just the EC5-Male-to-Cigarette-Socket on Amazon. You can use the same for half instead of this (you'll need to redo the connector though), but it's rated for only 15A max load, while mine is 30A. Also, mine makes the contraption useful with a battery pack or a conventional lead-acid battery. Furthermore it can be fuse protected, which can be helpful at times. The cost difference for the added functionality is less than $4.</summary></entry><entry><title type="html">I am Tired of Loaders</title><link href="https://nishantarora.in/I-am-tired-of-loaders.naml" rel="alternate" type="text/html" title="I am Tired of Loaders" /><published>2018-04-17T23:00:00-06:00</published><updated>2018-04-17T23:00:00-06:00</updated><id>https://nishantarora.in/I-am-tired-of-loaders</id><content type="html" xml:base="https://nishantarora.in/I-am-tired-of-loaders.naml">&lt;p&gt;I am tired of seeing the same circle revolving or the same bars sliding for more than a decade now. The only difference I feel is gifs have been replaced by CSS animations or SVGs. Whatever the purpose may be, these loaders are dumb and their only job is to notifiy the user that something is working behind the scenes to get something done. Fine! then there was a bunch of research, slow loaders make the entire application feel slow. Fast moving animations make the entire application feel faster, yada! yada! yada!. But that's how it is, background system will always take time and you need to notify users that they need to wait. It's simple, it works and it's easy, but does that mean it needs to be boring&lt;/p&gt;

&lt;center&gt;&lt;img src='data:image/svg+xml;utf8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;38&quot; height=&quot;38&quot; stroke=&quot;#000&quot;&gt;&lt;g fill=&quot;none&quot; fill-rule=&quot;evenodd&quot; stroke-width=&quot;2&quot; transform=&quot;translate(1 1)&quot;&gt;&lt;circle cx=&quot;18&quot; cy=&quot;18&quot; r=&quot;18&quot; stroke-opacity=&quot;.2&quot;/&gt;&lt;path d=&quot;M36 18c0-9.94-8.06-18-18-18&quot;&gt;&lt;animateTransform attributeName=&quot;transform&quot; dur=&quot;1s&quot; from=&quot;0 18 18&quot; repeatCount=&quot;indefinite&quot; to=&quot;360 18 18&quot; type=&quot;rotate&quot;/&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;'&gt;&lt;/center&gt;

&lt;p&gt;This loader above, is an svg and fits as the image src parameter, my purpose was to use it on my CV redirect page. A little background, I have my CV written on Google Docs and in order to share it with people, I use the export feature to get a pdf of it, This way anyone downloading my CV always gets a fresh copy. Basically this, &lt;i&gt;&lt;b&gt;https://docs.google.com/document/d/1BTDWnNAOSMduVWzgxmUwxLAwVr5JTYDXcxusbM31MqM/export?format=pdf&lt;/b&gt;&lt;/i&gt;. To personalize it further I made a &lt;i&gt;&lt;b&gt;/CV&lt;/b&gt;&lt;/i&gt; relative page on my site and it redirects to this &lt;i&gt;&lt;b&gt;https://nishantarora.in/CV&lt;/b&gt;&lt;/i&gt;. Just a slight hiccup, export feature on Google Docs is not the fastest.&lt;/p&gt;

&lt;p&gt;So, I added this stupid loader revolving circle to let the user know, just wait. I hated myself, but it looked awful. It was then a lightbulb turned on somewhere. How about I make this an interactive story. Imagine, I actually compile my CV everytime someone requests it? what would that look like?&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;root@nishantarora.in:/CV/build$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;./cv &lt;span class=&quot;nt&quot;&gt;--new&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'CV-NishantArora'&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;root@nishantarora.in:/CV/build$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;./cv &lt;span class=&quot;nt&quot;&gt;--add&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'exp.txt'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'edu.txt'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'proj.txt'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'cont.txt'&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;root@nishantarora.in:/CV/build$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;./cv &lt;span class=&quot;nt&quot;&gt;--compile&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;
Compiling Nishant's CV...

Writing PDF...

This was slow, but ¯\_(ツ)_/¯

&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;root@nishantarora.in:/CV/build$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; redirect
&lt;span class=&quot;go&quot;&gt;
Exiting, Byee...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I used this css console &lt;a href=&quot;https://codepen.io/shakdaniel/pen/OmZeJy&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;layout&lt;/a&gt; by &lt;a href=&quot;https://codepen.io/shakdaniel&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Shak Daniel&lt;/a&gt;. It's a good start I think! For lulz and giggles, wrote the typing effect. A couple of minutes later I had this: &lt;a href=&quot;https://codepen.io/whizzzkid/full/WzadpB/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://codepen.io/whizzzkid/full/WzadpB/&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;&lt;h3&gt;&lt;a href=&quot;/CV&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Try It Here &lt;/a&gt;&lt;/h3&gt;&lt;/center&gt;

&lt;p&gt;So why can't we have a story around what is happening behing the scenes instead of static rotating images? I guess this is similar to the see-through dishwasher that myth-busters had. I'd totally pay for a see-through dishwasher, but no one makes it. Similarly I'd like a loader which tells a story, but usually people do not make it.&lt;/p&gt;

&lt;p&gt;Lemme know what you think in the comments below.&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="Experiences" /><category term="css loaders" /><category term="gif loaders" /><category term="loaders" /><category term="wait" /><category term="wait loaders" /><category term="inspirations" /><category term="new loaders" /><summary type="html">I am tired of seeing the same circle revolving or the same bars sliding for more than a decade now. The only difference I feel is gifs have been replaced by CSS animations or SVGs. Whatever the purpose may be, these loaders are dumb and their only job is to notifiy the user that something is working behind the scenes to get something done. Fine! then there was a bunch of research, slow loaders make the entire application feel slow. Fast moving animations make the entire application feel faster, yada! yada! yada!. But that's how it is, background system will always take time and you need to notify users that they need to wait. It's simple, it works and it's easy, but does that mean it needs to be boring</summary></entry><entry><title type="html">The Time When Sony Music Used Instagram Proxy API and Got Banned</title><link href="https://nishantarora.in/the-time-when-sony-music-used-instagram-proxy-api-and-got-banned.naml" rel="alternate" type="text/html" title="The Time When Sony Music Used Instagram Proxy API and Got Banned" /><published>2018-01-24T22:00:00-07:00</published><updated>2018-01-24T22:00:00-07:00</updated><id>https://nishantarora.in/the-time-when-sony-music-used-instagram-proxy-api-and-got-banned</id><content type="html" xml:base="https://nishantarora.in/the-time-when-sony-music-used-instagram-proxy-api-and-got-banned.naml">&lt;p&gt;Last couple of hours have been crazy and I am not even kidding! This is a worthy first post of 2018.&lt;/p&gt;

&lt;p&gt;I hope you found my &lt;a href=&quot;/building-your-image-gallery-using-public-instagram-API.naml&quot;&gt;Instagram Proxy API&lt;/a&gt; project interesting. In a nutshell, it let's you access Instagram's public data programatically as a JSON CORS compliant API. However, this project started gaining traction after Instagram disabled access to it's public data. I implemented a workaround which works pretty stable and you can find more about it on the the &lt;a href=&quot;https://github.com/whizzzkid/instagram-proxy-api&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;github project&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;This post is not about how this API works, but the unusual amount of traffic, especially scraping requests I have been getting. Getting around most of the scraping requests was easy. I used the rate-limiter from cloudflare and then allowed access based on HTTP Referrer to make sure I was getting requests from actual websites. This is not fool-proof, but it kinda works. The real pain in the butt has been the commercial for-profit websites trying to use the public endpoints hosted at &lt;a href=&quot;https://igapi.ga&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;igpi.ga&lt;/a&gt; and &lt;a href=&quot;https://igpi.ga&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;igpi.ga&lt;/a&gt; on their website. Since the API is running on a free heroku instance (I did not want to pay to run a free service) I clearly mentioned on the project page that this will only be allowed to run on personal websites, blogs and portfolios. However I added a one-click deploy button for whoever was interested in running this on their own heroku account for whatever purpose they like.&lt;/p&gt;

&lt;p&gt;At first it was a little inconvientient, I would browse the logs once a day and send out email notice to potential violaters. 24 hours later, would &lt;a href=&quot;https://github.com/whizzzkid/instagram-proxy-api/blob/master/blacklist.js&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;blacklist&lt;/a&gt; their websites from referring requests to my service. Then I lost interest in reading logs for a couple of weeks as I got busy with life. Yesterday I was curious to see how was everything working and I just scanned through the logs only to realize that the numbers were through the roof. I was getting requests from a couple of websites, rather frequently.&lt;/p&gt;

&lt;p&gt;Three of these websites appeared frequently, &lt;i&gt;ace-tee.com&lt;/i&gt;, &lt;i&gt;selig.eu&lt;/i&gt; and &lt;i&gt;danyiom.com&lt;/i&gt;, the first looked like a personal page of a music artist. Then I noticed that she was doing concerts and had like thousands of instagram followers. I kept scrolling down only to discover &lt;i&gt;&quot;Copyright &amp;copy; 2018, sonymusic.de, Sony Music Corporation.&quot;&lt;/i&gt;. At first, I was elated that a big company relied on my service for images, then I looked at the second website and found a similar thing, &lt;i&gt;&quot;Copyright &amp;copy; 2018, sonymusic.de, Sony Music Corporation.&quot;&lt;/i&gt; and again. I was overwhelmed, feeling happy and sad at the same time.&lt;/p&gt;

&lt;p&gt;Imagine, you're a web developer working for one of the largest music corporations in the world. You've been asked to develop webpages of artists your corporation manages. The requirement clearly states that the page will recieve a huge amount of traffic, as these artists are socially active and people love to check them out. How will you approach this task? If it was me, I would be vetting all the resources my page will be loading the data from. Verify that if the services my page relies on, will even be able to serve the number of requests required to cater to my traffic needs (I'd even refrain loading from services like rawgit, as I am not sure it would meet the huge demand). Isn't this amature behaviour? The worst part is, I can supply malicious js code in response to these requests and redirect all traffic to the website of my choice (unethical, but possible!)&lt;/p&gt;

&lt;p&gt;Looks like, whoever was developing the code did not give a rat's ass about ethics or requirements. Probably sony cheaped out and got these pages outsourced from a &quot;economical&quot; entity based somewhere in my homeland, India. It was troubling to learn that this happens more often than it should. I posted about this on &lt;a href=&quot;https://www.reddit.com/r/javascript/comments/7sh4gn/advice_needed_sonymusicde_is_exploiting_a_service/&quot;  target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;reddit&lt;/a&gt; and got some interesting advice. I did the same I do with other non-compliant websites and sent out a 24-hour notice:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-markdown&quot; data-lang=&quot;markdown&quot;&gt;To: CorporateCommunicationsGSA@sonymusic.com
From: me@nishantarora.in
Subject: [Unauthorized Access] Violation of Agreement for Instagram Proxy API

Namaste

Your website: [websites] seems to be leaching my proxy API service for instagram
photos hosted at https://igapi.ga and https://igpi.ga

The intention of this service is to provide Instagram Public API access for
personal use and using this service for commercial purposes is a strict
violation of this. You will need to stop the commercial use of this service on
your website which is causing downtime to other users. In next 24 hours I'll
block all requests coming in from your website to protect other users.

In case you want to keep using this service or want a customized solution for
this, there needs to be legal agreement between us.

Feel free to let me know if something is not clear.

Warm Regards
Nishant Arora&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;They did not respond, what did I expect? but I saw them take action, in less than 24-hours, they setup their own instance at &lt;b&gt;https://sme-instagram-api.herokuapp.com/&lt;/b&gt; and started using that to serve instagram traffic for their artist's pages. It was redundant, but I banned them anyways. &lt;b&gt;I am happy that some important entity thought my service was worthy to be used on their pages. I am also happy they gave me chance to ban them from using my service. I am sad, that Sony Corp did not even bother to send out an apology for doing this, a simple acknowledged would have done, but they sneakly just changed their code as if nothing had happend.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I am now working on a whitelist only model, I am tired of maintaining a blacklist. I would now let users submit their site for approval on the project and once approved they will be able to use this api on their websites.&lt;/p&gt;

&lt;p&gt;Last 24 hours were fun, I hope you enjoyed reading it :)&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="Experiences" /><category term="instagram" /><category term="proxy" /><category term="api" /><category term="free" /><category term="public" /><category term="sony" /><category term="music" /><category term="banned" /><summary type="html">Last couple of hours have been crazy and I am not even kidding! This is a worthy first post of 2018.</summary></entry><entry><title type="html">Building Your Image Gallery Using Public Instagram API</title><link href="https://nishantarora.in/building-your-image-gallery-using-public-instagram-API.naml" rel="alternate" type="text/html" title="Building Your Image Gallery Using Public Instagram API" /><published>2017-05-24T18:00:00-06:00</published><updated>2017-05-24T18:00:00-06:00</updated><id>https://nishantarora.in/building-your-image-gallery-using-public-instagram-API</id><content type="html" xml:base="https://nishantarora.in/building-your-image-gallery-using-public-instagram-API.naml">&lt;p&gt;This is an incidental discovery. I was a TA for &lt;b&gt;CSC 309: Programming on the Web&lt;/b&gt; during &lt;a href=&quot;https://csc309-fall-2016.github.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Fall 2016&lt;/a&gt; and &lt;a href=&quot;https://csc309-spring2017.github.io/staff.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Spring 2017&lt;/a&gt;. During spring I was responsible for all of the lab design and course material, to make it easier for students to understand subtle things about web development.&lt;/p&gt;

&lt;p&gt;So basically teaching students about Javascript, now I know a lot of people in the CS community do not embrace Javascript and that is fine, but once you start to know it better you start to understand how powerful a few things are in this part of the CS world. One of the most tough things to get your head around is the &lt;i&gt;JS Event Loop&lt;/i&gt; and &lt;i&gt;JS Scopes&lt;/i&gt;. Many seasoned developers know this just by practice but when it comes to explaining it to students it's a tough nut to crack. So I made this presentation for my students:&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://docs.google.com/presentation/d/1E99EiNSbgprZkalsfR1BNXjhXtznXHZbk2etaF5IV5I/embed?start=true&amp;loop=true&amp;delayms=5000&quot; frameborder=&quot;0&quot; width=&quot;960&quot; height=&quot;600&quot; allowfullscreen=&quot;true&quot; mozallowfullscreen=&quot;true&quot; webkitallowfullscreen=&quot;true&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;Presentations are okay-ish, but there is no point continuing till the students can get their hands dirty with code. Let's ask them to make an image gallery. So far so good, but why will students enjoy loading some random images on an html page? I won't enjoy this, here it get's weirder, let's customize these gallaries using images from their own instagram accounts.&lt;/p&gt;

&lt;p&gt;This means, I'll also need to explain how Instagram's API work and how they need to register an app with Instagram to make their app functional. This would be overwhelming for a one hour lab session, considering most students who attend this course are not even from the CS background.&lt;/p&gt;

&lt;p&gt;A bit of research and I landed on &lt;a href=&quot;https://stackoverflow.com/a/33783840/1114922&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;this answer at SOF&lt;/a&gt;. This is simple, you can basically traverse through all of the Instagram's public data using this approach. So let's build this, but wait, this public API does not support JSONP, which means my browser won't let me load this JSON as that would be a violation of the CORS policy. I could hypothetically ask my students to manually bypass their browser's CORS complianc, but then they cannot use this code on their own websites later, it would be useless.&lt;/p&gt;

&lt;p&gt;So I set out to build a CORS compliant solution for this problem, basically a proxy API for instagram which makes their public API work with JSONP and I had my first working version in 30 minutes, over next 40 minutes I polished some edge cases and added some features (like pagination and limits). The final version was up and running on heroku in 90 minutes flat: &lt;a href=&quot;https://instareproxy.herokuapp.com/uoft/media/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://instareproxy.herokuapp.com/uoft/media/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is running on &lt;a href=&quot;https://www.heroku.com/pricing&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;heroku's free tier&lt;/a&gt; and I am surprised it holds up really well, there were some weird crashes which were resolved over next couple of days (check my commits &lt;a href=&quot;https://github.com/whizzzkid/instagram-reverse-proxy/commits/master&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here&lt;/a&gt;.) Using this is simple, check use instructions &lt;a href=&quot;https://github.com/whizzzkid/instagram-reverse-proxy&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here&lt;/a&gt;. Once you have the images loaded as json on your page, you can design a gallery around it.&lt;/p&gt;

&lt;p&gt;A simple example is, &lt;a href=&quot;https://igapi.ga/whizzzkid/media?count=3&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here are my last three posts on Instagram&lt;/a&gt; as JSON. If I were to access this using JSONP the would look something like this: &lt;a href=&quot;https://igapi.ga/whizzzkid/media?count=3&amp;callback=foo&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://igapi.ga/whizzzkid/media?count=3&amp;callback=foo&lt;/a&gt;. You can see this in action on my blogs front page: &lt;a href=&quot;https://nishantarora.in/#instagram&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://nishantarora.in&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now a question I've been getting a lot is: &lt;b&gt;Why Call It &lt;i&gt;Instagram Reverse Proxy&lt;/i&gt;?&lt;/b&gt; The answer is fairly simple, while researching about this I read some comment somehwere &lt;i&gt;&quot;you need to build reverse proxy to provide Instagram's public data as you need&quot;&lt;/i&gt;, that's it, I was building a reverse proxy for Instagram when I started. We in the CS community are simply bad at naming things. ¯\_(ツ)_/¯&lt;p&gt;

&lt;p&gt;Make something good out of this, Cheers!&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update July 06, 2017:&lt;/b&gt; Served 300,000+ requests in last 30 days.&lt;/p&gt;

&lt;p&gt;The logs have gone wild, the sheer number of requests are amazing for this service is running on the free heroku tier. In the last 30 days we have serviced more than 300,000 requests to this API. Check this graph out:&lt;/p&gt;

&lt;img src=&quot;//i.imgur.com/vAorSPR.png&quot;&gt;

&lt;p&gt;At first I was surprized with this number and was inclined towards thinking that someone was trying to scrape instagram using this API. Turns out I was wrong, a really popular asian website is using this service on their website. I am in talks with them to move this traffic to a dedicated separate instance of this service.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update July 11, 2017:&lt;/b&gt; Served 440,000+ requests in last 30 days. Heroku suspended my account.&lt;/p&gt;

&lt;p&gt;OMFG, this shit just got out of hand:

&lt;img src=&quot;//i.imgur.com/pNp7R74.png&quot;&gt;

My account at heroku has been suspended as of now. :-/&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update July 12, 2017:&lt;/b&gt; The number of hits are still not down, moving all services to igpi.ga ('a' removed). A crude blacklist is in place.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update July 20, 2017:&lt;/b&gt;New leacher detected.&lt;/p&gt;

&lt;p&gt;Notice was sent to the owner, access will be blocked in next 24 hours like in the case of other leachers.

&lt;img src=&quot;//i.imgur.com/PC2mlWT.png&quot;&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="research" /><category term="instagram" /><category term="proxy" /><category term="api" /><category term="free" /><category term="public" /><category term="csc309" /><category term="image gallery" /><category term="jsonp" /><category term="json" /><category term="uoft" /><summary type="html">This is an incidental discovery. I was a TA for CSC 309: Programming on the Web during Fall 2016 and Spring 2017. During spring I was responsible for all of the lab design and course material, to make it easier for students to understand subtle things about web development.</summary></entry><entry><title type="html">Using Fingerprint Sensor as a Touchpad on Mobile Devices</title><link href="https://nishantarora.in/using-fingerprint-sensor-as-a-touchpad-on-mobile-devices.naml" rel="alternate" type="text/html" title="Using Fingerprint Sensor as a Touchpad on Mobile Devices" /><published>2017-05-16T18:00:00-06:00</published><updated>2017-05-16T18:00:00-06:00</updated><id>https://nishantarora.in/using-fingerprint-sensor-as-a-touchpad-on-mobile-devices</id><content type="html" xml:base="https://nishantarora.in/using-fingerprint-sensor-as-a-touchpad-on-mobile-devices.naml">&lt;p&gt;I have been away for a while, many of you know I started with my Masters at UofT last fall and since then I have not had time to update my blog. Right now I started with my internship and my daily routine is falling into place. I now have some time available to write about things I did in the last eight months.&lt;/p&gt;

&lt;img src=&quot;assets/post/usability_study_1.png&quot;&gt;

&lt;p&gt;This is one of the most interesting projects I did in the Spring Term at UofT. The inspiration for this project was the 9GAG android app. Everyone who knows me, knows that I am an avid 9gag reader and I often browse through memes before dozing off in my bed. I can't be the only one to have dropped the phone on my face while using the phone in the bed. Those who are unaware about this problem, this is what it looks like (this is the actual project proposal):&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://docs.google.com/presentation/d/1rT6m6gcY4h8FjjPqjounbWkU1MSP8QNSMHxlz13wXJs/embed?start=true&amp;loop=true&amp;delayms=5000&quot;
  frameborder=&quot;0&quot; width=&quot;960&quot; height=&quot;600&quot; allowfullscreen=&quot;true&quot; mozallowfullscreen=&quot;true&quot; webkitallowfullscreen=&quot;true&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;9GAG solved this problem by allowing navigation through the posts using the volume rocker buttons. This was a gamechanger for me, I could now browse 9GAG peacefully in bed &lt;s&gt;(unfortunately the latest release of the app has ditched this feature)&lt;/s&gt;. The problem of the phone falling turns out to be because of two main reasons, first being our tendency to use the phone unimanually (single-handedly) and the second being the muscle fatigue caused in the hand due to unimanual use of the phone. Since we primarily use our thumbs to interact with the front facing touchscreen, the hand grip gives way for the phone to fall.&lt;/p&gt;

&lt;p&gt;So, what can be an alternative to this problem? I suggest we start interacting with the back of the device, where fortunately our index finger is already comfortably placed. Instead of building a new hardware to study this problem, I set out to convert the rear fingerprint sensor on my LG G5 into a touchpad. This enables us to perform various gestures like tapping and swiping which in turn activate actions like scrolling, zooming and clicking in the phone UI.&lt;/p&gt;

&lt;p&gt;I developed two dummy android apps to perform the study:&lt;/p&gt;
&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;img src=&quot;assets/post/alternative_scroll_app_screenshot.png&quot; width=&quot;250&quot;&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img src=&quot;assets/post/dummygram_app_screenshot.png&quot; width=&quot;250&quot;&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;center&gt;
        &lt;b&gt;&lt;a href=&quot;https://github.com/whizzzkid/AlternativeScroll&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;AlternativeScroll&lt;/a&gt;&lt;/b&gt; &lt;br&gt;
        &lt;i&gt;This simply loads a webpage and allows scrolling via gestures on the fingerprint scanner. Swiping scrolls down, Tapping scrolls up.&lt;/i&gt;
      &lt;/center&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;center&gt;
        &lt;b&gt;&lt;a href=&quot;https://github.com/whizzzkid/DummyGram&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;DummyGram:&lt;/a&gt;&lt;/b&gt; &lt;br&gt;
        &lt;i&gt;Ideally it's a clone of instagram, but loads data locally (it's WIP). Each swipe loads the next picture and each tap likes the picture.&lt;/i&gt;
      &lt;/center&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The aim was to develop a MVC, perform a study on users and quantify how this new input modality helped users. The results were interesting, read the full study here: &lt;a href=&quot;files/AlternativeMobileInputMethodsviaOnboardHardwareaUsabilityStudy.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Alternative Mobile Input Methods via Onboard Hardware a Usability Study&lt;/a&gt;

&lt;p&gt;Here is my presentation for this study during the &lt;i&gt;&lt;a href=&quot;http://p.arh.am/ece1780/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ECE1780: Advanced Mobile User Interfaces&lt;/a&gt;&lt;/i&gt; class:
&lt;iframe width=&quot;560&quot; height=&quot;415&quot; src=&quot;https://www.youtube.com/embed/MdY6aijwXNE&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;p&gt;&lt;i&gt;I am thankful to my ECE1780 professor, &lt;a href=&quot;http://p.arh.am/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Prof. Parham Aarabi&lt;/a&gt;. He was really supportive about pursuing this wild idea of using the fingerprint sensor as a touchpad.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;&lt;a href=&quot;https://ca.linkedin.com/in/david-holman-4474b0a0&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Dr. David Holman&lt;/a&gt; my professor for another course I studied (Human Computer Interaction) helped me understand the design of a usability study and proof-read my drafts. Thank You!&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Overall this was fun, I loved it. Feel free to use the code I posted on GitHub and PRs are welcome.&lt;/p&gt;

&lt;p&gt;Cheers :)&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="research" /><category term="android" /><category term="fingerprint" /><category term="scanner" /><category term="touchpad" /><category term="phone" /><category term="usability study" /><category term="alternative input modalities" /><category term="university of toronto" /><category term="uoft" /><summary type="html">I have been away for a while, many of you know I started with my Masters at UofT last fall and since then I have not had time to update my blog. Right now I started with my internship and my daily routine is falling into place. I now have some time available to write about things I did in the last eight months.</summary></entry><entry><title type="html">Activating Google Chrome’s Password Import Export Feature</title><link href="https://nishantarora.in/activating-google-chromes-password-import-export-feature.naml" rel="alternate" type="text/html" title="Activating Google Chrome’s Password Import Export Feature" /><published>2016-08-08T13:58:55-06:00</published><updated>2016-08-08T13:58:55-06:00</updated><id>https://nishantarora.in/activating-google-chromes-password-import-export-feature</id><content type="html" xml:base="https://nishantarora.in/activating-google-chromes-password-import-export-feature.naml">&lt;p&gt;There are numerous threads you can find all over the internet telling you how to migrate passwords from Google Chrome browser to firefox or simply exporting them to CSV and reusing them elsewhere. For me I recently switched my Google Accounts and it has been nothing but painful to move the cloud synced settings in chrome.&lt;/p&gt;
&lt;p&gt;Fortunately I found &lt;a href=&quot;https://github.com/megmage/chrome-export-passwords&quot;&gt;this snippet&lt;/a&gt; which helped me create a CSV out of the currently stored passwords. But what if there existed a simpler option. Follow these simple steps to activate this inbuilt password import/export feature on chrome. (Disclaimer, the feature is in Beta stages and might make you loose all your passwords. Take necessary precautions)
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    Open a new tab and type/paste in address bar: &lt;strong&gt;chrome://flags/#password-import-export&lt;/strong&gt;
    &lt;/li&gt;
  &lt;li&gt;
    Change the option to &lt;strong&gt;&quot;enabled&quot;&lt;/strong&gt; from &lt;strong&gt;&quot;default&quot;&lt;/strong&gt;&lt;br&gt;
      &lt;img src=&quot;/assets/post/chrome-password-import-export.png&quot; alt=&quot;chrome-password-import-export&quot; /&gt;&lt;/a&gt;
    &lt;/li&gt;
  &lt;li&gt;Relaunch the browser as needed.&lt;/li&gt;
  &lt;li&gt;Go to &lt;strong&gt;chrome://settings/passwords&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;Export the current list, to download the current passwords, and keep this in safe place.&lt;/li&gt;
  &lt;li&gt;To add more passwords just create a new CSV with same format (i.e &quot;Name&quot;, &quot;URL&quot;, &quot;Username&quot;, &quot;Password&quot;) just import.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
  It can take a while for the imported passwords to show up (CSV parsing for some reason takes time) Once that is done the passwords will show up.
&lt;/p&gt;
&lt;p&gt;
  As the time of writing, I am on &lt;strong&gt;Chrome Version 52.0.2743.116 (64-bit)&lt;/strong&gt;. This feature is slow, and in beta. Do not blame me if you lose your passwords. Save the current password list at all costs.
&lt;/p&gt;
&lt;p&gt;
  &lt;em&gt;
    &lt;strong&gt;Pro Tip:&lt;/strong&gt; keep the chrome running for a couple of hours, and will sync this with the cloud and these passwords will then be available everywhere. Restart to see if your account lost sync. Restart and re-login if needed. It took me a couple of tries to get this right.
  &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Happy Hacking&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="Tutorials" /><category term="chrome" /><category term="password" /><category term="import" /><category term="export" /><category term="google" /><summary type="html">There are numerous threads you can find all over the internet telling you how to migrate passwords from Google Chrome browser to firefox or simply exporting them to CSV and reusing them elsewhere. For me I recently switched my Google Accounts and it has been nothing but painful to move the cloud synced settings in chrome. Fortunately I found this snippet which helped me create a CSV out of the currently stored passwords. But what if there existed a simpler option. Follow these simple steps to activate this inbuilt password import/export feature on chrome. (Disclaimer, the feature is in Beta stages and might make you loose all your passwords. Take necessary precautions) Open a new tab and type/paste in address bar: chrome://flags/#password-import-export Change the option to &quot;enabled&quot; from &quot;default&quot; Relaunch the browser as needed. Go to chrome://settings/passwords Export the current list, to download the current passwords, and keep this in safe place. To add more passwords just create a new CSV with same format (i.e &quot;Name&quot;, &quot;URL&quot;, &quot;Username&quot;, &quot;Password&quot;) just import. It can take a while for the imported passwords to show up (CSV parsing for some reason takes time) Once that is done the passwords will show up. As the time of writing, I am on Chrome Version 52.0.2743.116 (64-bit). This feature is slow, and in beta. Do not blame me if you lose your passwords. Save the current password list at all costs. Pro Tip: keep the chrome running for a couple of hours, and will sync this with the cloud and these passwords will then be available everywhere. Restart to see if your account lost sync. Restart and re-login if needed. It took me a couple of tries to get this right. Cheers! Happy Hacking</summary></entry><entry><title type="html">Adding Front-End To Your Raspberry Pi Server</title><link href="https://nishantarora.in/adding-front-end-to-your-raspberry-pi-server.naml" rel="alternate" type="text/html" title="Adding Front-End To Your Raspberry Pi Server" /><published>2016-04-24T21:54:35-06:00</published><updated>2016-04-24T21:54:35-06:00</updated><id>https://nishantarora.in/adding-front-end-to-your-raspberry-pi-server</id><content type="html" xml:base="https://nishantarora.in/adding-front-end-to-your-raspberry-pi-server.naml">&lt;p&gt;I know I was suppose to tell you guys how to install scanner support to your raspberry pi print server. But before that we would like to add a front-end. Simple monitoring of the status, nothing fancy.&lt;/p&gt;
&lt;p&gt;A quick search revealed that some users have written a &lt;a href=&quot;https://gist.github.com/jvhaarst/4388108/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;script&lt;/a&gt;. I installed it and was setup in a couple of minutes. But you know what, this looks so 90s. :-/ I hate the design. It sucks!&lt;/p&gt;
&lt;p&gt;So I ended up writing my own front-end for the server. Check out the screenshots:&lt;/p&gt;
&lt;img class=&quot;aligncenter&quot; src=&quot;/assets/post/Fk1v8Tm.png&quot; /&gt;
&lt;img class=&quot;aligncenter&quot; src=&quot;/assets/post/Cl1GxrJ.png&quot; /&gt;
&lt;p&gt;Isn't it cool? checkout how this looked before:&lt;/p&gt;
&lt;img class=&quot;aligncenter&quot; src=&quot;/assets/post/YRUtS.png&quot; /&gt;
&lt;p&gt;Looked shit IMHO. So what I added:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Completely rewritten with performance in mind.&lt;/li&gt;
&lt;li&gt;Less processing on server side (we're running this on Pi) more processing to the user.&lt;/li&gt;
&lt;li&gt;Complete Material Design Compliance.&lt;/li&gt;
&lt;li&gt;Google Charts *_*&lt;/li&gt;
&lt;li&gt;No dependency.&lt;/li&gt;
&lt;li&gt;Responsive Design&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Download and Install instructions: &lt;a href=&quot;https://github.com/whizzzkid/RPi-System-Info-Script&quot;&gt;https://github.com/whizzzkid/RPi-System-Info-Script&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Happy Hacking :)&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="labs" /><category term="Raspberry Pi" /><category term="Frontend" /><category term="System Monitor" /><category term="GUI" /><category term="Material Design Lite" /><summary type="html">I know I was suppose to tell you guys how to install scanner support to your raspberry pi print server. But before that we would like to add a front-end. Simple monitoring of the status, nothing fancy. A quick search revealed that some users have written a script. I installed it and was setup in a couple of minutes. But you know what, this looks so 90s. :-/ I hate the design. It sucks! So I ended up writing my own front-end for the server. Check out the screenshots: Isn't it cool? checkout how this looked before: Looked shit IMHO. So what I added: Completely rewritten with performance in mind. Less processing on server side (we're running this on Pi) more processing to the user. Complete Material Design Compliance. Google Charts *_* No dependency. Responsive Design Download and Install instructions: https://github.com/whizzzkid/RPi-System-Info-Script Cheers! Happy Hacking :)</summary></entry><entry><title type="html">Minimal Raspberry Pi Google Cloud Print Server</title><link href="https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml" rel="alternate" type="text/html" title="Minimal Raspberry Pi Google Cloud Print Server" /><published>2016-04-16T21:54:55-06:00</published><updated>2016-04-16T21:54:55-06:00</updated><id>https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server</id><content type="html" xml:base="https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml">&lt;p&gt;OMG, it's been a year since I posted my last post. TBH, I have had a couple of drafts in 2015, but did not get time to complete anyone of them to be published.&lt;/p&gt;
&lt;p&gt;So I was cleaning up my electronic junk, and believe me I order a lot of stuff online and then lose track of it. Back in 2014 I ordered a Raspberry Pi, model B and it just came out of a box lying under some other boxes. It's a wasted Rs. 2400.&lt;a href=&quot;https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml/img_20160416_202912&quot; rel=&quot;lightbox&quot;&gt;&lt;img class=&quot;aligncenter wp-image-1039 size-medium&quot; src=&quot;/assets/IMG_20160416_202912-222x300.jpg&quot; alt=&quot;IMG_20160416_202912&quot; width=&quot;222&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I had initially planned it to be my media server, but then I bought a chromecast and DLNA compatible NAS server. So this was pretty much out of the equation. Moreover RPi are slow for File/Media servers. So let's leave that for the solutions already available. I have an old deskjet 1050 AIO printer which is almost breathing it's last breath. It's really broken, with the outer body cracked and the I/O tray missing, but the thing still prints. So, if I were to buy a new printer then buying a Google Cloud Enabled printer would be a no brainer. But, it struck me, can I make this box online without much effort?&lt;a href=&quot;https://nishantarora.in&quot; rel=&quot;attachment wp-att-1040&quot;&gt;&lt;br /&gt;
&lt;/a&gt; &lt;a href=&quot;https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml/img_20160416_203033&quot; rel=&quot;attachment wp-att-1041&quot;&gt;&lt;img class=&quot;wp-image-1041 size-medium aligncenter&quot; src=&quot;/assets/IMG_20160416_203033-300x222.jpg&quot; alt=&quot;IMG_20160416_203033&quot; width=&quot;300&quot; height=&quot;222&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The following setup took me less than an hour to complete and everything seems to be up and running smooth.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Download Distro:&lt;/strong&gt; I lost track of the RPi world long ago, a quick search revealed that a distribution called minibian is available and the developer is quite active with this. Please consider donating him. Head over &lt;a href=&quot;https://minibianpi.wordpress.com/download/&quot;&gt;here&lt;/a&gt; to download the latest image. At the time of writing it is March 12th update.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writing Image:&lt;/strong&gt; Just unzip the tar-gunzip package to get to the .img file and follow this guide here. Use &lt;a href=&quot;http://elinux.org/RPi_Easy_SD_Card_Setup#Using_the_Win32DiskImager_program&quot;&gt;this guide&lt;/a&gt; In case you're running linux, use &lt;a href=&quot;http://elinux.org/RPi_Easy_SD_Card_Setup#Using_the_Linux_command_line&quot;&gt;this guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH:&lt;/strong&gt; My windows laptop ran out of battery so I continued the setup from here on my chromebook. I plugged the sdcard into the RPi, hooked it to a LAN cable from my wifi router, powered it on using a 5v 2amp charger. I had no idea about the lan address so a quick check into my wifi router's DHCP tables revealed that 192.168.0.51 had been assigned to my RPi, so a simple ssh into 'root@192.168.0.51' with password 'raspberry' landed me the terminal with su access.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resizing the SD Card and setting up locales.&lt;/strong&gt; Since, this is a minimal install, there is no GUI to do this, you might find steps to do this from terminal, but here is the easier way:
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;apt-get update&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; apt-get upgrade&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;raspi-config&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure RPi:&lt;/strong&gt; run &lt;span class=&quot;lang:python decode:true crayon-inline &quot;&gt;raspi-config&lt;/span&gt;  and you get the RPi GUI for expanding the SD card and setting internationalization options. Do that and reboot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Installing Nano:&lt;/strong&gt; you can install an editor for quick editing files over ssh, nano works nice.&lt;span class=&quot;lang:sh decode:true crayon-inline&quot;&gt;apt-get install nano&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cups Web Printing:&lt;/strong&gt; Cups stands for &lt;em&gt;common unix printing system&lt;/em&gt;. This should support all printers from all manufacturers. Check with your manufacturer if the provide linux drivers, like HP does in a package called hplip. Follow this &lt;a href=&quot;https://samhobbs.co.uk/2014/07/raspberry-pi-print-scanner-server&quot;&gt;excellant guide&lt;/a&gt;. You can leave the scanner part for now, just follow all steps under the heading 'Printing'.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GCP Cups Connector:&lt;/strong&gt; The folks at Google Cloud Print team has this &lt;a href=&quot;https://github.com/google/cups-connector/wiki/Installing-on-Raspberry-Pi-Raspbian-Jessie&quot;&gt;great step by step guide&lt;/a&gt; to set the cups connector up and running in no time, however the code has bugs and it won't run directly. I filed this as an &lt;a href=&quot;https://github.com/google/cups-connector/issues/216&quot;&gt;issue&lt;/a&gt; with the team.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Creating a Google Group: &lt;/strong&gt;head over to &lt;a href=&quot;http://groups.google.com&quot;&gt;Google Groups&lt;/a&gt; to create a new group with your famil/friends with whom you would like to share the printer with, once done, get the groups email id. That would look something like your_group@googlegroups.com&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Correcting the GCP config: &lt;/strong&gt;while running the init script, you can respond with any gmail id. When all the steps are complete, before moving this to &lt;span class=&quot;lang:sh decode:true crayon-inline &quot;&gt;/etc/gcp_cups_connector&lt;/span&gt;  dir. run: &lt;span class=&quot;lang:sh decode:true crayon-inline&quot;&gt;nano ~/gcp-cups-connector.config.json&lt;/span&gt;  change scope to the google group email id and continue with the guide from step 8.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Setting up the service to start at boot: &lt;/strong&gt;&lt;a href=&quot;https://github.com/google/cups-connector/wiki/Run-Connector-Automatically-on-Boot&quot;&gt;This guide &lt;/a&gt;has 3 methods to do this, we need the first one. Since you are already logged in as 'root', you do not need to use sudo, you can run them without sudo. Also ideally the command &lt;span class=&quot;lang:python decode:true crayon-inline &quot;&gt;systemctl enable gcp&lt;/span&gt;  should make this start every time the system starts, but this won't work as the network would be down at the start. So we need to make it retry till it finds the network. You can do &lt;span class=&quot;lang:python decode:true crayon-inline&quot;&gt;nano /etc/systemd/system/gcp.service&lt;/span&gt;  and make the file look like following (notice the restart and restart sec statements):&lt;/li&gt;
&lt;script src=&quot;https://gist.github.com/whizzzkid/949ee404a513f2421da31f22d18bdb30.js&quot;&gt; &lt;/script&gt;
&lt;li&gt;&lt;strong&gt;Reboot and wait: &lt;/strong&gt;since you're logged in as root, type &lt;span class=&quot;lang:sh decode:true crayon-inline &quot;&gt;reboot&lt;/span&gt;  on the terminal and wait. Ideally, the printer would be listed here https://www.google.com/cloudprint/#printers now you can enjoy printing from your chromebook, phone or any machine connected to the internet.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hope it was smooth, took me less than 45 mins to get this up and running. Finally this shows up:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml/ydutzo43y86&quot; rel=&quot;attachment wp-att-1038&quot;&gt;&lt;img class=&quot;size-medium wp-image-1038 aligncenter&quot; src=&quot;/assets/YDUtzO43y86-300x119.png&quot; alt=&quot;YDUtzO43y86&quot; width=&quot;300&quot; height=&quot;119&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Messy Setup:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml/img_20160416_203008&quot; rel=&quot;attachment wp-att-1042&quot;&gt;&lt;img class=&quot;size-medium wp-image-1042 aligncenter&quot; src=&quot;/assets/IMG_20160416_203008-300x222.jpg&quot; alt=&quot;IMG_20160416_203008&quot; width=&quot;300&quot; height=&quot;222&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And on phone:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://nishantarora.in/minimal-raspberry-pi-google-cloud-print-server.naml/screenshot_20160416-205331&quot; rel=&quot;attachment wp-att-1043&quot;&gt;&lt;img class=&quot;size-medium wp-image-1043 aligncenter&quot; src=&quot;/assets/Screenshot_20160416-205331-169x300.png&quot; alt=&quot;Screenshot_20160416-205331&quot; width=&quot;169&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;Next up, I found a resistive touch screen for arduino in my stack, can I use this with raspberry pi to show the printer status on the screen?&lt;/p&gt;
&lt;p&gt;Happy Hacking :)&lt;/p&gt;
&lt;p&gt;Cheeers.&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="tutorials" /><category term="cloud" /><category term="Google" /><category term="pi" /><category term="print" /><category term="raspberry" /><category term="server" /><summary type="html">OMG, it's been a year since I posted my last post. TBH, I have had a couple of drafts in 2015, but did not get time to complete anyone of them to be published. So I was cleaning up my electronic junk, and believe me I order a lot of stuff online and then lose track of it. Back in 2014 I ordered a Raspberry Pi, model B and it just came out of a box lying under some other boxes. It's a wasted Rs. 2400. I had initially planned it to be my media server, but then I bought a chromecast and DLNA compatible NAS server. So this was pretty much out of the equation. Moreover RPi are slow for File/Media servers. So let's leave that for the solutions already available. I have an old deskjet 1050 AIO printer which is almost breathing it's last breath. It's really broken, with the outer body cracked and the I/O tray missing, but the thing still prints. So, if I were to buy a new printer then buying a Google Cloud Enabled printer would be a no brainer. But, it struck me, can I make this box online without much effort? The following setup took me less than an hour to complete and everything seems to be up and running smooth. Download Distro: I lost track of the RPi world long ago, a quick search revealed that a distribution called minibian is available and the developer is quite active with this. Please consider donating him. Head over here to download the latest image. At the time of writing it is March 12th update. Writing Image: Just unzip the tar-gunzip package to get to the .img file and follow this guide here. Use this guide In case you're running linux, use this guide. SSH: My windows laptop ran out of battery so I continued the setup from here on my chromebook. I plugged the sdcard into the RPi, hooked it to a LAN cable from my wifi router, powered it on using a 5v 2amp charger. I had no idea about the lan address so a quick check into my wifi router's DHCP tables revealed that 192.168.0.51 had been assigned to my RPi, so a simple ssh into 'root@192.168.0.51' with password 'raspberry' landed me the terminal with su access. Resizing the SD Card and setting up locales. Since, this is a minimal install, there is no GUI to do this, you might find steps to do this from terminal, but here is the easier way: apt-get update; apt-get upgrade; apt-get install raspi-config; Configure RPi: run raspi-config  and you get the RPi GUI for expanding the SD card and setting internationalization options. Do that and reboot. Installing Nano: you can install an editor for quick editing files over ssh, nano works nice.apt-get install nano Cups Web Printing: Cups stands for common unix printing system. This should support all printers from all manufacturers. Check with your manufacturer if the provide linux drivers, like HP does in a package called hplip. Follow this excellant guide. You can leave the scanner part for now, just follow all steps under the heading 'Printing'. GCP Cups Connector: The folks at Google Cloud Print team has this great step by step guide to set the cups connector up and running in no time, however the code has bugs and it won't run directly. I filed this as an issue with the team. Creating a Google Group: head over to Google Groups to create a new group with your famil/friends with whom you would like to share the printer with, once done, get the groups email id. That would look something like your_group@googlegroups.com Correcting the GCP config: while running the init script, you can respond with any gmail id. When all the steps are complete, before moving this to /etc/gcp_cups_connector  dir. run: nano ~/gcp-cups-connector.config.json  change scope to the google group email id and continue with the guide from step 8. Setting up the service to start at boot: This guide has 3 methods to do this, we need the first one. Since you are already logged in as 'root', you do not need to use sudo, you can run them without sudo. Also ideally the command systemctl enable gcp  should make this start every time the system starts, but this won't work as the network would be down at the start. So we need to make it retry till it finds the network. You can do nano /etc/systemd/system/gcp.service  and make the file look like following (notice the restart and restart sec statements): Reboot and wait: since you're logged in as root, type reboot  on the terminal and wait. Ideally, the printer would be listed here https://www.google.com/cloudprint/#printers now you can enjoy printing from your chromebook, phone or any machine connected to the internet. Hope it was smooth, took me less than 45 mins to get this up and running. Finally this shows up: Messy Setup: And on phone: Next up, I found a resistive touch screen for arduino in my stack, can I use this with raspberry pi to show the printer status on the screen? Happy Hacking :) Cheeers.</summary></entry><entry><title type="html">PrestaShop: Enable Cloudflare Flexible SSL</title><link href="https://nishantarora.in/prestashop-enable-cloudflare-flexible-ssl.naml" rel="alternate" type="text/html" title="PrestaShop: Enable Cloudflare Flexible SSL" /><published>2014-12-23T19:10:18-07:00</published><updated>2014-12-23T19:10:18-07:00</updated><id>https://nishantarora.in/prestashop-enable-cloudflare-flexible-ssl</id><content type="html" xml:base="https://nishantarora.in/prestashop-enable-cloudflare-flexible-ssl.naml">&lt;p&gt;I guess everyone knows about the Cloudflare's flexible SSL, which is free and can be enabled for all sites served using CF's CDN network. Like this blog itself is being served over the CF network and has the Flexible SSL enabled. However just enabling the SSL/page rule thingy will not solve all your problems. Like my blog which uses wordpress didn't work properly in the first go. I had to redo some portions of the theme (mostly regex edits) to support the new secure urls. Currently it uses a tweaked mod_rewrite + page rules to force SSL everywhere.&lt;/p&gt;
&lt;p&gt;Wordpress was easy, but currently I am working with PrestaShop for someone and enabling flexible SSL seems painful. I could maybe workout a patch and ask the team if they feel like pulling it to their core repository. I am not sure if this can be done using a prestashop module. However, I can give you a quick fix for the problem.&lt;/p&gt;
&lt;p&gt;The problem is, PrestaShop's design, it doesn't supports flexible/shared/server SSL certificates by default. It wants your system to have a dedicated SSL installed. Here is the problematic class: &lt;a href=&quot;https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Tools.php#L269&quot;&gt;https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Tools.php#L269&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To solve this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;STEP 1:&lt;/strong&gt; Complete the cloudflare setup for you prestashop website.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;STEP 2:&lt;/strong&gt; Enable cloudflare Flexible SSL as mentioned here &lt;a href=&quot;https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-Off-Flexible-SSL-Full-SSL-Full-SSL-Strict-mean-&quot;&gt;https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-Off-Flexible-SSL-Full-SSL-Full-SSL-Strict-mean-&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;STEP 3:&lt;/strong&gt; &lt;del&gt;Do not indulge in CloudFlare page rules, it's good to go.&lt;/del&gt; Add a pagerule for your website, something like &quot;*.yourwebsite.com/*&quot; with https always enabled, It will help!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;STEP 4:&lt;/strong&gt; Login to phpMyAdmin for your server. Locate table 'ps_configuration', find rows with names &lt;em&gt;&quot;PS_SSL_ENABLED&quot;&lt;/em&gt; and &lt;em&gt;&quot;PS_SSL_ENABLED_EVERYWHERE&quot;&lt;/em&gt; edit their values to be 1, earlier it was 0.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;STEP 5:&lt;/strong&gt; Use your favourite FTP client to get to your site root, and use your favourite editor to edit the following files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;em&gt;public_html/config/settings.inc.php&lt;/em&gt; and edit the following line towards the end:&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'_PS_CLOUDFLARE_SSL'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;em&gt;&lt;a href=&quot;https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Tools.php#L269&quot;&gt;public_html/classes/Tools.php&lt;/a&gt;&lt;/em&gt; and change the following function:&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/whizzzkid/d506ee697274d1dcdbf25192110ed275.js&quot;&gt; &lt;/script&gt;
&lt;p&gt;That should be it, your site should be fully functioning with free SSL enabled, thanks to cloudflare!&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;</content><author><name>Nishant Arora</name><email>me@nishantarora.in</email></author><category term="tutorials" /><category term="prestashop" /><category term="cloudflare" /><category term="free ssl" /><category term="flexible ssl" /><category term="cdn" /><summary type="html">I guess everyone knows about the Cloudflare's flexible SSL, which is free and can be enabled for all sites served using CF's CDN network. Like this blog itself is being served over the CF network and has the Flexible SSL enabled. However just enabling the SSL/page rule thingy will not solve all your problems. Like my blog which uses wordpress didn't work properly in the first go. I had to redo some portions of the theme (mostly regex edits) to support the new secure urls. Currently it uses a tweaked mod_rewrite + page rules to force SSL everywhere. Wordpress was easy, but currently I am working with PrestaShop for someone and enabling flexible SSL seems painful. I could maybe workout a patch and ask the team if they feel like pulling it to their core repository. I am not sure if this can be done using a prestashop module. However, I can give you a quick fix for the problem. The problem is, PrestaShop's design, it doesn't supports flexible/shared/server SSL certificates by default. It wants your system to have a dedicated SSL installed. Here is the problematic class: https://github.com/PrestaShop/PrestaShop/blob/1.6/classes/Tools.php#L269 To solve this: STEP 1: Complete the cloudflare setup for you prestashop website. STEP 2: Enable cloudflare Flexible SSL as mentioned here https://support.cloudflare.com/hc/en-us/articles/200170416-What-do-the-SSL-options-Off-Flexible-SSL-Full-SSL-Full-SSL-Strict-mean- STEP 3: Do not indulge in CloudFlare page rules, it's good to go. Add a pagerule for your website, something like &quot;*.yourwebsite.com/*&quot; with https always enabled, It will help! STEP 4: Login to phpMyAdmin for your server. Locate table 'ps_configuration', find rows with names &quot;PS_SSL_ENABLED&quot; and &quot;PS_SSL_ENABLED_EVERYWHERE&quot; edit their values to be 1, earlier it was 0. STEP 5: Use your favourite FTP client to get to your site root, and use your favourite editor to edit the following files. Edit: public_html/config/settings.inc.php and edit the following line towards the end: define('_PS_CLOUDFLARE_SSL', '1'); Edit: public_html/classes/Tools.php and change the following function: That should be it, your site should be fully functioning with free SSL enabled, thanks to cloudflare! Cheers!</summary></entry></feed>