<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Subhadip's Blog</title><link>https://www.subhadig.net/posts/</link><description>Recent content on Subhadip's Blog</description><generator>Hugo</generator><language>en-us</language><copyright>Subhadip Ghosh</copyright><lastBuildDate>Sat, 02 Sep 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://www.subhadig.net/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>A practical guide to get started with Pass</title><link>https://www.subhadig.net/posts/a-practical-guide-to-get-started-with-pass/</link><pubDate>Sat, 02 Sep 2023 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/a-practical-guide-to-get-started-with-pass/</guid><description>&lt;h1 id="1--introduction"&gt;1. Introduction&lt;/h1&gt;
&lt;p&gt;In my recent endeavour to upgrade my digital security, I started using
&lt;a href="https://www.passwordstore.org/"&gt;Pass&lt;/a&gt;,
the command-line based password manager for my online accounts.
While there were a few online guides that I could follow to get started with
Pass, I did feel a need of a comprehensive guide for new users of Pass.
In my attempt to fill the gap, I will try to touch upon various aspects that one
needs to be mindful of to use Pass in the most secure and optimal way.&lt;/p&gt;</description></item><item><title>Understanding Kotlin Covariance and Contravariance</title><link>https://www.subhadig.net/posts/understanding-kotlin-covariance-and-contravariance/</link><pubDate>Mon, 25 Jul 2022 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/understanding-kotlin-covariance-and-contravariance/</guid><description>&lt;h1 id="1--introduction"&gt;1. Introduction&lt;/h1&gt;
&lt;p&gt;To someone coming from the Java world to the world of Kotlin, the concepts of
Covariance and Contravariance can be somewhat overwhelming to grab at first.
But they don&amp;rsquo;t have to be once you start understanding the basic cadence of it.
This article is going to be a step by step depiction of how I have come to
understand these two topics.&lt;/p&gt;
&lt;h1 id="2--lets-create-some-classes"&gt;2. Let&amp;rsquo;s create some classes!&lt;/h1&gt;
&lt;p&gt;First let&amp;rsquo;s create a small class hierarchy that we can use to understand these
concepts.
&lt;code&gt;Paper&lt;/code&gt; is the parent class of the &lt;code&gt;Regular&lt;/code&gt; paper and the &lt;code&gt;Premium&lt;/code&gt; paper.&lt;/p&gt;</description></item><item><title>Upgrading to Debian 11 Bullseye</title><link>https://www.subhadig.net/posts/upgrading-to-debian-11-bullseye/</link><pubDate>Tue, 01 Mar 2022 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/upgrading-to-debian-11-bullseye/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Although Debian 11 codenamed &lt;em&gt;Bullseye&lt;/em&gt; was released almost 7 months
back on &lt;a href="https://www.debian.org/releases/bullseye/"&gt;14th August, 2021&lt;/a&gt;, it was
only in January, 2022 that I upgraded all my computers running Debian 10 to
Debian 11.
Admittedly a little late to the party, I like to take a cautious approach to
upgrading my systems, which is not very difficult to predict given my Linux
distribution of choice!
In this post, I am going to share my experience and the steps I used while
doing the actual upgrade.&lt;/p&gt;</description></item><item><title>GIMP - Crop to the edges of a document and change Perspective</title><link>https://www.subhadig.net/posts/gimp-crop-to-the-edges-of-a-document-and-change-perspective/</link><pubDate>Fri, 14 Jan 2022 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/gimp-crop-to-the-edges-of-a-document-and-change-perspective/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Since I don&amp;rsquo;t have a scanner at home, if I need to quickly share a soft copy of
a physical document online, usually I take a picture of the document from my
mobile phone and share.
But the problem with pictures is that the sides of the document do not appear
parallel in the image.
I used to use Google Photos to crop an image to the edges of the document so
that it appears somewhat like a scanned document and not an obvious crappy
picture taken from a mobile phone camera.&lt;/p&gt;</description></item><item><title>Easily format markdown tables in Vim</title><link>https://www.subhadig.net/posts/easily-format-markdown-tables-in-vim/</link><pubDate>Fri, 15 Oct 2021 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/easily-format-markdown-tables-in-vim/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Creating markdown tables in Vim is not very intuitive.
Out of the box Vim does not have the capability of formatting markdown tables.
And manually keeping them formatted is no less than a tedious job.
For reasons like these, I have for years avoided using tables in markdown.
But a good thing about Vim is that it&amp;rsquo;s very easy to customize it and add new
functionalities.
Recently I spent some time to make the task of creating and keeping markdown
tables formatted a little easier in Vim.&lt;/p&gt;</description></item><item><title>Functional Global Menu with Xfce Appmenu plugin</title><link>https://www.subhadig.net/posts/functional-global-menu-on-xfce-with-appmenu-plugin/</link><pubDate>Fri, 10 Sep 2021 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/functional-global-menu-on-xfce-with-appmenu-plugin/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;After tinkering with it for a while now I finally have got a very much
functional global menu working on my Xfce4 desktop running on Debian 10.
I will list down the steps I followed to get the global menu configured on my
Debian Xfce box in this post.&lt;/p&gt;
&lt;h3 id="global-menu-vs-local-menu"&gt;Global menu vs Local menu&lt;/h3&gt;
&lt;p&gt;For those of you who might be wondering what a &lt;em&gt;global menu&lt;/em&gt; is, it is a way of
displaying the application menus on the top of the screen like the way MacOS
does.
By default the Xfce4 desktop displays the menus right below the Window title
bar separately in each Window.&lt;/p&gt;</description></item><item><title>Preview markdown files from Vim - The easy way</title><link>https://www.subhadig.net/posts/preview-markdown-files-from-vim-the-easy-way/</link><pubDate>Sat, 28 Nov 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/preview-markdown-files-from-vim-the-easy-way/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I primarily take notes in vim in markdown format.
The upside is that editing in vim is a pleasure.
But one downside of this approach is that my notes often contain images and
rich texts (as
opposed to plain texts) and vim out of the box is not a good tool to view
anything that is more than just text.
In this post, I discuss about how you can easily preview your markdown notes in
your browser directly from your vim editor with the help of a small vim script
and an utility called &lt;em&gt;pandoc&lt;/em&gt; in just a couple of keystroke.
All without a fancy external vim plugin.&lt;/p&gt;</description></item><item><title>The easiest way to stay always connected on IRC</title><link>https://www.subhadig.net/posts/the-easiest-way-to-stay-always-connected-on-irc/</link><pubDate>Sun, 28 Jun 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/the-easiest-way-to-stay-always-connected-on-irc/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Connecting to an IRC room may not be a difficult task but if you communicate
with a group of members connecting from different locations across the globe
and are in different timezones and if you don&amp;rsquo;t want to miss out messages from
them while you are offline, you may find yourself in a tricky situation.
In this post I am going to share the easiest and the most
cost-effective way to always stay connected on IRC using
&lt;a href="https://en.wikipedia.org/wiki/Matrix_%28protocol%29"&gt;Matrix&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Running Kafka in Docker</title><link>https://www.subhadig.net/posts/running-kafka-in-docker/</link><pubDate>Sat, 06 Jun 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/running-kafka-in-docker/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Running &lt;em&gt;Apache Kafka&lt;/em&gt; with &lt;em&gt;Docker&lt;/em&gt; can be harder than it should be.
Or perhaps it&amp;rsquo;s easy once you know what exactly you need to do. In this post,
I&amp;rsquo;m going to discuss about how I run Kafka in &lt;em&gt;Docker&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id="what-is-kafka"&gt;What is Kafka?&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://kafka.apache.org/"&gt;Apache Kafka&lt;/a&gt; is a distributed real-time event
streaming and ingestion platform that is capable of handling very large volume
of data. With the rise in the &lt;em&gt;Microservices&lt;/em&gt; architecture in recent years,
&lt;em&gt;Kafka&lt;/em&gt; has gained a lot of popularity.&lt;/p&gt;</description></item><item><title>Getting started with Kubernetes using Minikube - Deploying an application</title><link>https://www.subhadig.net/posts/getting-started-with-kubernetes-using-minikube-deploying-an-application/</link><pubDate>Thu, 14 May 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/getting-started-with-kubernetes-using-minikube-deploying-an-application/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;This is my second article in the
&lt;a href="https://www.subhadig.net/tags/minikube/"&gt;Kubernetes with Minikube&lt;/a&gt; series.
In the
&lt;a href="https://www.subhadig.net/posts/getting-started-with-kubernetes-using-minikube-installation/"&gt;first article&lt;/a&gt;
I discussed about how to create a local Kubernetes cluster with &lt;em&gt;Minikube&lt;/em&gt;. In
this article, I will be talking about deploying an application in a local
&lt;em&gt;Minikube&lt;/em&gt; cluster.&lt;/p&gt;
&lt;h3 id="simple-web-service"&gt;Simple Web service&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Simple Web service&lt;/em&gt; is a &lt;a href="https://spring.io/projects/spring-boot"&gt;Spring Boot&lt;/a&gt;
application written it Java. It has the following REST endpoint:
&lt;code&gt;GET /details&lt;/code&gt;. And here is how the response looks like:&lt;/p&gt;</description></item><item><title>AMS: Data Collection Service</title><link>https://www.subhadig.net/posts/ams-data-collection-service/</link><pubDate>Wed, 06 May 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/ams-data-collection-service/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;This is the second article in my
&lt;a href="https://www.subhadig.net/tags/application-monitoring-service/"&gt;Application Monitoring System&lt;/a&gt;
(AMS) series where I am building an open source application to monitor performances
of other applications. In this post, I will be discussing about the second
component, the &lt;strong&gt;Data Collection Service&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="data-collection-service"&gt;Data Collection Service&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;Data Collection Service&lt;/em&gt; is a
&lt;a href="https://spring.io/projects/spring-boot"&gt;Spring Boot&lt;/a&gt; application written in
Java. As the name suggests, it is the collector component of our &lt;em&gt;Application
Monitoring System&lt;/em&gt; and it has the ability to
pull metrics data from various source systems and send to various
destination systems.&lt;/p&gt;</description></item><item><title>How to call Spring MongoRepository from an ExecutorService</title><link>https://www.subhadig.net/posts/how-to-call-spring-mongorepository-from-an-executorservice/</link><pubDate>Wed, 29 Apr 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/how-to-call-spring-mongorepository-from-an-executorservice/</guid><description>&lt;h3 id="the-problem"&gt;The problem&lt;/h3&gt;
&lt;p&gt;Recently I encountered an issue in code when I tried to call the
&lt;a href="https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/repository/MongoRepository.html"&gt;Spring MongoRepository&lt;/a&gt;
from a non-Spring-managed thread in a Java &lt;em&gt;Spring Boot&lt;/em&gt; application. Here is a
brief description of the issue.&lt;/p&gt;
&lt;h4 id="the-repository-interface"&gt;The Repository interface&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;ResponseRepository&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;extends&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MongoRepository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s a standard &lt;em&gt;Spring Repository&lt;/em&gt; interface without any custom methods.&lt;/p&gt;
&lt;h4 id="the-calling-class"&gt;The calling class&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@Component&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//A Spring Component&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnImaginaryComponent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nd"&gt;@Autowired&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;private&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ResponseRepository&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;responseRepo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;public&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;saveResponseInANewThread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Response&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//Create an Executor service&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ExecutorService&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Executors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newSingleThreadExecutor&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//Submit a Runnable instance&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;executor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;responseRepo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When &lt;code&gt;anImaginaryComponent.saveResponseInANewThread(r)&lt;/code&gt; is invoked, it
never saves the &lt;em&gt;r&lt;/em&gt; &lt;code&gt;Response&lt;/code&gt; into the database. And the worst part is that
it doesn&amp;rsquo;t throw any exceptions or print any log messages for the failure.&lt;/p&gt;</description></item><item><title>Getting started with Kubernetes using Minikube - Installation</title><link>https://www.subhadig.net/posts/getting-started-with-kubernetes-using-minikube-installation/</link><pubDate>Tue, 21 Apr 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/getting-started-with-kubernetes-using-minikube-installation/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I am working on a series of opinionated posts on how to get started with the
basics of
&lt;a href="https://www.subhadig.net/tags/minikube/"&gt;Kubernetes using Minikube&lt;/a&gt;. In
these posts, I will discuss on a range of topics starting from the installation
of Minikube to the deployment of pods and also workarounds for a few annoying
issues I faced along the way. This is the first article of the series where I
talk about how to install Minikube in your local computer.&lt;/p&gt;</description></item><item><title>AMS: Data Provider Service - Generating performance metrics with Spring Boot Actuator</title><link>https://www.subhadig.net/posts/ams-data-provider-service-generating-performance-metrics-with-spring-boot-actuator/</link><pubDate>Sun, 15 Mar 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/ams-data-provider-service-generating-performance-metrics-with-spring-boot-actuator/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;This is the first article in a series of upcoming articles on designing and
creating an &lt;a href="https://www.subhadig.net/tags/application-monitoring-service/"&gt;Application Monitoring System&lt;/a&gt;.
An Application Monitoring System (AMS) is a system that can monitor
performance of other running applications. I am building this application
component by component from scratch and I will publish it here on this blog.
In this post, I talk about how to create and run services that provide
application performance metrics using Java, Spring Boot and Docker.&lt;/p&gt;</description></item><item><title>Requesting dark mode to websites on Firefox</title><link>https://www.subhadig.net/posts/requesting-dark-mode-to-websites-on-firefox/</link><pubDate>Sun, 01 Mar 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/requesting-dark-mode-to-websites-on-firefox/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Most mainstream web-browsers including Firefox now-a-days come with a feature
where your browser sends your preferred colorshemes to websites when you visit
them. If the website supports this feature, then you are presented with a
light or dark version of the website based on your preference. In this post I
will share how to manually configure it in Firefox.&lt;/p&gt;
&lt;h3 id="prefers-color-scheme"&gt;prefers-color-scheme&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme"&gt;prefers-color-scheme&lt;/a&gt;
is a CSS feature that can be used by websites to detect if the browser has
requested a light or a dark color theme. And if your browser sends the preference
of dark theme and if a visited website chooses to
implement an alternate dark CSS colorsheme then the web content will be
displayed in dark mode. Here are the allowed values for &lt;em&gt;prefers-color-scheme&lt;/em&gt;:&lt;/p&gt;</description></item><item><title>Creating word documents on the command line</title><link>https://www.subhadig.net/posts/creating-word-documents-on-the-command-line/</link><pubDate>Sun, 23 Feb 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/creating-word-documents-on-the-command-line/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;The command line has always seemed to me something that is both fascinating and
under-utilized to a large extent at the same time.
Creating a document on the command line is easy and sometimes it is more
straightforward than using WYSIWYG tools like LibreOffice or MS Office or
Google Docs. In this post I share how I use Pandoc, Vim and Markdown for
creating good professional grade documents on the command line.&lt;/p&gt;</description></item><item><title>Linux equivalent for MacOS open</title><link>https://www.subhadig.net/posts/linux-equivalent-for-macos-open/</link><pubDate>Mon, 20 Jan 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/linux-equivalent-for-macos-open/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I have been using a Mac at my work for a few months now and there&amp;rsquo;s one command
line utility
in MacOS that I am quite impressed with called &lt;em&gt;open&lt;/em&gt;. In this post I talk about
a similar alternative in Linux world.&lt;/p&gt;
&lt;h3 id="what-is-open"&gt;What is &lt;em&gt;open&lt;/em&gt;?&lt;/h3&gt;
&lt;p&gt;From the &lt;em&gt;open&lt;/em&gt; man page:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Open a file or folder.&lt;/p&gt;
&lt;p&gt;The open command opens a file (or a folder or URL), just as if you had
double-clicked the file&amp;rsquo;s icon.&lt;/p&gt;</description></item><item><title>My list of things to do after installing Debian on the PC</title><link>https://www.subhadig.net/posts/my-list-of-things-to-do-after-installing-debian-on-the-pc/</link><pubDate>Wed, 15 Jan 2020 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/my-list-of-things-to-do-after-installing-debian-on-the-pc/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I like the fact that Debian does not do a lot of customizations over
the upstream packages by default but this also means extra work for you for setting up
things after installing Debian on the PC. The upside is that you get to customize
things exactly the way you like it. It definitely helps to have a list to start
with and this post lists down some of the customizations I make after installing
a fresh copy of Debian.&lt;/p&gt;</description></item><item><title>Moving My Blog to GitHub Pages from Wordpress.com</title><link>https://www.subhadig.net/posts/moving-my-blog-to-github-pages-from-wordpress/</link><pubDate>Wed, 25 Dec 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/moving-my-blog-to-github-pages-from-wordpress/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I recently moved my personal blog to GitHub Pages from
Wordpress.com. I have been thinking about doing it for
sometime and this time I finally did it. And in this post
I wanted to share the a few things about it.&lt;/p&gt;
&lt;h3 id="what-this-post-is-and-what-it-is-not"&gt;What this post is and what it is not&lt;/h3&gt;
&lt;p&gt;This post talks about about how I made the switch to Jekyll and GitHub
Pages from Wordpress.com and the reasons behind it. It is
not a rant about Wordpress.com.&lt;/p&gt;</description></item><item><title>Fix for Debian Buster System Freeze</title><link>https://www.subhadig.net/posts/fix-for-debian-buster-system-freeze/</link><pubDate>Mon, 11 Nov 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/fix-for-debian-buster-system-freeze/</guid><description>&lt;h3&gt;The Problem&lt;/h3&gt;
&lt;p&gt;After the release of Debian 10 Buster, I installed it on my Dell Inspiron 3558 laptop which comes with onboard Intel HD Graphics. I am using Xfce desktop environment instead of the default Gnome desktop. After the installation, I would intermittently face the problem where the whole desktop would suddenly just freeze and stop responding to the mouse and the keyboard. Even after hours of waiting the system would never come back to the normal state and the only solution was to hard reboot the whole system. It seemed really weird as prior to installing Debian 10, I had Debian 9 running on it for more than a year and I never had any such issues.&lt;/p&gt;</description></item><item><title>Run Alpine Linux as a Docker Container</title><link>https://www.subhadig.net/posts/run-alpine-linux-as-a-docker-container/</link><pubDate>Sat, 27 Jul 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/run-alpine-linux-as-a-docker-container/</guid><description>&lt;p&gt;If you have never heard of Alpine Linux before, it's a distribution of Linux, a very lightweight one . In fact it's so small, an empty container of Alpine Linux can be run with less than 8 MB of memory. And that's one of the reasons why it's extensively used in containers. Docker Hub has an official image of Alpine Linux. So it's fairly easy to run Alpine Linux as a docker container or build one on top of it.&lt;/p&gt;</description></item><item><title>Run MySQL as Docker Container on Debian</title><link>https://www.subhadig.net/posts/run-mysql-in-docker-on-debian/</link><pubDate>Mon, 27 May 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/run-mysql-in-docker-on-debian/</guid><description>&lt;p&gt;Event though Debian is considered as one of the most stable Linux distributions out there, part of it's stability comes from the fact that a large portion of it's package base consists of well-tested but outdated packages. This should be a blessing most of the times but if you are a developer like me, some times you may need a latest or specific version of a package. In this case, I needed the latest version of the mysql-server package. Although official apt repository is available from MySQL to install the latest version of it on Debian, to be able to run something in containers has it's own advantages including having the ability to run multiple versions of the same package simultaneously and can be easily cleaned up after using.&lt;/p&gt;</description></item><item><title>Fix for incorrect rendering of Indic fonts in Firefox on Debian</title><link>https://www.subhadig.net/posts/fix-for-incorrect-rendering-of-indic-fonts-in-firefox-on-debian/</link><pubDate>Mon, 18 Feb 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/fix-for-incorrect-rendering-of-indic-fonts-in-firefox-on-debian/</guid><description>&lt;p&gt;Debian Stretch, the current stable release of Debian now comes with Firefox ESR 60. One strange issue I have noticed with the out of the box configuration of Firefox on Debian is that it does not correctly render the Indic fonts on the websites. Most notable issue is that it breaks the connected letters while showing. Here's how I fixed it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the fonts-indic package.&lt;br /&gt;

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install fonts-indic&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;br/&gt;
&lt;li&gt;Now open Firefox and go to Preferences &amp;gt; General &amp;gt; Language and Appearance &amp;gt; Fonts &amp;amp; Colors and click on Advanced. Select the language you want to set fonts for from the "Fonts for" dropdown and select fonts with your specific language support for Serif and Sans-serif fonts, click Ok.
&lt;p&gt;Here's how my settings looks like:&lt;/p&gt;</description></item><item><title>How to fix Eclipse IDE flickering issue on Debian</title><link>https://www.subhadig.net/posts/how-to-fix-eclipse-ide-flickering-issue-on-debian/</link><pubDate>Fri, 25 Jan 2019 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/how-to-fix-eclipse-ide-flickering-issue-on-debian/</guid><description>&lt;p&gt;I am using Eclipse IDE (version 2018-12 at the time of writing) on Debian 9 Xfce and the issue with it is that the Eclipse editor windows would flicker around the edges. Sometimes so much so that it's impossible to type inside it. Here's how I fixed it:&lt;/p&gt;
&lt;p&gt;First check the value of GTK_IM_MODULE in your environment by executing&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$GTK_IM_MODULE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In my case the output was "xim". But Eclipse expect it to be "ibus". So enter the following command in a terminal session to set it to the value.&lt;/p&gt;</description></item><item><title>Format USB drive after installing Debian from it</title><link>https://www.subhadig.net/posts/format-usb-drive-after-installing-debian-from-it/</link><pubDate>Sat, 01 Dec 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/format-usb-drive-after-installing-debian-from-it/</guid><description>&lt;p&gt;If you have used an USB drive to write iso images to before installing Debian or recent versions of Ubuntu, here are the steps to reclaim it after installation is over.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal and list the available device names using the following command:

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lsblk&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which should show you an output like the one below:&lt;/p&gt;

