<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.1">Jekyll</generator><link href="https://roshansingh.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://roshansingh.github.io/" rel="alternate" type="text/html" /><updated>2021-08-08T20:05:57+00:00</updated><id>https://roshansingh.github.io/feed.xml</id><title type="html">Roshan Singh</title><subtitle>Just a place for my ramblings</subtitle><entry><title type="html">Laptop Review - Thinkpad X1 Carbon Gen 9</title><link href="https://roshansingh.github.io/2021/08/08/laptop-review-thinkpad-x1-carbon-gen-9/" rel="alternate" type="text/html" title="Laptop Review - Thinkpad X1 Carbon Gen 9" /><published>2021-08-08T06:50:00+00:00</published><updated>2021-08-08T06:50:00+00:00</updated><id>https://roshansingh.github.io/2021/08/08/thinkpad-x1-carbon-review</id><content type="html" xml:base="https://roshansingh.github.io/2021/08/08/laptop-review-thinkpad-x1-carbon-gen-9/">&lt;p&gt;I needed a new laptop for quite some time as the current one is almost 10 years old. I have been using a 2012 Thinkpad T530 which is very capable and built like a tank. It has survived two drops from 3-4 feets with only minor damage. Unfortunately it weighs like a tank too. The speakers on it were terrible and I had to constantly look for headphones every time I had to attend a meeting.&lt;/p&gt;

&lt;p&gt;So after deliberating for some time, I came up wit this list of things which would help me narrow down the choices:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Light Weight, less than 1.5 kg&lt;/li&gt;
  &lt;li&gt;Long battery life, more than 6 hours&lt;/li&gt;
  &lt;li&gt;14’ screen with 1920 x 1200 resolution or more. Touchscreen if possible, because why not :)&lt;/li&gt;
  &lt;li&gt;Good processor with at least 16 GB RAM&lt;/li&gt;
  &lt;li&gt;Good speakers&lt;/li&gt;
  &lt;li&gt;Decent webcam&lt;/li&gt;
  &lt;li&gt;Preferably comes pre-installed with Linux&lt;/li&gt;
  &lt;li&gt;USB and HDMI ports. I dont like carrying dongle everywhere.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After scanning the forums for a month, I came up with this list of contenders:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Dell XPS developer edition&lt;/li&gt;
  &lt;li&gt;System 76 Lemur pro&lt;/li&gt;
  &lt;li&gt;Thinkpad X1 Carbon Gen 8/9&lt;/li&gt;
  &lt;li&gt;Thinkpad T14&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I had and inclination towards thinkpad because the last one worked really well. I went to &lt;a href=&quot;https://www.reddit.com/r/thinkpad/comments/nuyxy0/which_thinkpad_to_buy_x1_carbon_t14_or_p14/&quot;&gt;r/thinkpad&lt;/a&gt; to figure out the difference between T14 and X1 Carbon. So both these laptops are very similar except X1 Carbon has better speakers and weighs less.&lt;/p&gt;

&lt;p&gt;Finally I ordered X1 Carbon with i7 processor, touchscreen and 32 GB RAM. It came to around 2100 USD after taxes. It came preinstalled with Ubuntu 20.04 which I swapped with Elementary 6 preview.&lt;/p&gt;

&lt;h2 id=&quot;the-good&quot;&gt;The good&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;The speakers are the best that I have seen so far on a Non-Apple laptop.&lt;/li&gt;
  &lt;li&gt;It boots under 10 seconds and everything is really fast.&lt;/li&gt;
  &lt;li&gt;Keyboard is very good and and have decent travel unlink MacBook pro.&lt;/li&gt;
  &lt;li&gt;Trackpad is also very good. Pinch-zoom gestures do not work out of the box.&lt;/li&gt;
  &lt;li&gt;Fingerprint login did not work very well on Ubuntu.&lt;/li&gt;
  &lt;li&gt;Touchscreen works very well.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-bad&quot;&gt;The bad&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;They have placed the fan under the body so you can not place it on the bed for too long.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-ugly&quot;&gt;The Ugly&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;The biggest downside the webcam. It is worse than the 10 year old T530. After reading Lenovo forums I feel like Lenovo decided to put really shitty webcam on a 2000 USD premium laptop. It works well only if you have good lighting in your room and that too the video is not that great.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;verdict&quot;&gt;Verdict&lt;/h2&gt;
