<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux on Samarthya</title><link>https://samarthya.me/tags/linux/</link><description>Recent content in Linux on Samarthya</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© Samarthya 2018-2026. All rights reserved.</copyright><lastBuildDate>Sat, 14 Jun 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://samarthya.me/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Securing Kafka Brokers: A Practical Operations Checklist</title><link>https://samarthya.me/posts/securing-kafka-brokers/</link><pubDate>Sat, 14 Jun 2025 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/securing-kafka-brokers/</guid><description>&lt;p&gt;I used to think of Kafka security as a client configuration problem. Then I started thinking about the broker host itself: which user owns the process, who can read the configuration, what is exposed on the network, and what happens during an incident.&lt;/p&gt;</description></item><item><title>sed</title><link>https://samarthya.me/posts/sed-stream-editor/</link><pubDate>Tue, 11 Feb 2025 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/sed-stream-editor/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="2048"&#10; height="2048"&#10; src="https://samarthya.me/posts/sed-stream-editor/sed-1_hu_cac36d7418a22cdc.jpg"&#10; srcset="https://samarthya.me/posts/sed-stream-editor/sed-1_hu_cac36d7418a22cdc.jpg 800w, https://samarthya.me/posts/sed-stream-editor/sed-1_hu_b3de6260f581f354.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/sed-stream-editor/sed-1.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;In the realm of Unix-like operating systems, where command-line prowess reigns supreme, &lt;code&gt;sed&lt;/code&gt; stands tall as a versatile and indispensable tool. Born in the early 1970s at the legendary Bell Labs, &lt;code&gt;sed&lt;/code&gt; (short for “stream editor”) emerged from the creative mind of Lee E. McMahon. Its creation was inspired by the need for a command-line utility capable of performing substitutions, akin to the functionality found in the &lt;code&gt;grep&lt;/code&gt; command but with the added ability to modify the matched text.&lt;/p&gt;</description></item><item><title>Failed to connect to bus: No medium found</title><link>https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/</link><pubDate>Wed, 11 Sep 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="2048"&#10; height="2048"&#10; src="https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/mg_hu_65fd3660b056b34a.jpg"&#10; srcset="https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/mg_hu_65fd3660b056b34a.jpg 800w, https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/mg_hu_ee6ab60ffb0a7cb9.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/failed-to-connect-to-bus-no-medium-found/mg.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;If you have ever seen this error, you know the pain of a fellow linux user.&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Failed to connect to bus: No medium found&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;This is message I get when I was trying to install &lt;code&gt;podman.socket&lt;/code&gt;&lt;/p&gt;</description></item><item><title>UMASK: What is it?</title><link>https://samarthya.me/posts/umask-what-is-it/</link><pubDate>Wed, 31 Jul 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/umask-what-is-it/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/umask-what-is-it/random.jpg"&#10; srcset="https://samarthya.me/posts/umask-what-is-it/random.jpg 800w, https://samarthya.me/posts/umask-what-is-it/random.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/umask-what-is-it/random.jpg"&gt;&lt;/figure&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Introduction&#10; &lt;div id="introduction" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#introduction" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;In Unix-like operating systems, file &lt;code&gt;permissions&lt;/code&gt; play a critical role in ensuring system security and proper access control. One of the key tools for managing file permissions is the &lt;code&gt;umask&lt;/code&gt; (user file creation mode mask). This blog post explores the history, purpose, and best practices for using &lt;code&gt;umask&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Target fs?</title><link>https://samarthya.me/posts/target-fs/</link><pubDate>Wed, 26 Jun 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/target-fs/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="382"&#10; src="https://samarthya.me/posts/target-fs/target.png"&#10; srcset="https://samarthya.me/posts/target-fs/target.png 800w, https://samarthya.me/posts/target-fs/target.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/target-fs/target.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;Linux, as an open-source operating system, has undergone significant transformations over the years. One of the critical components of modern Linux distributions is &lt;code&gt;systemd&lt;/code&gt;, a system and service manager introduced to provide a more efficient and unified way of initializing and managing system resources. Central to systemd’s functionality are “targets,” which play a crucial role in orchestrating the boot process and managing system states. In this blog, we’ll explore the history of systemd targets, their usage, and how they function during the Linux boot process.&lt;/p&gt;</description></item><item><title>Containers: A brief take</title><link>https://samarthya.me/posts/containers-a-brief-take/</link><pubDate>Fri, 17 May 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/containers-a-brief-take/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/containers-a-brief-take/dock12.jpg"&#10; srcset="https://samarthya.me/posts/containers-a-brief-take/dock12.jpg 800w, https://samarthya.me/posts/containers-a-brief-take/dock12.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/containers-a-brief-take/dock12.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;The story of Linux containers is a tale of innovation and collaboration, with roots surprisingly deep in the history of the Linux operating system itself.&lt;/p&gt;</description></item><item><title>Ansible Configuration: Make the Defaults Explicit</title><link>https://samarthya.me/posts/ansible-configuration-basics/</link><pubDate>Sat, 16 Mar 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-configuration-basics/</guid><description>&lt;p&gt;When I first used Ansible, I was happy that it worked without a configuration file. Later, the same playbook behaved differently depending on which folder I ran it from. That was the point at which I stopped treating the defaults as magic and created a small project-level &lt;code&gt;ansible.cfg&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>What about `profile.d`</title><link>https://samarthya.me/posts/what-about-profile-d/</link><pubDate>Thu, 22 Feb 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/what-about-profile-d/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/what-about-profile-d/image-today-1.jpg"&#10; srcset="https://samarthya.me/posts/what-about-profile-d/image-today-1.jpg 800w, https://samarthya.me/posts/what-about-profile-d/image-today-1.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/what-about-profile-d/image-today-1.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;The &lt;code&gt;/etc/profile.d&lt;/code&gt; directory, though seemingly simple, plays a vital role in the smooth operation of your Linux system. But how did this unassuming directory come to be, and how has it evolved over time? Let’s embark on a journey through the history of this essential component.&lt;/p&gt;</description></item><item><title>How a file write happens in Linux?</title><link>https://samarthya.me/posts/how-a-file-write-happens-in-linux/</link><pubDate>Wed, 14 Feb 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/how-a-file-write-happens-in-linux/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/how-a-file-write-happens-in-linux/gem1.jpg"&#10; srcset="https://samarthya.me/posts/how-a-file-write-happens-in-linux/gem1.jpg 800w, https://samarthya.me/posts/how-a-file-write-happens-in-linux/gem1.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/how-a-file-write-happens-in-linux/gem1.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;Writing to a file on a device in Linux involves a fascinating journey through different layers of the system.&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;💬 When you write to a file on a device, the inode provides context about the file’s location and properties, while the device driver translates that information into instructions for the specific device. The driver then interacts with the hardware to physically write the data to the storage medium. It’s a seamless collaboration between these two crucial elements that enables efficient and reliable data management across diverse devices in Linux.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Writing to a file in Linux deep-dive</title><link>https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/</link><pubDate>Wed, 14 Feb 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/gem5.jpg"&#10; srcset="https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/gem5.jpg 800w, https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/gem5.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/writing-to-a-file-in-linux-deep-dive/gem5.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;Previously I gave a high level flow for how a process of simple file write looks like in a Linux environment &lt;a href="https://samarthya.me/posts/how-a-file-write-happens-in-linux/" &gt;here&lt;/a&gt;. In this blog, I will add more tech-details. Let’s say I want to write “Hello World” to a file &lt;code&gt;/home/samarthya/myfile.txt&lt;/code&gt; – What happens behind the scene?&lt;/p&gt;</description></item><item><title>Getting Started with Ansible: From One Command to a Playbook</title><link>https://samarthya.me/posts/getting-started-with-ansible/</link><pubDate>Sun, 21 Jan 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/getting-started-with-ansible/</guid><description>&lt;p&gt;I had been writing shell commands for every small infrastructure change. It worked, until I needed to repeat the same change on another machine and could no longer remember which command I had run first. That was my reason for starting with Ansible.&lt;/p&gt;</description></item><item><title>Kernel</title><link>https://samarthya.me/posts/kernel/</link><pubDate>Thu, 29 Jun 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/kernel/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="2048"&#10; height="1826"&#10; src="https://samarthya.me/posts/kernel/kernel-1_hu_f0d0a26a3bbd7386.png"&#10; srcset="https://samarthya.me/posts/kernel/kernel-1_hu_f0d0a26a3bbd7386.png 800w, https://samarthya.me/posts/kernel/kernel-1_hu_9cba927bf1020b05.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/kernel/kernel-1.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;Kernel&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Introduction&#10; &lt;div id="introduction" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#introduction" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;The Linux &lt;code&gt;Kernel&lt;/code&gt; stands as the backbone of the Linux operating system, serving as a critical component that enables the system to interact with hardware and manage system resources efficiently. Understanding the history and evolution of the Linux Kernel is essential for comprehending the vast ecosystem of this open-source marvel.&lt;/p&gt;</description></item><item><title>Podman Machine: How &amp; Why?</title><link>https://samarthya.me/posts/podman-machine-how-why/</link><pubDate>Tue, 07 Mar 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/podman-machine-how-why/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Podman Machine: containers run by Podman inside a VM on your local system or a remote server, with the commands to create, start and run"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/podman-machine-how-why/podman_hu_d5df1b0dd90194af.png"&#10; srcset="https://samarthya.me/posts/podman-machine-how-why/podman_hu_d5df1b0dd90194af.png 800w, https://samarthya.me/posts/podman-machine-how-why/podman.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/podman-machine-how-why/podman.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Podman&lt;/p&gt;</description></item><item><title>Python vs Bash</title><link>https://samarthya.me/posts/python-vs-bash/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/python-vs-bash/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Python compared with Bash: kind of language, what each is best for, libraries, and when to choose each"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/python-vs-bash/pycomp_hu_9aa880e447e5b1c6.png"&#10; srcset="https://samarthya.me/posts/python-vs-bash/pycomp_hu_9aa880e447e5b1c6.png 800w, https://samarthya.me/posts/python-vs-bash/pycomp.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/python-vs-bash/pycomp.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Python and bash are both programming languages, but they have different purposes and use cases.&lt;/p&gt;</description></item><item><title>Running QEMu based VM’s on OSX M1</title><link>https://samarthya.me/posts/running-qemu-based-vms-on-osx-m1/</link><pubDate>Wed, 24 Aug 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/running-qemu-based-vms-on-osx-m1/</guid><description>&lt;p&gt;&lt;code&gt;A popular choice in the OSS QEMu is an open source machine emulator (system emulation/usermode emulation&lt;/code&gt;) and virtualizer. Since I recently moved to Apple M1 silicone, I had not option of sticking to VirtualBox and was forced to relook at my options.&lt;/p&gt;</description></item><item><title>Bash: Named Reference</title><link>https://samarthya.me/posts/bash-named-reference/</link><pubDate>Wed, 02 Mar 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/bash-named-reference/</guid><description>&lt;p&gt;Bash is different world. Powerful, simple, elegant and complex all at the same time. Recently while trying to reduce the burden of repetitive code, I was trying to check what can be done to use references in Bash (something like pointers) and it was an interesting problem that I enjoyed solving.&lt;/p&gt;</description></item><item><title>Notes: For self</title><link>https://samarthya.me/posts/notes-1/</link><pubDate>Wed, 23 Feb 2022 07:27:42 +0000</pubDate><guid>https://samarthya.me/posts/notes-1/</guid><description>&lt;div&#10; class="tab__container w-full"&#10; &#10; &gt;&#10; &lt;div class="tab__nav" role="tablist"&gt;&#10; &lt;div class="flex flex-wrap gap-1"&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 tab--active"&#10; role="tab"&#10; aria-selected="true"&#10; data-tab-index="0"&#10; data-tab-label="bash"&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10; &#10; bash&#10; &lt;/span&gt;&#10; &lt;/button&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 "&#10; role="tab"&#10; aria-selected="false"&#10; data-tab-index="1"&#10; data-tab-label="= &amp;amp; =="&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10; &#10; = &amp;amp; ==&#10; &lt;/span&gt;&#10; &lt;/button&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 "&#10; role="tab"&#10; aria-selected="false"&#10; data-tab-index="2"&#10; data-tab-label="Brackets ["&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10; &#10; Brackets [&#10; &lt;/span&gt;&#10; &lt;/button&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 "&#10; role="tab"&#10; aria-selected="false"&#10; data-tab-index="3"&#10; data-tab-label="bc"&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10; &#10; bc&#10; &lt;/span&gt;&#10; &lt;/button&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 "&#10; role="tab"&#10; aria-selected="false"&#10; data-tab-index="4"&#10; data-tab-label="awk"&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10; &#10; awk&#10; &lt;/span&gt;&#10; &lt;/button&gt;&lt;/div&gt;&#10; &lt;/div&gt;&#10; &lt;div class="tab__content mt-4"&gt;&lt;div class="tab__panel tab--active" data-tab-index="0"&gt;&#10; &lt;ul&gt;&#10;&lt;li&gt;Bash is a string oriented language&lt;/li&gt;&#10;&lt;li&gt;We do not write &lt;code&gt;step=$((step++))&lt;/code&gt; this expression will return a numeric value which the shell will then take as the command to to be executed.&lt;/li&gt;&#10;&lt;li&gt;No spaces are allowed around the equal sign for variable assignment.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;let &amp;quot;step++&amp;quot;&lt;/code&gt; is same as &lt;code&gt;(( step++ ))&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Use &lt;code&gt;declare&lt;/code&gt; to set variable values and attributes&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10; &lt;/div&gt;&lt;div class="tab__panel " data-tab-index="1"&gt;&#10; In bash &lt;code&gt;=&lt;/code&gt; and &lt;code&gt;==&lt;/code&gt; both mean the same thing&#10; &lt;/div&gt;&lt;div class="tab__panel " data-tab-index="2"&gt;&#10; &lt;blockquote&gt;&lt;p&gt;💬 What is the difference between &lt;code&gt;[&lt;/code&gt; and &lt;code&gt;[[&lt;/code&gt;?&lt;/p&gt;&#10;&lt;/blockquote&gt;&lt;ol class="not-prose my-10 space-y-5 border-s border-primary-200 ps-6 dark:border-primary-900"&gt;&#10;&lt;li class="relative"&gt;&#10; &lt;span class="absolute -start-10 top-0 flex h-8 w-8 items-center justify-center rounded-full bg-primary-600 text-sm font-black text-white ring-4 ring-neutral dark:ring-neutral-800"&gt;•&lt;/span&gt;&#10; &lt;h3 class="text-lg font-bold text-neutral-900 dark:text-white"&gt;if cd $dir; then&lt;/h3&gt;&#10; &lt;div class="mt-1 text-neutral-600 dark:text-neutral-400"&gt;&lt;p&gt;In this case the command &lt;code&gt;cd $dir&lt;/code&gt; will be executed and based on success or failure of the command executed the if or else part will be executed respectively.&lt;/p&gt;&#10;&lt;h3 class="relative group"&gt;&lt;code&gt;if [$dir]; then&lt;/code&gt;&#10; &lt;div id="if-dir-then" class="anchor"&gt;&lt;/div&gt;&#10;&lt;pre&gt;&lt;code&gt;&amp;lt;span&#10; class=&amp;quot;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&amp;quot;&amp;gt;&#10; &amp;lt;a class=&amp;quot;text-primary-300 dark:text-neutral-700 !no-underline&amp;quot; href=&amp;quot;#if-dir-then&amp;quot; aria-label=&amp;quot;Anchor&amp;quot;&amp;gt;#&amp;lt;/a&amp;gt;&#10;&amp;lt;/span&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;Single bracket is equivalent to test command evaluate conditional expression&lt;/p&gt;&#10;&lt;ol class="not-prose my-10 space-y-5 border-s border-primary-200 ps-6 dark:border-primary-900"&gt;&#10;&lt;li class="relative"&gt;&#10; &lt;span class="absolute -start-10 top-0 flex h-8 w-8 items-center justify-center rounded-full bg-primary-600 text-sm font-black text-white ring-4 ring-neutral dark:ring-neutral-800"&gt;•&lt;/span&gt;&#10; &lt;h3 class="text-lg font-bold text-neutral-900 dark:text-white"&gt;&amp;lt; &amp;amp; &amp;gt;&lt;/h3&gt;&#10; &lt;div class="mt-1 text-neutral-600 dark:text-neutral-400"&gt;&lt;ul&gt;&#10;&lt;li&gt;Within &lt;code&gt;[&lt;/code&gt; compare using simple ASCII ordering &amp;amp; within &lt;code&gt;[[&lt;/code&gt; comparison is lexicographic.&lt;/li&gt;&#10;&lt;li&gt;Within &lt;code&gt;[&lt;/code&gt; you have to escape &lt;code&gt;\&amp;gt;&lt;/code&gt; to avoid redirection.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/div&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10; &lt;/div&gt;&lt;div class="tab__panel " data-tab-index="3"&gt;&#10; &lt;blockquote&gt;&lt;p&gt;💬 BC is a language?&lt;/p&gt;&#10;&lt;/blockquote&gt;&lt;div&#10; id="accordion-8263b81ba10c2527e53c5b24ef678386"&#10; class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"&#10; data-accordion="collapse"&#10; data-accordion-separated="false"&#10;&gt;&#10;&lt;details&#10; class="group border-none"&#10; data-accordion-item&#10;&lt;blockquote&gt;&lt;/blockquote&gt; &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;&#10; &lt;span class="flex items-center gap-2"&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&#10;&amp;lt;/span&amp;gt;&#10;&amp;lt;span class=&amp;quot;accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;relative block icon&amp;quot;&amp;gt;&amp;lt;svg&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;xmlns=&amp;ldquo;&lt;a href="http://www.w3.org/2000/svg%22" target="_blank" rel="noreferrer"&gt;http://www.w3.org/2000/svg"&lt;/a&gt;&#10;viewBox=&amp;ldquo;0 0 20 20&amp;rdquo;&#10;fill=&amp;ldquo;currentColor&amp;rdquo;&#10;aria-hidden=&amp;ldquo;true&amp;rdquo;&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;path&#10;fill-rule="evenodd"&#10;d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"&#10;clip-rule="evenodd"&#10;/&gt;&#10;&lt;/svg&gt;&#10;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/p&gt;&#10; &lt;/summary&gt;&#10;&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;&#10; &lt;/div&gt;&#10;&lt;/details&gt;&#10;&lt;/div&gt;&#10;&lt;style&gt;&#10; #accordion-8263b81ba10c2527e53c5b24ef678386 &gt; details + details {&#10; border-top: 1px solid rgb(var(--color-neutral-200));&#10; }&#10; .dark #accordion-8263b81ba10c2527e53c5b24ef678386 &gt; details + details {&#10; border-top-color: rgb(var(--color-neutral-700));&#10; }&#10;&lt;/style&gt;&#10;&lt;style&gt;&#10; #accordion-8263b81ba10c2527e53c5b24ef678386 details[data-accordion-item] &gt; summary .accordion-chevron {&#10; transform: rotate(-90deg);&#10; transition: transform 200ms ease-in-out;&#10; }&#10; #accordion-8263b81ba10c2527e53c5b24ef678386 details[data-accordion-item][open] &gt; summary .accordion-chevron {&#10; transform: rotate(0deg);&#10; }&#10;&lt;/style&gt;&#10;&lt;script&gt;&#10; (() =&gt; {&#10; const root = document.getElementById("accordion-8263b81ba10c2527e53c5b24ef678386");&#10; if (!root) return;&#10; const items = root.querySelectorAll("details[data-accordion-item]");&#10; items.forEach((item) =&gt; {&#10; item.addEventListener("toggle", () =&gt; {&#10; if (!item.open) return;&#10; items.forEach((other) =&gt; {&#10; if (other !== item) other.removeAttribute("open");&#10; });&#10; });&#10; });&#10; })();&#10;&lt;/script&gt;&#10;&lt;blockquote&gt;&lt;p&gt;💬 Supports arbitrary precision numbers with interactive execution of statements. (Command line)&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10; &lt;/div&gt;&lt;div class="tab__panel " data-tab-index="4"&gt;&#10; &lt;p&gt;&lt;code&gt;awk&lt;/code&gt; provides filtering capabilities&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt; printf &amp;#39;gate\napple\nwhat\nkite\n&amp;#39; | awk &amp;#39;/at/&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gate&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;what&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;printf &amp;#39;gate\napple\nwhat\nkite\n&amp;#39; | awk &amp;#39;!/e/&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;what&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;&lt;code&gt;awk&lt;/code&gt; is primarily used for field based processing&lt;/p&gt;&#10;&lt;p&gt;One liner structure &lt;code&gt;awk 'cond1{action1} cond2{action2} … condN{actionN}'&lt;/code&gt;&lt;/p&gt;&#10;&#10; &lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>Spinnaker: docker-registry</title><link>https://samarthya.me/posts/spinnaker-docker-registry/</link><pubDate>Fri, 04 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/spinnaker-docker-registry/</guid><description>&lt;p&gt;You will need a valid docker registry before you add any trigger in the pipeline in &lt;code&gt;Spinnaker&lt;/code&gt;&lt;/p&gt;&#10;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; &lt;a href="https://spinnaker.io/docs/setup/install/providers/docker-registry/" target="_blank" rel="noreferrer"&gt;Official documentation&lt;/a&gt; is a good resource to seek more clarifications&#10;— Spinnaker&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;In my case I have already added an account my-docker-registry as under (The final result after you successfully configure Docker.&lt;/p&gt;</description></item><item><title>Zabbix Agent</title><link>https://samarthya.me/posts/zabbix-agent/</link><pubDate>Wed, 10 Nov 2021 06:06:09 +0000</pubDate><guid>https://samarthya.me/posts/zabbix-agent/</guid><description>&lt;p&gt;In this blog I will walk you through basic steps needed to deploy a Zabbix 5 Agent on a &lt;code&gt;Centos&lt;/code&gt; Machine. The Zabbix Release is available &lt;a href="https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Machine&#10; &lt;div id="machine" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#machine" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root@node4&amp;gt;cat /etc/redhat-release &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CentOS Linux release 7.9.2009 (Core)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;Download and install the RPM&lt;/p&gt;</description></item><item><title>PS: Process Status</title><link>https://samarthya.me/posts/ps-process-status/</link><pubDate>Tue, 20 Oct 2020 11:13:18 +0000</pubDate><guid>https://samarthya.me/posts/ps-process-status/</guid><description>&lt;p&gt;MAN Pages are one source of truth for all curious queries.&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;man ps&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ps - report a snapshot of the current processes.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;It is used to display instant information about the active processes in the system.&lt;/p&gt;</description></item><item><title>Kernel Mode</title><link>https://samarthya.me/posts/kernel-mode/</link><pubDate>Sat, 17 Oct 2020 14:58:39 +0000</pubDate><guid>https://samarthya.me/posts/kernel-mode/</guid><description>&lt;p&gt;The CPU operates in two modes in Linux&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;User mode (non privileged mode)&lt;/li&gt;&#10;&lt;li&gt;Kernel mode (System mode)&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;When operating in Kernel mode it has un-restricted access to resources like memory and input output devices.&lt;/p&gt;</description></item><item><title>journalctl - Query the systemd journal</title><link>https://samarthya.me/posts/journalctl-query-the-systemd-journal/</link><pubDate>Sat, 17 Oct 2020 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/journalctl-query-the-systemd-journal/</guid><description>&lt;p&gt;&lt;code&gt;journald&lt;/code&gt; is used to query the &lt;code&gt;systemd&lt;/code&gt; journal contents.&lt;/p&gt;&#10;&#10;&lt;h3 class="relative group"&gt;Example 1&#10; &lt;div id="example-1" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#example-1" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h3&gt;&#10;&lt;p&gt;Lets try and see the kubelet service logs in the &lt;code&gt;systemd&lt;/code&gt; journal&lt;/p&gt;</description></item><item><title>Linux Utils</title><link>https://samarthya.me/posts/linux-utils/</link><pubDate>Tue, 13 Oct 2020 08:29:43 +0000</pubDate><guid>https://samarthya.me/posts/linux-utils/</guid><description>&lt;h1 class="relative group"&gt;Ping&#10; &lt;div id="ping" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ping" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h1&gt;&#10;&lt;p&gt;I have used &lt;code&gt;ping&lt;/code&gt; often but never to an extend that I could understand the complete range of options and power available at hand.&lt;/p&gt;</description></item><item><title>SYSTEMD: Mother of all processes</title><link>https://samarthya.me/posts/systemd-mother-of-all-processes/</link><pubDate>Wed, 30 Sep 2020 14:33:47 +0000</pubDate><guid>https://samarthya.me/posts/systemd-mother-of-all-processes/</guid><description>&lt;p&gt;&lt;code&gt;systemd&lt;/code&gt; is the replacement system for System V and with the primary goal of starting services in parallel.&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;Remember &lt;code&gt;init&lt;/code&gt; levels?&lt;/p&gt;&#10;&lt;/blockquote&gt;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; GRUB: Grand Unified Boot Loader&#10;— /boot/grub/grub.conf&#10;&lt;/div&gt;&#10;&#10;&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt="systemd architecture: utilities, daemons and targets built on the systemd core, its libraries and the Linux kernel"&#10; src="https://opensource.com/sites/default/files/uploads/systemd-architecture.png"&#10; &gt;&lt;/figure&gt;&#10;&lt;p&gt;Some key points&lt;/p&gt;</description></item><item><title>Docker</title><link>https://samarthya.me/posts/docker-ubuntu-a-refresher/</link><pubDate>Sat, 11 Jul 2020 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/docker-ubuntu-a-refresher/</guid><description>&lt;p&gt;Usually I use Centos, but this time I wanted to try out docker swarm and ubuntu was the preferred option due to the options and supporting blogs available.&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;Do read – &lt;a href="https://docs.docker.com/get-started/#containers-and-virtual-machines" target="_blank" rel="noreferrer"&gt;https://docs.docker.com/get-started/#containers-and-virtual-machines&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;docker.com&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Metric Beat</title><link>https://samarthya.me/posts/metric-beat/</link><pubDate>Fri, 24 Jan 2020 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/metric-beat/</guid><description>&lt;p&gt;All right, its been a busy week and finally some time at hand to write about something I have been doing.&lt;/p&gt;&#10;&lt;p&gt;Mostly I am working on ELK stack these days, securing, validating, data analytics etc. Today, had the opportunity to go the Secure Elastic way, by enabling the TLS for secure communication within Nodes (Elastic cluster) and finally setup a Metric beat to get the status of the node.&lt;/p&gt;</description></item><item><title>Locale</title><link>https://samarthya.me/posts/locale-centos/</link><pubDate>Fri, 05 Apr 2019 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/locale-centos/</guid><description>&lt;p&gt;Did you ever see a warning printed on your console the moment you log into your Linux machine and did that warning ever complaned to you about the benign locale?&lt;/p&gt;</description></item></channel></rss>