&lt;img class="size-full wp-image-1126 aligncenter" src="https://www.subhadig.net/assets/images/fomat_pendrive_1.png" alt="" width="447" height="215" /&gt;&lt;/li&gt;

&lt;li&gt;Identify the device name of your USB drive. Extreme caution should be taken while at it because wrong device names can potentially wipe your entire hard disk. In this case, the USB drive that we want to format is &lt;em&gt;sdb&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Writing the iso image to the USB drive has made it a read-only device. To change it back, the partition table needs to broken. Issue the below command after replacing &lt;em&gt;sdb &lt;/em&gt;with the device name identified in the previous step:

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo dd &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/zero &lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/sdb &lt;span class="nv"&gt;bs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1M &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sync&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This step might take some time to complete depending upon the size of the USB drive. So be patient. When it is over, you should see an output like the below:&lt;/p&gt;</description></item><item><title>Creating an unpriviledged lxc container on Debian Stretch</title><link>https://www.subhadig.net/posts/creating-an-unpriviledged-lxc-container-on-debian-stretch/</link><pubDate>Mon, 15 Oct 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/creating-an-unpriviledged-lxc-container-on-debian-stretch/</guid><description>&lt;p&gt;After a few earlier failed attempts, today I was successfully able to create an unprivileged LXC container on Debian Stretch for the first time. I had experience of using LXC's more user friendly cousin LXD before I moved to Debian but unfortunately LXD is not available on Debian yet. While LXC is more low level compared to LXD, if you just need a basic container, it's still pretty solid. The Debian wiki on LXC container is fairly straight forward and easy to follow, but still for someone who is a novice to both Debian and LXC, it is very easy to get lost. So I am writing this post so that it can be a good place to start if you need a very basic setup.&lt;/p&gt;</description></item><item><title>Assigning volume up/down shortcut keys for secondary speaker in Linux</title><link>https://www.subhadig.net/posts/assigning-volume-up-down-shortcut-keys-for-secondary-speaker-in-linux/</link><pubDate>Sun, 30 Sep 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/assigning-volume-up-down-shortcut-keys-for-secondary-speaker-in-linux/</guid><description>&lt;p&gt;I have a wireless Bluetooth speaker that I use with my laptop running Debian 9 with Xfce. My laptop also has a primary speaker. So when I connect my Bluetooth speaker to my laptop, my laptop is actually connected to both the primary and secondary speaker at the same time. The laptop volume up/down keys will still be mapped to the primary speaker and if I wish to control the volume of the secondary speaker, I needed to open the Volume Control window from the Panel volume plugin, which was a pain if you had to do it every time.&lt;/p&gt;</description></item><item><title>Installing the latest Libreoffice on Debian stable</title><link>https://www.subhadig.net/posts/installing-the-latest-libreoffice-on-debian-stable/</link><pubDate>Sun, 23 Sep 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/installing-the-latest-libreoffice-on-debian-stable/</guid><description>&lt;p&gt;One of the few software that I like to keep always updated to the latest version on my system is Libreoffice, because of the compatibility improvements with the other office suite each new version brings. And while Debian Stable provides a solid and stable base system, the libreoffice package becomes outdated with time. A lot of the guides on updating Libreoffice in Debian on the Internet speak about installing the latest binaries from the Libreoffice website. But the main shortcoming with this approach is that updating to the next version is again a manual task.&lt;/p&gt;</description></item><item><title>Install Debian on an unclean target</title><link>https://www.subhadig.net/posts/install-debian-on-an-unclean-target/</link><pubDate>Thu, 13 Sep 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/install-debian-on-an-unclean-target/</guid><description>&lt;p&gt;Recently I had to downgrade my main laptop from Debian testing to Debian stable (Stretch at the time of writing). Since I did not have a separate home partition, re-installation meant formatting the entire partition that would erase all my personal data and settings. But this time I did not want go over the pain of configuring everything from scratch, so I went ahead without formatting my root partition. After a few times of failures and analyzing the installation logs, I learnt the trick.&lt;/p&gt;</description></item><item><title>How to easily write in MediaWiki</title><link>https://www.subhadig.net/posts/how-to-easily-write-in-mediawiki/</link><pubDate>Fri, 18 May 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/how-to-easily-write-in-mediawiki/</guid><description>&lt;p&gt;MediaWiki is a very popular free and open-source wiki software that powers some of the most visited wikis on the Internet including the Wikipedia. You can also host it in your own environment for your own wiki requirements or for your organization.&lt;/p&gt;