&lt;p&gt;I will still recommend this as a good Linux laptop if the webcam is not a deal breaker for you.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="thinkpad" /><category term="x1carbon" /><summary type="html">I needed a new laptop for quite some time as the current one is almost 10 years old. I have been using a 2012 Thinkpad T530 which is very capable and built like a tank. It has survived two drops from 3-4 feets with only minor damage. Unfortunately it weighs like a tank too. The speakers on it were terrible and I had to constantly look for headphones every time I had to attend a meeting.</summary></entry><entry><title type="html">Agile Retrospective for team improvement</title><link href="https://roshansingh.github.io/2020/04/12/agile-retrospective-for-team-improvement/" rel="alternate" type="text/html" title="Agile Retrospective for team improvement" /><published>2020-04-12T10:00:00+00:00</published><updated>2020-04-12T10:00:00+00:00</updated><id>https://roshansingh.github.io/2020/04/12/agile-retrospective-for-team-improvement</id><content type="html" xml:base="https://roshansingh.github.io/2020/04/12/agile-retrospective-for-team-improvement/">&lt;p&gt;Agile has been followed in some form or the other all the software development teams that I have worked for. Most teams used sprints and daily scrum meeting only. Some teams used sprint planning meetings where you decided the ticket that you would work on during the sprint.&lt;/p&gt;

&lt;p&gt;I have often seen that the Product Owners or Team Leads bring in work as they see fit into sprints without any formal sprint planning meeting. Usually there is some informal followup where people discuss if the work is being done and whether enough work in brought into the sprints.&lt;/p&gt;

&lt;p&gt;In my current organization, we do a lot of meetings related to agile methodology like sprint planning, grooming and retrospective. I was not initially on-board with the idea of conducting so many meetings as I thought that a lot of collective hours are being spent on meeting instead of actual work. But of late, I have noticed significant improvement in team morale, ownership and communication. So I decided to write about retrospective which I found was extremly helpful in identifying problems within the team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retrospective meeting&lt;/strong&gt; is conducted at the end of a sprint (before sprint planning) where the team reflects on how well they did in the sprint. The meeting is used by the team to raise issues that they are facing and how they can fix them.&lt;/p&gt;

&lt;p&gt;The meeting can be divided in three phases - &lt;strong&gt;idea generation&lt;/strong&gt;, &lt;strong&gt;discussion&lt;/strong&gt; and &lt;strong&gt;solution&lt;/strong&gt;. Each phase is time boxed so that we do not run out of time. 15 minutes each would be a good start.&lt;/p&gt;

&lt;h2 id=&quot;idea-generation&quot;&gt;Idea generation&lt;/h2&gt;
&lt;p&gt;Team members use sticky notes to come up with ideas or notes around these three themes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;What went well?&lt;/strong&gt; This is for the team to feel good about their work and learn their strong points eg, there was a complicated migration that the team managed to push out.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;What caused confusion?&lt;/strong&gt; Sometimes due to unclear tickets, processes or inadequate training some team members can feel confused or lost. This is where you can identify those problems.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;What went wrong?&lt;/strong&gt; Things can go wrong for a lot of reasons like miscommunication, poor planning or external dependencies. These issues need to be identified and discussed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;discussion&quot;&gt;Discussion&lt;/h2&gt;
&lt;p&gt;Once you are done with idea generation phase, you need to arrange your tickets in three columns - one for search theme. It should look something like this.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://waynedgrant.files.wordpress.com/2012/02/dsc_0019.jpg&quot; alt=&quot;Retrospective&quot; /&gt;Image courtesy: &lt;a href=&quot;https://waynedgrant.wordpress.com/2012/04/01/sprint-retrospective-techniques/&quot;&gt;https://waynedgrant.wordpress.com/2012/04/01/sprint-retrospective-techniques/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the team should discuss these ideas and get clarification if they couldn’t understand something. At the end of the discussion, you can discard the “what went well” ideas since your team is already good at it.&lt;/p&gt;

