<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mandar Vaze on Medium]]></title>
        <description><![CDATA[Stories by Mandar Vaze on Medium]]></description>
        <link>https://medium.com/@mandarvaze?source=rss-ecb98c5a0e53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vYVxFWfVj7aBCN3A.jpg</url>
            <title>Stories by Mandar Vaze on Medium</title>
            <link>https://medium.com/@mandarvaze?source=rss-ecb98c5a0e53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:36:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mandarvaze/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Firefox Reader mode in your Terminal]]></title>
            <link>https://medium.com/@mandarvaze/firefox-reader-mode-in-your-terminal-6d0c643464c9?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d0c643464c9</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[focus]]></category>
            <category><![CDATA[distraction-free]]></category>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[noads]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Sat, 15 Jan 2022 11:00:33 GMT</pubDate>
            <atom:updated>2022-01-15T11:00:33.155Z</atom:updated>
            <content:encoded><![CDATA[<p>These days, I’m trying to move to more text based workflows.</p><p>On that journey, I came across `readable`</p><p>`readable` strips out just the readability code from mozilla’s firefox engine and provides it as a node module.</p><p>`npm install -g readability-cli` will install a script called `readable`</p><p>By default, readable will strip out all the non-essentials from the webpage and create another HTML page.</p><p>One can not use it as-is, cause it has all the HTML tags. So one needs a browser.</p><p>Since we are already in terminal why not use `w3m` ?</p><p>Here is how I use it.</p><p>`readable <a href="https://microblog.desipenguin.com/post/fzf-with-fish/">https://microblog.desipenguin.com/post/fzf-with-fish/</a> | w3m -T text/html`</p><p>and here is how it looks 😄</p><figure><img alt="Microblog in Terminal" src="https://cdn-images-1.medium.com/max/778/1*zpG8jeV2M1pjSbMi-P_pyw.png" /><figcaption>Microblog in Terminal</figcaption></figure><p>— — -</p><p>On a related note, w3m official homepage asks one to download tarball.</p><p>But your OS’s package manager probably has w3m. So I suggest use that instead.</p><p>FWIW, I used `brew install w3m` on macOS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d0c643464c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why my tests fail only during pre-commit ?]]></title>
            <link>https://medium.com/@mandarvaze/why-my-tests-fail-only-during-pre-commit-65710983b5e0?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/65710983b5e0</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[hooks]]></category>
            <category><![CDATA[pytest]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 07:43:01 GMT</pubDate>
            <atom:updated>2020-09-06T00:58:02.875Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why my tests fail only during pre-commit ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJTtUPlt7wDFceWLbTbKSA.png" /></figure><h3>Symptom</h3><p>Recently I ran across (what I thought was) strange behaviour.</p><p>I use pre-commit for all my git commits, and one of the step is to ensure that all the unit tests pass.</p><p>I also have a make target to run just the unit tests.</p><p>Each time when I tried commit, the unit test step in the pre-commit would fail - which indicates that the unit tests did not pass. But when I run make unit it would pass. 🤷</p><p>During the pre-commit, pytest would return with exit code 5 - which indicates no tests ran. So it wasn&#39;t that one or more tests failed during pre-commit - but nothing was <em>tested</em> - and due to non-zero exit code, pre-commit prevented the commit (as it should)</p><h3>Root Cause</h3><p>It turns out pre-commit runs all the steps only on the modified files. It passes the list of modified files to each command - implicitly. That is, unless you configure it not to. 😀</p><p>So when I modify a source file (not a test file) — pytest would “ignore” the file — since it would not contain any tests.</p><h3>Solution</h3><p>Now that we understand the “why” — solution is obvious.</p><blockquote><em>Patient : Doctor, it hurts when I do </em>this</blockquote><blockquote><em>Doctor : Then don’t do </em>that<em> 😂</em></blockquote><p>For the unit test step, ask pre-commit not to pass the file names as an argument via pass_filenames: false</p><p><em>Originally published on </em><a href="https://learnings.desipenguin.com/"><em>my blog</em></a><em> on June 4, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65710983b5e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run Chrome from Docker in macOS]]></title>
            <link>https://medium.com/@mandarvaze/how-to-run-chrome-from-docker-in-macos-c60488141f47?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/c60488141f47</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Sat, 16 May 2020 01:50:23 GMT</pubDate>
            <atom:updated>2020-09-24T16:03:51.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bDw6U0mVaPri9b4a.png" /></figure><h3>Background</h3><p>Some days ago, I got a call from someone asking for a solution. Due to global pandemic they were unable to hand over a laptop to new employee. They wanted the new employee to access a certain websites but did not wish to share the passwords.</p><p>Their idea : provide access to <em>already-logged-in</em> browser to the new person, so they would have access to the sites, but do not need the passwords.</p><p>They had considered AWS workspaces — but it is costly. (Finally they got some “Free for a couple of months” deal, and used as their final solution)</p><p>I suggested “Chrome in Docker”. The conversation ended, but it intrigued me and wanted to try it out myself.</p><p>I started with <a href="https://github.com/jessfraz/dockerfiles/tree/master/chrome/stable">this</a> but it did not work as-is for me. Partially because (I think) the original repo assumes linux host, and I am on macOS. So I had to make some changes.</p><h3>Summary of my changes</h3><ul><li>I included the chrome.json in the repo. See details about this file in the Dockerfile comments.</li><li>I had to replace libpango with libpangox since the original repo is couple years old.</li><li>Removed talk-plugin cause I don&#39;t need it.</li><li>Created run.sh- because the docker command becomes too long, and changing a param becomes PITA</li><li>Removed --device params because it does not apply to macOS (I think)</li><li>Finally, I needed XServer, which comes with linux but not macOS. Hence brew cask install xquartz</li></ul><h3>Bit of Troubleshooting</h3><p>Where is the fun if things work in the first attempt ? I kept getting Unable to Open XDisplay error.</p><p>To fix the error, I had to set the ip as per <a href="https://medium.com/@dimitris.kapanidis/running-gui-apps-in-docker-containers-3bd25efa862a">this</a></p><p>I created setxhost.sh to simplify this. (Originally it was part of run.sh)</p><p>You can see all my changes in my <a href="https://github.com/mandarvaze/chrome-on-docker">git repo</a> which contains all my modification.</p><p>The README has detailed instructions to try this on your mac.</p><p><em>Originally published at </em><a href="https://learnings.desipenguin.com/post/chrome-on-docker/"><em>https://learnings.desipenguin.com</em></a><em> on May 16, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c60488141f47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to safely use Google Application Credentials on Heroku]]></title>
            <link>https://medium.com/@mandarvaze/how-to-safely-use-google-application-credentials-on-heroku-4e310ad67934?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e310ad67934</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Mon, 11 May 2020 18:22:04 GMT</pubDate>
            <atom:updated>2020-09-05T16:56:20.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgua8CjiXwAWfPPiJBqM8w.png" /></figure><h3>Problem</h3><p>If you have deployed an app on heroku, you know that the <strong>only</strong> way to get any files there is via git. Normally this is fine, but Google API expects an environment variable GOOGLE_APPLICATION_CREDENTIALS that points to a json <strong>file</strong>.</p><p>If you google, you might come across tutorials like <a href="https://towardsdatascience.com/tutorial-google-vision-api-with-python-and-heroku-3b8d3ff5f6ef">this</a> or even <a href="https://stackoverflow.com/questions/57126545/how-to-authenticate-google-vision-api-credentials-on-heroku-using-node-js">SO answer</a></p><p>Essentially they tell you to commit the json file downloaded from Google into git. Since heroku does not have a <em>file system</em> per se, there is no way to get the json file to heroku.</p><p><strong>But</strong> ….. this file should <strong>never</strong> be in git. The file contains your security credentials, and it is (indirectly) linked to your credit card.</p><p>Even if hacker does not get (direct) access to your credit card, if they use <em>your</em> credentials, <em>your</em> account will get billed (once you go over quota) and google will charge <em>your</em> credit card.</p><p>So putting the credentials json file in git is a bad idea.</p><p>So what should a developer to do ?</p><h3>Solution</h3><p>The <em>workaround</em> is to store the contents on json file in an environment variable, and at runtime, create the json file on-the-fly by reading the environment variable.</p><p>But there is better option, use this <a href="https://elements.heroku.com/buildpacks/elishaterada/heroku-google-application-credentials-buildpack">Custom Build pack</a></p><p>Even better, Create .profile file in your repo, and create the json file from the environment variable. <a href="https://github.com/elishaterada/heroku-google-application-credentials-buildpack/pull/5#issuecomment-547896688">No buildpack required.</a></p><h3>Commands</h3><ul><li>On your local machine, where you have downloaded the credentials.json</li><li>Store the JSON contents in environment variable : heroku config:set GOOGLE_CREDENTIALS=&quot;$(&lt; credentials.json)&quot;</li><li>Create a .profile and put this in it : echo ${GOOGLE_CREDENTIALS} &gt; /app/google-credentials.json</li><li>This will create the file on heroku’s ephemeral file system each time a dyno is booted.</li><li>Commit this .profile in the root of your git repo</li><li>Point to the file as Google API expects.</li><li>heroku config:set GOOGLE_APPLICATION_CREDENTIALS=/app/google-credentials.json</li><li>🎉</li></ul><p><em>This post was originally published on my personal blog </em><a href="https://learnings.desipenguin.com/post/goog-cred-heroku/"><em>here</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e310ad67934" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use python for testing your Ethereum Smart Contracts]]></title>
            <link>https://medium.com/hackernoon/how-to-use-python-for-testing-your-ethereum-smart-contracts-e3d3f4b6e587?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3d3f4b6e587</guid>
            <category><![CDATA[populus]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Tue, 20 Mar 2018 00:00:00 GMT</pubDate>
            <atom:updated>2018-04-20T20:36:09.166Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTi22ZcqVADce4SJtIpyBw.jpeg" /></figure><h3>How to use python to test your Ethereum Smart Contracts</h3><p>I recently started working on Ethereum Blockchain development. Most of the tools, including the solidity language are biased towards javascript.</p><p>While I managed to get started using truffle when it came to testing, I found that javascript tests were (IMO) unnecessarily too long.</p><p>But that is the nature of the language.</p><p>I have always been more comfortable with python than JS. I liked and have used py.test in my previous projects. So when I had an option to test my smart contracts using py.test, I definitely was gonna give it a try.</p><p>That is when I came across populus. Turns out it aims to be “truffle for pythonistas” (my words, not the “official” tagline, but they can use it.)</p><p>Initially it was a personal project — which was officially adopted by ethereum organization (on github) adding credibility to the excellent work done so far.</p><p>You can read the official documentation <a href="http://populus.readthedocs.io/en/latest/quickstart.html">here</a></p><h3>Testing</h3><p>As I mentioned earlier, I came for the chance to use py.test for testing the smart contracts.</p><p>Writing the tests (along with web3.py) was quite easy.</p><p>Running the tests in not populus test (like truffle test). As I mentioned earlier, it is via py.test. So it is py.test &lt;folder_containing_tests&gt;/</p><p>.. and this is where I ran into a “glitch”.</p><p>Turns out there is a known <a href="https://github.com/ethereum/populus/issues/431">issue</a> and a <a href="https://github.com/ethereum/populus/issues/414#issuecomment-352628648">solution</a></p><p>One thing I liked about using py.test was that I did not require to <strong>explicitly</strong> start testrpc</p><p>For truffle test testrpc or geth is required to be run explicitly. Else you get the following error:</p><pre>$ truffle test <br>Could not connect to your Ethereum client. Please check that your Ethereum client: <br>    - is running <br>    - is accepting RPC connections (i.e., &quot;--rpc&quot; option is used in geth) <br>    - is accessible over the network <br>    - is properly configured in your Truffle configuration file (truffle.js)</pre><p>I’m not saying that there is anything is wrong in that, just that it is nice to omit a step.</p><h3>Local Chain(s)</h3><p>One more nice feature populus has over truffle is the ability to create local geth instance.</p><p>This can be done easily with populus chain new &lt;chain_name&gt;</p><p>This does several of the following things :</p><ul><li>Creates a genesis.json (Usually one needs to create this by hand, or copy an existing one from “somewhere” and modify)</li><li>Creates one account, that has enough balance.</li><li>Creates two scripts : One to creates genesis block(init_chain.sh) and other to start the “node” (run_chain.sh)</li></ul><p>Benefit of this is that a new developer does not need to understand the complexities of various options in both genesis.json and the long list of command line options to geth</p><p>It just works.</p><p>This is useful to semi-experienced developer as well. She can modify the genesis.json and the scripts as required.</p><p>Since there is no “change password” concept, one can not create a “better” password without removing the existing account and recreating a new one. This means you need to modify the run_chain.sh script, since it mentions an account for the --unlock parameter. One also needs to modify genesis.json since the “pre-populated” account is mentioned there under alloc.</p><p>But that is OK, since populus is meant for the development anyway.</p><p>Read the detailed tutorial about using populus to create local chains <a href="http://populus.readthedocs.io/en/latest/tutorial.part-2.html">here</a></p><p><em>There is also </em><em>populus chain reset &lt;chain_name&gt; but it doesn’t work. I’ve filed an issue </em><a href="https://github.com/ethereum/populus/issues/451"><em>here</em></a></p><h3>Deploying the Contracts</h3><p>For simple, one-off contracts, there is a command line version : populus deploy</p><p>For a slightly complex deployments, especially when one needs to pass arguments to the Contract constructor, one needs to write their own python code.</p><p>This is no different than writing migrations scripts in truffle land, except there one gets “default” scripts on truffle init, here we don’t.</p><p>Read details <a href="http://populus.readthedocs.io/en/latest/deploy.html">here</a></p><h3>Migrations</h3><p>populus had this feature in older version, but it was removed. when asked on gitter, I was told that there is a plan to “bring them back” See <a href="https://gitter.im/ethereum/populus?at=5aa6d7dd35dd17022e4fbfba">this</a></p><h3>Should I ditch truffle ?</h3><p>Not yet.</p><p>While I wanted to use populus as the only option, I think it is behind the “maturity” compared to truffle</p><p>For now, I use truffle for the project I share with others (since truffle seems to be more “well known”) but for my “personal” project, I will continue to use populus (and report issues, discuss on gitter and send in the PR if/where I can)</p><p><strong>Note</strong> : You can view my (work-in-progress) code <a href="https://github.com/mandarvaze/eth-playground">here</a>. It has both truffle as well as populus config files. The tests are only in python. I do have a deployment script in python.</p><p><em>Originally published at </em><a href="https://mandarvaze.bitbucket.io/posts/populus-ethereum-dev-env/"><em>mandarvaze.bitbucket.io</em></a><em> on March 20, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3d3f4b6e587" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/how-to-use-python-for-testing-your-ethereum-smart-contracts-e3d3f4b6e587">How to use python for testing your Ethereum Smart Contracts</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving from Nikola to Hugo]]></title>
            <link>https://medium.com/@mandarvaze/moving-from-nikola-to-hugo-eebf2e758e35?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/eebf2e758e35</guid>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[nikola]]></category>
            <category><![CDATA[hugo]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Sat, 03 Mar 2018 00:00:00 GMT</pubDate>
            <atom:updated>2018-03-06T02:47:37.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*U0XsPiEUubWk7zezHp1x7Q.png" /></figure><p><em>I understand that a post about a static site generator on Medium is kinda pointless. But let’s face it. Medium can reach a lot more people than my blog can. And in the process, someone could find this post (and indirectly other posts on my blog, via the link at the end) useful.</em></p><p>When I started my second blog, instead of pelican, I tried awesome Nikola SSG. It is truly awesome. What I (initially) liked about it was it had support for org-mode i.e. I could write my blog in org-mode and Nikola would generate the post out of it.</p><p>I spent looking for “decent” theme, but couldn’t find one. I tried material theme for a while, but realized it could not do syntax highlighting.</p><p>Since many of my posts had some code, it was an important requirement. But in order to not get “stuck”, I chose a one that I could “live with”, but I was never happy.</p><p>When I heard about Hugo, I was impressed by the vast number of themes. I wanted to “move” immediately.</p><p>But by then, I was “locked” into Nikola due to it’s built-in Gallery feature. One just drops files into a folder, and that is all. (Hugo requires me to list the filename, which may be good, but I wonder how well it would scale.)</p><p>I could not get Gallery to work “back then”. You can read about my first attempt <a href="https://mandarvaze.bitbucket.io/posts/getting-started-with-go/">here</a></p><h3>Process</h3><p>When I started again, I started playing with the exampleSite that came with the theme. I tried to get Gallery feature to work. (Was quite easy. Theme documentation has an example)</p><p>Once prototype worked, I had to convert my posts from org-mode and rst into markdown</p><h3>Initial conversion to markdown</h3><p>I know hugo supports rst (and org-mode), but I am tired of having to “tweak”. (At one point, it was fun. Now I just want to focus on writing. This is also the reason I moved from linux to macOS few years ago.)</p><p>So back to “conversion” I used the following to get the “initial” conversion. “Initial” you say ? Indeed it is just the beginning. Read on.</p><pre>$ for f in `ls -1 *.rst`; do<br>n=$(echo $f | cut -d&#39;.&#39; -f1) <br>pandoc -f rst -t markdown -o /hugo/basedir/blogname/content/post/$n.md $f <br>done <br>$ for f in `ls -1 *.org`; do<br>n=$(echo $f | cut -d&#39;.&#39; -f1) <br>pandoc -f rst -t markdown -o /hugo/basedir/blogname/content/post/$n.md $f <br>done</pre><h3>Fix front matter</h3><p>While the “promise” of SSGs is that if you write the content on the $common_format you can easily switch, it reality, it is not easy, as I found out “second” time.</p><p>When I had two SSGs, pelican and nikola — they both had “slightly” different “style” (for the lack of better word). To their credit, nikola eventually supported front matter that works well with pelican. In fact, I was using same post (mostly) as-is between pelican and nikola for some time. (Mostly because things like “link to other posts” etc. are different.)</p><p>Hugo on the other hand “quite” different style.</p><ul><li>Note: Hugo allows three formats for the front matter. TOML, YAML and JSON. Initially I tried TOML, but syntax is too different = as opposed to already used : So for later “coversions” I went with YAML *</li></ul><p>Mostly the “values” in the front matter are double quoted strings, which is not the case for nikola. This was easy in evil via ysiw&quot;</p><h3>Change category to categories</h3><p>Hugo is probably first SSG I have come across that supports multiple categories. Others usually go with “one category, multiple tags”</p><p>So aside from changing the key name, I also had to enclose both categories and tags into square brackets like [] and each value to be “double quoted”.</p><p>Then there are other smaller things like :</p><ul><li>Fix dates: I had full datetime stamp</li><li>Remove {.sourceCode}. This was auto inserted by pandoc conversion for :code: in the rst files. (Refer to <a href="https://mandarvaze.bitbucket.io/posts/inline-code-block-in-rst/">Inline code blocks</a> post, about how I used it earlier.)</li><li>Replace \&quot; and \&#39; with normal double and single quotes. These too were inserted by pandoc</li></ul><h3>To automated or not ?</h3><p>I did consider writing script or something to automate this, but didn’t. I did most of this manually. Off course, knowing vi commands did make my life easier. (But one could have done this with any other editor. Most of them have “find-and-replace”.) On a related note, I came across <a href="https://thekennethlove.com/2018/02/real-world-programming-or-the-whole-damn-point-is-to-solve-problems/">this</a> post.</p><h3>Migrating galleries</h3><p>Instead of dumping everything under banner, I created subfolders under static/images</p><p>I copied the files from my old blog structure to this new structure.</p><p>One of the benefits of nikola was that I could just dump new files, and automatically they would show up. Here I need to explicitly list each and every file.</p><p>The down side was the order in which they would show up was very random (Probably due to internal use of dictionaries — where the order is never the same. But this is just a guess.)</p><p>So I decided to use this opportunity to display the images in reverse chronological order (in simple terms — latest image shows up first. Makes sense ain’t it ? Regular visitors may have already seen the old images, and may be interested in the new content.)</p><p>While this works well going forward, populating this list “by hand” was a tough task.</p><p>I used ls -lrt1 to get the list of files from newer-&gt;older.</p><p>I copy pasted the results to the .md file. (Removed .. and other files)</p><p>Then using vi/evil magic — added the fixed path to all the entries.</p><h3>Git stuff</h3><p>After spending a couple of days working on the changes in the pockets. I was ready to replace my site.</p><p>I couldn’t just do another push since some of the folder names might be same, but since contents are different, I didn’t wanna take a risk.</p><p>So I wanted a clean start. (But I also wanted to retain the history)</p><p>I didn’t know how to do that.</p><p>One option I considered was doing git rm * and commit this with a message “Reboot”</p><p>I could have always gone back using git log history, but that would be cumbersome.</p><p>So I decided to move the existing site into it’s own branch, so that if required, I could just switch the branches.</p><p>I first renamed existing master to nikola - just to be safe. git branch -m master nikola</p><p>Before I <strong>delete</strong> the master, I needed to tell bitbucket that master is no longer the main branch.</p><p>So from bitbucket website, I chose nikola to be my main branch.</p><p>Then deleted the master using git branch -D master; git push origin :master</p><p>Now the master was empty (didn’t exist).</p><p>A simple git add .; git commit; git push origin master created master in the bitbucket.</p><p>But ..</p><p>Repeatedly hitting “Cmd+R” kept on showing my old site. My heart sank ..</p><p>Then just as a trial, I went back to bitbucket and made master the main branch again.</p><p>and that was it.</p><p>New site was ready.</p><h3>Final thoughts</h3><p>This is my third SSG. I started with pelican. Then nikola. and Now hugo.</p><p>While all of them support markdown, I personally prefer reStructuredText, I think it is much more expressive.</p><p>It does not help that markdown-mode in spacemacs is broken. Specifically evil IMO, may be more. So editing becomes more tedious.</p><p>When migrating, I used to switch to text-mode to get away from the “broken-ness”</p><p>Then there is also the “special” syntax specific to each SSG called “short codes”. Since there is no common standard for it, each has to invent their own. They are similar yet not <strong>exactly same</strong>. So while porting, it indeed becomes “additional work”.</p><p>I really hope I stick with this for a (long) while, but “tinkerer” in me, is gonna want me to look for better theme at least. But it will be a while before that.</p><p>I do want to move my <a href="https://mandarvaze.github.io/">other site</a> to hugo. May be a different theme. Or I’ll just have a single blog like I had <a href="https://mandarvaze.github.io/2016/08/easier-blogging.html#finalize-the-blogging-platform">planned</a></p><p><em>Originally published at </em><a href="https://mandarvaze.bitbucket.io/posts/migrating-to-hugo/"><em>mandarvaze.bitbucket.io</em></a><em> on March 3, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eebf2e758e35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prize Linked Savings Account]]></title>
            <link>https://medium.com/@mandarvaze/prize-linked-savings-account-6a4b50c19896?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a4b50c19896</guid>
            <category><![CDATA[money]]></category>
            <category><![CDATA[economics]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Wed, 13 Dec 2017 11:02:10 GMT</pubDate>
            <atom:updated>2018-01-09T12:22:37.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*YXx7lOjLvLH9oLLf.png" /></figure><p>Recently I heard an episode on Freakonomics podcast called “No-lose Lottery”. You can listen to the episode <a href="http://freakonomics.com/podcast/say-no-no-lose-lottery-rebroadcast/">here</a></p><p>Apparently, this is a rebroadcast. Original episode was in 2010.</p><p>But those details aside, this post is to quickly summarize the concept of “Prize Linked Savings Account”</p><p>As shown in the illustration above,</p><p>The savings accounts provide you with the safety. That is <em>your</em> funds are always safe, and you also get some interest.</p><p>This interest may not be much, in fact there are better avenues of investment.</p><p>But each higher “potential” revenue instrument comes with higher risk.</p><p>Highest risk (and possible highest reward) comes from a lottery.</p><p>You could win a jackpot.</p><p>But most people don’t.</p><p>They keep on “investing” in the hopes of winning “big” (and in the process, lose their savings)</p><p>Prize Linked Savings accounts bring the best of both worlds.</p><p>It is a savings account (so your money is safe) But the interest rate is <strong>zero</strong></p><p>One doesn’t earn anything on that money. (but like other bank account, you can take out your money any time)</p><p>But …</p><p>There is a potential to earn “big”</p><p>Every so often there will be a winner.</p><p>MAMA — Millionaire-A-Month-Account, as the name suggests has a “draw” once every month.</p><p>Seems like a good idea, win-win, no ?</p><p>But then there come the regulators, the bureaucrats</p><p>They don’t like it (for the most part, although that is changing)</p><p>Most of the times, the “lottery” industry is monopolized by the government. There is a huge revenue in this industry, so government does not want to “share the pie”</p><p>And this is not geography specific.</p><p>The podcast provides examples from US as well as South Africa.</p><p>So what can you do, if you liked this idea ?</p><p>I guess try to “influence” your policy makers to allow such bank accounts ;)</p><p><em>Originally published at </em><a href="https://mandarvaze.bitbucket.io/posts/prize-linked-savings.html"><em>mandarvaze.bitbucket.io</em></a><em> on December 13, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a4b50c19896" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beethoven’s fifth]]></title>
            <link>https://medium.com/@mandarvaze/http-www-music-for-music-teachers-com-images-beethovens-5th-extended-page-2-gif-155d6218ec4c?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/155d6218ec4c</guid>
            <category><![CDATA[beethoven]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[symphony]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Sun, 25 Jun 2017 16:51:32 GMT</pubDate>
            <atom:updated>2017-08-08T05:24:54.916Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_4IRMYuE1hI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_4IRMYuE1hI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_4IRMYuE1hI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b85b27bfaf1c0f9d0062e654adb0548/href">https://medium.com/media/2b85b27bfaf1c0f9d0062e654adb0548/href</a></iframe><h3>Beethoven’s fifth</h3><p>Beethoven’s music has three distinct phases — early, mid and late. This is very uncommon, since most musicians have a “set” style through out their career. Fifth symphony was written during the “mid” part of his career.</p><p>Beethoven was working on the fifth for four years.</p><p>Beethoven had started going deaf around this time, that may be the reason parts of the symphony are “loud”</p><p>Four letter motif of the Beethoven’s Fifth symphony was used by BBC during the second world war because :</p><ul><li>It sounds like morse code letter “V”</li><li>Roman numeral for five is “V”</li><li>“V” for victory</li></ul><p>Reference : Classical classroom podcast <a href="https://www.houstonpublicmedia.org/articles/arts-culture/2014/12/29/55020/classical-classroom-episode-72-you-dont-know-fifth-with-emily-reese/">Episode 72</a></p><p><em>Originally published at </em><a href="https://mandarvaze.bitbucket.io/posts/beethovens-fifth.html"><em>mandarvaze.bitbucket.io</em></a><em> on June 25, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155d6218ec4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be Unreasonable]]></title>
            <link>https://medium.com/@mandarvaze/be-unreasonable-7480ed4a1c7b?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/7480ed4a1c7b</guid>
            <category><![CDATA[robin-sharma]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[summary]]></category>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Wed, 14 Sep 2016 07:54:15 GMT</pubDate>
            <atom:updated>2017-08-08T00:22:52.206Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_mxBs0IL0DxQO3dhIs1Iw.png" /></figure><p>I came across <a href="http://www.robinsharma.com/academy/yabyy/unleash-your-greatness-this-year/">this video</a> by Robin Sharma (The author of great books like “The Monk who sold his Ferrari” and “The leader without title”)</p><p>It starts with the following quote :</p><blockquote>The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.</blockquote><p>Robin goes on to suggest that you install 3 habits during the next 90 days, that set the tone for the next 12 months, so that 2016 can be your greatest year (Rather than a repeat of the last year)</p><ul><li><strong>Protect your mindset</strong></li><li>Make sure you are surrounded by positive people</li><li>Don’t watch TV</li><li><strong>Prepare the night before</strong></li><li>Plan for the next day.</li><li>Write top three lessons learned that day</li><li>Write three positive things that happened today</li><li><strong>Focus on single biggest opportunity</strong></li></ul><blockquote>A Person who chases two rabbits, catches neither</blockquote><p><em>Note:</em> I have been writing the <a href="http://www.fiveminutejournal.com/">Five Minute Journal</a> last 6 months. It covers the second point very well.</p><p><em>Originally published at </em><a href="http://mandarvaze.bitbucket.io/"><em>mandarvaze.bitbucket.io</em></a><em> on January 13, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7480ed4a1c7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“I do not have a task”]]></title>
            <link>https://medium.com/@mandarvaze/i-do-not-have-a-task-51cfa20c5e1e?source=rss-ecb98c5a0e53------2</link>
            <guid isPermaLink="false">https://medium.com/p/51cfa20c5e1e</guid>
            <dc:creator><![CDATA[Mandar Vaze]]></dc:creator>
            <pubDate>Tue, 25 Feb 2014 03:43:04 GMT</pubDate>
            <atom:updated>2014-02-25T03:43:04.296Z</atom:updated>
            <content:encoded><![CDATA[<h4>Showing initiative to help yourself</h4><blockquote>Start ups are considered (by some) as best opportunity to advance one’s career. Irrespective of your years of experience or previous background, start ups will let you work on variety of tasks without specifying boundary.</blockquote><p>It is sad when a start up employee says or thinks “I am done working on what I was asked, and have no next task”</p><p>Unless it is your first day/week, you probably know the pulse of the organization. You also (should) know various projects/products/initiatives being perused.</p><p>Start ups are always short of resources. There is always more work than people available. Show initiative, that is the only way to grow. If you keep expecting “work to be assigned” to you, you are probably not a good fit for a start up.</p><blockquote>What are the various things one can do when waiting for formally being assigned the next task ?</blockquote><ul><li>Look at the bug tracking system : see which bugs/features you can address and volunteer for those. Even if you do not end up working on it, at least you would have now understood — probably unknown till now — part of the code.</li><li>Learn new technology : This might be more time consuming, but you should be doing this anyway, probably along with your main assignment.</li><li>Make performance improvements : Depending on the time you have till the next assignment, this may or may not be possible. But you can get started ☺</li><li>Review code written by peers. This helps you learn to write better code, also helps you reduce code review comments if any, especially if you are a junior associate.</li><li>Check to see if you can help with non-development related work, and expand your mind by knowing other parts of business. This could be looking at front end code, if you are a back end developer, or vice versa.</li><li>You can also try to get involved in non-technical work. Create an internal company newsletter. Try out new tools company can use for collaboration. Update the documentation. Write up suggested updates for the company website and send suggestions to the founders. If the company facebook/twitter account is non-functional or not well utilized, volunteer to run that. <em>(Thanks Navin Kabra , for suggesting this entire bullet)</em></li><li>Try to learn more about the domain you are working on. This might help you understand implicit requirements in your field of work.</li></ul><blockquote>This is not restricted to start ups, People should be doing this in any organization, and there are lots of big companies where this is encouraged.</blockquote><p>I <em>assumed</em> more “established” companies may have problems when junior person “tries to look around”, on the other hand start ups may welcome it. I’m sure there are exception in either cases.</p><p><em>Thanks to </em><a href="https://medium.com/@ngkabra"><em>Navin</em></a><em> and </em><a href="https://medium.com/@iamSB"><em>Sushrut</em></a><em> for Reviewing the draft and making this post better.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51cfa20c5e1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>