&lt;p&gt;At my work, we use MediaWiki for our developer's wiki site. When I started working for a new product team sometimes back, I came to know about this wiki format for the first time and I didn't like it very much.&lt;/p&gt;</description></item><item><title>Installing Debian Testing</title><link>https://www.subhadig.net/posts/installing-debian-testing/</link><pubDate>Sat, 07 Apr 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/installing-debian-testing/</guid><description>&lt;p&gt;After my previous post about &lt;a href="https://subhadipsblog.wordpress.com/2018/02/09/my-rolling-debian-system/"&gt;why I chose Debian Testing as my current distribution&lt;/a&gt;, I wanted to share how I installed and configured Debian Testing. So that somebody out there looking for a guide to install their own Debian rolling system, will have at least a starting point.&lt;/p&gt;

&lt;p&gt;Before I proceed with the post, please know that although I am a long time Linux user, with Debian, I just started my journey a couple of months back. And by no mean I am a seasoned Debian user. So whatever steps I am going to list in this post are the ones that I thought would be best suited for my requirement when I installed it on my system.&lt;/p&gt;</description></item><item><title>My Rolling Debian System</title><link>https://www.subhadig.net/posts/my-rolling-debian-system/</link><pubDate>Fri, 09 Feb 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/my-rolling-debian-system/</guid><description>&lt;p&gt;A few weeks back, I switched my home laptop to Debian and I wanted to write about my reasons behind choosing Debian and my experience with it for the first few days. But before I dive into that, here's a little background about myself. I have been using Ubuntu and later Xubuntu at home and later at office on my Desktop and on my Laptop for more than 7 years now and on the server front, I have worked on both Redhat/Centos and Ubuntu based systems. So I am not new to Linux at all.&lt;/p&gt;</description></item><item><title>VLC Player not playing nice with Radeon?</title><link>https://www.subhadig.net/posts/vlc-player-not-playing-nice-with-radeon/</link><pubDate>Mon, 22 Jan 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/vlc-player-not-playing-nice-with-radeon/</guid><description>&lt;p&gt;If you are on Ubuntu 16.04 using radeon open source driver for your graphics card and having issues with playing mp4 or mkv files with VLC media player then read on. If you are not sure what graphics driver is in use in your system, paste the below line in Terminal.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lspci -v -s lspci &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/VGA/{print $1}&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And check for the below line in the output:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Kernel driver in use: radeon&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The issue occurs as soon as you open a media file of type mkv or mp4 with VLC media player. Immediately after opening, it crashes silently. But if you check the /var/log/syslog, you should be able to see segmentation fault messages.&lt;/p&gt;</description></item><item><title>Higher Order Functions in Java?</title><link>https://www.subhadig.net/posts/higher-order-functions-in-java/</link><pubDate>Thu, 18 Jan 2018 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/higher-order-functions-in-java/</guid><description>&lt;p&gt;Higher order functions are those functions that can return functions as their results. The returned function can then be invoked in the same way as you would invoke a normal function. In programming languages like Python, where functional programming is treated as a first class citizen, you can easily define higher order function like this.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;adder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;add_with_5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;adder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;final_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add_with_5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Java on the other hand introduced functional programming in version 1.8. The support is still very primitive and it does not allow one to create higher order functions that return functions.&lt;/p&gt;</description></item><item><title>Inconsistent space width across editors</title><link>https://www.subhadig.net/posts/inconsistent-space-width-across-editors/</link><pubDate>Sun, 22 Oct 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/inconsistent-space-width-across-editors/</guid><description>&lt;p&gt;I had a weird problem today when my perfectly indented code comments from Vi editor were looking like a mess in Geany.&lt;/p&gt;