&lt;p&gt;The ideas under “what went wrong” and “what caused confusion” should be merged. Similar ideas should be grouped to create a common theme. At the end of this phase, you should have identified some common problems in the team which needs improvement.&lt;/p&gt;

&lt;h2 id=&quot;solution&quot;&gt;Solution&lt;/h2&gt;
&lt;p&gt;In this phase the team should vote on top 2-3 problems which they would like to address immediately in the next sprint. The team can either collectively come up with ideas or use sticky notes to individually come up with ideas for every problem and vote on it.&lt;/p&gt;

&lt;p&gt;At the end of retrospective meeting, they should create tickets for team improvement and add it to the next sprint. These tickets should be reviewed in their next retrospective to see how well they did on addressing these problems.&lt;/p&gt;

&lt;p&gt;It takes some time to get used to retrospective, but over time I have found that it solved lot of friction within the team and helped us collectively figure to out solutions to the problems.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="agile" /><summary type="html">Agile has been followed in some form or the other all the software development teams that I have worked for. Most teams used sprints and daily scrum meeting only. Some teams used sprint planning meetings where you decided the ticket that you would work on during the sprint.</summary></entry><entry><title type="html">Things I learned in 2019</title><link href="https://roshansingh.github.io/2020/02/01/things-i-learned-in-2019/" rel="alternate" type="text/html" title="Things I learned in 2019" /><published>2020-02-01T10:00:00+00:00</published><updated>2020-02-01T10:00:00+00:00</updated><id>https://roshansingh.github.io/2020/02/01/things-i-learned-in-2019</id><content type="html" xml:base="https://roshansingh.github.io/2020/02/01/things-i-learned-in-2019/">&lt;p&gt;I work in a very small team of three engineers which does not leave much room for dedicating resources for managing infrastructure. We wanted explore managed AWS solutions so that we can focus on delivering features without worry about scaling the infrastructure or dealing with maintaining servers.&lt;/p&gt;

&lt;p&gt;This post briefly describes the new technologies that we are using to make our lives easier. I am sure that these solutions may not be very cost effective but then it allows us to focus on things that matter most for us. In the last one year since we have started using these new technologies we have not faced any significant disruption in our daily work schedule because of outage. We just work on features and focus on shipping things.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;AWS Lambda for managing API&lt;/strong&gt;
We use Python Flask as our backend framework. &lt;a href=&quot;https://github.com/Miserlou/zappa&quot; target=&quot;_blank&quot;&gt;Zappa&lt;/a&gt; is being used for deployments. It can bundle the code and dependencies together, upload the package to an S3 bucket, create lambdas and configure api gateway. So pretty much everything. You just have to create a new IAM user with appropriate permissions and zappa takes care of the rest.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;AWS S3 for frontend app hosting&lt;/strong&gt; S3 buckets are used for hosting the single page apps. Our build tools create the final package and upload it to S3.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Dynamodb&lt;/strong&gt;
We now use dynamodb instead of Mongodb. There are some restrictions with respect to index creation and nested objects, but it was the closest thing available to us. AWS now offers documentdb which can be used as an replacement for mongodb. We had to make adjustments around index creation.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Managed Elasticsearch&lt;/strong&gt; Managed Elasticsearch has been a lifesaver. You can directly add new nodes and upgrade storage or VM specs and everything works seamlessly. We had to make several iterations before we could reach the desired configuration for our cluster.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Terraform&lt;/strong&gt; 
&lt;a href=&quot;https://www.terraform.io/&quot; target=&quot;_blank&quot;&gt;Terraform&lt;/a&gt; is an Infrastructure as code solution. You can define your infrastructure in YAML files. Terraform reads these files and creates the necessary resources by using cloud provider’s apis. We save the generated terraform files in a private S3 bucket so that the state is persisted. Terraform is really helpful when you need to create multiple environment. You can write your code once and then create multiple environments by using different api keys or changing the variable names.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Drone&lt;/strong&gt; &lt;a href=&quot;https://drone.io/&quot; target=&quot;_blank&quot;&gt;Drone&lt;/a&gt; is a continuous delivery platform. We use it for deployment to various environments. We have a staging and a master branch which are pointed to staging and production environments. Every time a pull request is merged into staging or master branch it gets deployed to the lambdas using zappa. For fronend projects, an npm build is triggered and then then the files are uploaded to appropriate S3 buckets.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These new technologies have made it possible for our team to ship incremental features so easy and stress-free. I don’t think I can go back to managing servers or VMs again.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="automation" /><category term="infrastructure" /><category term="aws" /><summary type="html">I work in a very small team of three engineers which does not leave much room for dedicating resources for managing infrastructure. We wanted explore managed AWS solutions so that we can focus on delivering features without worry about scaling the infrastructure or dealing with maintaining servers.</summary></entry><entry><title type="html">Setting up screen on linux</title><link href="https://roshansingh.github.io/2018/09/14/screen-setup/" rel="alternate" type="text/html" title="Setting up screen on linux" /><published>2018-09-24T01:10:12+00:00</published><updated>2018-09-24T01:10:12+00:00</updated><id>https://roshansingh.github.io/2018/09/14/setting-up-screen-on-linux</id><content type="html" xml:base="https://roshansingh.github.io/2018/09/14/screen-setup/">&lt;p&gt;Screen is a program that runs in terminal and allows you to create multiple terminals with one ssh login. It runs in background so that you can attach to the same session if ssh disconnects. Its particularly useful when you are using mobile data or have to leave some process running in foreground.&lt;/p&gt;

