<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Utshab Saha on Medium]]></title>
        <description><![CDATA[Stories by Utshab Saha on Medium]]></description>
        <link>https://medium.com/@utshabsaha?source=rss-5d8da1034965------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UeEGWHtedzCE-NfwX5hung.jpeg</url>
            <title>Stories by Utshab Saha on Medium</title>
            <link>https://medium.com/@utshabsaha?source=rss-5d8da1034965------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:23:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@utshabsaha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[No space left in the device. Docker is failing to build images.]]></title>
            <link>https://medium.com/@utshabsaha/no-space-left-in-the-device-docker-is-failing-to-build-images-e4efaaae272f?source=rss-5d8da1034965------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4efaaae272f</guid>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Utshab Saha]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 14:32:07 GMT</pubDate>
            <atom:updated>2024-12-07T14:44:15.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4hMwHzeY-4yVxUSyZOmOg.png" /></figure><p>Hello there, in this blog I am going to discuss an issue I recently faced during my work. From the title you are already guessing it and it’s probably a simple one for most of you, but just in case you are new to docker and for a quick bit of information I am writing this so that we can always look this article back for a recap in future.</p><h3>Issue</h3><p>Primarily there were two issues</p><p>Docker failed to build images with a message <em>no space left in the device (unfortunately when I was writing this article my shell session was lost also didn’t have the terminal output to paste the exact here)</em></p><ol><li>Docker could not connect to the docker registry with the following message</li></ol><pre>docker: Error response from daemon: Get &quot;https://registry-1.docker.io/v2/&quot;: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:41731-&gt;[::1]:53: read: connection refused.</pre><h3>Solution</h3><p>Now let’s dive into the solution. You may have already guessed it right. But let’s go one by one.</p><h4>Issue 1</h4><p>By default, docker daemon stores the images that you build/pull at a path /var/lib/docker in the root / device in Linux systems. BTW in my case, it was a <strong>Linux</strong> system. To be more specific you can try and hit the below command to see the actual hashes of the images.</p><pre>cat /var/lib/docker/image/overlay2/repositories.json</pre><p>Okay so now when I was trying to build an image out of an application it failed saying no space left in the device. This means the server was running out of disk space, which was alarming as it was production-grade system and I was handed over with it recently without any prior information. Take a look</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*WHJJIysJ9iXjQU6IL7Vd9g.png" /></figure><p>Clearly /dev/sda1 is through the roof already. So I had no other choice but to try docker daemon to use some other block device. So here are the following steps that I followed to solve this.</p><h4><strong>Step 1</strong></h4><p>I had /dev/sdb1 mounted on /home with sufficient space. So I prepared a docker storage there.</p><pre>mkdir /home/docker-storage<br>chown -R root:root /home/docker-storage/<br>chmod 711 /home/docker-storage/</pre><h4>Step 2</h4><p>In this step, I modified the docker daemon to use new <em>docker storage. </em>Docker daemon look for a file /etc/docker/daemon.json through which we can modify docker daemon as per our need. So here is the content that I put in order to specify the daemon to use new storage. Don’t forget to stop the daemon first systemctl stop docker</p><pre>{<br>  &quot;data-root&quot;: &quot;/home/docker-storage&quot;<br>}</pre><p>Just in case you don’t see daemon.json in /etc/docker just create one.</p><h4>Step 3</h4><p>Now moved all the contents of the /var/lib/docker in /home/docker-storage</p><pre>mv /var/lib/docker /home/docker-storage<br>ln -s /home/docker-storage/docker /var/lib/docker<br>systemctl start docker<br>docker info | grep &quot;Docker Root Dir&quot;</pre><p>You must see the new directory as Docker Root Dir:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ww1ynjHtkx8jmIU4U-GBNg.png" /></figure><h4>Issue 2</h4><p>Unlike issue 1 this issue is slightly specific to my server configuration. Let’s have a look again into the issue.</p><pre>docker: Error response from daemon: Get &quot;https://registry-1.docker.io/v2/&quot;: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:41731-&gt;[::1]:53: read: connection refused.</pre><p>Since this is a network-related issue, this may caused by various network misconfigurations such as <em>internet connectivity, firewall, domain name resolution/DNS issue </em>etc. So figure out I did a couple of tests.</p><p><strong>Test 1: Checking of public internet connectivity</strong></p><pre>ping 8.8.8.8</pre><p>If the above command returns the ttl response, it means no issue with the internet connectivity, and for me it was as expected. Hence moved to <em>Test 2.</em></p><p><strong>Test 2: Checking of name resolution</strong></p><p>Here I test if my server can reach registry-1.docker.io .</p><pre>nslookup registry-1.docker.io</pre><p>The above command shows me the below which confirms the issue.</p><pre>;; connection timed out; no servers could be reached</pre><p>This clearly shows there is an issue with the server&#39;s DNS configuration.</p><p>Now let’s look into the solution. By default /etc/resolv.conf configures DNS servers for name resolution and upon checking it I found it to be <strong><em>blank completely</em></strong>. Ideally, there should be some values similar to the below image. Where the IP address is the DNS server address of your cloud virtual network, which is a cloud-managed service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0E68LLOpQuJILdQRS37UxA.png" /></figure><h4><strong>Set the name server</strong></h4><p>Since my use case /etc/resolv.conf was blank so I put the below values in it.</p><pre>nameserver 8.8.8.8   # Google DNS<br>nameserver 1.1.1.1   # Cloudflare DNS</pre><p>And of course, I restarted the NetworkManager to fetch the new configuration.</p><pre>systemctl restart networking</pre><p>Now let’s verify again with the below commands.</p><pre>nslookup registry-1.docker.io<br>docker run hello-world</pre><h3>Conclusion</h3><p>Alright, the issues were pretty basic but it is always good to have it journaled for the better future. So let’s recap at a glance.</p><ol><li>Docker failed to build images since / volume did not have sufficient memory to store the images. So we can tweak the docker daemon and change the docker storage to a custom directory.</li><li>Docker was not able to reach the <em>docker registry </em>due to a name resolution issue. Upon troubleshooting, we figured nameserver was not configured in the server. So we fixed that and Voilà!! Docker ran like a charm.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4efaaae272f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What and why DevOps? The simplest!]]></title>
            <link>https://medium.com/@utshabsaha/what-is-devops-ba6cf5560592?source=rss-5d8da1034965------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba6cf5560592</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[operations]]></category>
            <dc:creator><![CDATA[Utshab Saha]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 18:11:45 GMT</pubDate>
            <atom:updated>2024-11-07T05:28:27.361Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, my tech people. I hope you are all doing great. Alright, if you are reading this, it means you are in search of the knowledge to understand the philosophy behind DevOps. So you may have already googled a lot or scrolled through many YouTube videos and been introduced to some tech jargon such as SDLC, QA, CICD, Shift left, etc, etc, and probably have been seeing the below picture a lot already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*D2VFqWkyWbyakWrwjQHf4Q.png" /></figure><p>Forget all this complex jargon and allow me 1–2 minutes to explain DevOps in a rudimentary way that I have perceived over the past years of my career.</p><p>Alright, let’s suppose you have an awesome idea for a product that you want to start a business with. So first thing you will look for some craftsman who can craft or develop that product for you right? Well, you did so and you got your product ready and you asked your craftsman to maintain a good quality, which is definitely crucial for the reputation of your business in the market, isn’t it? So you are now satisfied with your product and you are confident to launch it in the market taking it to the customers. Since you are just at the beginning stage you asked your craftsman to ship it to the sellers and of course, he/she agreed to.</p><p>Woohoo!! congratulations it was a success. Now that your business on run, it starts to grow and you keep getting more orders for the product.</p><p>Hence your craftsman is now full of plate. Earlier probably he was producing 2–3 products a day now with the raised demand he/she is producing 10–15 products a day and it is increasing with the business needs. Since the quantity of the product is increased at the same stipulated time you start to experience quality is slightly degrading which is hitting your business and you realize, sooner or later the quality of your products gonna be sporadic with increasing demand if you don’t adopt a new strategy.</p><p>Well for now it’s fairly simple, you hired a few more craftsmen, and you solved the issue. Now that you are quite a bit successful you thought of introducing more such products in your product lineup. So it’s a no-brainer and you applied the same method as your successful one and let’s assume this endeavor is also successful and your business is growing faster than you thought.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZ-jyZ2bVmMclOi4j6xhUw.png" /></figure><p>With such exponential growth, you realize that to maintain the quality you need more craftsmen which also eats up your budget.</p><p>Let’s understand that briefly. So craftsmen are specialized in crafting the product and maintaining the quality but still, they are human with their plate full of tasks. Hence you shouldn&#39;t be surprised if they miss some quality checks, also they are handling shipping which is not their expertise. Also probably you are getting some feedback from your customers that you need your craftsmen to fix them.</p><p>So now you can understand you are actually struggling in <em>scaling</em>. You may hire more people to solve this but it will cost you more. So you realized the goal is to <em>scale in a cost-efficient way</em>.</p><p>Since you have understood the problem and figured out the goal, you adopt a new plan and implement kind of a system where you form some individual units to handle specific tasks such as you formed a team for shipment, you formed a team for quality assurance, and you already have multiple teams of craftsmen for multiple products and you defined some guidelines for each to abide by.</p><p>Now<em> the way you addressed this problem is </em><strong><em>DevOps</em></strong>. So you offloaded some burden on the craftsmen so they now can focus on crafting quality products and also faster, your quality is also being passed through some expert checking, also shipment is being handled efficiently and all these in a cost-effective way because now you can spend selectively based on needs.</p><h4>Conclusion</h4><p>DevOps is more of a culture/strategy rather than a technology. So it is about solving the scaling issues and enhancing the overall process in a cost-efficient way without trading the quality. In a more technical way, we can say that the <em>way</em> of automating the <em>software development life cycle (SDLC) </em>phases<em>, </em>mostly the operations part,<em> </em>is <em>DevOps</em> and all the tools that we can see in the image above are just the means of implementation of DevOps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba6cf5560592" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSL certificate pin generate]]></title>
            <link>https://medium.com/@utshabsaha/ssl-certificate-pin-generate-616ff66c24e8?source=rss-5d8da1034965------2</link>
            <guid isPermaLink="false">https://medium.com/p/616ff66c24e8</guid>
            <category><![CDATA[ssl-certificate-providers]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[sslsecurity]]></category>
            <category><![CDATA[ssl-pinning]]></category>
            <dc:creator><![CDATA[Utshab Saha]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 05:13:37 GMT</pubDate>
            <atom:updated>2024-04-05T08:31:48.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*Elh8QgoxmkMxt_bw.jpg" /></figure><p>SSL certificate pinning is a security technique used to verify the identity of a server during an HTTPS connection. It works by adding an extra layer of trust on top of the standard certificate validation process.</p><p>The main benefit of certificate pinning is enhanced security against man-in-the-middle (MITM) attacks. Even if an attacker intercepts the communication and presents a fraudulent certificate signed by a compromised CA, the connection will be rejected because it won’t match the pinned element.</p><p>Now let’s see how we can generate the <em>pin</em> in the course of certificate renewal or a brand new setup</p><h3>Step 1: Retrieve certificate chain</h3><p>Now of course to calculate the <em>pins</em> we need <em>certificates</em>, which looks like this.</p><pre>-----BEGIN CERTIFICATE-----<br>PUddPF2tycSbyiuuY*K3SpHwBSN6Ctx$Wd54vMfSx^vTuPY9Lg8bQp<br>DgHs&amp;amp;97J1&amp;amp;l5hCDl^7%C@#I%&amp;amp;NFKtqK^(zctKjvyEh<br>ZE8RfghLRg(^Ut!q9o%ss8%ueHg*zj4I4oS5C7f5w*SN^MBgtEe1O8<br>-----END CERTIFICATE-----<br>-----BEGIN CERTIFICATE-----<br>UU&amp;amp;6KbmWtxYkyF0IfJsIDEW(JK&amp;amp;yCT^@vwGvRrf0UK&amp;amp<br>vNZ9gXJVMcNT&amp;amp;scRoNKGy&amp;amp;!tD4E3RDl0jk3Y$r#kIosaop<br>&amp;amp;oV259UeLObZV8zh$sS%VT*ZayrlAsG9a)o@0qRv%4bd(GpN#y<br>-----END CERTIFICATE-----</pre><p>Of course the above example is just a format of how a certificate chain can look like and is not a valid certificate. These <em>certificates </em>are usually stored in .pem or .crt or .cert files. But during our day to day work life we may not get the <em>certificate </em>files<em> </em>on a silver platter. However we can definitely extract the certificate using openssl . Now this command can give us lot many information than only the certificates which we need eventually. Hence I am writing the exact command which will output only the <em>certificates</em> excluding other information. You might wanna check them when you are troubleshooting or investigating some issues.</p><pre>openssl s_client -showcerts -connect example.com:443 &lt;/dev/null 2&gt;/dev/null | sed -ne &#39;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#39;</pre><p>Hit the command and you will get the exact format as we saw in certificate format section. Now you can save the output in any .pem or .crt or .certfile.</p><h3>Step 2: Calculate the pin</h3><p>Now that we have the <em>certificates </em>we are ready to calculate the pin. Again we are going to take help of openssl command. Since the .pem or .crt files contains <em>multiple certificates </em>or <em>certificate chain </em>we can calculate <em>pins </em>for each of them separately but here I am being a lazy DevOps guy and having a little scripting/coding skill whatever you say, I have prepared a script to get the job done for all the certificates at one go. Here it is</p><pre>#!/bin/bash<br><br>##############################################################<br>    # Algorithm<br>##############################################################<br>    # if (i is endpattern) and (start is 0)<br>    #     =&gt; combine keep_i and i<br>    #     =&gt; store in cert<br>    #     =&gt; increase start<br>    #     =&gt; continue<br><br>    # else if (i is endpattern) and (start is 1)<br>    #     =&gt; combine keep_i and i<br>    #     =&gt; store i in cert<br>    #     =&gt; reset keep_i<br>    #     =&gt; reset start<br>    #     =&gt; calculate pin <br>    #     =&gt; reset cert<br>    #     =&gt; continue<br>    # else<br>    #     if (i is begining pattern)<br>    #         =&gt; overwrite keep_i with i<br>    #     else<br>    #         =&gt; store i in cert<br>##############################################################<br>cert=&quot;&quot;<br>beginpattern=&quot;-+BEGIN|-+END&quot;<br>endpattern=&quot;CERTIFICATE-+&quot;<br>start=0<br>keep_i=&quot;&quot;<br>for i in $(cat $1)<br>do<br>    if [[ &quot;$i&quot; =~ $endpattern &amp;&amp; $start == 0 ]]; then<br>        echo &quot;$keep_i $i&quot; &gt;&gt; temp.cert<br>        start=$(( start + 1 ))<br>    elif [[ &quot;$i&quot; =~ $endpattern &amp;&amp; $start == 1 ]]; then<br>        echo &quot;$keep_i $i&quot; &gt;&gt; temp.cert<br>        keep_i=&quot;&quot;<br>        start=0<br>        # To view certificate uncomment below<br>        # cat temp.cert<br>        echo &quot;Calculate pin&quot;<br>        cat temp.cert | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64<br>        rm temp.cert<br>    else<br>        if [[ &quot;$i&quot; =~ $beginpattern ]]; then<br>            keep_i=$i<br>        else<br>            echo $i &gt;&gt; temp.cert<br>        fi<br>    fi<br>done</pre><p>Save the above script in whatever the file maybe I named it as ssl-pin-gen.sh . Now considering you have saved the <em>certificates </em>in a file named example.cert hit the next commands to get the <em>pins.</em></p><pre>chmod +x ssh-pin-gen.sh<br>./ssh-pin-gen.sh example.cert</pre><p>Also we can combine both the steps to make it more convenient to use. I have kept separately for better understanding of the readers. Feel free to tweak and share as a single command among the teams, colleagues and friends.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=616ff66c24e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>