&lt;p&gt;&lt;img class="aligncenter size-large wp-image-1030" src="https://www.subhadig.net/assets/images/inconsistent-space-1.png" alt="" width="605" height="129" /&gt;&lt;/p&gt;
&lt;p&gt;The pound signs were all out of line though they look perfectly aligned when opened in Vi editor. Initially I thought that it was a problem with the tab settings in Geany. But after tweaking some of the tab settings did not produce any result, I noticed that spaces in Geany were having lesser width compared to other characters, which was the root of the problems. I found that the font that I was using in Geany was not fixed width. And for that I should use Mono variation of the fonts. So I changed the font setting in Edit &amp;gt; Preference &amp;gt; Interface &amp;gt; Fonts &amp;gt; Editor to below:&lt;/p&gt;</description></item><item><title>Opening large JSON files with Geany</title><link>https://www.subhadig.net/posts/opening-large-json-files-with-geany/</link><pubDate>Sat, 23 Sep 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/opening-large-json-files-with-geany/</guid><description>&lt;p&gt;A few days back at work I was trying to open a fairly large unformatted (a single line) JSON file generated through one of the junit tests. At first I tried to open it in Eclipse since my Eclipse JEE IDE contains an inbuilt JSON formatter but it ended in a disaster! So much so that I had to kill the Java process running Eclipse. Then I tried to open it using Mousepad, the default text editor that comes pre-installed with Xubuntu. It also failed and got hung. I even tried with Gedit but still no luck. I copied the file to a Windows machine and opened it using Notepad++. The online JSON formatters were able to prettify it, so I went on with it then. But the fact that I was not able to open it natively on my system was bugging me.&lt;/p&gt;</description></item><item><title>Correct Way of Using EntityManager in Singleton EJB</title><link>https://www.subhadig.net/posts/correct-way-of-using-entitymanager-in-singleton-ejb/</link><pubDate>Sat, 16 Sep 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/correct-way-of-using-entitymanager-in-singleton-ejb/</guid><description>&lt;p&gt;This week and last week I spent a lot of time writing code to implement the persistence feature for our module with EJB 3 at work. This is the first time I was working with EJB so there was quite a bit of learnings involved. During this time, I noticed that even some of the most seasoned developers don't have a very clear idea about how the whole Persistence thing in JPA works under the hood. They would take some of the things for granted like if they use an EntityManager in their managed objects, something will auto-magically manage everything for them and in the process, did some rookie mistakes.&lt;/p&gt;</description></item><item><title>EntityManager with try-with-resource</title><link>https://www.subhadig.net/posts/entitymanager-with-try-with-resource/</link><pubDate>Mon, 11 Sep 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/entitymanager-with-try-with-resource/</guid><description>&lt;p&gt;try-with-resource is the new feature introduced in Java 1.7 to automatically close a resource after using. It basically helps you to avoid a finally block at the end of the try-catch block to close any resource that needs closing like the BufferedReader. But there's a catch. You can not use any type of resource with a try-with-resource block, only those classes that extend java.lang.AutoCloseable can be used, an interface that has a single method:&lt;/p&gt;</description></item><item><title>Invoking Python scripts from test cases running within a venv</title><link>https://www.subhadig.net/posts/invoking-python-scripts-from-test-cases-running-within-a-venv/</link><pubDate>Sat, 05 Aug 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/invoking-python-scripts-from-test-cases-running-within-a-venv/</guid><description>&lt;p&gt;Before the final release, I like to test my Python scripts the way these are supposed to be invoked in actual environment, usually with command line arguments. And this is apart from the unit testing and integration testing that I have for the individual modules. I also use Python venv for development because I don't like to directly install all the required libs in my operating system, thus keeping the system PATH clean from the development libs. Invoking a Python script within the test cases is easy, you just need to use the os.system() function. But running a Python script from os.system() using the '&lt;em&gt;python script-name.py&lt;/em&gt;' syntax invokes the python executable from the OS even if I am running the outer Python test case from withing a venv.&lt;/p&gt;</description></item><item><title>Accessing Mysql database installed in an LXD container</title><link>https://www.subhadig.net/posts/accessing-mysql-database-installed-in-an-lxd-container/</link><pubDate>Sat, 20 May 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/accessing-mysql-database-installed-in-an-lxd-container/</guid><description>&lt;p&gt;This is my second post on LXD containers. Sometimes, using a container is a cleaner way to install and use applications for a number of reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can install packages from any version of any distribution. That means, even if you are using an LTS release of Ubuntu like me, you don't necessarily have to stick to an older version of a package. Or if some package is only supported on rpm based distributions, you don't need to worry about it.&lt;/li&gt;
&lt;li&gt;You can go ahead and completely uninstall/reinstall it at any time without worrying about residual files or configurations.&lt;/li&gt;
&lt;li&gt;You can roll back to a previous state in no time if something goes wrong unexpectedly (lxd snapshots!)&lt;/li&gt;
&lt;li&gt;And then there is the security perspective also (lxd containers are secure by nature).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Last weekend I tried running mysql database from a local container and connect to it from my local system. Here's how:&lt;/p&gt;</description></item><item><title>LXD Containers - First Experience</title><link>https://www.subhadig.net/posts/lxd-containers-first-experience/</link><pubDate>Sun, 02 Apr 2017 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/lxd-containers-first-experience/</guid><description>&lt;p&gt;Lately I have been playing around with LXD containers and I must say that I am quite impressed with it. LXD is the &lt;span class="_Tgc"&gt;virtualization&lt;/span&gt; technology that can be used to run a Linux container on a Linux host using the same kernel as the host.&lt;/p&gt;