&lt;p&gt;You can follow these instructions to set it up.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install screen
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now paste this on your ~/.screenrc file&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hardstatus alwayslastline
hardstatus string '%{= mK}%-Lw%{= KW}%50&amp;gt;%n%f* %t%{= mK}%+Lw%&amp;lt; %{= kG}%-=%D %d %M %Y %c:%s%{-}'
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
multiuser on
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally add this to your bash profile ~/.bashrc or ~/.bash_profile&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;if [ -z &quot;$STY&quot; ]; then
  exec screen -aAxR -S x
fi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now log out and log back in. You can read some instructions online on how to use it.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="screen" /><category term="linux" /><summary type="html">Screen is a program that runs in terminal and allows you to create multiple terminals with one ssh login. It runs in background so that you can attach to the same session if ssh disconnects. Its particularly useful when you are using mobile data or have to leave some process running in foreground.</summary></entry><entry><title type="html">Working with docker</title><link href="https://roshansingh.github.io/2018/09/14/working-with-docker/" rel="alternate" type="text/html" title="Working with docker" /><published>2018-09-14T01:11:05+00:00</published><updated>2018-09-14T01:11:05+00:00</updated><id>https://roshansingh.github.io/2018/09/14/working-with-docker</id><content type="html" xml:base="https://roshansingh.github.io/2018/09/14/working-with-docker/">&lt;p&gt;During migration of a website which has not been updated in a while, it occured to me that docker will be ideal for this website. It did not have a lot of traffic and business impact was also less.&lt;/p&gt;

