<?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[vmacwrites - Medium]]></title>
        <description><![CDATA[Tech writings by Vidyasagar Machupalli - Medium]]></description>
        <link>https://medium.com/vmacwrites?source=rss----284cc9132fcc---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>vmacwrites - Medium</title>
            <link>https://medium.com/vmacwrites?source=rss----284cc9132fcc---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 11 Nov 2026 21:34:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/vmacwrites" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From MkDocs 1.6 to Zensical — Here’s Why I Finally Made the Move]]></title>
            <link>https://medium.com/vmacwrites/from-mkdocs-1-6-to-zensical-heres-why-i-finally-made-the-move-53b273b49cdd?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/53b273b49cdd</guid>
            <category><![CDATA[zensical]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[mkdocs]]></category>
            <category><![CDATA[mkdocs-material]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Fri, 08 May 2026 15:30:26 GMT</pubDate>
            <atom:updated>2026-05-08T15:30:26.392Z</atom:updated>
            <content:encoded><![CDATA[<p>I want to tell you about a warning message that showed up in my terminal one afternoon and completely changed how I think about my documentation setup.</p><p>I was running a routine mkdocs serve on a project I have been maintaining for a while. <a href="https://www.mkdocs.org/">MkDocs</a> 1.6, Material theme, a handful of plugins, nothing fancy. Then this showed up:</p><pre>│ ⚠ Warning from the Material for MkDocs team           │<br>│                                                         │<br>│ MkDocs 2.0, the underlying framework of Material for   │<br>│ MkDocs, will introduce backward-incompatible changes,  │<br>│ including:                                              │<br>│                                                         │<br>│ × All plugins will stop working                        │<br>│ × All theme overrides will break                       │<br>│ × No migration path exists                             │<br>│ × Closed contribution model                            │<br>│ × Currently unlicensed                                 │</pre><p>I read it twice. Then I went and read the <a href="https://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/">full analysis</a> the Material for MkDocs team published.</p><p>That was the beginning of a longer journey than I expected.</p><h3>What Is Actually Happening with MkDocs 2.0</h3><p>Before I get into my migration story, let me give you the full picture because it is a bit of a mess and easy to get confused about.</p><p><a href="https://www.mkdocs.org/">MkDocs</a> and <a href="https://squidfunk.github.io/mkdocs-material/">Material for MkDocs</a> are two separate projects. MkDocs is the underlying framework. Material for MkDocs is the theme and plugin layer that sits on top of it, maintained by a completely different team. Most people use both together, so they often get lumped in as one thing. They are not.</p><p>MkDocs 1.x has been effectively unmaintained for well over 18 months now. Issues and pull requests are piling up. Long-standing bugs — including live-reload problems that I personally ran into — have gone without fixes. Nobody is certain whether security issues will even be addressed going forward.</p><p>Then came <a href="https://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/">MkDocs 2.0</a> — a ground-up rewrite with no backward compatibility. The plugin system was removed entirely. The theming system was rewritten from scratch. Your existing mkdocs.yml will not work with it. There is no migration guide. The project also shifted to a closed contribution model, meaning community members cannot even report bugs. And at the time of writing, it ships without a proper open source license, which makes it unsuitable for production use in most organizations.</p><p>The Material for MkDocs team dug into the pre-release thoroughly and published their findings. Their conclusion was clear — MkDocs 2.0 is not a drop-in replacement for anything. There is no path forward from 1.x to 2.0 without rebuilding your documentation setup from scratch.</p><p>So you have a situation where MkDocs 1.x is dead in everything but name, and MkDocs 2.0 breaks everything that made MkDocs 1.x worth using in the first place. Florian Maas documented the entire timeline well in <a href="https://fpgmaas.com/blog/collapse-of-mkdocs/">The Slow Collapse of MkDocs</a> — worth a read if you want the full backstory.</p><p>That is the context.</p><h3>My Setup Before the Migration</h3><p>I was running <a href="https://www.mkdocs.org/about/release-notes/">MkDocs 1.6</a> with the <a href="https://squidfunk.github.io/mkdocs-material/">Material theme</a> on a documentation project that had grown over a couple of years. Here is roughly what my mkdocs.yml looked like:</p><pre>site_name: My Project Docs<br>theme:<br>  name: material<br>  palette:<br>    primary: indigo<br>  features:<br>    - navigation.tabs<br>    - navigation.sections<br>    - content.code.copy<br><br>plugins:<br>  - search<br>  - tags<br>  - minify:<br>      minify_html: true<br><br>markdown_extensions:<br>  - admonition<br>  - pymdownx.highlight<br>  - pymdownx.superfences<br>  - pymdownx.tabbed:<br>      alternate_style: true<br>  - attr_list<br>  - def_list</pre><p>It worked. Mostly. But live-reload broke on me regularly. The search plugin occasionally produced stale results during development. And I had one plugin conflict between tags and a third-party extension that I never fully resolved — I just learned to live with it.</p><p>I am the kind of person who likes tools that stay out of the way. I wrote about this when covering <a href="https://medium.com/vmacwrites/must-have-terraform-tools-4197971f00c">must-have Terraform tools</a> — the best tools are the ones you barely notice because they just work. MkDocs 1.6 had stopped feeling that way.</p><p>When the MkDocs 2.0 warning appeared, I knew it was time to stop patching around issues and actually make a decision.</p><h3>Finding Zensical</h3><p>The Material for MkDocs team has been building <a href="https://zensical.org/">Zensical</a> as their path forward. It is not just a theme — it is a complete documentation toolchain built from scratch after nearly a decade of lessons from maintaining Material for MkDocs. Martin Donath, the creator of Material for MkDocs, spoke about the backstory of Zensical on <a href="https://talkpython.fm/episodes/show/542/">Talk Python To Me #542</a> — that conversation gives a lot of context on why a clean break was necessary rather than patching on top of what existed.</p><p>So I decided to try it.</p><h3>First Attempt — Python 3.9.6</h3><p>I went to install Zensical on my Mac.</p><pre>pip install zensical</pre><p>Error.</p><pre>ERROR: Could not find a version that satisfies the requirement zensical<br>ERROR: No matching distribution found for zensical</pre><p>My Mac was still on Python 3.9.6, which is what ships by default on older macOS setups. I had never updated it because everything I needed was working fine with it. This kind of Python version mismatch is something I have run into before in other contexts — I actually documented a similar situation with Ansible in my article on <a href="https://medium.com/vmacwrites/ansible-no-python-interpreters-found-for-host-4184fb5eda8b">No python interpreters found for host</a>, where the fix also came down to getting the right Python version in place.</p><p><a href="https://zensical.org/">Zensical</a> requires Python 3.10 or higher. My setup was below the minimum and the install simply refused to continue. No helpful error pointing to the version requirement either — just a blunt “no matching distribution” message that sent me looking in the wrong direction for a while.</p><h3>Fixing Python First</h3><p>I manage Python versions with <a href="https://github.com/pyenv/pyenv">pyenv</a>, which I strongly recommend if you are doing any serious Python work on a Mac. It keeps your system Python untouched and lets you run different versions per project. If you are not already using it, installing it is straightforward with Homebrew — and if you are still getting your macOS terminal setup sorted, my recent article on <a href="https://medium.com/vmacwrites/the-ultimate-terminal-stack-in-2026-a-cross-platform-guide-for-macos-linux-and-windows-c0d1f93cd9cc">The Ultimate Terminal Stack in 2026</a> covers the full environment setup that makes this kind of tooling much easier to manage.</p><pre>pyenv install 3.11.9<br>pyenv global 3.11.9<br>python --version<br># Python 3.11.9</pre><p>If you do not have pyenv yet:</p><pre>brew install pyenv</pre><p>Then add this to your .zshrc or .bash_profile:</p><pre>export PYENV_ROOT=&quot;$HOME/.pyenv&quot;<br>export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;<br>eval &quot;$(pyenv init -)&quot;</pre><p>Restart your terminal, install 3.11.9, set it as global, and you are good to go.</p><h3>Installing Zensical — Second Try</h3><p>With Python 3.11.9 in place, I created a fresh virtual environment for the project and tried again.</p><pre>python -m venv zensical-env<br>source zensical-env/bin/activate<br>pip install zensical</pre><p>Clean install. No errors this time.</p><h3>The Migration from MkDocs 1.6</h3><p>This is the part I want to be honest about. The migration is not a one-command operation. But it is also not as painful as I feared.</p><p><strong>Step 1 — Initialize a new Zensical project</strong></p><pre>zensical init my-docs<br>cd my-docs</pre><p><strong>Step 2 — Move your Markdown files</strong></p><p>Your existing docs/ folder structure carries over almost entirely. Zensical reads Markdown the same way. I copied my files over and the content was intact.</p><pre>cp -r old-project/docs/* my-docs/docs/</pre><p><strong>Step 3 — Rewrite the config</strong></p><p>This is the real work. Zensical uses TOML instead of YAML. Here is what my config looked like after the migration:</p><pre>[site]<br>name = &quot;My Project Docs&quot;<br>description = &quot;Documentation for my project&quot;<br>[theme]<br>style = &quot;material&quot;<br>palette = &quot;indigo&quot;<br>[features]<br>navigation_tabs = true<br>navigation_sections = true<br>code_copy = true<br>[nav]<br>auto = true<br>[search]<br>enabled = true</pre><p>Some things I had in <a href="https://www.mkdocs.org/">MkDocs</a> did not have a direct equivalent yet. The tags plugin, for instance, required checking the <a href="https://zensical.org/">Zensical docs</a> to see how tagging works in their model. The minify plugin is not needed — Zensical handles output optimization internally.</p><p>The pymdownx Markdown extensions largely work without explicit configuration because Zensical bundles sensible defaults. Admonitions, code highlighting, tabbed content — these all rendered correctly without me listing them one by one in the config.</p><p><strong>Step 4 — Verify and fix</strong></p><pre>zensical serve</pre><p>I went through every page in the browser and checked rendering. Most things looked right immediately. A few pages that used very specific Material-specific HTML overrides needed small fixes, but nothing that took more than a few minutes per page.</p><h3>What Changed for the Better</h3><p><strong>Live-reload works.</strong> I mean actually works. I had gotten so used to stopping and restarting mkdocs serve multiple times during a writing session that I forgot live-reload was supposed to just work. With <a href="https://zensical.org/">Zensical</a>, I make a change, save, and the browser updates. Every time.</p><p><strong>Config is readable.</strong> My old mkdocs.yml had grown into something I needed to scroll through carefully before making any change. The Zensical TOML config is short and obvious. I can read the whole thing in thirty seconds.</p><p><strong>Auto navigation.</strong> Zensical builds the nav tree from your folder structure. No more maintaining a hand-written nav definition every time I add a new page.</p><p><strong>No plugin conflicts.</strong> I have not run into a single compatibility issue. The things I need are either built in or have a clean extension path.</p><h3>What I Had to Give Up (For Now)</h3><p>Honesty matters here. The <a href="https://zensical.org/">Zensical</a> plugin ecosystem is still young. If you are heavily using specific MkDocs plugins, check whether Zensical has a replacement before you commit to migrating. The community and third-party extension library that <a href="https://www.mkdocs.org/">MkDocs</a> built over years does not exist yet for Zensical.</p><p>Also, if your team has a lot of custom theme overrides — custom CSS hooks, template blocks, JavaScript injections — those will need to be rethought. Zensical’s theming model is different enough that you cannot just copy your overrides across.</p><h3>Should You Migrate?</h3><p>If you are starting fresh, start with <a href="https://zensical.org/">Zensical</a>. There is no reason to build on <a href="https://www.mkdocs.org/">MkDocs</a> 1.x when it is no longer maintained, and MkDocs 2.0 is not a safe bet for production documentation.</p><p>If you are on an existing MkDocs 1.6 project, start planning the migration now rather than waiting for something to break. The <a href="https://squidfunk.github.io/mkdocs-material/blog/2025/11/18/goodbye-github-discussions/">Material for MkDocs team has committed</a> to security patches for at least 12 months, so you have a window. Use it to migrate on your own terms rather than scrambling when something stops working.</p><p>And if you are still on Python 3.9 like I was — fix that first. Everything else can wait five minutes while you sort out your Python version.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53b273b49cdd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/from-mkdocs-1-6-to-zensical-heres-why-i-finally-made-the-move-53b273b49cdd">From MkDocs 1.6 to Zensical — Here’s Why I Finally Made the Move</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Terminal Stack in 2026: A Cross-Platform Guide for macOS, Linux, and Windows]]></title>
            <link>https://medium.com/vmacwrites/the-ultimate-terminal-stack-in-2026-a-cross-platform-guide-for-macos-linux-and-windows-c0d1f93cd9cc?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/c0d1f93cd9cc</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[emulator]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 22:24:12 GMT</pubDate>
            <atom:updated>2026-03-06T22:24:13.450Z</atom:updated>
            <content:encoded><![CDATA[<h3>With the release of Macbook Neo, I thought this would be a perfect time to talk about my new terminal setup on macOS and how similar setup can be achieved on Linux and Windows Operating systems.</h3><p>I love exploring new tools and publish about these awesome tools. Like my recent article on <a href="https://dzone.com/articles/developer-tools-that-actually-matter-in-2026">Developer tools for 2026</a>. For years, my terminal setup was… adequate. Like many of you, I clung to iTerm2, sprinkled a few plugins on top, and called it a day. It worked, mostly. But as my coding demands grew, so did my frustration with the subtle lags, the lost command history, and the endless re-setting up of my workspace after a reboot.</p><p>The world of terminal tools has evolved rapidly. New projects written in languages like Zig and Rust are changing what’s possible. I decided it was time for a complete overhaul. My goal: a terminal that was lightning-fast, remembered everything, and helped me navigate my projects with zero friction.</p><p>Here’s how I built what I consider the ultimate macOS terminal environment for 2026.</p><h3>The Foundation: Ghostty — The Speed Demon</h3><p>The first step was ditching my old terminal emulator. <a href="https://ghostty.org/"><strong>Ghostty</strong></a> is the star here. It’s written in Zig and taps directly into Apple’s Metal API, making it incredibly performant. This isn’t just marketing hype; it means a buttery-smooth experience. Scrolling through huge log files is instant, and every character you type appears on screen without a hint of delay.</p><p>It also comes with native macOS features like tabs and split panes, and its configuration is a simple, human-readable file at ~/.config/ghostty/config. This makes it easy to back up and version control your settings.</p><h3>The Aesthetic: Anka/Coder — My New Favorite Font</h3><p>Font choice might seem minor, but it’s crucial when you stare at code all day. I moved to <strong>Anka/Coder</strong>. This font stands out because it’s a condensed monospace font. It allows you to see more code on your screen horizontally without sacrificing readability. It has a clean, almost retro-tech feel that perfectly complements a high-performance setup.</p><h3>The Brain: Atuin &amp; Zoxide — Never Forget, Always Find</h3><p>This is where true productivity gains happen. <strong>Atuin</strong> completely replaces your shell’s default history. Instead of a basic ~/.zsh_history file, Atuin stores every command you&#39;ve ever run in a searchable SQLite database. Hit your Up-Arrow key, and you get a beautiful, full-screen fuzzy search interface. You can filter by directory, exit code, or even sync it across multiple machines. That complex Docker command from last month? Found in seconds.</p><p>Then there’s <strong>Zoxide</strong>, a smarter cd command written in Rust. It learns your habits. If you frequently go to ~/Documents/Dev/projectX/backend/src, you can just type z back and Zoxide will take you there. It&#39;s like your terminal intuitively knows where you want to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCsaeoAW8rhLJRYnOlShXg.png" /><figcaption>Ghostty with tmux and Atuin</figcaption></figure><h3>The Safety Net: Tmux — Immortality for Your Sessions</h3><p>Have you ever had your terminal crash, or had to reboot your Mac, only to lose your entire workspace layout? All your open tabs, split panes, and running processes gone? <strong>Tmux</strong> (Terminal Multiplexer) solves this.</p><p>Tmux lets you create persistent sessions that run in the background. Even if your terminal window closes, your Tmux session (and everything inside it) keeps running. With plugins like tmux-resurrect and tmux-continuum, your entire Tmux environment—including all your panes, windows, and their contents—is automatically saved and restored when you launch Tmux again, even after a system reboot. It&#39;s like a save game for your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHfczRmNtVV8DjZTXB_2nw.png" /><figcaption>Modern macOS terminal stack</figcaption></figure><h3>The “One-Click” Setup: Your Complete Automation Script</h3><p>I believe in automation. Setting up a new development environment should be as simple as running one script. This script will:</p><ul><li>Install Homebrew (if you don’t have it).</li><li>Install Ghostty, Anka/Coder font, Tmux, Atuin, Zoxide, Starship, and other essential tools.</li><li>Configure your Zsh shell with autosuggestions and syntax highlighting.</li><li>Set up Ghostty with the correct font and persistence settings.</li><li>Configure Tmux with mouse support, intuitive split shortcuts, and session persistence plugins (TPM, tmux-resurrect, tmux-continuum).</li></ul><blockquote>Just copy this entire block, save it as setup.sh on your Mac, and run bash setup.sh in your current terminal. Remember to chmod to give appropriate permissions.</blockquote><pre>#!/bin/bash<br><br>echo &quot;🚀 Starting the Ultimate macOS Terminal Setup Script...&quot;<br><br># --- 1. Install Homebrew if not present ---<br>if ! command -v brew &amp;&gt; /dev/null; then<br>    echo &quot;🍺 Homebrew not found. Installing Homebrew...&quot;<br>    /bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;<br>    eval &quot;$(/opt/homebrew/bin/brew shellenv)&quot;<br>else<br>    echo &quot;✅ Homebrew already installed.&quot;<br>fi<br><br># --- 2. Install Core Tools &amp; Anka/Coder Font ---<br>echo &quot;📦 Installing Ghostty, Tmux, Atuin, Starship, Zoxide, fzf, eza, bat...&quot;<br>echo &quot;Also installing the Anka/Coder font (via Homebrew Cask).&quot;<br><br>brew install --cask ghostty<br>brew install --cask font-anka-coder # The &quot;Anker Coder&quot; font<br><br>brew install tmux atuin zoxide fzf eza bat starship<br><br># --- 3. Setup Zsh Plugins (Autosuggestions &amp; Syntax Highlighting) ---<br>echo &quot;🔌 Setting up Zsh plugins: autosuggestions and syntax highlighting...&quot;<br>mkdir -p ~/.zsh<br><br># Zsh-autosuggestions<br>if [ ! -d &quot;$HOME/.zsh/zsh-autosuggestions&quot; ]; then<br>    git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions<br>else<br>    echo &quot;   zsh-autosuggestions already cloned. Updating...&quot;<br>    (cd ~/.zsh/zsh-autosuggestions &amp;&amp; git pull)<br>fi<br><br># Zsh-syntax-highlighting<br>if [ ! -d &quot;$HOME/.zsh/zsh-syntax-highlighting&quot; ]; then<br>    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting<br>else<br>    echo &quot;   zsh-syntax-highlighting already cloned. Updating...&quot;<br>    (cd ~/.zsh/zsh-syntax-highlighting &amp;&amp; git pull)<br>fi<br><br># --- 4. Write ~/.zshrc (Shell Configuration) ---<br>echo &quot;📝 Creating/Updating ~/.zshrc configuration file...&quot;<br>cat &lt;&lt; &#39;EOF&#39; &gt; ~/.zshrc<br># --- Environment Variables ---<br>export LANG=en_US.UTF-8<br>export EDITOR=&#39;nvim&#39; # Or &#39;nano&#39;, &#39;code --wait&#39;, etc.<br><br># --- Zsh Plugin Loading ---<br>source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh<br>source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh<br><br># --- Tool Initializations ---<br>eval &quot;$(starship init zsh)&quot; # Minimalist, fast prompt<br>eval &quot;$(zoxide init zsh)&quot;   # Smart &#39;cd&#39; command<br>eval &quot;$(atuin init zsh)&quot;    # Searchable shell history<br><br># --- FZF Keybindings &amp; Completion ---<br># This line sources fzf&#39;s keybindings and completion setup<br>[ -f ~/.fzf.zsh ] &amp;&amp; source ~/.fzf.zsh<br><br># --- Modern CLI Aliases ---<br># Replace old commands with their modern, feature-rich alternatives<br>alias ls=&#39;eza --icons --group-directories-first&#39; # &#39;ls&#39; with icons and better grouping<br>alias ll=&#39;eza -lh --icons --grid&#39;                # &#39;ls -l&#39; with icons and grid view<br>alias cat=&#39;bat&#39;                                  # &#39;cat&#39; with syntax highlighting and Git integration<br>alias cd=&#39;z&#39;                                     # Make &#39;cd&#39; use zoxide&#39;s smart jumping<br>alias g=&#39;git&#39;                                    # Shorthand for Git<br><br># --- Custom Key Bindings ---<br># Use Up-Arrow for Atuin&#39;s full-screen history search<br>bindkey &#39;^[[A&#39; atuin-up-search<br>EOF<br><br># --- 5. Write Ghostty Configuration ---<br>echo &quot;👻 Creating ~/.config/ghostty/config file...&quot;<br>mkdir -p ~/.config/ghostty<br>cat &lt;&lt; EOF &gt; ~/.config/ghostty/config<br># Theme and Appearance<br>theme = dark-plus<br>font-family = &quot;Anka/Coder&quot; # Using the installed Anka/Coder font<br>font-size = 14<br>background-opacity = 0.9<br>background-blur = true<br><br># macOS Integration<br>macos-titlebar-style = hidden<br>window-save-state = &quot;always&quot; # Ensure sessions persist across Ghostty restarts<br>EOF<br><br># --- 6. Write Tmux Configuration &amp; Install TPM (Tmux Plugin Manager) ---<br>echo &quot;🪟 Creating ~/.tmux.conf file and installing Tmux Plugin Manager (TPM)...&quot;<br>mkdir -p ~/.tmux/plugins<br><br># Clone TPM if it doesn&#39;t exist<br>if [ ! -d &quot;$HOME/.tmux/plugins/tpm&quot; ]; then<br>    git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm<br>else<br>    echo &quot;   TPM already cloned. Updating...&quot;<br>    (cd ~/.tmux/plugins/tpm &amp;&amp; git pull)<br>fi<br><br>cat &lt;&lt; &#39;EOF&#39; &gt; ~/.tmux.conf<br># --- General Tmux Settings ---<br>set -g default-terminal &quot;screen-256color&quot; # Enable 256 colors<br>set -g mouse on                           # Enable mouse support for resizing panes, scrolling<br>set -s escape-time 0                      # Reduce escape key delay (important for Vim users)<br>set -g history-limit 10000                # Increase scrollback buffer<br><br># --- Custom Key Bindings for Panes ---<br># Split panes horizontally and vertically using intuitive | and - keys<br>bind | split-window -h -c &quot;#{pane_current_path}&quot; # Split vertical<br>bind - split-window -v -c &quot;#{pane_current_path}&quot; # Split horizontal<br>unbind &#39;&quot;&#39;                                       # Unbind default split keys<br>unbind %<br><br># --- Pane Navigation with Alt + Arrow Keys ---<br># This allows quick pane switching without the Tmux prefix key (Ctrl+b)<br>bind -n M-Left select-pane -L<br>bind -n M-Right select-pane -R<br>bind -n M-Up select-pane -U<br>bind -n M-Down select-pane -D<br><br># --- Status Bar Styling (Optional: For a cleaner look) ---<br>set -g status-style bg=default<br>set -g status-left-length 40<br>set -g status-left &quot;#[fg=green]Session: #S #[fg=yellow]• &quot; # Session name<br>set -g status-right &quot;#[fg=cyan]%H:%M #[fg=magenta]%d-%b-%y&quot; # Time and date<br><br># --- Tmux Plugin Manager (TPM) &amp; Plugins ---<br># List of plugins to be installed by TPM<br>set -g @plugin &#39;tmux-plugins/tpm&#39;           # Tmux Plugin Manager itself<br>set -g @plugin &#39;tmux-plugins/tmux-resurrect&#39; # Save and restore Tmux environment<br>set -g @plugin &#39;tmux-plugins/tmux-continuum&#39; # Continuously save Tmux environment<br><br># Configure tmux-continuum to automatically restore sessions on Tmux start<br>set -g @continuum-restore &#39;on&#39;<br><br># Initialize TPM. This line MUST be at the very end of .tmux.conf<br>run &#39;~/.tmux/plugins/tpm/tpm&#39;<br>EOF<br><br># --- Automated Tmux Plugin Installation ---<br>echo &quot;⚙️  Automatically installing Tmux plugins (no manual keypress needed)...&quot;<br>~/.tmux/plugins/tpm/bin/install_plugins<br><br>echo &quot;----------------------------------------------------&quot;<br>echo &quot;✅ SETUP COMPLETE!&quot;<br>echo &quot;----------------------------------------------------&quot;<br>echo &quot;Instructions for a perfect experience:&quot;<br>echo &quot;1. Open &#39;Ghostty&#39; from your Applications folder. (It should pick up the config automatically).&quot;<br>echo &quot;2. In Ghostty, type &#39;source ~/.zshrc&#39; and press Enter to load your new Zsh config.&quot;<br>echo &quot;3. Type &#39;tmux&#39; and press Enter to start your persistent Tmux session.&quot;<br>echo &quot;   Your modern terminal is now fully operational!&quot;<br>echo &quot;   (Press Up-Arrow to try Atuin&#39;s history search, &#39;z&#39; for smart CD, etc.)&quot;</pre><h3>The Cross-Platform Reality Check</h3><p>Before we dive into the installation scripts, we need to talk about compatibility. The dream is to install the exact same tools everywhere. The reality is that the backend tools are universal, but the frontends require OS-specific choices.</p><p><strong>What works everywhere (macOS, Linux, Windows via WSL2):</strong></p><ul><li><strong>Zsh:</strong> Our shell of choice.</li><li><strong>Tmux:</strong> For session persistence and window management.</li><li><strong>Atuin:</strong> The SQLite database that replaces your shell history and syncs it across all your machines.</li><li><strong>Zoxide:</strong> The smart replacement for the cd command.</li><li><strong>Starship:</strong> The minimalist, fast shell prompt.</li><li><strong>Modern CLI Tools:</strong> eza (replaces ls), bat (replaces cat), and fzf (fuzzy finder).</li><li><strong>Anka/Coder:</strong> The condensed monospace font for high-density coding.</li></ul><p><strong>The Exception: The Terminal Emulator</strong></p><ul><li><strong>Ghostty</strong> is the undisputed king of performance on macOS and Linux due to its native Zig and GPU-accelerated architecture. However, Ghostty is not built natively for Windows.</li><li><strong>Windows Terminal</strong> is the mandatory alternative for Windows users. When paired with the Windows Subsystem for Linux (WSL2), it provides a near-identical experience to Ghostty on Unix systems.</li></ul><h3>Operating System Specific Frontends</h3><p>Let us get the emulators and core package managers set up based on your current machine.</p><h3>macOS (The Ghostty Native Setup)</h3><p>Apple environments are the easiest to bootstrap thanks to Homebrew. Open your default Terminal.app and run:</p><pre># Install the core tools and Ghostty<br>brew install --cask ghostty font-anka-coder<br>brew install tmux atuin zoxide fzf eza bat starship</pre><h3>Linux (The Hybrid Setup)</h3><p>On Linux, you want to use your native package manager (like apt or pacman) for the heavy system tools, but use Homebrew for Linux to get the latest versions of the Rust-based utilities.</p><p>Open your terminal and run:</p><pre># Get the base system tools<br>sudo apt update &amp;&amp; sudo apt install zsh curl git gcc<br># Install Homebrew for Linux<br>/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;<br>eval &quot;$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)&quot;<br># Install the modern stack<br>brew install tmux atuin zoxide fzf eza bat starship font-anka-coder</pre><p><em>(Note: Ghostty is available for Linux, but installation varies heavily depending on whether you use Wayland or X11. Check the official Ghostty repository for the pre-compiled binaries for your specific distribution).</em></p><h3>Windows (The WSL2 Workaround)</h3><p>To get this stack running on Windows, we bypass the native Windows command prompt entirely. We use Windows Terminal as the visual wrapper and Ubuntu (via WSL2) as the actual engine.</p><p>Open PowerShell as Administrator:</p><pre># Install Windows Terminal<br>winget install Microsoft.WindowsTerminal<br><br># Install the Windows Subsystem for Linux<br>wsl --install -d Ubuntu</pre><p>Restart your computer. Open Windows Terminal, select the Ubuntu profile, and then follow the <strong>Linux</strong> instructions above to install Zsh, Homebrew, and the modern CLI tools inside your WSL environment. You will also need to download the Anka/Coder font from the web and install it through the Windows Font Settings menu to make it available to Windows Terminal.</p><h3>The Universal Brain Configuration</h3><p>Now that the frontends are installed, we unify the backend. This configuration is identical whether you are on Mac, Linux, or Windows (WSL).</p><h4>Configure Your Shell</h4><p>Clone the necessary Zsh plugins to give yourself IDE-like autocompletion:</p><pre>mkdir -p ~/.zsh<br>git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions<br>git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting</pre><p>Next, open your ~/.zshrc file and paste the logic that binds all our tools together:</p><pre># Load plugins<br>source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh<br>source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh<br># Initialize the modern tools<br>eval &quot;$(starship init zsh)&quot;<br>eval &quot;$(zoxide init zsh)&quot;<br>eval &quot;$(atuin init zsh)&quot;<br># Setup modern aliases<br>alias ls=&#39;eza --icons --group-directories-first&#39;<br>alias ll=&#39;eza -lh --icons --grid&#39;<br>alias cat=&#39;bat&#39;<br>alias cd=&#39;z&#39;<br># Make Atuin launch on Up-Arrow<br>bindkey &#39;^[[A&#39; atuin-up-search</pre><h3>Configure Tmux for Immortality</h3><p>To ensure your sessions survive unexpected reboots, we configure Tmux. First, install the Tmux Plugin Manager:</p><pre>git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm</pre><p>Then, create a ~/.tmux.conf file and add this text:</p><pre>set -g default-terminal &quot;screen-256color&quot;<br>set -g mouse on<br>set -s escape-time 0<br><br># Split panes logically<br>bind | split-window -h -c &quot;#{pane_current_path}&quot;<br>bind - split-window -v -c &quot;#{pane_current_path}&quot;<br># Enable persistence plugins<br>set -g @plugin &#39;tmux-plugins/tpm&#39;<br>set -g @plugin &#39;tmux-plugins/tmux-resurrect&#39;<br>set -g @plugin &#39;tmux-plugins/tmux-continuum&#39;<br>set -g @continuum-restore &#39;on&#39;<br>run &#39;~/.tmux/plugins/tpm/tpm&#39;</pre><p>Launch Tmux by typing tmux, then press Ctrl+b followed by I (capital i) to install the plugins.</p><h3>The Payoff</h3><p>If you followed these steps on your various machines, you now have a superpower.</p><p>When you sit down at your MacBook, Ghostty launches instantly. When you move to your Windows desktop, Windows Terminal fires up WSL2. On both machines, typing z project takes you to the exact same relative folder. Pressing the up arrow brings up your Atuin database, allowing you to pull a command you ran on your Linux server straight into your Windows environment.</p><p>By accepting that frontends must be OS-specific while standardizing your backend tools, you eliminate platform friction entirely.</p><h3>Conclusion</h3><p>This isn’t just a collection of tools; it’s an ecosystem designed for peak developer performance on macOS. By embracing modern, high-performance utilities, you’ll spend less time battling your terminal and more time focusing on what truly matters: building great software. Give it a try — your future, more productive self will thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0d1f93cd9cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/the-ultimate-terminal-stack-in-2026-a-cross-platform-guide-for-macos-linux-and-windows-c0d1f93cd9cc">The Ultimate Terminal Stack in 2026: A Cross-Platform Guide for macOS, Linux, and Windows</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving Secrets Manager DNS Resolution Errors in Terraform and Pulumi IaC]]></title>
            <link>https://medium.com/vmacwrites/resolving-ibm-secrets-manager-dns-resolution-errors-in-terraform-and-pulumi-iac-631a90d47b7c?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/631a90d47b7c</guid>
            <category><![CDATA[pulumi]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 18:30:32 GMT</pubDate>
            <atom:updated>2025-08-27T17:16:56.085Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>To understand Pulumi and its components, refer to <a href="https://dzone.com/articles/pulumi-infrastructure-as-code">this introduction</a></blockquote><p>I love <a href="https://medium.com/vmacwrites/must-have-terraform-tools-4197971f00c">Terraform</a> and as a curious explorer, I started looking for an alternative when Terraform introduced HCL2. An IaC alternative where I can use the programming language of my choice for declarative approach.</p><p>Infrastructure as Code (IaC) has revolutionized how organizations manage and provision cloud resources. By defining infrastructure through code rather than manual processes, teams can achieve consistency, version control, and automated deployment workflows. However, working with IaC tools can present unique challenges, particularly when integrating with cloud services like IBM Cloud Secrets Manager.</p><p>While creating a Pulumi project to provision Secrets Manager group instance, I came across an error</p><blockquote>CreateSecretGroupWithContext failed: Post &quot;https://0a21f2b7-e695-42e4-873f.us-south.secrets-manager.appdomain.cloud/api/v2/secret_groups&quot;: dial tcp: lookup 0a21f2b7-e695-42e4-873f.us-south.secrets-manager.appdomain.cloud: no such host</blockquote><p>halting the infrastructure provisioning entirely. This article provides a comprehensive guide to understanding, diagnosing, and resolving these DNS resolution errors while working with IBM Cloud Secrets Manager through both Terraform and Pulumi.</p><h3>Understanding Infrastructure as Code (IaC)</h3><p>Infrastructure as Code allows developers and operations teams to manage infrastructure through machine-readable definition files rather than physical hardware configuration or interactive configuration tools. This approach brings several benefits including repeatability, consistency, and the ability to version control infrastructure changes.</p><h3>Terraform vs Pulumi: A Brief Overview</h3><p>While Terraform uses HashiCorp Configuration Language (HCL) and has become the industry standard for IaC, Pulumi offers a modern alternative that allows infrastructure definition using familiar programming languages like Python, TypeScript, Go, .NET, and Java. Both tools support IBM Cloud through dedicated providers, but they differ significantly in their approach and capabilities.</p><p>Key differences include:</p><ul><li>Language Support: Terraform uses HCL exclusively, while Pulumi supports multiple general-purpose programming languages</li><li>State Management: Terraform uses local or remote state files, while Pulumi uses its SaaS backend by default</li><li>Testing Capabilities: Pulumi provides native support for unit and integration testing through programming language ecosystems</li></ul><h3>Introduction to Pulumi</h3><h3>What is Pulumi?</h3><p>Pulumi is a modern Infrastructure as Code platform that leverages existing programming languages and their native ecosystems to interact with cloud resources through the Pulumi SDK. Unlike traditional IaC tools that require learning domain-specific languages, Pulumi allows developers to use languages they already know and love.</p><h3>Key Advantages of Pulumi over Traditional IaC Tools</h3><p>Enhanced Developer Experience: Pulumi provides full IDE support with code completion, error checking, and refactoring capabilities that come naturally with general-purpose programming languages.</p><p>Advanced Testing Capabilities: Since Pulumi uses real programming languages, teams can leverage existing testing frameworks and methodologies to validate their infrastructure code.</p><p>Stronger Abstraction and Modularity: Programming language features like functions, classes, and packages enable more sophisticated infrastructure abstractions than simple configuration languages allow.</p><p>Native Integration with Application Code: Teams can embed infrastructure management directly in their applications or use the same languages for both application and infrastructure development.</p><h3>Pulumi’s Multi-Language Support</h3><p>Pulumi supports a wide range of programming languages:</p><ul><li>TypeScript/JavaScript: Native Node.js support with full npm ecosystem</li><li>Python: Full Python 3.x support with pip package management</li><li>Go: Native Go modules and tooling</li><li>.NET: Support for C#, F#, and VB.NET</li><li>Java: Full JVM ecosystem support</li><li>YAML: For simpler, declarative scenarios</li></ul><h3>Setting Up IBM Cloud with Pulumi</h3><h4>Installing the IBM Cloud Provider for Pulumi</h4><p>To work with IBM Cloud resources in Pulumi, you need to install the IBM Cloud provider. The IBM Cloud provider for Pulumi must be installed as a local package:</p><pre>pulumi package add terraform-provider ibm-cloud/ibm</pre><h3>Understanding the Service Endpoint Configuration Error</h3><p>Though I am exploring Pulumi, the IBM Pulumi provider is based on Terraform provider. So, I took a step back to see if the Terraform provider works but I hit the same error. While digging deeper, I found this <a href="https://github.com/IBM-Cloud/terraform-provider-ibm/issues/6273">GitHub issue</a> that clarifies many questions</p><h3>Error Analysis from GitHub Issue</h3><p>The specific issue documented in GitHub issue reveals a fundamental misconfiguration problem. When users specify service_endpoints = &quot;public-and-private&quot; in their Terraform configuration for IBM Secrets Manager, the resulting instance is provisioned with only private endpoints, despite the configuration suggesting otherwise.</p><p><strong>Root Cause Identification:</strong><br>The issue stems from IBM’s April 2025 change to make private endpoints the default for Secrets Manager instances. However, the critical distinction is that Secrets Manager uses a different parameter structure than other IBM Cloud services for endpoint configuration.</p><p>Configuration Inconsistency:</p><ul><li>Standard IBM Services: Use service_endpoints parameter</li><li>Secrets Manager: Uses allowed_network within the parameters block</li></ul><h3>Analyzing the Incorrect Configuration</h3><p>The problematic Terraform configuration from the GitHub issue:</p><pre>resource &quot;ibm_resource_instance&quot; &quot;secrets_manager&quot; {<br>  count                = var.provision_sm_instance == true ? 1 : 0<br>  name                 = var.sm_instance_name<br>  service             = &quot;secrets-manager&quot;<br>  plan                = var.sm_service_plan<br>  location            = var.region<br>  resource_group_id   = data.ibm_resource_group.sm_instance.id<br>  tags                = var.tags<br>  service_endpoints   = &quot;public-and-private&quot;  # ← This is INCORRECT for Secrets Manager<br>  <br>  timeouts {<br>    create = &quot;20m&quot;<br>  }<br>}</pre><p><strong>Pulumi implementation</strong></p><pre>secrets_manager = ibm.ResourceInstance(<br>    &quot;vpn-secrets-manager&quot;,<br>    name=&quot;vpn-secrets-manager&quot;,<br>    service=&quot;secrets-manager&quot;,<br>    plan=&quot;standard&quot;,<br>    location=region,<br>    resource_group_id=resource_group_id,<br>    service_endpoints=&quot;public-and-private&quot;, <br>    tags=[&quot;vpn&quot;, &quot;certificates&quot;, &quot;pulumi&quot;],<br>    opts=secrets_manager_opts<br>)</pre><p><strong>Result</strong>: Despite specifying service_endpoints = &quot;public-and-private&quot;, the instance is provisioned with only private endpoints, leading to DNS resolution failures when attempting to create secret groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GRmaHdrmcz30Uvj8ZEwROQ.png" /><figcaption>Pulumi error</figcaption></figure><h3>The Correct Configuration Approach</h3><p>Based on IBM’s documentation and the GitHub issue resolution, the correct approach uses the parameters block:</p><pre>resource &quot;ibm_resource_instance&quot; &quot;secrets_manager&quot; {<br>  count             = var.provision_sm_instance == true ? 1 : 0<br>  name              = var.sm_instance_name  <br>  service           = &quot;secrets-manager&quot;<br>  plan              = var.sm_service_plan<br>  location          = var.region<br>  resource_group_id = data.ibm_resource_group.sm_instance.id<br>  tags              = var.tags<br>  <br>  parameters = {<br>    &quot;allowed_network&quot; = &quot;public-and-private&quot;  # ← This is CORRECT for Secrets Manager<br>  }<br>  <br>  timeouts {<br>    create = &quot;20m&quot;<br>  }<br>}</pre><p>Pulumi code fix:</p><p><a href="https://github.com/VidyasagarMSC/pulumi/blob/57c6600dae9a3fc7048a59da3779200138a22170/__main__.py#L301C1-L314C1">pulumi/__main__.py at 57c6600dae9a3fc7048a59da3779200138a22170 · VidyasagarMSC/pulumi</a></p><pre>secrets_manager = ibm.ResourceInstance(<br>    &quot;vpn-secrets-manager&quot;,<br>    name=&quot;vpn-secrets-manager&quot;,<br>    service=&quot;secrets-manager&quot;,<br>    plan=&quot;standard&quot;,<br>    location=region,<br>    resource_group_id=resource_group_id,<br>    #service_endpoints=secrets_manager_service_endpoints,<br>    parameters={<br>        &quot;allowed_network&quot; : secrets_manager_service_endpoints,    <br>    },<br>    tags=[&quot;vpn&quot;, &quot;certificates&quot;, &quot;pulumi&quot;],<br>    opts=secrets_manager_opts<br>)</pre><blockquote>For complete Pulumi code examples, refer to my <a href="https://github.com/VidyasagarMSC/pulumi">GitHub repository</a></blockquote><h3>Conclusion</h3><p>The IBM Secrets Manager DNS resolution error stems from a critical configuration difference where Secrets Manager requires parameters = { &quot;allowed_network&quot; = &quot;...&quot; } instead of the standard service_endpoints parameter.</p><p><strong>Key Solutions:</strong></p><ul><li>Always use allowed_network within the parameters block for Secrets Manager</li><li>Implement validation to catch configuration errors early</li><li>Use infrastructure modules to encapsulate correct patterns</li><li>Test endpoint accessibility after provisioning</li></ul><p>Pulumi Advantages: Offers superior error handling, testing capabilities, and IDE support compared to traditional HCL-based approaches, making it easier to implement robust validation and error handling patterns.</p><p>By following these patterns and understanding the service-specific requirements, teams can avoid DNS resolution errors and build reliable infrastructure automation workflows for IBM Secrets Manager.</p><h3>Related Documentation</h3><ul><li><a href="https://cloud.ibm.com/docs/secrets-manager">IBM Cloud Secrets Manager</a></li><li><a href="https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-overview">IBM Cloud VPC VPN</a></li><li><a href="https://www.pulumi.com/registry/packages/ibm/">Pulumi IBM Cloud Provider</a></li><li><a href="https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-about-certificate-manager">Certificate Management Best Practices</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=631a90d47b7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/resolving-ibm-secrets-manager-dns-resolution-errors-in-terraform-and-pulumi-iac-631a90d47b7c">Resolving Secrets Manager DNS Resolution Errors in Terraform and Pulumi IaC</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Essential Role of Process Monitoring Scripts in Linux Environments]]></title>
            <link>https://medium.com/vmacwrites/the-essential-role-of-process-monitoring-scripts-in-linux-environments-50d6a241f924?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/50d6a241f924</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Mon, 12 May 2025 15:23:32 GMT</pubDate>
            <atom:updated>2025-05-12T15:26:58.680Z</atom:updated>
            <content:encoded><![CDATA[<h3>In today’s complex computing environments, keeping tabs on running processes isn’t just good practice — it’s absolutely critical. Whether you’re managing a fleet of Linux servers, maintaining development workstations, or overseeing macOS production systems, understanding what’s running (and what <em>should</em> be running) forms the foundation of system health, security, and performance.</h3><p>This comprehensive guide introduces a powerful yet lightweight Bash script that delivers cross-platform process monitoring with enterprise-grade capabilities. We’ll explore:</p><ul><li>The diverse landscape of Linux distributions and their monitoring needs</li><li>How this script solves real-world administration challenges</li><li>Detailed usage examples for various scenarios</li><li>Advanced integration techniques for professional environments</li></ul><h3>Understanding the Linux Distribution Landscape</h3><h3>1. Enterprise-Grade Workhorses</h3><p>Red Hat Enterprise Linux (RHEL), Ubuntu LTS, and SUSE Linux Enterprise dominate mission-critical environments. These distributions prioritize:</p><ul><li><strong>Stability</strong> over cutting-edge features</li><li><strong>Long-term support</strong> (5+ years typically)</li><li><strong>Certified compatibility</strong> with enterprise hardware/software</li></ul><p><em>Monitoring Consideration:</em> These systems often run business-critical services where unexpected process termination can cost thousands per minute of downtime.</p><h3>2. Rolling Release Distributions</h3><p>Arch Linux, openSUSE Tumbleweed, and Gentoo appeal to developers and enthusiasts with:</p><ul><li><strong>Continuous updates</strong> to the latest software versions</li><li><strong>Minimal default installations</strong></li><li><strong>Customization-focused</strong> philosophies</li></ul><p><em>Monitoring Consideration:</em> Frequent updates increase the chance of service disruptions, making automated monitoring particularly valuable.</p><h3>3. Specialized and Lightweight Systems</h3><p>From Alpine Linux’s container-optimized 5MB footprint to Kali’s security toolkit, these distributions serve niche purposes:</p><ul><li><strong>Embedded systems</strong> (Raspberry Pi OS)</li><li><strong>Security auditing</strong> (Kali, Parrot OS)</li><li><strong>Edge computing</strong> (Fedora IoT)</li></ul><p><em>Monitoring Consideration:</em> Resource constraints demand ultra-efficient monitoring tools that don’t contribute to system load.</p><h3>Introducing the Universal Process Monitor</h3><p>Our solution addresses these diverse needs through intelligent design:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/073cba454346b72b7006ead269b1a12d/href">https://medium.com/media/073cba454346b72b7006ead269b1a12d/href</a></iframe><h3>Key Features</h3><ol><li><strong>Dual-Platform Support</strong></li></ol><ul><li>Automatically detects and adapts to Linux or macOS environments</li><li>Handles differences in command syntax between systems</li></ul><p><strong>2. Flexible Output Options</strong></p><ul><li>Color-coded terminal output (default)</li><li>JSON format for programmatic use (--json flag)</li><li>Log file support (--log-file option)</li></ul><p><strong>3. Intelligent Process Detection</strong></p><ul><li>Uses pgrep for reliable process matching</li><li>Excludes the monitoring script itself from results</li><li>Normalizes output across different platforms</li></ul><p><strong>4. Lightweight Operation</strong></p><ul><li>Minimal dependencies (only basic Unix tools)</li><li>Fast execution with low resource usage</li></ul><h3><strong>Usage Examples</strong></h3><ul><li><strong>Basic Process Check</strong></li></ul><pre>./process_monitor.sh nginx mysql docker</pre><p><strong>Sample Output:</strong></p><pre>PROCESS CHECK - Ubuntu 22.04 LTS<br>TIME: 2023-07-15 14:30:45<br><br>nginx                     RUNNING       1234 www-data /usr/sbin/nginx -g daemon off;<br>mysql                     RUNNING       5678 mysql /usr/sbin/mysqld<br>docker                    NOT RUNNING   No matching process found</pre><p>On macOS,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u0Ta-A6RoTxA5nbI2NZk9g.png" /><figcaption>Process monitor running on macOS checking for the processes</figcaption></figure><ul><li><strong>JSON Output Mode</strong></li></ul><pre>./process_monitor.sh --json nginx docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvKo-xshs-4TQS4tdbRBvw.png" /><figcaption>JSON output using the json flag</figcaption></figure><p><strong>Sample Output:</strong></p><pre>{<br>    &quot;hostname&quot;: &quot;web-server&quot;,<br>    &quot;timestamp&quot;: &quot;2023-07-15 14:30:45&quot;,<br>    &quot;os&quot;: &quot;Ubuntu 22.04 LTS&quot;,<br>    &quot;processes&quot;: [<br>        {<br>            &quot;process&quot;: &quot;nginx&quot;,<br>            &quot;status&quot;: &quot;RUNNING&quot;,<br>            &quot;pid&quot;: &quot;1234&quot;,<br>            &quot;user&quot;: &quot;www-data&quot;,<br>            &quot;command&quot;: &quot;/usr/sbin/nginx -g daemon off;&quot;<br>        },<br>        {<br>            &quot;process&quot;: &quot;docker&quot;,<br>            &quot;status&quot;: &quot;NOT RUNNING&quot;,<br>            &quot;pid&quot;: null,<br>            &quot;user&quot;: null,<br>            &quot;command&quot;: null<br>        }<br>    ]<br>}</pre><ul><li><strong>Logging to File</strong></li></ul><pre>./process_monitor.sh --log-file &quot;/var/log/process_monitor.log&quot; redis postgres</pre><h3><strong>Integration Possibilities</strong></h3><ol><li><strong>System Monitoring</strong></li></ol><ul><li>Schedule regular checks with cron</li><li>Parse JSON output with monitoring tools</li></ul><p><strong>2. CI/CD Pipelines</strong></p><ul><li>Verify service status before deployments</li><li>Check for conflicting processes</li></ul><p><strong>3. Troubleshooting</strong></p><ul><li>Quick verification of running services</li><li>Check process dependencies</li></ul><h3><strong>Performance Characteristics</strong></h3><ul><li>Typically completes in under 100ms for basic checks</li><li>Minimal CPU and memory usage</li><li>Efficient process detection without spawning unnecessary subshells</li><li>The script is production-ready and can be immediately deployed in any Linux or macOS environment. Future enhancements could include Windows Subsystem for Linux (WSL) support or additional filtering options.</li></ul><h3><strong>Installation:</strong></h3><pre>chmod +x process_monitor.sh <br>./process_monitor.sh --help</pre><h3>Real-World Implementation Scenarios</h3><h3>1. Proactive Service Health Monitoring</h3><p><strong>Problem:</strong> Web servers occasionally crash without alerting</p><p><strong>Solution:</strong></p><pre># Cron job checking every 2 minutes<br>*/2 * * * * /usr/local/bin/monitor.sh --silent nginx || systemctl restart nginx</pre><p><strong>Outcome:</strong> Automatic recovery with failure timestamps in logs</p><h3>2. Security Baseline Enforcement</h3><p><strong>Problem:</strong> Need to detect unauthorized processes</p><p><strong>Solution:</strong></p><pre># Daily diff against approved list<br>diff &lt;(./monitor.sh --json | jq .) &lt;(jq . /etc/approved-processes.json)</pre><p><strong>Outcome:</strong> Immediate visibility into any unexpected processes</p><h3>3. Containerized Environment Monitoring</h3><p><strong>Problem:</strong> Process visibility inside Kubernetes pods</p><p><strong>Solution:</strong></p><pre># Kubectl integration example<br>kubectl exec -it pod-name -- /monitor.sh --json</pre><p><strong>Outcome:</strong> Consistent monitoring across container boundaries</p><h3>Advanced Integration Patterns</h3><h4>1. Prometheus/Grafana Dashboarding</h4><pre># Metrics endpoint creation<br>echo &quot;# HELP process_up Process status&quot; &gt; /var/lib/node_exporter/process.prom<br>echo &quot;# TYPE process_up gauge&quot; &gt;&gt; /var/lib/node_exporter/process.prom<br>./monitor.sh --json | jq -r &#39;.processes[] | &quot;process_up{process=\&quot;\(.process)\&quot;} \(.status == &quot;RUNNING&quot; ? 1 : 0)&quot;&#39; &gt;&gt; /var/lib/node_exporter/process.prom</pre><p><em>Result:</em> Beautiful dashboards showing service status across your entire fleet</p><h4>2. Centralized Log Analysis</h4><pre># Syslog integration example<br>./monitor.sh | logger -p local0.notice -t process-monitor</pre><p><em>Result:</em> Correlation of process events with other system logs in SIEM tools</p><h4>3. CI/CD Pipeline Gates</h4><pre># GitLab CI example<br>verify_services:<br>  script:<br>    - if ! ./monitor.sh --json postgresql | grep -q &quot;RUNNING&quot;; then exit 1; fi</pre><p><em>Result:</em> Failed deployments when dependent services aren’t available</p><h3>Conclusion: Building a Monitoring Culture</h3><p>Implementing this script represents more than just technical deployment — it’s about cultivating observability best practices:</p><ol><li><strong>Start Small</strong> Begin with critical services before expanding coverage</li><li><strong>Establish Baselines</strong></li></ol><pre>./monitor.sh --json &gt; /etc/process-baseline-$(date +%F).json</pre><p><strong>3. Iterate and Expand</strong> Add checks gradually as you identify new requirements</p><p><strong>4. Document Expectations</strong> Maintain a living document of what <em>should</em> be running</p><p>This approach gives you a professional-grade monitoring foundation that scales from single servers to enterprise environments while remaining lightweight and adaptable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50d6a241f924" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/the-essential-role-of-process-monitoring-scripts-in-linux-environments-50d6a241f924">The Essential Role of Process Monitoring Scripts in Linux Environments</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[S3cmd: CLI for Object Storage]]></title>
            <link>https://medium.com/vmacwrites/s3cmd-cli-for-object-storage-87a02e4b300b?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/87a02e4b300b</guid>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[object-storage]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 16:32:05 GMT</pubDate>
            <atom:updated>2025-03-05T16:32:05.491Z</atom:updated>
            <content:encoded><![CDATA[<p>In the recent times, I am exploring and playing with <a href="https://dzone.com/articles/top-tools-object-storage-data-management">Top Tools for Object Storage and Data Management</a>. In this journey, one of the tools that I was introduced to was s3cmd.</p><h3>What is s3cmd?</h3><p>S3cmd is a powerful open-source command-line tool designed for managing Amazon S3 and S3-compatible object storage services like IBM Cloud Object Storage. It provides a user-friendly interface for performing various operations on S3 buckets and objects, including creating and removing buckets, uploading, downloading, and deleting files.</p><h3>Key features of s3cmd include:</h3><p>1. Bucket management: Create, list, and delete buckets.<br>2. Object operations: Upload, download, and delete files within buckets.<br>3. Synchronization: Sync local directories with S3 buckets.<br>4. Access control: Modify bucket policies and access control lists.<br>5. Website hosting: Create and manage static websites hosted on S3.<br>6. Multipart uploads: Handle large file uploads efficiently.<br>7. Encryption: Support for server-side encryption.</p><p>S3cmd is compatible with Python 2.6 or newer, including Python 3.x, and runs on Linux and macOS systems. Its versatility and ease of use make it an excellent choice for both beginners and advanced users who need to interact with S3-compatible storage services.</p><p>This tool simplifies the process of managing cloud storage, allowing users to automate tasks, integrate S3 operations into scripts, and efficiently handle large amounts of data. Whether you’re a developer, system administrator, or data analyst, s3cmd can streamline your workflow when working with S3 and similar object storage platforms.</p><h3>s3cmd installation and configuration</h3><ol><li>Install S3cmd following the<a href="https://github.com/s3tools/s3cmd/blob/master/INSTALL.md"> instructions here</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFAYZTr0irO5bUZFxy0MAw.png" /><figcaption>s3cmd command on warp</figcaption></figure><p>2. To configure, you need to have an S3 cloud instance or any S3 compatible instance with HMAC credentials — Accesskey and Secrets key and endpoint that starts with or similar to <strong>s3://…</strong></p><blockquote>To understand what are HMAC credentials, refer to <a href="https://dzone.com/articles/guide-to-iam-in-object-storage">my article here</a></blockquote><p>3. Once you have the HMAC credentials and endpoint, you can run the following command for an interactive configuration.</p><pre>s3cmd --configure</pre><h3>Key commands</h3><p>Here are some commonly used s3cmd commands:</p><ol><li>Create a bucket:</li></ol><pre>s3cmd mb s3://bucket-name</pre><p>2. List all buckets:</p><pre>s3cmd ls</pre><p>3. Upload a file to a bucket:</p><pre>s3cmd put file.txt s3://bucket-name/</pre><p>4. Download a file from a bucket:</p><pre>s3cmd get s3://bucket-name/file.txt</pre><p>5. Delete a file from a bucket:</p><pre>s3cmd rm s3://bucket-name/file.txt</pre><p>6. List objects in a specific bucket:</p><pre>s3cmd ls s3://bucket-name/</pre><p>7. Synchronize a local directory with a bucket:</p><pre>s3cmd sync local_directory/ s3://bucket-name/</pre><p>8. Set public access for a file:</p><pre>s3cmd setacl s3://bucket-name/file.txt --acl-public</pre><p>9. Delete a bucket:</p><pre>s3cmd rb s3://bucket-name</pre><p>These commands allow you to perform basic operations like creating and deleting buckets, uploading and downloading files, and managing access permissions. S3cmd offers many more advanced features for managing your S3-compatible storage, making it a powerful tool for both simple and complex storage management tasks.</p><h3>403 error resolution</h3><p>The most common error is 403 — Access denied. Which you may think is because of the AccessKeyID or the Secrets key you provided. But actually this is a generic error.</p><p>&gt; ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.</p><p>One of the many reasons for this error is this configuration parameter that you either forgot to set or wrongly configured</p><blockquote>Use “%(bucket)s.s3.amazonaws.com” to the target Amazon S3. “%(bucket)s” and “%(location)s” vars can be used<br>if the target S3 system supports dns based buckets.<br>DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]:</blockquote><p>The right way to configure this parameter is</p><pre>%(bucket)s.&lt;END_POINT&gt;<br><br>For example:<br>%(bucket)s.s3.eu-de.cloud-object-storage.appdomain.cloud</pre><p>Once the right of credentials, endpoint &amp; the DNS-style is setup, you won’t see the 403 (InvalidAccesskeyId) error.</p><p>If this article is helpful. please clap 👏 and ♻️ share with your network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a02e4b300b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/s3cmd-cli-for-object-storage-87a02e4b300b">S3cmd: CLI for Object Storage</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to SymPy: A Python Library for Symbolic Mathematics]]></title>
            <link>https://medium.com/vmacwrites/an-introduction-to-sympy-a-python-library-for-symbolic-mathematics-ad13e70d5591?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/ad13e70d5591</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 20:57:45 GMT</pubDate>
            <atom:updated>2025-01-06T20:57:45.346Z</atom:updated>
            <content:encoded><![CDATA[<h3>SymPy is an open-source Python library for symbolic mathematics.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYafVsDzuh5YhxzcpMEnrw.png" /><figcaption>SymPy — Mathematics Python Library</figcaption></figure><p><strong>SymPy </strong>aims to become a full-featured computer algebra system (CAS) while keeping the code simple, extensible, and free of external dependencies. With SymPy, you can perform algebraic manipulations, calculus operations, linear algebra, equation solving, discrete mathematics, and much more, all symbolically, rather than numerically.</p><p>In this article, we will explore the SymPy library, its capabilities, and some practical examples that demonstrate how it can be used effectively for symbolic computation.</p><h3>What is SymPy?</h3><p>At its core, SymPy provides functions for performing symbolic calculations, which means it works with mathematical expressions in their exact form, rather than approximating values as floating-point numbers. SymPy leverages Python’s object-oriented nature to represent mathematical objects, such as variables, functions, and matrices, as Python objects.</p><p>SymPy is built in pure Python and does not require any external libraries or software packages. This makes it easy to install and use, and it’s suitable for applications in scientific computing, education, engineering, and mathematics.</p><h3>Key Features of SymPy</h3><ul><li><strong>Symbolic computation</strong>: Perform algebraic operations like simplification, expansion, and factorization on symbolic expressions.</li><li><strong>Calculus</strong>: Compute derivatives, integrals, limits, series expansions, and solve differential equations symbolically.</li><li><strong>Linear algebra</strong>: Manipulate matrices, solve linear systems, and compute determinants, eigenvalues, and eigenvectors.</li><li><strong>Equation solving</strong>: Solve algebraic equations (linear, polynomial, non-linear) symbolically.</li><li><strong>Plotting</strong>: Generate plots of functions and equations, both symbolic and numerical.</li></ul><h3>Installing SymPy</h3><p>To install SymPy, you can use pip:</p><pre>pip install sympy</pre><p>After installation, you can import the library into your Python script:</p><pre>import sympy as sp</pre><h3>Basic Usage of SymPy</h3><p>Let’s start by using SymPy to define symbolic variables and perform some basic algebraic manipulations.</p><h3>Defining Symbolic Variables</h3><p>You can define symbolic variables using the symbols function. For example:</p><pre>import sympy as sp<br><br># Define symbols<br>x, y, z = sp.symbols(&#39;x y z&#39;)<br><br># Display the symbols<br>print(x, y, z)</pre><h3>Simple Algebraic Operations</h3><p>Once you’ve defined symbolic variables, you can perform various algebraic operations such as addition, multiplication, and exponentiation.</p><pre># Define an expression<br>expr = x**2 + 2*x + 1<br><br># Simplify the expression<br>simplified_expr = sp.simplify(expr)<br>print(&quot;Simplified expression:&quot;, simplified_expr)<br><br># Expand a binomial<br>expanded_expr = sp.expand((x + 1)**2)<br>print(&quot;Expanded expression:&quot;, expanded_expr)<br><br># Factor an expression<br>factored_expr = sp.factor(x**2 + 2*x + 1)<br>print(&quot;Factored expression:&quot;, factored_expr)</pre><h3>Simplification and Expansion</h3><p>SymPy has built-in functions for simplifying and expanding expressions:</p><pre># Simplify the expression x**2 - 2*x + 1 - (x - 1)**2<br>expr_to_simplify = x**2 - 2*x + 1 - (x - 1)**2<br>simplified = sp.simplify(expr_to_simplify)<br>print(&quot;Simplified expression:&quot;, simplified)</pre><h3>Solving Equations</h3><p>SymPy makes it easy to solve equations symbolically. Here’s how to solve a linear equation:</p><pre># Solve x + 3 = 7<br>solution = sp.solve(x + 3 - 7, x)<br>print(&quot;Solution:&quot;, solution)</pre><p>For solving quadratic equations, SymPy will return all possible roots:</p><pre># Solve a quadratic equation<br>quadratic_solution = sp.solve(x**2 - 5*x + 6, x)<br>print(&quot;Quadratic solution:&quot;, quadratic_solution)</pre><h3>Calculus Operations</h3><p>SymPy excels in symbolic calculus. Let’s look at some common operations, such as differentiation and integration.</p><h4>Differentiation</h4><p>To compute the derivative of an expression:</p><pre># Derivative of x**3 + 2*x**2 + x with respect to x<br>derivative = sp.diff(x**3 + 2*x**2 + x, x)<br>print(&quot;Derivative:&quot;, derivative)</pre><h4>Integration</h4><p>To compute the integral of an expression:</p><pre># Integral of x**2 with respect to x<br>integral = sp.integrate(x**2, x)<br>print(&quot;Integral:&quot;, integral)</pre><h4>Limits</h4><p>You can also compute limits of expressions:</p><pre># Limit of (sin(x)/x) as x approaches 0<br>limit = sp.limit(sp.sin(x)/x, x, 0)<br>print(&quot;Limit:&quot;, limit)</pre><h4>Series Expansion</h4><p>SymPy allows you to expand an expression as a series around a given point:</p><pre># Series expansion of exp(x) around x = 0<br>series_expansion = sp.series(sp.exp(x), x, 0, 5)<br>print(&quot;Series expansion:&quot;, series_expansion)</pre><h3>Solving Differential Equations</h3><p>SymPy also provides tools for solving ordinary differential equations (ODEs) symbolically.</p><pre># Solve the differential equation y&#39;&#39; - 2*y&#39; + y = 0<br>y = sp.Function(&#39;y&#39;)<br>ode_solution = sp.dsolve(y(x).diff(x, x) - 2*y(x).diff(x) + y(x), y(x))<br>print(&quot;Differential equation solution:&quot;, ode_solution)</pre><h3>Linear Algebra with SymPy</h3><p>SymPy has robust support for linear algebra operations. Let’s see how to perform matrix operations and solve linear systems.</p><h4>Matrix Operations</h4><pre># Define matrices<br>A = sp.Matrix([[1, 2], [3, 4]])<br>B = sp.Matrix([[5, 6], [7, 8]])<br><br># Matrix addition<br>C = A + B<br>print(&quot;Matrix addition:\n&quot;, C)<br><br># Matrix multiplication<br>D = A * B<br>print(&quot;Matrix multiplication:\n&quot;, D)<br><br># Determinant of a matrix<br>det_A = A.det()<br>print(&quot;Determinant of A:&quot;, det_A)<br><br># Eigenvalues and eigenvectors<br>eigen = A.eigenvals(), A.eigenvects()<br>print(&quot;Eigenvalues and eigenvectors:&quot;, eigen)</pre><h4>Solving a Linear System</h4><p>You can solve systems of linear equations symbolically using the linsolve function.</p><pre># Solve the system of equations: x + y = 2, x - y = 0<br>system = [x + y - 2, x - y]<br>solution = sp.linsolve(system, x, y)<br>print(&quot;Solution to the system:&quot;, solution)</pre><h3>Plotting with SymPy</h3><p>SymPy includes basic plotting capabilities for visualizing symbolic expressions. You can use the plot function for this purpose:</p><pre>from sympy.plotting import plot<br><br># Plot the function sin(x)<br>plot(sp.sin(x))</pre><h3>Advanced Features of SymPy</h3><p>SymPy has many more advanced features such as:</p><ol><li><strong>Mathematical functions</strong>: Special functions like gamma, Bessel, and error functions.</li><li><strong>Solving Diophantine equations</strong>: SymPy can handle integer solutions for certain equations.</li><li><strong>SymPy physics module</strong>: For symbolic calculations in physics, including mechanics, optics, and quantum mechanics.</li><li><strong>Symbolic Fourier transforms</strong>: Useful for signal processing and other applications.</li><li><strong>Code generation</strong>: Generate Python, C, Fortran, or other language code for symbolic expressions.</li></ol><h3>Applications in Various Fields</h3><p>SymPy finds applications in numerous domains:</p><ol><li><strong>Physics</strong>: Quantum mechanics calculations and equation derivations</li><li><strong>Engineering</strong>: Solving complex mathematical models</li><li><strong>Computer Science</strong>: Algorithm analysis and optimization</li><li><strong>Finance</strong>: Option pricing and risk analysis</li></ol><h3>Code Generation</h3><p>One of SymPy’s powerful features is its ability to generate code in various programming languages:</p><pre>from sympy.utilities.codegen import codegen <br>expr = x**2 + sin(x) [(c_name, c_code), (h_name, c_header)] = codegen((&#39;f&#39;, expr), &#39;C&#39;, &#39;file&#39;, header=False, empty=False) <br>print(c_code)</pre><p>This feature allows users to convert symbolic expressions into efficient, executable code for numerical computation.</p><blockquote>The Jupyter Notebook with the outputs is available on the <a href="https://github.com/VidyasagarMSC/PyDataFlowNote/tree/main">GitHub repository</a>. You can run the Jupyter Notebook on Colab following the instructions on the GitHub repository.</blockquote><h3>Conclusion</h3><p>SymPy is a powerful tool for symbolic mathematics in Python. It can simplify complex expressions, solve equations, perform calculus operations, and handle linear algebra tasks symbolically. Whether you are a researcher, educator, engineer, or student, SymPy provides an easy-to-use yet powerful framework for performing a wide variety of symbolic computations.</p><p>With its simple installation process, ease of use, and extensive capabilities, SymPy has become a popular choice in the Python ecosystem for symbolic mathematics. By using the examples in this article as a starting point, you can begin to explore the full range of features SymPy has to offer.</p><p><em>Originally published at </em><a href="https://vmacwrites.substack.com/p/an-introduction-to-sympy-a-python"><em>https://vmacwrites.substack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad13e70d5591" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/an-introduction-to-sympy-a-python-library-for-symbolic-mathematics-ad13e70d5591">An Introduction to SymPy: A Python Library for Symbolic Mathematics</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pandas: Conversion using loc and iloc]]></title>
            <link>https://medium.com/vmacwrites/pandas-conversion-using-loc-and-iloc-d89d16010b49?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/d89d16010b49</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 22:00:40 GMT</pubDate>
            <atom:updated>2025-01-01T22:00:39.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pandas is a powerful Python library used for data manipulation and analysis.</h3><p>Created by Wes McKinney in 2008, it provides data structures and functions for working with structured data efficiently. Pandas allows users to analyze big data, clean messy datasets, and derive meaningful insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-tneCIMuJinqy0su" /><figcaption>Photo by <a href="https://unsplash.com/@kvncnls?utm_source=medium&amp;utm_medium=referral">Kevin Canlas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Key Features of Pandas</h3><ol><li>Data Structures: Pandas introduces two primary data structures:</li></ol><ul><li>Series: A one-dimensional labeled array</li><li>DataFrame: A two-dimensional labeled data structure with columns of potentially different types</li></ul><p>2. Data Manipulation: Pandas offers functions for analyzing, cleaning, exploring, and manipulating data.</p><p>3. Data Analysis: It enables users to perform complex operations like correlation analysis, grouping, and statistical calculations.</p><p>4. Data Visualization: Pandas integrates well with other libraries to create insightful visualizations.</p><h3>Practical Examples</h3><h3>Indexing with loc</h3><p>The loc function enables label-based indexing in DataFrames, allowing precise data selection:</p><pre>import pandas as pd<br><br># Create a sample DataFrame<br>df = pd.DataFrame({&#39;A&#39;: [1, 2, 3], &#39;B&#39;: [4, 5, 6], &#39;C&#39;: [7, 8, 9]}, index=[&#39;x&#39;, &#39;y&#39;, &#39;z&#39;])<br><br># Select rows with label &#39;y&#39; and &#39;z&#39;, and columns &#39;A&#39; and &#39;C&#39;<br>result = df.loc[[&#39;y&#39;, &#39;z&#39;], [&#39;A&#39;, &#39;C&#39;]]<br>print(result)</pre><p>The iloc function provides integer-based indexing for DataFrame selection:</p><pre>import pandas as pd<br><br># Create a sample DataFrame<br>df = pd.DataFrame({&#39;A&#39;: [1, 2, 3], &#39;B&#39;: [4, 5, 6], &#39;C&#39;: [7, 8, 9]})<br><br># Select rows 0 and 2, and columns 1 and 2<br>result = df.iloc[[0, 2], [1, 2]]<br>print(result)</pre><h3>Date Conversion with to_datetime</h3><p>The to_datetimefunction transforms various date formats into standardized datetime objects:</p><pre>import pandas as pd<br><br># Convert string to datetime<br>date_string = &quot;2023-09-17 14:30:00&quot;<br>dt_object = pd.to_datetime(date_string)<br>print(dt_object)<br><br># Convert multiple date strings<br>date_series = pd.Series([&#39;20200101&#39;, &#39;20200201&#39;, &#39;20200301&#39;])<br>dt_series = pd.to_datetime(date_series, format=&#39;%Y%m%d&#39;)<br>print(dt_series)</pre><p>Output:</p><pre>2023-09-17 14:30:00<br>0   2020-01-01<br>1   2020-02-01<br>2   2020-03-01<br>dtype: datetime64[ns]</pre><p>Pandas simplifies data manipulation tasks, making it an essential tool for data scientists and analysts. Its versatile functions like loc, iloc, and to_datetime provide powerful ways to interact with and transform data, enabling efficient data processing and analysis in Python.</p><h3>Something to consider while using loc or iloc</h3><p>Let’s convert the object column date to datetime using loc</p><pre>import pandas as pd<br><br>df = pd.DataFrame({&#39;date&#39;: [&#39;2023-01-01&#39;, &#39;2023-02-15&#39;, &#39;2023-03-31&#39;]})<br><br>df.loc[:, &#39;date&#39;] = pd.to_datetime(df.loc[:, &#39;date&#39;])<br><br>print(df)<br>print(df.dtypes)</pre><pre>Output: <br><br>   date<br>0  2023-01-01 00:00:00<br>1  2023-02-15 00:00:00<br>2  2023-03-31 00:00:00<br>date    object<br>dtype: object</pre><p>If you observe, the dtype is object not <strong><em>datetime64[ns]</em></strong>. If you try to extract the date using df[&#39;date&#39;].dt.date</p><p>You will see an error as the conversion was not successful.</p><pre>Traceback (most recent call last):<br>  File &quot;/HelloWorld.py&quot;, line 11, in &lt;module&gt;<br>    print(df.dt.date)<br>          ^^^^^<br>  File &quot;/usr/local/lib/python3.12/dist-packages/pandas/core/generic.py&quot;, line 6299, in __getattr__<br>    return object.__getattribute__(self, name)<br>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>AttributeError: &#39;DataFrame&#39; object has no attribute &#39;dt&#39;. Did you mean: &#39;at&#39;?</pre><p>The reason lies in the changes made in version 2.x.x of Pandas.</p><p>From <a href="https://pandas.pydata.org/docs/dev/whatsnew/v2.0.0.html#removal-of-prior-version-deprecations-changes">What’s new in 2.0.0 (April 3, 2023)</a>:</p><blockquote><em>Changed behavior in setting values with </em><em>df.loc[:, foo] = bar or </em><em>df.iloc[:, foo] = bar, these now always attempt to set values inplace before falling back to casting (</em><a href="https://github.com/pandas-dev/pandas/issues/45333"><em>GH 45333</em></a><em>)</em></blockquote><h3>How to overcome:</h3><p>The best way to address this issue is to either avoid using loc or iloc or as suggested on the <a href="https://pandas.pydata.org/docs/whatsnew/v1.5.0.html#inplace-operation-when-setting-values-with-loc-and-iloc">Pandas documentation</a> use <strong>DataFrame.__setitem__()</strong></p><pre>df = pd.DataFrame({&#39;date&#39;: [&#39;2023-01-01&#39;, &#39;2023-02-15&#39;, &#39;2023-03-31&#39;]})<br><br>df[&#39;date&#39;] = pd.to_datetime(df.loc[:, &#39;date&#39;])<br><br>print(df)<br>print(df.dtypes)<br><br>print(df[&#39;date&#39;].dt.date)</pre><h3>Additional read:</h3><p><a href="https://stackoverflow.com/questions/76766136/pandas-pd-to-datetime-assigns-object-dtype-instead-of-datetime64ns">https://stackoverflow.com/questions/76766136/pandas-pd-to-datetime-assigns-object-dtype-instead-of-datetime64ns</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d89d16010b49" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/pandas-conversion-using-loc-and-iloc-d89d16010b49">Pandas: Conversion using loc and iloc</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nvidia MIG with GPU Optimization in Kubernetes]]></title>
            <link>https://medium.com/vmacwrites/nvidia-mig-with-gpu-optimization-in-kubernetes-09a321b78993?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/09a321b78993</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 17:21:08 GMT</pubDate>
            <atom:updated>2024-12-07T17:20:55.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>Multi-Instance GPU (MIG) is a technology that allows partitioning of a single GPU into multiple smaller, isolated GPU instances. This feature enables better GPU utilization, especially for workloads that don’t fully saturate the GPU’s compute capacity.</h3><p>NVIDIA MIG (Multi-Instance GPU) is a technology introduced by NVIDIA to partition their GPUs (particularly the A100 and A30 models) into smaller, isolated instances. This allows multiple workloads or containers to run on a single physical GPU, enabling more efficient resource utilization and optimizing GPU usage, especially in multi-tenant environments.</p><p>With Kubernetes, the integration of MIG provides dynamic and flexible GPU resource allocation, optimizing GPU resources at a granular level. Kubernetes supports resource management through the nvidia.com/gpu resource plugin, which is extended to handle the MIG-enabled GPUs using specific operators and controllers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Df4XU4SKZY7FJmjujcfDfg.jpeg" /><figcaption>MIG overview source: NVIDIA</figcaption></figure><h3>GPU Optimization Techniques</h3><h3>Single Strategy</h3><p>In this approach, all MIG devices on a GPU are created with the same size. For example, on a P4d.24XL instance, you could create 56 slices of 1g.5gb or 24 slices of 2g.10gb.</p><h3>Mixed Strategy</h3><p>This technique allows for creating MIG devices of different sizes on the same GPU. For instance, you could partition a GPU into two 1g.10gb units, one 2g.20gb unit, and one 3g.40gb unit.</p><h3>Kubernetes Operators for MIG</h3><p>Two main operators facilitate MIG management in Kubernetes:</p><ol><li><strong>NVIDIA GPU Operator</strong>: This operator automates the creation of MIG partitions based on node labels. It uses a ConfigMap to define MIG profiles and applies them to labeled nodes.</li><li><strong>k8s-mig-operator</strong>: This is a Python-based operator that provides more granular control over MIG configurations. It allows for custom MIG profiles and supports toggling MIG on/off for individual GPUs.</li></ol><h3>Key Concepts in NVIDIA MIG for Kubernetes</h3><h3>GPU Partitioning:</h3><p>MIG allows a single GPU to be split into several smaller, independent instances (each with its own memory, compute cores, and other resources).<br>Each instance of MIG can be treated as a separate, discrete resource, enabling better isolation and multi-tenant support, similar to how virtual machines or containers work.</p><h3>Dynamic Resource Allocation</h3><p>With dynamic resource allocation, Kubernetes can allocate and deallocate GPU resources as needed. This provides flexibility in managing GPU workloads and ensures that resources are efficiently distributed among workloads based on real-time demand.</p><p>The MIG feature enables a more fine-grained allocation of GPU resources, allowing each container or pod to use a portion of the GPU instead of the whole GPU. This is especially beneficial in environments where GPU resources are a limited and valuable commodity.</p><p>Kubernetes can dynamically allocate MIG devices to pods using the resources section in pod specifications. For example:</p><pre>resources:<br>  limits:<br>    nvidia.com/mig-1g.5gb: 1</pre><p>This requests one 1g.5gb MIG device for the pod.</p><h3>Benefits of MIG in Kubernetes</h3><ol><li><strong>Improved GPU Utilization</strong>: MIG allows multiple pods to share a single GPU, increasing overall utilization.</li><li><strong>Isolation</strong>: Each MIG instance is hardware-isolated, ensuring performance predictability.</li><li><strong>Flexibility</strong>: Administrators can create various MIG profiles to match different workload requirements.</li><li><strong>Cost Efficiency</strong>: By running more pods per GPU, organizations can optimize their hardware investments.</li></ol><p>MIG technology, combined with Kubernetes operators, provides a powerful toolset for maximizing GPU resources in containerized environments, especially for AI and high-performance computing workloads.</p><h3>Key Operators for Managing NVIDIA MIG in Kubernetes</h3><p>To enable and manage NVIDIA MIG within Kubernetes clusters, several operators and tools are used. These operators automate the deployment, monitoring, and scaling of GPU resources (including MIG partitions).</p><ol><li><strong>NVIDIA GPU Operator</strong>:</li></ol><ul><li>The <strong>NVIDIA GPU Operator</strong> is a Kubernetes operator that simplifies the management of NVIDIA GPUs in Kubernetes clusters. It automates the deployment of NVIDIA drivers, runtime, monitoring tools, and device plugins.</li><li>The operator supports the configuration of MIG-enabled GPUs, dynamically allocating GPU instances to Kubernetes workloads.</li><li>It ensures that all necessary components (like device plugins) are installed and configured properly to expose MIG partitions for use by workloads.</li></ul><p><strong>2. NVIDIA Device Plugin for Kubernetes</strong>:</p><ul><li>The <strong>NVIDIA Device Plugin</strong> is a Kubernetes device plugin that allows pods to request GPUs. When MIG is enabled, this plugin can be extended to manage MIG instances.</li><li>It facilitates the allocation of MIG instances to workloads and ensures that workloads are scheduled based on available GPU instances.</li></ul><p><strong>3. NVIDIA DCGM Exporter</strong>:</p><ul><li>The <strong>NVIDIA Data Center GPU Manager (DCGM)</strong> Exporter is used to expose GPU metrics for monitoring within Kubernetes. It helps track GPU health, performance, and utilization, including MIG instances, which is crucial for dynamically adjusting resource allocation.</li></ul><h3>Conclusion</h3><p>NVIDIA MIG, combined with Kubernetes, offers a powerful mechanism to optimize GPU usage in multi-tenant, resource-constrained environments. The ability to partition GPUs into smaller, isolated instances allows for better resource utilization, fault isolation, and flexibility in GPU scheduling. By leveraging dynamic resource allocation, Kubernetes can adjust to workloads in real-time, ensuring optimal performance and efficient scaling of GPU resources. The NVIDIA GPU Operator, along with the NVIDIA Device Plugin, helps automate and manage this complex ecosystem, making it easier for users to utilize MIG-enabled GPUs effectively in Kubernetes clusters.</p><p>Resources:</p><ul><li><a href="https://docs.nvidia.com/datacenter/tesla/mig-user-guide/">https://docs.nvidia.com/datacenter/tesla/mig-user-guide/</a></li><li><a href="https://docs.nvidia.com/launchpad/ai/fleet-command/latest/fc-step-09.html">https://docs.nvidia.com/launchpad/ai/fleet-command/latest/fc-step-09.html</a></li><li><a href="https://github.com/riskfuel/k8s-mig-operator">https://github.com/riskfuel/k8s-mig-operator</a></li><li><a href="https://towardsdatascience.com/how-to-increase-gpu-utilization-in-kubernetes-with-nvidia-mps-e680d20c3181?gi=901c97cfd4c1">https://towardsdatascience.com/how-to-increase-gpu-utilization-in-kubernetes-with-nvidia-mps-e680d20c3181?gi=901c97cfd4c1</a></li><li><a href="https://www.leadergpu.com/articles/554-what-is-nvidia-mig">https://www.leadergpu.com/articles/554-what-is-nvidia-mig</a></li><li><a href="https://aws.amazon.com/blogs/containers/maximizing-gpu-utilization-with-nvidias-multi-instance-gpu-mig-on-amazon-eks-running-more-pods-per-gpu-for-enhanced-performance/">https://aws.amazon.com/blogs/containers/maximizing-gpu-utilization-with-nvidias-multi-instance-gpu-mig-on-amazon-eks-running-more-pods-per-gpu-for-enhanced-performance/</a></li><li><a href="https://blog.realvarez.com/get-more-out-of-gpus-with-nvidia-multi-instance-gpu/">https://blog.realvarez.com/get-more-out-of-gpus-with-nvidia-multi-instance-gpu/</a></li><li><a href="https://blogs.nvidia.com/blog/multi-instance-gpus/">https://blogs.nvidia.com/blog/multi-instance-gpus/</a></li><li><a href="https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cloud-native/containers/k8s-mig-manager">https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cloud-native/containers/k8s-mig-manager</a></li><li><a href="https://www.infracloud.io/blogs/guide-to-nvidia-gpu-operator-in-kubernetes/">https://www.infracloud.io/blogs/guide-to-nvidia-gpu-operator-in-kubernetes/</a></li><li><a href="https://docs.nvidia.com/datacenter/cloud-native/kubernetes/latest/index.html">https://docs.nvidia.com/datacenter/cloud-native/kubernetes/latest/index.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09a321b78993" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/nvidia-mig-with-gpu-optimization-in-kubernetes-09a321b78993">Nvidia MIG with GPU Optimization in Kubernetes</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model Context Protocol Overview]]></title>
            <link>https://medium.com/vmacwrites/model-context-protocol-overview-5a15a57e69c4?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/5a15a57e69c4</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-solution]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 17:13:05 GMT</pubDate>
            <atom:updated>2024-12-01T17:23:39.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Rs1X2coHJ1VogMjyDLR9Q.jpeg" /></figure><h4>Anthropic has introduced the Model Context Protocol (MCP), an open-source standard designed to simplify and standardize connections between AI models and external data sources. This protocol aims to solve the challenge of integrating AI systems with various tools and data repositories, which previously required custom implementations for each new data source.</h4><p>The announcement, available at <a href="https://www.anthropic.com/news/model-context-protocol">https://www.anthropic.com/news/model-context-protocol</a>, provides detailed information about this new protocol.</p><h3>Key Features and Benefits</h3><p>1. Universal Connectivity: MCP enables AI systems to connect with diverse data sources, including content repositories, business tools, and development environments.</p><p>2. Standardized Integration: Instead of creating custom connectors for each data source, developers can build against a single, universal protocol.</p><p>3. Two-Way Connections: MCP facilitates secure, bidirectional communication between AI-powered tools and data sources.</p><p>4. Open-Source Approach: The protocol is open-source, encouraging community-driven adoption and innovation.</p><p>5. Improved AI Performance: By providing AI models with better access to relevant data, MCP aims to enhance the quality and relevance of AI-generated responses.</p><h3>Technical Architecture</h3><p>MCP utilizes a client-server architecture:</p><p>1. MCP Servers: Expose data from various sources<br>2. MCP Clients: AI applications that connect to these servers</p><p>The protocol consists of three main components:</p><p>1. Protocol Layer: Handles message framing, request/response linking, and high-level communication patterns<br>2. Transport Layer: Manages communication between client and server<br>3. SDKs: Currently available for TypeScript and Python</p><h3>Security and Privacy</h3><p>MCP prioritizes security through a local-first approach:</p><p>1. Local Connections: Initially, MCP only supports connections to servers running on the local machine<br>2. Explicit Permissions: The protocol requires specific permissions for each tool and interaction<br>3. Server-Controlled Resources: Servers maintain control over their resources, eliminating the need to share API keys with LLM providers</p><h3>Current Status and Adoption</h3><p>1. Early Adopters: Companies have begun integrating MCP into their systems<br>2. Development Tools: Various firms are adding MCP support to their platforms<br>3. Pre-built Servers: Servers are available for popular systems like Google Drive, Slack, GitHub, and SQL databases</p><h3>Future Developments</h3><p>1. Remote Connections: Work is in progress to allow for remote servers with enterprise-grade authentication<br>2. Expanded Toolkit: Plans to provide developer toolkits for deploying remote production MCP servers</p><h3>Potential Impact</h3><p>MCP has the potential to become a foundational tool for AI model integration, similar to how ODBC standardized database connectivity in the 1990s. By simplifying AI integration and improving data accessibility, MCP could accelerate the adoption and effectiveness of AI systems across various industries and applications.</p><h3>Key points from the announcement include:</h3><p>1. Open-source nature: MCP is released as an open-source project to encourage community contributions and adoption.</p><p>2. Purpose: MCP aims to solve the challenge of integrating AI systems with various data sources, replacing fragmented integrations with a single, universal protocol.</p><p>3. Architecture: MCP uses a client-server model, where MCP servers expose data from various sources, and MCP clients (AI applications) connect to these servers.</p><p>4. Components: The announcement introduces three major components:</p><ul><li>The Model Context Protocol specification and SDKs</li><li>Local MCP server support in Claude Desktop apps</li><li>An open-source repository of MCP servers</li></ul><p>5. Pre-built servers: Anthropic has shared pre-built MCP servers for popular systems like Google Drive, Slack, GitHub, Git, Postgres, and Puppeteer.</p><p>6. Early adoption: Companies like Block and Apollo have integrated MCP, while development tool firms such as Zed, Replit, Codeium, and Sourcegraph are adding MCP support.</p><p>7. Getting started: The announcement provides instructions for developers to start building and testing MCP connectors, including installing pre-built servers through the Claude Desktop app and following a quickstart guide.</p><p>8. Future developments: Anthropic plans to provide developer toolkits for deploying remote production MCP servers that can serve entire Claude for Work organizations.</p><p>9. Community involvement: Anthropic emphasizes their commitment to building MCP as a collaborative, open-source project and invites developers, enterprises, and early adopters to contribute to the ecosystem.</p><h3>Conclusion</h3><p>The announcement highlights MCP’s potential to significantly improve AI assistants’ ability to access and utilize relevant data, potentially leading to more accurate and contextually appropriate responses across various applications and industries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a15a57e69c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/model-context-protocol-overview-5a15a57e69c4">Model Context Protocol Overview</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chain of Trust: Decoding SSL Certificate Security Architecture]]></title>
            <link>https://medium.com/vmacwrites/chain-of-trust-decoding-ssl-certificate-security-architecture-2bde46655d37?source=rss----284cc9132fcc---4</link>
            <guid isPermaLink="false">https://medium.com/p/2bde46655d37</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Vidyasagar Machupalli]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 14:01:51 GMT</pubDate>
            <atom:updated>2025-08-17T13:33:53.532Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This article is part of a 3-part article series covering beginners to advanced SSL security architecture. Please refer to the further reading section in the last to check the follow-up articles.</blockquote><p>The chain of trust is a fundamental concept in digital security that underpins the reliability and authenticity of SSL/TLS certificates used to secure online communications. It establishes a hierarchical structure of trust, starting from a trusted root Certificate Authority (CA) and extending down to the end-entity certificate used by a website or service.</p><p>This chain is important for several reasons. First of all, it allows for the scalable distribution of trust across the internet. Instead of requiring every device to trust millions of individual certificates, they only need to trust a small number of root CAs. Second, it provides a mechanism for verifying the authenticity of certificates. When a browser encounters a certificate, it can trace the chain back to a trusted root, ensuring that each link in the chain is valid and trustworthy. This process helps prevent man-in-the-middle attacks and other forms of certificate fraud. Additionally, the chain of trust enables the revocation of compromised certificates without undermining the entire system. If an intermediate CA is compromised, only the certificates issued by that CA need to be revoked, rather than all certificates issued by the root CA. This flexibility and security make the chain of trust an essential component of modern internet security.</p><h3>Understanding the Chain of Trust</h3><p>The chain of trust is a hierarchical structure of digital certificates that validates the authenticity of a certificate. This chain typically consists of three main components:</p><ol><li>Root Certificate Authority (Root CA)</li><li>Intermediate Certificate Authority (Intermediate CA)</li><li>End-entity Certificate (Server or Client Certificate)</li></ol><h3>Root Certificate Authority (Root CA)</h3><p>The Root CA sits at the top of the trust hierarchy. It is a self-signed certificate, meaning it vouches for its own authenticity. Root CAs are implicitly trusted by web browsers and operating systems. They are responsible for issuing certificates to Intermediate CAs and, in some cases, directly to end-entities.</p><p>Key characteristics of Root CAs:</p><ul><li>Self-signed certificates</li><li>Stored securely offline to prevent compromise</li><li>Long validity periods (typically 20–30 years)</li><li>Highly trusted and recognized globally</li></ul><h3>Intermediate Certificate Authority (Intermediate CA)</h3><p>Intermediate CAs bridge the gap between Root CAs and end-entity certificates. They are issued by Root CAs and, in turn, issue certificates to end-entities or other Intermediate CAs. The use of Intermediate CAs enhances security by allowing the Root CA to remain offline while the Intermediate CA handles day-to-day certificate issuance.</p><p>Key characteristics of Intermediate CAs:</p><ul><li>Issued by Root CAs</li><li>Can issue certificates to end-entities or other Intermediate CAs</li><li>Shorter validity periods than Root CAs (typically 10–15 years)</li><li>Enhance security and flexibility in certificate management</li></ul><h3>End-entity Certificate</h3><p>This is the certificate issued to a specific entity, such as a website or email server. It’s the certificate that end-users interact with when visiting a secure website or sending encrypted email.</p><p>Key characteristics of End-entity Certificates:</p><ul><li>Issued by Intermediate CAs or, occasionally, Root CAs</li><li>Shortest validity period (typically 1–2 years)</li><li>Contains information about the entity it represents (e.g., domain name for websites)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*A4t3dGXmLISgKHg860AAGw.png" /><figcaption>SSL Chain of trust generated using Eraser</figcaption></figure><h3>Role in Security</h3><p>The chain of trust plays a crucial role in ensuring the security and integrity of online communications:</p><ol><li><strong>Authentication</strong>: It verifies the identity of the certificate holder, ensuring that you’re communicating with the intended party.</li><li><strong>Integrity</strong>: It ensures that the certificate hasn’t been tampered with or altered in transit.</li><li><strong>Encryption</strong>: While not directly responsible for encryption, a valid certificate chain is necessary for establishing encrypted connections.</li><li><strong>Revocation</strong>: If a certificate in the chain is compromised, it can be revoked, invalidating all certificates below it in the chain.</li></ol><h3>Tools to Check Chain of Trust and Certificate Validity</h3><p>Several tools are available to verify the chain of trust and validate certificates:</p><h3>OpenSSL</h3><p>OpenSSL is a versatile command-line tool that can perform various SSL/TLS-related tasks.</p><p>To check a certificate chain:</p><pre>openssl s_client -connect example.com:443 -showcerts</pre><p>This command will display the entire certificate chain and highlight any issues.</p><h3>Certificate Checker Tools</h3><p>Many online services provide comprehensive certificate checking capabilities:</p><ol><li><strong>SSL Labs Server Test</strong>: Offers in-depth analysis of SSL/TLS configurations.</li><li><strong>DigiCert Certificate Inspector</strong>: Scans for certificate issues across your entire network.</li><li><strong>Qualys SSL Server Test</strong>: Provides detailed information about SSL/TLS configuration and potential vulnerabilities.</li></ol><h3>Browser Developer Tools</h3><p>Modern web browsers include developer tools that can display certificate information:</p><ol><li>Click on the padlock icon in the address bar.</li><li>Select “Certificate” or a similar option.</li><li>Review the certificate details, including the chain of trust.</li></ol><h3>Certificate Validation Process</h3><p>When a client connects to a server, it performs several checks to validate the certificate:</p><ol><li><strong>Signature Verification</strong>: The client verifies each certificate’s digital signature in the chain, starting from the end-entity certificate up to the Root CA.</li><li><strong>Trust Anchor Check</strong>: The client checks if the Root CA is in its list of trusted root certificates.</li><li><strong>Validity Period</strong>: The client ensures all certificates in the chain are within their validity periods.</li><li><strong>Revocation Check</strong>: The client may check if any certificates in the chain have been revoked using Certificate Revocation Lists (CRLs) or Online Certificate Status Protocol (OCSP).</li><li><strong>Name Matching</strong>: For the end-entity certificate, the client verifies that the certificate’s Subject Alternative Name (SAN) or Common Name (CN) matches the domain being accessed.</li></ol><h3>Common Issues in Certificate Chain Validation</h3><ol><li><strong>Incomplete Chain</strong>: The server doesn’t provide all necessary intermediate certificates.</li><li><strong>Expired Certificates</strong>: One or more certificates in the chain have expired.</li><li><strong>Revoked Certificates</strong>: A certificate in the chain has been revoked.</li><li><strong>Name Mismatch</strong>: The server’s certificate doesn’t match the domain name being accessed.</li><li><strong>Untrusted Root</strong>: The Root CA isn’t in the client’s list of trusted roots.</li></ol><p>The <a href="https://testssl.sh/">testssl.sh tool</a> is a powerful, open-source command-line utility for testing SSL/TLS enabled servers. It provides comprehensive information about a server’s SSL/TLS configuration, including supported protocols, ciphers, and certificate details. This tool is particularly useful for administrators and security professionals looking to assess the security of their SSL/TLS implementations.</p><pre>./testssl.sh --jsonfile-pretty SSL_test.json https://example.com:443/</pre><p>While running ./testssl.sh, if you see an error <em>Chain of trust — NOT ok ,</em> you need to check whether intermediate certificates are supplied and are part of the chain of trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NZqaVxUdvsHlmaGJdNNQg.png" /></figure><p>If you are supplying all the certificates including the intermediate certificate but still seeing the error, supply the certificates to the testssh using the <em>add-ca </em>flag pointing to the folder with all the certificates in the chain of trust</p><pre>./testssl.sh --add-ca ~/Downloads/amc-private-certificate --jsonfile-pretty SSL_test.json https://example.com:443/</pre><p>The result should now be</p><pre>{<br>    &quot;id&quot;: &quot;cert_chain_of_trust&quot;,<br>    &quot;severity&quot;: &quot;OK&quot;,<br>    &quot;finding&quot;: &quot;passed.&quot;<br>}</pre><h3>Conclusion</h3><p>Understanding the chain of trust and regularly validating certificates is crucial for maintaining a secure online environment. By utilizing the tools and knowledge discussed, you can ensure that your digital certificates are properly configured and trusted, thereby safeguarding your online communications and transactions.</p><blockquote>Further recommended reading</blockquote><blockquote>1. <a href="https://hackernoon.com/troubleshooting-ssl-why-your-ssl-certificate-isnt-working-on-windows">Troubleshooting SSL: Why Your SSL Certificate Isn’t Working on Windows</a></blockquote><blockquote>2. <a href="https://dzone.com/articles/advanced-ssl-certificate-troubleshooting-windows">Advanced SSL Certificate Troubleshooting for Windows: Chain of Trust, Debugging, and Best Practices</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bde46655d37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vmacwrites/chain-of-trust-decoding-ssl-certificate-security-architecture-2bde46655d37">Chain of Trust: Decoding SSL Certificate Security Architecture</a> was originally published in <a href="https://medium.com/vmacwrites">vmacwrites</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>