&lt;p&gt;Well, it's a little difficult to grab the idea at first. Unless of course you interacted with it before. You can think of it as a virtual machine that you run using VirtualBox or VMWare on your Linux or Windows host machine but the difference is that when you run a virtual machine, you are running a separate kernel inside the virtual machine but in this case, you are fooling the guest OS running inside the LXD container into thinking that it's running its own kernel whereas it's just using the same kernel running on the host OS. And the result is that you get an isolated container with a much smaller memory footprint and little overhead compared to a full blown virtual machine.&lt;/p&gt;</description></item><item><title>Automated Package Installation and Configuration Script for Ubuntu</title><link>https://www.subhadig.net/posts/automated-package-installation-and-configuration-script-for-ubuntu/</link><pubDate>Thu, 29 Dec 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/automated-package-installation-and-configuration-script-for-ubuntu/</guid><description>&lt;p&gt;In my last post, I discussed about how I created my first Amazon EC2 instance and ran our Java web server on it. One of the most important things that I have realized over the years is that if you work with a small group of developers, you ought to think about automating certain jobs like testing, deployment, setting up server etc. So that you can concentrate on the real work rather than spending valuable time in doing repetitive tasks. The benefit against spending extra time in writing scripts may not be prominent at first, but over time you will realize the gain in terms of person hours and headaches saved because of the automated scripts.&lt;/p&gt;</description></item><item><title>Running Java app server on AWS EC2 Ubuntu instance</title><link>https://www.subhadig.net/posts/running-java-app-server-on-aws-ec2-ubuntu-instance/</link><pubDate>Sat, 26 Nov 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/running-java-app-server-on-aws-ec2-ubuntu-instance/</guid><description>&lt;p&gt;Today I will be writing about setting up an Ubuntu instance on the Amazon AWS cloud and running a Java web application on it. We are working on a hobby project that has its back-end written in Java. The app back-end was first hosted on &lt;a href="https://www.heroku.com/" target="_blank"&gt;Heroku&lt;/a&gt; but due to some issues, we decided to move it to Amazon AWS. I was given the responsibility to set up our server. This was the first time I had an opportunity to work with Amazon AWS. But it turned out to be quite fun.&lt;/p&gt;</description></item><item><title>My Experience with React: The Hello World</title><link>https://www.subhadig.net/posts/my-experience-with-react-the-hello-world/</link><pubDate>Sun, 02 Oct 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/my-experience-with-react-the-hello-world/</guid><description>&lt;p&gt;I have been working on a home project these days for which I needed to use a Javascript framework on the UI. But to select a JS framework is a difficult task because there are a overwhelmingly lot to choose from. And each of those has its own strengths and flaws. Still after considering a few of them, I finally chose React. The reasons why I selected React are a) it's more Javascript-centric  than some of its close competitors which means, you write your app in JS with pieces of HTML embedded inside JS and b) it uses the Node.js and the npm ecosystem, so it's easier to grasp for somebody with prior Node experience. So I decided to learn React.js.&lt;/p&gt;</description></item><item><title>Automatically dim display when switching to battery power on Ubuntu</title><link>https://www.subhadig.net/posts/dim-display-when-switching-to-battery-power-on-ubuntu/</link><pubDate>Wed, 21 Sep 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/dim-display-when-switching-to-battery-power-on-ubuntu/</guid><description>&lt;p&gt;I bought a Dell Inspiron laptop recently which came with Ubuntu 14.04 preinstalled. Something I noticed with the factory Ubuntu 14.04 image was that some of the settings were tweaked to work better with the laptop. One fine example was that the laptop display would automatically dim when I switched to laptop battery from the power supply. It would again go back to full brightness once I connected the adapter back.&lt;/p&gt;</description></item><item><title>The Perfect Javascript Editor</title><link>https://www.subhadig.net/posts/the-perfect-javascript-editor/</link><pubDate>Sun, 28 Aug 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/the-perfect-javascript-editor/</guid><description>&lt;p&gt;Being primarily a Java developer using Eclipse IDE, there are two things I always look for in any IDE - content assist/code completion and syntax checking/highlighting. While the latest version of Eclipse (Neon) has made a lot of improvements over the previous versions in terms of the JSDT plugin for Javascript developers, it's far from perfect. The syntax highlighting works upto some extent but the content assist is still very primitive if at all useful.&lt;/p&gt;</description></item><item><title>SSH into CentOS 7 guest from host machine using VirtualBox</title><link>https://www.subhadig.net/posts/ssh-into-centos-7-guest-from-host-machine-using-virtualbox/</link><pubDate>Sat, 14 May 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/ssh-into-centos-7-guest-from-host-machine-using-virtualbox/</guid><description>&lt;p&gt;I have mostly used Ubuntu and Debian-based distributions till now which means the other side of the Linux world, where the RHEL based distributions reside is still a grey area to me. Recently I needed to install CentOS server in VirtualBox to test something out. But soon I found that it's a little cumbersome to work in the VirtualBox vm window because I can't copy/paste texts normally to/from the VirtualBox as I can do in Terminal and I can't cycle through the open windows in my guest machine using Alt+Tab when I am using the vm. So I decided to ssh to the CentOS guest from the host machine and work from the host Terminal instead.&lt;/p&gt;</description></item><item><title>Installing qemu with kvm and virt-manager</title><link>https://www.subhadig.net/posts/installing-qemu-with-kvm-and-virt-manager/</link><pubDate>Sat, 02 Apr 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/installing-qemu-with-kvm-and-virt-manager/</guid><description>&lt;p&gt;I have used Oracle Virtualbox before. It has an easy and intuitive UI, supports all the features I needed and is open-source. But this time I decided to use another widely recognized virtualization solution on Linux, qemu, along with kvm.&lt;/p&gt;