&lt;p&gt;So I gave myself a few days to deep dive and learn it. The documentation and getting started guide is just beautiful. Everything was explained properly and all the flags in the docker command were listed down with lot of examples. I will recommend spending a week if you are planning to use it. List down everything that you need and do a bit of research to understand how to do things. There are enough blogs available which can help you with that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good parts:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Not having to worry about host system was such a game changer. I used mac to build my image and Ubuntu for production deployment. I could use any linux distribution for the base image.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Prebuilt images which can be customized to suit your needs. In my case, I needed something to host my flask application. I used a prebuilt image with nginx and uwsgi. I just to add my code to the image and point uwsgi to load it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Docker monitors your services and auto-restarts them for you.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Scaling services could not have been easier :)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You can add configuration files for various environments and add them to your service at the time of deployment at any specific location (eg. /etc/myservice.conf) so that your application can read it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Logs can be redicted to splunk with just a flag. If you ever had to setup log forwarders you know that it can be a painful experience if you have to do it manually on all the servers. In my case we have a leased data center so we don’t have the luxury of using custom built images all the time.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Things to keep in mind:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Since the containers can die and be restarted automatically. Sometimes it can be started on some other host machine than that it was originally running on. Persisting data like reports or uploaded files or images can be a pain if you do not use a cloud service like S3. You can mount a directory on host machine to the container so I mounted a NFS shared directory on all the docker host machines and then mounted it on the container.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The images built by docker is fairly large so if you work in a place where you do not have large data limits for your broadband plan I think you should reconsider your decision of using docker.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Docker image hosting can increase your expenses. Docker hub currently allows one private repo.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Some understanding of system administration will be needed if you have to debug something.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Docker does not directly support cron jobs. You might have to do some tricks with setting up cron service.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The community edition does not come with a UI for managing docker swarm(cluster of hosts which run docker) or adding/scaling new services. I am using &lt;a href=&quot;https://portainer.io/&quot;&gt;Portainer&lt;/a&gt; which is fairly easy to understand and use. Kubernetes is another service which can be used to maintain swarm but I found it difficult to understand and set up on your own.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;</content><author><name>Roshan Singh</name></author><category term="docker" /><summary type="html">During migration of a website which has not been updated in a while, it occured to me that docker will be ideal for this website. It did not have a lot of traffic and business impact was also less.</summary></entry><entry><title type="html">Should caste based reservation be allowed?</title><link href="https://roshansingh.github.io/2018/01/04/should-caste-based-reservation-be-allowed/" rel="alternate" type="text/html" title="Should caste based reservation be allowed?" /><published>2018-01-04T01:11:05+00:00</published><updated>2018-01-04T01:11:05+00:00</updated><id>https://roshansingh.github.io/2018/01/04/should-caste-based-reservation-be-allowed</id><content type="html" xml:base="https://roshansingh.github.io/2018/01/04/should-caste-based-reservation-be-allowed/">&lt;p&gt;TL;DR: Caste based reservations should be allowed until caste based discrimination is stopped.&lt;/p&gt;

&lt;p&gt;This is an issue which is close to all the Indians and have affected their lives. Despite what the government portrays the ground realities of jobs and education are grim.&lt;/p&gt;

&lt;p&gt;On an average there are 20 times more applicants than the number of open positions. Consider NEET which is the eligibility exam for doctors in India, there were 11.5 lakhs (1.1 m) applicants to roughly 56,000 open positions. Out of 56,000 half of the seats are from private colleges which are significantly expensive than the public colleges. The situation is similar or even worse for engineering, chartered accounts or public sector jobs.&lt;/p&gt;

&lt;p&gt;To the upper castes, it creates a lot of pressure throughout life whether one is studying or working so they are opposed to it. Some people want government to provide incentives to economically backward people from all castes. This looks like a noble idea, however since everything in India is prone to corruption I highly doubt that people who need the money will actually receive it.&lt;/p&gt;

&lt;p&gt;To the lower castes (SC/ST/OBC) this is opens up a window to climb up the ladder both socially and economically. So more and more backward castes want them to be considered themselves included in OBC some OBC castes even want them to be considered SC.&lt;/p&gt;

&lt;p&gt;From what I have seen growing up, most people who have received benefits of this reservations are the children of people who have themselves benefitted from reservations once. This opens another problem of whether it is justified to keep giving reservations to people who are already well off?&lt;/p&gt;

&lt;p&gt;I was strongly opposed to reservations while I was growing up because it had significantly reduced the number of open seats for me in the colleges I wanted to get admitted to, so I had to settle for a medium tier college. I was also of the opinion that caste based discrimination was a thing of past which is just not true.&lt;/p&gt;

&lt;p&gt;Caste based discrimination is very much prevalent in India from North to South. Some people get beaten up because they use wells meant for upper caste. They are not allowed to enter in the temples. People have separate utensils in their homes meant for lower castes. Grooms are not allowed to ride horses in marriage processions. Inter caste marriages are not accepted and sometimes brides and grooms are even killed.&lt;/p&gt;

&lt;p&gt;In my opinion, until we are really equal in the society where people are not harassed and inter-caste marriages are a norm, caste based reservations must be allowed.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="essay" /><summary type="html">TL;DR: Caste based reservations should be allowed until caste based discrimination is stopped.</summary></entry><entry><title type="html">Spark streaming reduceByKeyAndWindow unstable application</title><link href="https://roshansingh.github.io/2016/10/28/spark-streaming-reducebykeyandwindow-unstable-application/" rel="alternate" type="text/html" title="Spark streaming reduceByKeyAndWindow unstable application" /><published>2016-10-28T06:41:26+00:00</published><updated>2016-10-28T06:41:26+00:00</updated><id>https://roshansingh.github.io/2016/10/28/spark-streaming-reducebykeyandwindow-unstable-application</id><content type="html" xml:base="https://roshansingh.github.io/2016/10/28/spark-streaming-reducebykeyandwindow-unstable-application/">&lt;p&gt;I wanted to run a job which runs 24×7 and which reports if certain keywords occur more than a N times in the stream. Spark streaming looked a ideal candidate for this task. Spark has a &lt;a href=&quot;http://spark.apache.org/docs/latest/streaming-programming-guide.html#window-operations&quot;&gt;reduceByKeyAndWindow function&lt;/a&gt; which was exactly what I was looking for.&lt;/p&gt;

&lt;p&gt;I decided to use a window length of 1 minute and slide interval of 30 minutes. I had assumed that it will discard all the keys every 30 minutes. While running the job I noticed that the memory usage and the processing time kept on increasing to a point that the application would never be stable i.e. each job was taking more time than the window interval. So new jobs kept on getting added to the processing queue.&lt;/p&gt;

&lt;p&gt;Since the documentation on this function is so little that I had to ask around the mailing list for the . After a few days a guy responded that I needed to add a filter function which will discard the unwanted keys.&lt;/p&gt;

&lt;pre&gt;reduceByKeyAndWindow(reduceRows, invReduceRows, 1800, 60, filterFunc=filterOldKeys)&lt;/pre&gt;

&lt;p&gt;So now the actual function call looks something like this. The filterOldKey is a simple function where I check if count of the key is greater than 0. This solved my problem.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="spark" /><category term="spark-streaming" /><summary type="html">I wanted to run a job which runs 24×7 and which reports if certain keywords occur more than a N times in the stream. Spark streaming looked a ideal candidate for this task. Spark has a reduceByKeyAndWindow function which was exactly what I was looking for.</summary></entry><entry><title type="html">Spark streaming: Fixing all executors not getting jobs</title><link href="https://roshansingh.github.io/2016/10/28/spark-streaming-fixing-all-executors-not-getting-jobs/" rel="alternate" type="text/html" title="Spark streaming: Fixing all executors not getting jobs" /><published>2016-10-28T06:26:25+00:00</published><updated>2016-10-28T06:26:25+00:00</updated><id>https://roshansingh.github.io/2016/10/28/spark-streaming-fixing-all-executors-not-getting-jobs</id><content type="html" xml:base="https://roshansingh.github.io/2016/10/28/spark-streaming-fixing-all-executors-not-getting-jobs/">&lt;p&gt;I was working on a feature recently which needed a streaming job that runs 24×7 and processing 100 million rows per day. The spark web ui is a wonderful tool to look at how things are running internally. While debugging I noticed that the streaming jobs were getting allocated to only one machine. Spark has a set priority to dispatch jobs to the executors based on proximity (on the same host, in the same pool etc) and if they complete the job within a fixed interval then all the jobs are sent to the same executor.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;wp-image-683 aligncenter&quot; src=&quot;/wp-content/uploads/2016/10/executor-300x145.png&quot; alt=&quot;executor&quot; width=&quot;811&quot; height=&quot;392&quot; srcset=&quot;/wp-content/uploads/2016/10/executor-300x145.png 300w, /wp-content/uploads/2016/10/executor-768x371.png 768w, /wp-content/uploads/2016/10/executor-1024x494.png 1024w, /wp-content/uploads/2016/10/executor.png 1349w&quot; sizes=&quot;(max-width: 811px) 100vw, 811px&quot; /&gt;&lt;/p&gt;