&lt;p&gt;First of all, let me give some brief idea about qemu, virt-manager and kvm. Qemu is the software which can be used to install and run a guest OS on top of the actual OS to put it in a very simple way although it's much more powerful than that. It can be compared to Virtualbox except that qemu itself does not have a UI, instead it's a command line utility. Virt-manager is some thing that provides a GUI to qemu. Together virt-manager and qemu can be thought of as the Virtualbox. On the other hand, kvm is the Linux kernel module that can help qemu execute the virtualized instructions directly on the CPU which can improve the performance greatly. This is to be kept in mind that qemu can run even without kvm but the speed will be much slower.&lt;/p&gt;</description></item><item><title>[Solved] Keyboard Shortcuts with Control key not working under Xubuntu/Xfce</title><link>https://www.subhadig.net/posts/keyboard-shortcuts-with-control-key-not-working-under-xubuntuxfce/</link><pubDate>Fri, 25 Mar 2016 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/keyboard-shortcuts-with-control-key-not-working-under-xubuntuxfce/</guid><description>&lt;p&gt;Have you ever faced a situation where you are using an IDE like Eclipse that uses a lot of Control + some other key combination shortcuts to do various tasks and you are pretty much used to those shortcuts but those shortcuts do not work under Xfce? Well I like Xubuntu because of the lightweight Xfce desktop environment but being primarily a Java developer, I also use Eclipse IDE a lot and not being able to use the keyboard shortcuts that I am very much used to was a pain. Not anymore. After spending some time looking up on the internet, I found the solution. Here it goes.&lt;/p&gt;</description></item><item><title>Coding with Go - Part 1 : The Workspace Setup</title><link>https://www.subhadig.net/posts/coding-with-go-part-1-the-workspace-setup/</link><pubDate>Sun, 27 Dec 2015 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/coding-with-go-part-1-the-workspace-setup/</guid><description>&lt;p&gt;Go (sometimes referred as Golang) is the system programming language from Google which is my new interest these days. Some of my favourite points about Go so far:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's a compiled language and I like compiled languages. To somebody who has used C/C++ and later Java for programming, this should come as no surprise.&lt;/li&gt;
&lt;li&gt;It has fairly easy syntax and it's not a lot different from C which definitely helps to learn the language quickly.&lt;/li&gt;
&lt;li&gt;It can be used like a scripting language.&lt;/li&gt;
&lt;li&gt;It has a fairly large built-in package collection.&lt;/li&gt;
&lt;li&gt;It has first class Linux support.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here's what I did to get my workstation ready to code with Go:&lt;/p&gt;</description></item><item><title>My Custom Vim Configuration</title><link>https://www.subhadig.net/posts/my-custom-vim-configuration/</link><pubDate>Thu, 17 Dec 2015 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/my-custom-vim-configuration/</guid><description>&lt;p&gt;Though Vim is my favourite command-line text editor, not all the default configurations suit my taste. Luckily, changing the default configurations of Vim editor on my Xubuntu 14.04 LTS (any Linux based OS for that matter) is fairly easy and so is persisting the changes. Here's what you need to do in order to persist the changed configurations for Vim editor (so that the changes do not disappear after you restart your Vim editor): Create a file with name &lt;em&gt;.vimrc&lt;/em&gt; and save it in your home directory. So whatever configurations you write in that &lt;em&gt;.vimrc&lt;/em&gt; file of yours, will be picked when you start your Vim editor (after modifying &lt;em&gt;.vimrc&lt;/em&gt;, you may need to restart the Vim editor in order for the changes to take effect).&lt;/p&gt;</description></item><item><title>Developing Node.js with Atom Editor</title><link>https://www.subhadig.net/posts/developing-node-js-with-atom-editor/</link><pubDate>Sun, 27 Sep 2015 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/developing-node-js-with-atom-editor/</guid><description>&lt;p&gt;Recently I have been playing with Node.js and for every developer, getting the perfect IDE/Editor and setting up the workspace is very important. Here's how I got my set up ready:&lt;/p&gt;

&lt;p&gt;I am using Xubuntu 14.04.3 LTS. So the steps that I am going to share will work in any of the Ubuntu flavours.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Installing Node.js:&lt;/strong&gt; Node.js is already there in the default Ubuntu 14.04 repository and the version is 0.10.25. If you need more updated version, you have 2 ways. You can either download it from the official Node.js &lt;a href="https://nodejs.org/" target="_blank"&gt;site&lt;/a&gt;, or you can follow &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server" target="_blank"&gt;this&lt;/a&gt; tutorial and add a third-party repository or use &lt;em&gt;nvm&lt;/em&gt; to get it installed. In the first case, it will not be auto-updated though. However, I chose to use the default repository version as I didn't see the point in going through all these hassle unless I specifically want a feature that is only available in the newer versions.&lt;/p&gt;</description></item><item><title>[Solved] Flash player in Google Chrome keeps getting stuck under Ubuntu/Linux</title><link>https://www.subhadig.net/posts/solved-flash-player-in-google-chrome-keeps-getting-stuck-under-ubuntulinux/</link><pubDate>Sat, 28 Mar 2015 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/solved-flash-player-in-google-chrome-keeps-getting-stuck-under-ubuntulinux/</guid><description>&lt;p&gt;Although I use both Firefox and Chrome on my Linux box, for playing any flash video (yes, I know flash is going to go away and I hate it too but for the time being, it's still here), sometimes Chrome is the only option as the Flash player plugin for Linux is very old and many websites do not support it already (Chrome separately packages it's own flash player which is not dependent directly upon your platform (which means it is available for Linux also) and it's version is regularly updated, if you didn't know already).&lt;/p&gt;</description></item><item><title>[Solved] Cheese Webcam Booth not displaying video from Webcam in Ubuntu</title><link>https://www.subhadig.net/posts/solved-cheese-webcam-booth-not-displaying-video-from-webcam-in-ubuntu/</link><pubDate>Sun, 15 Mar 2015 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/solved-cheese-webcam-booth-not-displaying-video-from-webcam-in-ubuntu/</guid><description>&lt;p&gt;I own a Logitech c170 web-cam which has very good Linux support. I bought this web-cam almost 2 years ago and at that time, it worked like a charm on Ubuntu 12.04. I stopped using the web-cam over a year ago and I almost forgot about it. A few days ago, I had an interview on Skype and as my phone front camera does not work well with Skype, I needed to take this one from my Desktop. So I took the web-cam and plugged it in to my computer running Ubuntu 14.04 (yes, I upgraded), launched Cheese (comes pre-installed on Ubuntu 14.04) hoping everything would work just as before. But to my surprise, even though I could take photos using Cheese, I could not see the video stream. Here's what I did to solve the problem:&lt;/p&gt;</description></item><item><title>Install Subeclipse subversion plugin in Eclipse + Ubuntu</title><link>https://www.subhadig.net/posts/install-subeclipse-subversion-plugin-in-eclipse-ubuntu/</link><pubDate>Wed, 14 May 2014 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/install-subeclipse-subversion-plugin-in-eclipse-ubuntu/</guid><description>&lt;p&gt;Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. Installing Subeclipse plug-in in Eclipse running on Ubuntu (or any other Linux distribution) is a little more complex than on win-32 platform. You need to install an additional package that contains the JavaHL binaries. To install Subeclipse, follow the below simple steps:&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;Go to Ubuntu Software Center and install the below package.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;libsvn-java&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;2.&lt;strong&gt;Note the installed version of the above package.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Permanently change Duplex settings and Network card speed in Ubuntu</title><link>https://www.subhadig.net/posts/permanently-change-duplex-settings-and-network-card-speed-in-ubuntu/</link><pubDate>Sun, 11 May 2014 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/permanently-change-duplex-settings-and-network-card-speed-in-ubuntu/</guid><description>&lt;p&gt;Users of Alliance or similar broadband services might have noticed that their network connection would sometimes get dropped while on Ubuntu or the network speed is somewhat less than what is advertised. The solution for this is that you need to change the duplex setting of your network connection. Don't freak out yet, it's not as hard as you might think. Follow the below simple steps:&lt;/p&gt;