&lt;pre&gt;spark.scheduler.mode FAIR
spark.locality.wait 100ms&lt;/pre&gt;

&lt;p&gt;By making the above changes to spark-defaults.conf you can force spark to dispatch the jobs to other nodes. You might have to tweak spark.locality.wait a little so that it suits your needs.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="spark" /><category term="spark-streaming" /><summary type="html">I was working on a feature recently which needed a streaming job that runs 24×7 and processing 100 million rows per day. The spark web ui is a wonderful tool to look at how things are running internally. While debugging I noticed that the streaming jobs were getting allocated to only one machine. Spark has a set priority to dispatch jobs to the executors based on proximity (on the same host, in the same pool etc) and if they complete the job within a fixed interval then all the jobs are sent to the same executor.</summary></entry><entry><title type="html">Sending mails from munin using custom command</title><link href="https://roshansingh.github.io/2016/04/03/sending-mails-from-munin-using-custom-command/" rel="alternate" type="text/html" title="Sending mails from munin using custom command" /><published>2016-04-03T04:30:32+00:00</published><updated>2016-04-03T04:30:32+00:00</updated><id>https://roshansingh.github.io/2016/04/03/sending-mails-from-munin-using-custom-command</id><content type="html" xml:base="https://roshansingh.github.io/2016/04/03/sending-mails-from-munin-using-custom-command/">&lt;p&gt;We use Sendgrid for email delivery on our cloud. Using custom commands in munin can be tricky. After struggling for some time I wrote a small python script to send emails from munin using sendgrid.&lt;/p&gt;

&lt;p&gt;Add this line to munin.conf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;contacts mycontact
contact.mycontact.command /usr/bin/sendemail alerts@example.com &quot;[Munin] Alert for ${var:host}&quot; &quot;warnings: ${var:wfields} / criticals: ${var:cfields}&quot;
contact.mycontact.text text
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save this file as sendemail in /usr/bin and give it execute permission using chmod +x /usr/bin/sendemail. You should configure the email and sendgrid login details before using this script.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/usr/bin/python
import smtplib, sys
from email.mime.text import MIMEText
from email.Header import Header

DEFAULT_SENDER = 'noreply@example.com'
SENDGRID_USER = 'user'
SENDGRID_PASSWORD = 'pass'

if len(sys.argv) &amp;lt; 3:
    print 'Usage: ./sendemail &quot;foo@example.com&quot; &quot;This is the subject&quot; &quot;This is the email text&quot;'
    sys.exit(1)

smtp = smtplib.SMTP('smtp.sendgrid.net', 2525, 'www.example.com')
smtp.starttls()
smtp.login(SENDGRID_USER, SENDGRID_PASSWORD)

emailIds = sys.argv[1].split(',')
subject = sys.argv[2]
body = sys.argv[3]

message = MIMEText(body)
message['Subject'] = Header(subject)
message['From']    = DEFAULT_SENDER
message['To']      = ','.join(emailIds)

smtp.sendmail(DEFAULT_SENDER, emailIds, message.as_string())
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should start receiving alerts from munin.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="munin" /><summary type="html">We use Sendgrid for email delivery on our cloud. Using custom commands in munin can be tricky. After struggling for some time I wrote a small python script to send emails from munin using sendgrid.</summary></entry><entry><title type="html">Motorcycle review: Bajaj Avenger 2013</title><link href="https://roshansingh.github.io/2015/01/27/motorcycle-review-bajaj-avenger-2013/" rel="alternate" type="text/html" title="Motorcycle review: Bajaj Avenger 2013" /><published>2015-01-27T10:19:46+00:00</published><updated>2015-01-27T10:19:46+00:00</updated><id>https://roshansingh.github.io/2015/01/27/motorcycle-review-bajaj-avenger-2013</id><content type="html" xml:base="https://roshansingh.github.io/2015/01/27/motorcycle-review-bajaj-avenger-2013/">&lt;p&gt;I bought Avenger in July 2013. Specification can be read at &lt;a href=&quot;http://www.bajajauto.com/avenger/&quot;&gt;http://www.bajajauto.com/avenger/&lt;/a&gt;. I have toured extensively in Karnataka and Leh, so I think this review will definitely help you make up your mind.&lt;/p&gt;