&lt;p&gt;1. &lt;strong&gt;Get the desired duplex settings from your service provider. &lt;/strong&gt;In this case, we will assume that it's "10 duplex half". Replace it with the appropriate speed in your case.&lt;/p&gt;</description></item><item><title>Brushing up Python</title><link>https://www.subhadig.net/posts/brushing-up-python/</link><pubDate>Tue, 18 Feb 2014 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/brushing-up-python/</guid><description>&lt;p&gt;I have been brushing up my skills in Python from last week. I am a Java developer by profession and my love for Python came purely from a hobby perspective. But nevertheless, love is love. First time I learnt Python when I was still not that into Java and the Python version was 2.x. But this time, I went with the version 3.x.&lt;br /&gt;
I am also learning how to make GUI application with PyGObject since PyGtk is not used in new development anymore. This is some amazing work by the developers that I don't have to work in C++ to make GTK+ applications. My next goal is to make my first application in Python and GTK+, albeit a simple one, which I might publish also.&lt;/p&gt;</description></item><item><title>[SOLVED] SVN/JavaHL version problem in Ubuntu 13.04 with Eclipse Indigo</title><link>https://www.subhadig.net/posts/solved-svnjavahl-version-problem-in-ubuntu-13-04/</link><pubDate>Sun, 13 Oct 2013 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/solved-svnjavahl-version-problem-in-ubuntu-13-04/</guid><description>&lt;p&gt;I upgraded my Ubuntu from 12.04. Eclipse 3.7 with Subclipse 1.6 was installed in 12.04. Now after upgrading to 13.04, after I start Eclipse and synchronize my project with the repository, it throws the error message: "Incompatible JavaHL library loaded. 1.6.x or later required."&lt;/p&gt;

&lt;p&gt;Possible reason: libsvn-java is needed to be installed in Ubuntu in order to make SVN work in Eclipse. The installed version in Ubuntu 12.04 was 1.6 as far as I remember. But after upgrading to 13.04, the libsvn-java version was also upgraded to 1.7. But the version of Subclipse that is compatible with libsvn-java 1.7 is Subclipse 1.8.&lt;/p&gt;</description></item><item><title>Not Switching to Kubuntu</title><link>https://www.subhadig.net/posts/not-switching-to-kubuntu/</link><pubDate>Sat, 22 Jun 2013 00:00:00 +0000</pubDate><guid>https://www.subhadig.net/posts/not-switching-to-kubuntu/</guid><description>&lt;p&gt;I have been an Ubuntu user (Linux in General) for long enough time. When I was in college, I would live boot different distributions of Linux just for trying out, eager to see what new desktop effects they might have added, what the defaults applications were. But after I graduated from college and joined work, I would get little time to do all those stuffs. So I settled for just one and also I needed a stable environment. Currently I am using Ubuntu 12.04 and today after getting back from work, I felt like I got bored with Ubuntu. So I thought, what the hell, I should try out KDE and if I like then I might even replace Ubuntu. So I downloaded Kubuntu and ran it on a USB stick. I installed it in one of my spare partition also, to give it a fair chance to impress me. And it really did impress me. I liked the desktop environment, I liked the KDE default application set. They were designed very carefully. The applications launched way faster than they would in Ubuntu. But I don't know why, my eyes were still searching for the same fonts and the same look they were used to see on Ubuntu. Also I missed all those keyboard shortcuts that I enjoy using while on Ubuntu. So I rebooted back to Ubuntu. I fixed the Grub2 which was replaced by Kubuntu Grub2 with the grey screen. But I could not re-enable the auto-hiding of Grub2 while booting. I guess I will find some way to do that. But now I am feeling quite sleepy.&lt;/p&gt;</description></item></channel></rss>