&lt;p&gt;General:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Engine&lt;/strong&gt;: The 220 cc engine gets you off from 0-60 pretty quickly. This is a cruiser so couple of seconds does not matter. It will accelerate till 80 fairly. Once you cross 90 there is not much power left in the bike, you will accelerate very slowly. It will get you till 110. You will feel the vibrations on the foot pegs after 90. The sweet spot is between 70-90. You can just relax and cruise on an open road at that speed and you will absolutely love the ride.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Maneuverability&lt;/strong&gt;: Since it is long (longer than RE Bullet also) and quite heavy so it is quite frustrating to ride in traffic. It feels really heavy when riding at speeds below 30. It needs more area to make u-turns. But once you touch 40 it feels lighter, you can even lean at corners.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mileage&lt;/strong&gt;: In city I get around 28-32 km/l and on highway around 35-38 km/l. I rev the engines hard so I can’t complain on the mileage. People have managed to get 45 on highways.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Big seat &lt;/strong&gt;: This was a big factor while choosing this bike. Since I wanted to ride long distance I wanted comfortable seats. The stock seats were better than other bikes but I added a gel pad and 0.5′ foam on top of the seat for more comfort.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Seating position&lt;/strong&gt;: The low seating position with legs stretched out gives you a chair like seat, which is quite comfortable. The “Feel like god” tagline makes perfect sense when you hop on it. It may take you a while to get used to it though. I am 6 feet tall and weigh 82 kg and I find it extremely comfortable. Be prepared for some splashes in the rainy season though 😉&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Good Headlights&lt;/strong&gt;: The default head lights are good. The whole road will be lit perfectly in high beam.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Chrome&lt;/strong&gt;: Bajaj has used sufficient chrome on it to make it shine. I absolutely love it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Electric Ignition&lt;/strong&gt;: It comes only with an electric ignition. I have not faced any problem with starting even while I was in Leh. Just one push of the button and the engine will come to life.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Back Rest&lt;/strong&gt;: There is a back reset for pillion rider. I use to to strap my luggage 🙂&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Types&lt;/strong&gt;: The MRF Zappier tyres are good. I have done 15,000 km and they still look good. I have had only one puncture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Braking&lt;/strong&gt;: The front tyre is stretched out, so it can be a nightmare at turns and skids at times. You will learn how to use both the brakes to control it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Odo/Speedometer/Indicator&lt;/strong&gt;: It comes with analog meters. The speedometer starts swinging once you cross 100 km/hr. I have managed to clock 115 km/hr on it but I am not sure how faulty the meter was. The turn, high beam and neutral indicators are slapped on the tank so you have to look down to see it which is really annoying. There is no RPM indicator.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Fuel Gauge&lt;/strong&gt;: The fuel gauge is faulty. You just can’t depend on it. I have also noticed water droplets inside the fuel gauge. This has been seen on other avenger bikes, wonder why they have not fixed it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tank Capacity&lt;/strong&gt;: It can hold 14 litres of petrol. I wish the tank was bigger.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Rear View Mirror&lt;/strong&gt;: The stock mirrors are really bad. I have to change mine.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pillion Seat&lt;/strong&gt;: The pillion seat is very small, good for only city rides.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Rider Foot Pegs&lt;/strong&gt;: I wish the foot pegs were a little more forward. It would have made the seating position more relaxed.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Suspensions&lt;/strong&gt;: The rear suspensions are hard and you will feel every bump on your butts.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Gear&lt;/strong&gt;: The gear shifting in not smooth. It gets stuck during down shifting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is really a good motorcycle for the price you pay. I wish Bajaj did something to improve its design and performance.&lt;/p&gt;</content><author><name>Roshan Singh</name></author><category term="bajaj-avenger" /><category term="motorcyle" /><category term="review" /><summary type="html">I bought Avenger in July 2013. Specification can be read at http://www.bajajauto.com/avenger/. I have toured extensively in Karnataka and Leh, so I think this review will definitely help you make up your mind.</summary></entry></feed>