<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vidyasagar SC Machupalli</title>
    <description>The latest articles on Forem by Vidyasagar SC Machupalli (@vidyasagarmsc).</description>
    <link>https://forem.com/vidyasagarmsc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F139311%2Fc15d2845-f300-4a92-ac0c-effd771a4bd8.jpg</url>
      <title>Forem: Vidyasagar SC Machupalli</title>
      <link>https://forem.com/vidyasagarmsc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vidyasagarmsc"/>
    <language>en</language>
    <item>
      <title>Finding Today's Changed Files: A Quick Python Script for File Uploads</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Mon, 03 Nov 2025 03:03:08 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/finding-todays-changed-files-a-quick-python-script-for-file-uploads-13b7</link>
      <guid>https://forem.com/vidyasagarmsc/finding-todays-changed-files-a-quick-python-script-for-file-uploads-13b7</guid>
      <description>&lt;p&gt;My friend recently asked me for help with a common problem: they needed to upload files to a remote server, but didn't want to upload everything—just the files that had changed today. Manually checking modification dates for dozens of files? Not fun.&lt;/p&gt;

&lt;p&gt;So I wrote a quick Python script to solve it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When you're syncing files to a remote server, uploading everything is inefficient and time-consuming. You really only need the files you've modified today—whether that's code you've been working on, documents you've edited, or data files you've processed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;This &lt;code&gt;get_latest_files_by_today()&lt;/code&gt; function scans a folder and returns only the files modified today, sorted with the most recent first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_latest_files_by_today&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Validates the folder path&lt;/strong&gt; to avoid errors&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compares each file's modification date&lt;/strong&gt; to today's date&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sorts results by time&lt;/strong&gt; (newest first)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returns clean filenames&lt;/strong&gt; ready to use&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key insight is comparing just the date portion—ignoring the specific time—so anything touched today qualifies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;today&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;modified_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromtimestamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modified_timestamp&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;modified_date&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;today_files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;modified_timestamp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Usage
&lt;/h2&gt;

&lt;p&gt;My friend now runs this script at the end of their workday:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;latest_files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_latest_files_by_today&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/path/to/project&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latest_files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output gives them an instant list of exactly which files need uploading to the remote server. No guesswork, no manual checking, no accidentally missing a file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond File Uploads
&lt;/h2&gt;

&lt;p&gt;While we built this for upload workflows, it's useful anytime you need to track today's file activity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating daily backups of changed files&lt;/li&gt;
&lt;li&gt;Reviewing what you worked on before leaving for the day&lt;/li&gt;
&lt;li&gt;Monitoring build outputs or logs&lt;/li&gt;
&lt;li&gt;Checking which documents were edited during a meeting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Simple Tools, Big Impact
&lt;/h2&gt;

&lt;p&gt;This script uses only Python's standard library—no external dependencies, no complex setup. Just point it at a folder and get your results.&lt;/p&gt;

&lt;p&gt;Sometimes the most helpful code isn't the most sophisticated. It's the utility that solves a real problem in 40 lines, saves you 15 minutes every day, and just works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Got a folder that needs smart file filtering? Give this script a try.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_latest_files_by_today&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Retrieves and sorts files in a given folder, returning only those modified today.

    Args:
        folder_path (str): The path to the folder to scan.

    Returns:
        list: A list of full filenames (name + extension) of files modified today,
              sorted by modification time (latest first).
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error: Folder &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; does not exist.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="n"&gt;today&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;today_files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isfile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;modified_timestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getmtime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;modified_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromtimestamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modified_timestamp&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;modified_date&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;today_files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;modified_timestamp&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="c1"&gt;# Sort files by modification time in descending order (latest first)
&lt;/span&gt;    &lt;span class="n"&gt;today_files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Extract only the full filenames
&lt;/span&gt;    &lt;span class="n"&gt;sorted_filenames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;today_files&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sorted_filenames&lt;/span&gt;

&lt;span class="c1"&gt;# Example usage:
&lt;/span&gt;&lt;span class="n"&gt;current_directory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getcwd&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;latest_files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_latest_files_by_today&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_directory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;latest_files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Or with a specific folder:
# my_folder = "/path/to/your/folder"
# latest_files_in_folder = get_latest_files_by_today(my_folder)
# print(latest_files_in_folder)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/Users/vmac/Documents/Code/Python/.venv/bin/python /Users/vmac/Documents/Code/Python/latestfile.py 
Files changed today &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'latestfile.py'&lt;/span&gt;, &lt;span class="s1"&gt;'abc.py'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

Process finished with &lt;span class="nb"&gt;exit &lt;/span&gt;code 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>shortposts</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Resolving Secrets Manager DNS Resolution Errors in Terraform and Pulumi IaC</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Fri, 08 Aug 2025 18:30:32 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/resolving-secrets-manager-dns-resolution-errors-in-terraform-and-pulumi-iac-29hj</link>
      <guid>https://forem.com/vidyasagarmsc/resolving-secrets-manager-dns-resolution-errors-in-terraform-and-pulumi-iac-29hj</guid>
      <description>&lt;p&gt;I love &lt;a href="https://medium.com/vmacwrites/must-have-terraform-tools-4197971f00c" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;While creating a Pulumi project to provision Secrets Manager group instance, I came across an error&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CreateSecretGroupWithContext failed: Post "&lt;a href="https://0a21f2b7-e695-42e4-873f.us-south.secrets-manager.appdomain.cloud/api/v2/secret%5C_groups%22:" rel="noopener noreferrer"&gt;https://0a21f2b7-e695-42e4-873f.us-south.secrets-manager.appdomain.cloud/api/v2/secret\_groups":&lt;/a&gt; dial tcp: lookup 0a21f2b7-e695-42e4-873f.us-south.secrets-manager.appdomain.cloud: no such host&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Infrastructure as Code (IaC)
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terraform vs Pulumi: A Brief Overview
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Key differences include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language Support: Terraform uses HCL exclusively, while Pulumi supports multiple general-purpose programming languages&lt;/li&gt;
&lt;li&gt;State Management: Terraform uses local or remote state files, while Pulumi uses its SaaS backend by default&lt;/li&gt;
&lt;li&gt;Testing Capabilities: Pulumi provides native support for unit and integration testing through programming language ecosystems&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introduction to Pulumi
&lt;/h3&gt;

&lt;h3&gt;
  
  
  What is Pulumi?
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Advantages of Pulumi over Traditional IaC Tools
&lt;/h3&gt;

&lt;p&gt;Enhanced Developer Experience: Pulumi provides full IDE support with code completion, error checking, and refactoring capabilities that come naturally with general-purpose programming languages.&lt;/p&gt;

&lt;p&gt;Advanced Testing Capabilities: Since Pulumi uses real programming languages, teams can leverage existing testing frameworks and methodologies to validate their infrastructure code.&lt;/p&gt;

&lt;p&gt;Stronger Abstraction and Modularity: Programming language features like functions, classes, and packages enable more sophisticated infrastructure abstractions than simple configuration languages allow.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pulumi’s Multi-Language Support
&lt;/h3&gt;

&lt;p&gt;Pulumi supports a wide range of programming languages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TypeScript/JavaScript: Native Node.js support with full npm ecosystem&lt;/li&gt;
&lt;li&gt;Python: Full Python 3.x support with pip package management&lt;/li&gt;
&lt;li&gt;Go: Native Go modules and tooling&lt;/li&gt;
&lt;li&gt;.NET: Support for C#, F#, and VB.NET&lt;/li&gt;
&lt;li&gt;Java: Full JVM ecosystem support&lt;/li&gt;
&lt;li&gt;YAML: For simpler, declarative scenarios&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting Up IBM Cloud with Pulumi
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Installing the IBM Cloud Provider for Pulumi
&lt;/h4&gt;

&lt;p&gt;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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pulumi package add terraform-provider ibm-cloud/ibm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the Service Endpoint Configuration Error
&lt;/h3&gt;

&lt;p&gt;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 &lt;a href="https://github.com/IBM-Cloud/terraform-provider-ibm/issues/6273" rel="noopener noreferrer"&gt;GitHub issue&lt;/a&gt; that clarifies many questions&lt;/p&gt;

&lt;h3&gt;
  
  
  Error Analysis from GitHub Issue
&lt;/h3&gt;

&lt;p&gt;The specific issue documented in GitHub issue reveals a fundamental misconfiguration problem. When users specify service_endpoints = "public-and-private" in their Terraform configuration for IBM Secrets Manager, the resulting instance is provisioned with only private endpoints, despite the configuration suggesting otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root Cause Identification:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
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.&lt;/p&gt;

&lt;p&gt;Configuration Inconsistency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard IBM Services: Use service_endpoints parameter&lt;/li&gt;
&lt;li&gt;Secrets Manager: Uses allowed_network within the parameters block&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Analyzing the Incorrect Configuration
&lt;/h3&gt;

&lt;p&gt;The problematic Terraform configuration from the GitHub issue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "ibm_resource_instance" "secrets_manager" {
  count = var.provision_sm_instance == true ? 1 : 0
  name = var.sm_instance_name
  service = "secrets-manager"
  plan = var.sm_service_plan
  location = var.region
  resource_group_id = data.ibm_resource_group.sm_instance.id
  tags = var.tags
  service_endpoints = "public-and-private" # ← This is INCORRECT for Secrets Manager

  timeouts {
    create = "20m"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pulumi implementation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;secrets_manager = ibm.ResourceInstance(
    "vpn-secrets-manager",
    name="vpn-secrets-manager",
    service="secrets-manager",
    plan="standard",
    location=region,
    resource_group_id=resource_group_id,
    service_endpoints="public-and-private", 
    tags=["vpn", "certificates", "pulumi"],
    opts=secrets_manager_opts
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt; : Despite specifying service_endpoints = "public-and-private", the instance is provisioned with only private endpoints, leading to DNS resolution failures when attempting to create secret groups.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly40ss75do145zncsfr5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fly40ss75do145zncsfr5.png" width="800" height="847"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Pulumi error&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  The Correct Configuration Approach
&lt;/h3&gt;

&lt;p&gt;Based on IBM’s documentation and the GitHub issue resolution, the correct approach uses the parameters block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "ibm_resource_instance" "secrets_manager" {
  count = var.provision_sm_instance == true ? 1 : 0
  name = var.sm_instance_name  
  service = "secrets-manager"
  plan = var.sm_service_plan
  location = var.region
  resource_group_id = data.ibm_resource_group.sm_instance.id
  tags = var.tags

  parameters = {
    "allowed_network" = "public-and-private" # ← This is CORRECT for Secrets Manager
  }

  timeouts {
    create = "20m"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pulumi code fix:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/VidyasagarMSC/pulumi" rel="noopener noreferrer"&gt;Pulumi Code repository&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;secrets_manager = ibm.ResourceInstance(
    "vpn-secrets-manager",
    name="vpn-secrets-manager",
    service="secrets-manager",
    plan="standard",
    location=region,
    resource_group_id=resource_group_id,
    #service_endpoints=secrets_manager_service_endpoints,
    parameters={
        "allowed_network" : secrets_manager_service_endpoints,    
    },
    tags=["vpn", "certificates", "pulumi"],
    opts=secrets_manager_opts
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;For complete Pulumi code examples, refer to my &lt;a href="https://github.com/VidyasagarMSC/pulumi" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The IBM Secrets Manager DNS resolution error stems from a critical configuration difference where Secrets Manager requires parameters = { "allowed_network" = "..." } instead of the standard service_endpoints parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always use allowed_network within the parameters block for Secrets Manager&lt;/li&gt;
&lt;li&gt;Implement validation to catch configuration errors early&lt;/li&gt;
&lt;li&gt;Use infrastructure modules to encapsulate correct patterns&lt;/li&gt;
&lt;li&gt;Test endpoint accessibility after provisioning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Related Documentation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.ibm.com/docs/secrets-manager" rel="noopener noreferrer"&gt;IBM Cloud Secrets Manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-overview" rel="noopener noreferrer"&gt;IBM Cloud VPC VPN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pulumi.com/registry/packages/ibm/" rel="noopener noreferrer"&gt;Pulumi IBM Cloud Provider&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-about-certificate-manager" rel="noopener noreferrer"&gt;Certificate Management Best Practices&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>pulumi</category>
      <category>python</category>
      <category>cloudcomputing</category>
      <category>iac</category>
    </item>
    <item>
      <title>The Essential Role of Process Monitoring Scripts in Linux Environments</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Mon, 12 May 2025 15:23:32 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/the-essential-role-of-process-monitoring-scripts-in-linux-environments-2pe5</link>
      <guid>https://forem.com/vidyasagarmsc/the-essential-role-of-process-monitoring-scripts-in-linux-environments-2pe5</guid>
      <description>&lt;h3&gt;
  
  
  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 &lt;em&gt;should&lt;/em&gt; be running) forms the foundation of system health, security, and performance.
&lt;/h3&gt;

&lt;p&gt;This comprehensive guide introduces a powerful yet lightweight Bash script that delivers cross-platform process monitoring with enterprise-grade capabilities. We’ll explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The diverse landscape of Linux distributions and their monitoring needs&lt;/li&gt;
&lt;li&gt;How this script solves real-world administration challenges&lt;/li&gt;
&lt;li&gt;Detailed usage examples for various scenarios&lt;/li&gt;
&lt;li&gt;Advanced integration techniques for professional environments&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Understanding the Linux Distribution Landscape
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. Enterprise-Grade Workhorses
&lt;/h3&gt;

&lt;p&gt;Red Hat Enterprise Linux (RHEL), Ubuntu LTS, and SUSE Linux Enterprise dominate mission-critical environments. These distributions prioritize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stability&lt;/strong&gt; over cutting-edge features&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-term support&lt;/strong&gt; (5+ years typically)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Certified compatibility&lt;/strong&gt; with enterprise hardware/software&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Monitoring Consideration:&lt;/em&gt; These systems often run business-critical services where unexpected process termination can cost thousands per minute of downtime.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Rolling Release Distributions
&lt;/h3&gt;

&lt;p&gt;Arch Linux, openSUSE Tumbleweed, and Gentoo appeal to developers and enthusiasts with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Continuous updates&lt;/strong&gt; to the latest software versions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minimal default installations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customization-focused&lt;/strong&gt; philosophies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Monitoring Consideration:&lt;/em&gt; Frequent updates increase the chance of service disruptions, making automated monitoring particularly valuable.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Specialized and Lightweight Systems
&lt;/h3&gt;

&lt;p&gt;From Alpine Linux’s container-optimized 5MB footprint to Kali’s security toolkit, these distributions serve niche purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Embedded systems&lt;/strong&gt; (Raspberry Pi OS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security auditing&lt;/strong&gt; (Kali, Parrot OS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge computing&lt;/strong&gt; (Fedora IoT)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Monitoring Consideration:&lt;/em&gt; Resource constraints demand ultra-efficient monitoring tools that don’t contribute to system load.&lt;/p&gt;

&lt;h3&gt;
  
  
  Introducing the Universal Process Monitor
&lt;/h3&gt;

&lt;p&gt;Our solution addresses these diverse needs through intelligent design:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Dual-Platform Support&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Automatically detects and adapts to Linux or macOS environments&lt;/li&gt;
&lt;li&gt;Handles differences in command syntax between systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Flexible Output Options&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Color-coded terminal output (default)&lt;/li&gt;
&lt;li&gt;JSON format for programmatic use (--json flag)&lt;/li&gt;
&lt;li&gt;Log file support (--log-file option)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Intelligent Process Detection&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses pgrep for reliable process matching&lt;/li&gt;
&lt;li&gt;Excludes the monitoring script itself from results&lt;/li&gt;
&lt;li&gt;Normalizes output across different platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Lightweight Operation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal dependencies (only basic Unix tools)&lt;/li&gt;
&lt;li&gt;Fast execution with low resource usage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Usage Examples&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic Process Check&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./process_monitor.sh nginx mysql docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Sample Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROCESS CHECK - Ubuntu 22.04 LTS
TIME: 2023-07-15 14:30:45

nginx RUNNING 1234 www-data /usr/sbin/nginx -g daemon off;
mysql RUNNING 5678 mysql /usr/sbin/mysqld
docker NOT RUNNING No matching process found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr11eln6bx5gzqocp1xyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr11eln6bx5gzqocp1xyy.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Process monitor running on macOS checking for the processes&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JSON Output Mode&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./process_monitor.sh --json nginx docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3m5dpddrfeswrre2vbs2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3m5dpddrfeswrre2vbs2.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;JSON output using the json flag&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "hostname": "web-server",
    "timestamp": "2023-07-15 14:30:45",
    "os": "Ubuntu 22.04 LTS",
    "processes": [
        {
            "process": "nginx",
            "status": "RUNNING",
            "pid": "1234",
            "user": "www-data",
            "command": "/usr/sbin/nginx -g daemon off;"
        },
        {
            "process": "docker",
            "status": "NOT RUNNING",
            "pid": null,
            "user": null,
            "command": null
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Logging to File&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./process_monitor.sh --log-file "/var/log/process_monitor.log" redis postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Integration Possibilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;System Monitoring&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Schedule regular checks with cron&lt;/li&gt;
&lt;li&gt;Parse JSON output with monitoring tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. CI/CD Pipelines&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify service status before deployments&lt;/li&gt;
&lt;li&gt;Check for conflicting processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Troubleshooting&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quick verification of running services&lt;/li&gt;
&lt;li&gt;Check process dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Performance Characteristics&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Typically completes in under 100ms for basic checks&lt;/li&gt;
&lt;li&gt;Minimal CPU and memory usage&lt;/li&gt;
&lt;li&gt;Efficient process detection without spawning unnecessary subshells&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Installation:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x process_monitor.sh 
./process_monitor.sh --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Real-World Implementation Scenarios
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. Proactive Service Health Monitoring
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Web servers occasionally crash without alerting&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Cron job checking every 2 minutes
*/2 * * * * /usr/local/bin/monitor.sh --silent nginx || systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Automatic recovery with failure timestamps in logs&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Security Baseline Enforcement
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Need to detect unauthorized processes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Daily diff against approved list
diff &amp;lt;(./monitor.sh --json | jq .) &amp;lt;(jq . /etc/approved-processes.json)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Immediate visibility into any unexpected processes&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Containerized Environment Monitoring
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Process visibility inside Kubernetes pods&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Kubectl integration example
kubectl exec -it pod-name -- /monitor.sh --json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Consistent monitoring across container boundaries&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced Integration Patterns
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Prometheus/Grafana Dashboarding
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Metrics endpoint creation
echo "# HELP process_up Process status" &amp;gt; /var/lib/node_exporter/process.prom
echo "# TYPE process_up gauge" &amp;gt;&amp;gt; /var/lib/node_exporter/process.prom
./monitor.sh --json | jq -r '.processes[] | "process_up{process=\"\(.process)\"} \(.status == "RUNNING" ? 1 : 0)"' &amp;gt;&amp;gt; /var/lib/node_exporter/process.prom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Beautiful dashboards showing service status across your entire fleet&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Centralized Log Analysis
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Syslog integration example
./monitor.sh | logger -p local0.notice -t process-monitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Correlation of process events with other system logs in SIEM tools&lt;/p&gt;

&lt;h4&gt;
  
  
  3. CI/CD Pipeline Gates
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# GitLab CI example
verify_services:
  script:
    - if ! ./monitor.sh --json postgresql | grep -q "RUNNING"; then exit 1; fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Failed deployments when dependent services aren’t available&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion: Building a Monitoring Culture
&lt;/h3&gt;

&lt;p&gt;Implementing this script represents more than just technical deployment — it’s about cultivating observability best practices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start Small&lt;/strong&gt; Begin with critical services before expanding coverage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Establish Baselines&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./monitor.sh --json &amp;gt; /etc/process-baseline-$(date +%F).json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Iterate and Expand&lt;/strong&gt; Add checks gradually as you identify new requirements&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Document Expectations&lt;/strong&gt; Maintain a living document of what &lt;em&gt;should&lt;/em&gt; be running&lt;/p&gt;

&lt;p&gt;This approach gives you a professional-grade monitoring foundation that scales from single servers to enterprise environments while remaining lightweight and adaptable.&lt;/p&gt;




</description>
      <category>linux</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Podman: Detailed Overview, Advantages, Disadvantages, and Setup</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Sun, 04 May 2025 13:34:31 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/podman-detailed-overview-advantages-disadvantages-and-setup-31gg</link>
      <guid>https://forem.com/vidyasagarmsc/podman-detailed-overview-advantages-disadvantages-and-setup-31gg</guid>
      <description>&lt;p&gt;Podman is an open-source container engine that enables users to create, manage, and run OCI containers and pods across Linux, macOS, and Windows. Unlike Docker, Podman is daemonless, running containers directly under the user's control, which brings unique benefits in security and flexibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmgrf534msuzno98g2zu.png" alt="Image description" width="800" height="465"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Advantages of Podman
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Daemonless Operation&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman does not require a central background service. Each container runs as a child process of the user, reducing resource overhead and improving security by eliminating a single point of failure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rootless Containers&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman supports running containers without root privileges. This greatly reduces the risk of privilege escalation and is ideal for multi-user systems or environments with strict security requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Compatibility&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman’s command-line interface is largely compatible with Docker, allowing most Docker commands and workflows to be used without modification. It can build and run containers from Dockerfiles and work with Docker images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pods and Kubernetes Integration&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman natively supports pods, which are groups of containers sharing resources, similar to Kubernetes. This makes it easier to transition workloads to Kubernetes environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Systemd Integration&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman can generate systemd unit files for containers and pods, making it easy to manage container lifecycles and ensure containers start automatically on system boot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Without a central daemon, Podman typically consumes fewer resources and starts containers faster, especially in environments with many containers or limited resources.&lt;/p&gt;


&lt;h2&gt;
  
  
  Disadvantages of Podman
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Learning Curve&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman introduces concepts like rootless mode, custom storage, and networking configurations that may require extra learning, especially for users transitioning from Docker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smaller Ecosystem&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Podman’s ecosystem and third-party integrations are not as extensive as Docker’s, which can make finding solutions or integrating with other tools more challenging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Networking Limitations&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Some advanced networking features are less mature or require more manual setup compared to Docker, particularly for complex routing or load balancing scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature Maturity&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Features like orchestration and high availability are still evolving in Podman and may require additional tools or manual configuration.&lt;/p&gt;


&lt;h2&gt;
  
  
  Podman Installation and Setup
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Debian/Ubuntu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; podman
podman &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CentOS/RHEL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;podman
podman &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  macOS
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Using Homebrew:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;podman
podman machine init
podman machine start
podman info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you can download the official installer from the Podman website or use Podman Desktop for a GUI-based experience. After installation, initialize and start a Podman machine, as containers on macOS run inside a lightweight virtual machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Podman Desktop (GUI):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the &lt;code&gt;.dmg&lt;/code&gt; file from the Podman Desktop website.&lt;/li&gt;
&lt;li&gt;Drag the Podman Desktop icon to the Applications folder.&lt;/li&gt;
&lt;li&gt;Launch Podman Desktop and follow the prompts to install the Podman engine if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Download the Podman installer from the official Podman website or GitHub releases.&lt;/li&gt;
&lt;li&gt;Run the installer and follow the prompts.&lt;/li&gt;
&lt;li&gt;Podman uses Windows Subsystem for Linux (WSLv2) to run containers.&lt;/li&gt;
&lt;li&gt;After installation, initialize and start Podman using Podman Desktop or with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;podman&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;machine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;podman&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;machine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;podman&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can use Podman from PowerShell, CMD, or directly within the WSL environment.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Podman Basic Configuration and Settings
&lt;/h2&gt;

&lt;p&gt;Podman’s behavior can be customized using configuration files and environment variables:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Configuration Files:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;containers.conf&lt;/code&gt;: Sets engine-wide defaults (runtime, network, resource limits).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;storage.conf&lt;/code&gt;: Configures storage drivers and options.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;registries.conf&lt;/code&gt;: Lists container registries for pulling/pushing images.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;policy.json&lt;/code&gt;: Manages image signature verification policies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Environment Variables:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CONTAINERS_CONF&lt;/code&gt;: Path to &lt;code&gt;containers.conf&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CONTAINERS_REGISTRIES_CONF&lt;/code&gt;: Path to &lt;code&gt;registries.conf&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CONTAINERS_STORAGE_CONF&lt;/code&gt;: Path to &lt;code&gt;storage.conf&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CONTAINER_HOST&lt;/code&gt;: URL for remote Podman service (e.g., &lt;code&gt;unix:///run/user/$UID/podman/podman.sock&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TMPDIR&lt;/code&gt;: Directory for temporary image storage.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;, &lt;code&gt;XDG_DATA_HOME&lt;/code&gt;, &lt;code&gt;XDG_RUNTIME_DIR&lt;/code&gt;: Control where configuration, image storage, and runtime data are stored, especially in rootless mode.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Example: Creating and Managing Pods
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create an empty pod:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;podman pod create &lt;span class="nt"&gt;--name&lt;/span&gt; demo-pod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;List pods:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;podman pod &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;List containers in a pod:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;podman ps &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--pod&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Add a container to a pod:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;podman run &lt;span class="nt"&gt;-dt&lt;/span&gt; &lt;span class="nt"&gt;--pod&lt;/span&gt; demo-pod nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary Table: Podman vs Docker
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Podman&lt;/th&gt;
&lt;th&gt;Docker&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Architecture&lt;/td&gt;
&lt;td&gt;Daemonless&lt;/td&gt;
&lt;td&gt;Central daemon required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rootless Mode&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI Compatibility&lt;/td&gt;
&lt;td&gt;Docker-compatible&lt;/td&gt;
&lt;td&gt;Standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Systemd Integration&lt;/td&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;Requires workarounds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod/Kubernetes Support&lt;/td&gt;
&lt;td&gt;Native pods, easy Kubernetes integration&lt;/td&gt;
&lt;td&gt;Requires additional tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Enhanced (rootless, user auditing)&lt;/td&gt;
&lt;td&gt;Higher attack surface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ecosystem&lt;/td&gt;
&lt;td&gt;Growing, less mature&lt;/td&gt;
&lt;td&gt;Large, mature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Lightweight, fast startup&lt;/td&gt;
&lt;td&gt;Slightly higher overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tooling&lt;/td&gt;
&lt;td&gt;Fewer third-party tools&lt;/td&gt;
&lt;td&gt;Extensive tooling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Podman is a powerful alternative to Docker, offering improved security, rootless operation, and native pod support. While its ecosystem is still growing and some advanced features are maturing, it is a strong choice for developers and administrators seeking a secure, flexible, and modern container engine. Installation is straightforward on all major platforms, with both CLI and GUI options available. Configuration is highly customizable, allowing Podman to fit a wide range of use cases.&lt;/p&gt;

</description>
      <category>containers</category>
      <category>development</category>
      <category>shortposts</category>
      <category>docker</category>
    </item>
    <item>
      <title>S3cmd: CLI for Object Storage</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Wed, 05 Mar 2025 16:32:05 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/s3cmd-cli-for-object-storage-2j02</link>
      <guid>https://forem.com/vidyasagarmsc/s3cmd-cli-for-object-storage-2j02</guid>
      <description>&lt;p&gt;In the recent times, I am exploring and playing with &lt;a href="https://dzone.com/articles/top-tools-object-storage-data-management" rel="noopener noreferrer"&gt;Top Tools for Object Storage and Data Management&lt;/a&gt;. In this journey, one of the tools that I was introduced to was s3cmd.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is s3cmd?
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key features of s3cmd include:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Bucket management: Create, list, and delete buckets.
&lt;/li&gt;
&lt;li&gt;Object operations: Upload, download, and delete files within buckets.
&lt;/li&gt;
&lt;li&gt;Synchronization: Sync local directories with S3 buckets.
&lt;/li&gt;
&lt;li&gt;Access control: Modify bucket policies and access control lists.
&lt;/li&gt;
&lt;li&gt;Website hosting: Create and manage static websites hosted on S3.
&lt;/li&gt;
&lt;li&gt;Multipart uploads: Handle large file uploads efficiently.
&lt;/li&gt;
&lt;li&gt;Encryption: Support for server-side encryption.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  s3cmd installation and configuration
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install S3cmd following the&lt;a href="https://github.com/s3tools/s3cmd/blob/master/INSTALL.md" rel="noopener noreferrer"&gt;instructions here&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpb8c8cejjpv9a2p18l2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpb8c8cejjpv9a2p18l2q.png" width="800" height="575"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;s3cmd command on warp&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;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  &lt;strong&gt;s3://…&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;To understand what are HMAC credentials, refer to &lt;a href="https://dzone.com/articles/guide-to-iam-in-object-storage" rel="noopener noreferrer"&gt;my article here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Once you have the HMAC credentials and endpoint, you can run the following command for an interactive configuration.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;s3cmd &lt;span class="nt"&gt;--configure&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Key commands
&lt;/h3&gt;

&lt;p&gt;Here are some commonly used s3cmd commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  s3cmd mb s3://bucket-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;List all buckets:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  s3cmd &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Upload a file to a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  s3cmd put file.txt s3://bucket-name/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Download a file from a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  s3cmd get s3://bucket-name/file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Delete a file from a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   s3cmd &lt;span class="nb"&gt;rm &lt;/span&gt;s3://bucket-name/file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;List objects in a specific bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   s3cmd &lt;span class="nb"&gt;ls &lt;/span&gt;s3://bucket-name/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Synchronize a local directory with a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   s3cmd &lt;span class="nb"&gt;sync &lt;/span&gt;local_directory/ s3://bucket-name/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Set public access for a file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   s3cmd setacl s3://bucket-name/file.txt &lt;span class="nt"&gt;--acl-public&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Delete a bucket:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   s3cmd rb s3://bucket-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;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.&lt;/p&gt;
&lt;h3&gt;
  
  
  403 error resolution
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the many reasons for this error is this configuration parameter that you either forgot to set or wrongly configured&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use “%(bucket)s.s3.amazonaws.com” to the target Amazon S3. “%(bucket)s” and “%(location)s” vars can be used&lt;br&gt;&lt;br&gt;
if the target S3 system supports dns based buckets.&lt;br&gt;&lt;br&gt;
DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The right way to configure this parameter is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%(bucket)s.&amp;lt;END_POINT&amp;gt;

For example:
%(bucket)s.s3.eu-de.cloud-object-storage.appdomain.cloud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the right of credentials, endpoint &amp;amp; the DNS-style is setup, you won’t see the 403 (InvalidAccesskeyId) error.&lt;/p&gt;

&lt;p&gt;If this article is helpful. please clap 👏 and ♻️ share with your network.&lt;/p&gt;




</description>
      <category>cli</category>
      <category>objectstorage</category>
      <category>cloud</category>
      <category>security</category>
    </item>
    <item>
      <title>An Introduction to SymPy: A Python Library for Symbolic Mathematics</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Mon, 06 Jan 2025 20:57:45 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/an-introduction-to-sympy-a-python-library-for-symbolic-mathematics-4gig</link>
      <guid>https://forem.com/vidyasagarmsc/an-introduction-to-sympy-a-python-library-for-symbolic-mathematics-4gig</guid>
      <description>&lt;h3&gt;
  
  
  SymPy is an open-source Python library for symbolic mathematics.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ob6tt83pfsw78xf3ajs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ob6tt83pfsw78xf3ajs.png" width="800" height="814"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;SymPy — Mathematics Python Library&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SymPy&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is SymPy?
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Features of SymPy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Symbolic computation&lt;/strong&gt; : Perform algebraic operations like simplification, expansion, and factorization on symbolic expressions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calculus&lt;/strong&gt; : Compute derivatives, integrals, limits, series expansions, and solve differential equations symbolically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linear algebra&lt;/strong&gt; : Manipulate matrices, solve linear systems, and compute determinants, eigenvalues, and eigenvectors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Equation solving&lt;/strong&gt; : Solve algebraic equations (linear, polynomial, non-linear) symbolically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plotting&lt;/strong&gt; : Generate plots of functions and equations, both symbolic and numerical.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Installing SymPy
&lt;/h3&gt;

&lt;p&gt;To install SymPy, you can use pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install sympy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, you can import the library into your Python script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import sympy as sp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic Usage of SymPy
&lt;/h3&gt;

&lt;p&gt;Let’s start by using SymPy to define symbolic variables and perform some basic algebraic manipulations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Defining Symbolic Variables
&lt;/h3&gt;

&lt;p&gt;You can define symbolic variables using the symbols function. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import sympy as sp

# Define symbols
x, y, z = sp.symbols('x y z')

# Display the symbols
print(x, y, z)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Simple Algebraic Operations
&lt;/h3&gt;

&lt;p&gt;Once you’ve defined symbolic variables, you can perform various algebraic operations such as addition, multiplication, and exponentiation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Define an expression
expr = x**2 + 2*x + 1

# Simplify the expression
simplified_expr = sp.simplify(expr)
print("Simplified expression:", simplified_expr)

# Expand a binomial
expanded_expr = sp.expand((x + 1)**2)
print("Expanded expression:", expanded_expr)

# Factor an expression
factored_expr = sp.factor(x**2 + 2*x + 1)
print("Factored expression:", factored_expr)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Simplification and Expansion
&lt;/h3&gt;

&lt;p&gt;SymPy has built-in functions for simplifying and expanding expressions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Simplify the expression x**2 - 2*x + 1 - (x - 1)**2
expr_to_simplify = x**2 - 2*x + 1 - (x - 1)**2
simplified = sp.simplify(expr_to_simplify)
print("Simplified expression:", simplified)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solving Equations
&lt;/h3&gt;

&lt;p&gt;SymPy makes it easy to solve equations symbolically. Here’s how to solve a linear equation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Solve x + 3 = 7
solution = sp.solve(x + 3 - 7, x)
print("Solution:", solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For solving quadratic equations, SymPy will return all possible roots:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Solve a quadratic equation
quadratic_solution = sp.solve(x**2 - 5*x + 6, x)
print("Quadratic solution:", quadratic_solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Calculus Operations
&lt;/h3&gt;

&lt;p&gt;SymPy excels in symbolic calculus. Let’s look at some common operations, such as differentiation and integration.&lt;/p&gt;

&lt;h4&gt;
  
  
  Differentiation
&lt;/h4&gt;

&lt;p&gt;To compute the derivative of an expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Derivative of x **3 + 2*x** 2 + x with respect to x
derivative = sp.diff(x **3 + 2*x** 2 + x, x)
print("Derivative:", derivative)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Integration
&lt;/h4&gt;

&lt;p&gt;To compute the integral of an expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Integral of x**2 with respect to x
integral = sp.integrate(x**2, x)
print("Integral:", integral)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Limits
&lt;/h4&gt;

&lt;p&gt;You can also compute limits of expressions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Limit of (sin(x)/x) as x approaches 0
limit = sp.limit(sp.sin(x)/x, x, 0)
print("Limit:", limit)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Series Expansion
&lt;/h4&gt;

&lt;p&gt;SymPy allows you to expand an expression as a series around a given point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Series expansion of exp(x) around x = 0
series_expansion = sp.series(sp.exp(x), x, 0, 5)
print("Series expansion:", series_expansion)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solving Differential Equations
&lt;/h3&gt;

&lt;p&gt;SymPy also provides tools for solving ordinary differential equations (ODEs) symbolically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Solve the differential equation y'' - 2*y' + y = 0
y = sp.Function('y')
ode_solution = sp.dsolve(y(x).diff(x, x) - 2*y(x).diff(x) + y(x), y(x))
print("Differential equation solution:", ode_solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Linear Algebra with SymPy
&lt;/h3&gt;

&lt;p&gt;SymPy has robust support for linear algebra operations. Let’s see how to perform matrix operations and solve linear systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  Matrix Operations
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Define matrices
A = sp.Matrix([[1, 2], [3, 4]])
B = sp.Matrix([[5, 6], [7, 8]])

# Matrix addition
C = A + B
print("Matrix addition:\n", C)

# Matrix multiplication
D = A * B
print("Matrix multiplication:\n", D)

# Determinant of a matrix
det_A = A.det()
print("Determinant of A:", det_A)

# Eigenvalues and eigenvectors
eigen = A.eigenvals(), A.eigenvects()
print("Eigenvalues and eigenvectors:", eigen)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Solving a Linear System
&lt;/h4&gt;

&lt;p&gt;You can solve systems of linear equations symbolically using the linsolve function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Solve the system of equations: x + y = 2, x - y = 0
system = [x + y - 2, x - y]
solution = sp.linsolve(system, x, y)
print("Solution to the system:", solution)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Plotting with SymPy
&lt;/h3&gt;

&lt;p&gt;SymPy includes basic plotting capabilities for visualizing symbolic expressions. You can use the plot function for this purpose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sympy.plotting import plot

# Plot the function sin(x)
plot(sp.sin(x))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Advanced Features of SymPy
&lt;/h3&gt;

&lt;p&gt;SymPy has many more advanced features such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mathematical functions&lt;/strong&gt; : Special functions like gamma, Bessel, and error functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solving Diophantine equations&lt;/strong&gt; : SymPy can handle integer solutions for certain equations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SymPy physics module&lt;/strong&gt; : For symbolic calculations in physics, including mechanics, optics, and quantum mechanics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Symbolic Fourier transforms&lt;/strong&gt; : Useful for signal processing and other applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code generation&lt;/strong&gt; : Generate Python, C, Fortran, or other language code for symbolic expressions.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Applications in Various Fields
&lt;/h3&gt;

&lt;p&gt;SymPy finds applications in numerous domains:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Physics&lt;/strong&gt; : Quantum mechanics calculations and equation derivations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineering&lt;/strong&gt; : Solving complex mathematical models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Computer Science&lt;/strong&gt; : Algorithm analysis and optimization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finance&lt;/strong&gt; : Option pricing and risk analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Code Generation
&lt;/h3&gt;

&lt;p&gt;One of SymPy’s powerful features is its ability to generate code in various programming languages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sympy.utilities.codegen import codegen 
expr = x**2 + sin(x) [(c_name, c_code), (h_name, c_header)] = codegen(('f', expr), 'C', 'file', header=False, empty=False) 
print(c_code)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This feature allows users to convert symbolic expressions into efficient, executable code for numerical computation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Jupyter Notebook with the outputs is available on the &lt;a href="https://github.com/VidyasagarMSC/PyDataFlowNote/tree/main" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. You can run the Jupyter Notebook on Colab following the instructions on the GitHub repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://vmacwrites.substack.com/p/an-introduction-to-sympy-a-python" rel="noopener noreferrer"&gt;&lt;em&gt;https://vmacwrites.substack.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>python</category>
      <category>libraries</category>
      <category>mathematics</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Pandas: Conversion using loc and iloc</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Wed, 01 Jan 2025 22:00:39 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/pandas-conversion-using-loc-and-iloc-594b</link>
      <guid>https://forem.com/vidyasagarmsc/pandas-conversion-using-loc-and-iloc-594b</guid>
      <description>&lt;h3&gt;
  
  
  Pandas is a powerful Python library used for data manipulation and analysis.
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A-tneCIMuJinqy0su" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2A-tneCIMuJinqy0su" width="800" height="1200"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Kevin Canlas on Unsplash&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Features of Pandas
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Data Structures: Pandas introduces two primary data structures:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Series: A one-dimensional labeled array&lt;/li&gt;
&lt;li&gt;DataFrame: A two-dimensional labeled data structure with columns of potentially different types&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Data Manipulation: Pandas offers functions for analyzing, cleaning, exploring, and manipulating data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Analysis: It enables users to perform complex operations like correlation analysis, grouping, and statistical calculations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Visualization: Pandas integrates well with other libraries to create insightful visualizations.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Practical Examples
&lt;/h3&gt;
&lt;h3&gt;
  
  
  Indexing with loc
&lt;/h3&gt;

&lt;p&gt;The loc function enables label-based indexing in DataFrames, allowing precise data selection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="c1"&gt;# Create a sample DataFrame
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DataFrame&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;C&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;z&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;# Select rows with label 'y' and 'z', and columns 'A' and 'C'
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;z&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;C&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The iloc function provides integer-based indexing for DataFrame selection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="c1"&gt;# Create a sample DataFrame
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DataFrame&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;C&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;

&lt;span class="c1"&gt;# Select rows 0 and 2, and columns 1 and 2
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iloc&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Date Conversion with to_datetime
&lt;/h3&gt;

&lt;p&gt;The to_datetimefunction transforms various date formats into standardized datetime objects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="c1"&gt;# Convert string to datetime
&lt;/span&gt;&lt;span class="n"&gt;date_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2023-09-17 14:30:00&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;dt_object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date_string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt_object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Convert multiple date strings
&lt;/span&gt;&lt;span class="n"&gt;date_series&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Series&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20200101&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20200201&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20200301&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;dt_series&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date_series&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%Y%m%d&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dt_series&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2023-09-17 14:30:00
0 2020-01-01
1 2020-02-01
2 2020-03-01
dtype: datetime64[ns]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Something to consider while using loc or iloc
&lt;/h3&gt;

&lt;p&gt;Let’s convert the object column date to datetime using loc&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DataFrame&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2023-01-01&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2023-02-15&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2023-03-31&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dtypes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 

   &lt;span class="n"&gt;date&lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;2023&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2023&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;2023&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;31&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt;
&lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you observe, the dtype is object not &lt;strong&gt;&lt;em&gt;datetime64[ns]&lt;/em&gt;&lt;/strong&gt;. If you try to extract the date using df['date'].dt.date&lt;/p&gt;

&lt;p&gt;You will see an error as the conversion was not successful.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Traceback (most recent call last):
  File "/HelloWorld.py", line 11, in &amp;lt;module&amp;gt;
    print(df.dt.date)
          ^^^^^
  File "/usr/local/lib/python3.12/dist-packages/pandas/core/generic.py", line 6299, in __getattr__
    return object. __getattribute__ (self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DataFrame' object has no attribute 'dt'. Did you mean: 'at'?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason lies in the changes made in version 2.x.x of Pandas.&lt;/p&gt;

&lt;p&gt;From &lt;a href="https://pandas.pydata.org/docs/dev/whatsnew/v2.0.0.html#removal-of-prior-version-deprecations-changes" rel="noopener noreferrer"&gt;What’s new in 2.0.0 (April 3, 2023)&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Changed behavior in setting values with&lt;/em&gt; &lt;em&gt;df.loc[:, foo] = bar or&lt;/em&gt; &lt;em&gt;df.iloc[:, foo] = bar, these now always attempt to set values inplace before falling back to casting (&lt;/em&gt;&lt;a href="https://github.com/pandas-dev/pandas/issues/45333" rel="noopener noreferrer"&gt;&lt;em&gt;GH 45333&lt;/em&gt;&lt;/a&gt;&lt;em&gt;)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to overcome:
&lt;/h3&gt;

&lt;p&gt;The best way to address this issue is to either avoid using loc or iloc or as suggested on the &lt;a href="https://pandas.pydata.org/docs/whatsnew/v1.5.0.html#inplace-operation-when-setting-values-with-loc-and-iloc" rel="noopener noreferrer"&gt;Pandas documentation&lt;/a&gt; use &lt;strong&gt;DataFrame.__setitem__()&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = pd.DataFrame({'date': ['2023-01-01', '2023-02-15', '2023-03-31']})

df['date'] = pd.to_datetime(df.loc[:, 'date'])

print(df)
print(df.dtypes)

print(df['date'].dt.date)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional read:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/76766136/pandas-pd-to-datetime-assigns-object-dtype-instead-of-datetime64ns" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/76766136/pandas-pd-to-datetime-assigns-object-dtype-instead-of-datetime64ns&lt;/a&gt;&lt;/p&gt;




</description>
      <category>pandas</category>
      <category>data</category>
    </item>
    <item>
      <title>Reflecting on My 2024 Journey: Achievements and Growth</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Sun, 08 Dec 2024 17:13:01 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/reflecting-on-my-2024-journey-achievements-and-growth-1joj</link>
      <guid>https://forem.com/vidyasagarmsc/reflecting-on-my-2024-journey-achievements-and-growth-1joj</guid>
      <description>&lt;p&gt;As I think on 2024, I’m overwhelmed with gratitude and excitement for the incredible journey I’ve experienced. This year has been a remarkable chapter in my professional and personal growth. I have achieved significant milestones. I have received heartwarming support from my incredible network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8adjyvb0i5xyocts8z78.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8adjyvb0i5xyocts8z78.jpg" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Professional Milestones
&lt;/h2&gt;

&lt;p&gt;This year brought some extraordinary recognition that I’m truly humbled by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Most Admired Global Indian 2024&lt;/strong&gt; – &lt;a href="https://www.passionvista.com/sarath-chandra-vidya-sagar-machupalli/" rel="noopener noreferrer"&gt;https://www.passionvista.com/sarath-chandra-vidya-sagar-machupalli/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BCS Fellowship&lt;/strong&gt;  acknowledging my contributions to the IT industry in June 2024&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distinguished Architect Certification&lt;/strong&gt;  from The Open Group in March 2024&lt;/li&gt;
&lt;li&gt;Member of &lt;strong&gt;Association of Enterprise Architects AEA&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs7l1t373viugqxjuf7c3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs7l1t373viugqxjuf7c3.jpg" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Passion and Purpose
&lt;/h2&gt;

&lt;p&gt;At IBM, I’ve continued to dive deep into my core passions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quantum computing&lt;/li&gt;
&lt;li&gt;Data science&lt;/li&gt;
&lt;li&gt;Machine learning&lt;/li&gt;
&lt;li&gt;Cloud technologies&lt;/li&gt;
&lt;li&gt;Solution architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reflecting on my recent experiences, I had the incredible opportunity to attend the  &lt;strong&gt;Quantum Ideas Summer School&lt;/strong&gt;. This immersive event featured sessions led by renowned quantum professors and researchers, focusing on the fundamentals of quantum computation and its potential applications. Engaging with experts in the field not only deepened my understanding of quantum technologies but also inspired me to explore innovative solutions that harness these advancements.&lt;/p&gt;

&lt;p&gt;Throughout my journey, I have continuously sought to expand my skill set, particularly in emerging technologies. My commitment to lifelong learning has led me to earn several certifications that enhance my expertise. Notably, I completed a  &lt;strong&gt;Practical Introduction to Quantum-Safe Cryptography&lt;/strong&gt;  certification from IBM in April 2024, which has equipped me with valuable insights into the intersection of quantum computing and cybersecurity.&lt;/p&gt;

&lt;p&gt;In addition to my quantum-focused skills, I have developed a comprehensive portfolio of technical competencies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI and Machine Learning&lt;/strong&gt; : I hold the “&lt;a href="http://watsonx.ai/" rel="noopener noreferrer"&gt;watsonx.ai&lt;/a&gt; Data Science and MLOps Sales Foundation” certification from IBM, which has broadened my understanding of machine learning models and their deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Technologies&lt;/strong&gt; : My experience with IBM Cloud continues to grow, allowing me to design and implement cloud-native solutions effectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Software Development&lt;/strong&gt; : With over 17 years in software development, I am proficient in multiple programming languages and frameworks, enabling me to tackle diverse projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solution Architecture&lt;/strong&gt; : As a Senior Certified Solutions Architect at IBM, I focus on creating scalable and efficient architectures that meet client needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These skills not only empower me to contribute effectively to my current role but also position me as a thought leader in the tech community. I remain dedicated to sharing knowledge through speaking engagements, writing articles, and participating in open-source projects. My goal is to inspire others while driving digital transformation through innovative technology solutions.&lt;/p&gt;

&lt;p&gt;My journey has always been about more than just technical expertise. It’s about creating  &lt;strong&gt;innovative solutions&lt;/strong&gt;  that bridge technology and human potential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Community Engagement
&lt;/h2&gt;

&lt;p&gt;In 2024, I had the privilege of serving as a judge for multiple prestigious awards, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Globee® Awards for Technology in May 2024&lt;/li&gt;
&lt;li&gt;Globee® Awards for Customer Excellence in May 2024&lt;/li&gt;
&lt;li&gt;Golden Bridge Awards® in June 2024&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I continued to engage with the community. I served as a core member and organizer of the BlueCoders Meetup Community. I fostered collaboration and innovation among peers.&lt;/p&gt;

&lt;h2&gt;
  
  
  I’m excited to share some of the technical articles I published in 2024:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“Latest Data Architectures, Tools, and Technologies: Emerging Trends” (October 23, 2024)&lt;/li&gt;
&lt;li&gt;“Nurturing the Developer Within: A Journey of Growth and Community” (December 1, 2024)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These articles show my ongoing commitment to sharing knowledge and insights with the tech community. I’m particularly proud of reaching over &lt;strong&gt;60,000 total&lt;/strong&gt; views on my &lt;a href="https://dev.to/vidyasagarmsc/nurturing-the-developer-within-a-journey-of-growth-and-2n9o"&gt;Dev.to&lt;/a&gt; posts, a milestone that underscores the value of community engagement and knowledge sharing.&lt;/p&gt;

&lt;p&gt;Throughout the year, I continued to contribute to DZone as an expert, with my articles accumulating &lt;strong&gt;431.9K&lt;/strong&gt; pageviews (as of 1st Jan, 2025) across &lt;strong&gt;72&lt;/strong&gt; publications. This platform has been an excellent avenue for discussing cloud technologies, AI, and various other tech topics.&lt;/p&gt;

&lt;p&gt;I’m grateful for the opportunity to contribute to the tech community through these publications. I look forward to sharing more insights in the coming year.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;— &lt;a href="https://bsky.app/profile/did:plc:s56vjrjpief27hfjjsp3rdey?ref_src=embed" rel="noopener noreferrer"&gt;VidyaSagar Machupalli (@vidyasagarmsc.bsky.social)&lt;/a&gt; &lt;a href="https://bsky.app/profile/did:plc:s56vjrjpief27hfjjsp3rdey/post/3lcq7bv2xks2h?ref_src=embed" rel="noopener noreferrer"&gt;2024-12-07T17:17:51.550Z&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Personal Reflection
&lt;/h2&gt;

&lt;p&gt;As a multi-faceted professional – an architect, speaker, writer, and photographer – I’ve been fortunate to explore technologies that can truly transform our world. My goal remains consistent: to develop solutions that solve real-world problems, mentor emerging talents, and contribute to open-source projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Social Media Highlights
&lt;/h2&gt;

&lt;p&gt;Throughout the year, I shared insights and updates on my social media platforms – &lt;a href="https://vidyasagarmsc.github.io/#connect" rel="noopener noreferrer"&gt;https://vidyasagarmsc.github.io/#connect&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Heartfelt Thank You
&lt;/h2&gt;

&lt;p&gt;To my mentors, colleagues, friends, and family:&lt;br&gt;&lt;br&gt;
Your unwavering support has been my greatest strength. Each challenge, each opportunity has been a stepping stone, and I’m grateful for every moment of this incredible journey.&lt;/p&gt;

&lt;p&gt;To the tech community that has embraced me:&lt;br&gt;&lt;br&gt;
Your collaboration, feedback, and shared passion continue to inspire me. Together, we’re not just developing technology – we’re shaping the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s to continuous learning, innovation, and creating a better tomorrow!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Blogs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dzone.com/authors/vidyasagarmsc" rel="noopener noreferrer"&gt;https://dzone.com/authors/vidyasagarmsc&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/vidyasagarmsc/nurturing-the-developer-within-a-journey-of-growth-and-2n9o"&gt;https://dev.to/vidyasagarmsc/nurturing-the-developer-within-a-journey-of-growth-and-2n9o&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vidyasagarmsc.github.io" rel="noopener noreferrer"&gt;https://vidyasagarmsc.github.io&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>newyearchallenge</category>
      <category>devchallenge</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>Nurturing the Developer Within: A Journey of Growth and Community</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Sun, 01 Dec 2024 17:01:49 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/nurturing-the-developer-within-a-journey-of-growth-and-2n9o</link>
      <guid>https://forem.com/vidyasagarmsc/nurturing-the-developer-within-a-journey-of-growth-and-2n9o</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of technology, keeping the developer inside you alive&lt;br&gt;
is not just a choice—it's a necessity. As we navigate through our careers, it's easy&lt;br&gt;
to get caught up in the day-to-day tasks and forget the essence of what makes us&lt;br&gt;
developers: our curiosity, our drive to solve problems, and our passion for creating.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Essence of the Inner Developer
&lt;/h2&gt;

&lt;p&gt;At its core, the developer spirit is about more than just writing code. It's about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Continuous Learning : Embracing new technologies and methodologies.&lt;/li&gt;
&lt;li&gt;Problem-Solving : Approaching challenges with creativity and persistence.&lt;/li&gt;
&lt;li&gt;Innovation : Thinking outside the box to create novel solutions.&lt;/li&gt;
&lt;li&gt;Collaboration : Working with others to achieve greater outcomes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Keeping Your Developer Spirit Alive Matters
&lt;/h2&gt;

&lt;p&gt;Maintaining your inner developer is crucial for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Career Longevity : The tech industry moves fast. Staying current ensures you remain valuable.&lt;/li&gt;
&lt;li&gt;Personal Growth : Challenging yourself leads to new skills and perspectives.&lt;/li&gt;
&lt;li&gt;Job Satisfaction : Engaging with new ideas keeps your work exciting and fulfilling.&lt;/li&gt;
&lt;li&gt;Leadership Opportunities : A developer mindset is invaluable in guiding teams and projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Power of Community and Sharing
&lt;/h2&gt;

&lt;p&gt;One of the most effective ways to keep your developer spirit thriving is by engaging with the community and sharing your knowledge. This is where platforms like Dev.to come into play.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Dev.to Journey: A Celebration of 60K+ Views&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm incredibly excited and grateful to announce that my posts on Dev.to have surpassed 60,000 total views! This milestone is not just a personal achievement; it's a testament to the power of community engagement and knowledge sharing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A heartfelt thank you&lt;/strong&gt; to everyone who has read, commented, shared, and engaged with my content. Your support and interaction have been invaluable in this journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Sharing Matters
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Reinforces Learning : Explaining concepts to others deepens your own understanding.&lt;/li&gt;
&lt;li&gt;Builds Your Brand : Consistent sharing establishes you as a thought leader.&lt;/li&gt;
&lt;li&gt;Helps Others : Your insights might be exactly what another developer needs.&lt;/li&gt;
&lt;li&gt;Creates Opportunities : Sharing can lead to collaborations, job offers, and speaking engagements.&lt;/li&gt;
&lt;li&gt;Gives Back : Contributing to the community that has helped you grow.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Strategies to Keep Your Inner Developer Alive
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Set Personal Coding Challenges : Take on projects outside of work that excite you.&lt;/li&gt;
&lt;li&gt;Attend Tech Meetups and Conferences : Connect with like-minded individuals and learn about cutting-edge technologies.&lt;/li&gt;
&lt;li&gt;Contribute to Open Source : Collaborate with developers worldwide on projects that matter.&lt;/li&gt;
&lt;li&gt;Read and Write Technical Blogs : Stay informed and share your own experiences.&lt;/li&gt;
&lt;li&gt;Experiment with New Technologies : Don't be afraid to play with new tools and frameworks.&lt;/li&gt;
&lt;li&gt;Mentor Others : Teaching is one of the best ways to reinforce your own knowledge.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Impact of Community Engagement
&lt;/h2&gt;

&lt;p&gt;Engaging with the developer community, whether through platforms like Dev.to, GitHub, or local meetups, has numerous benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exposure to Diverse Perspectives : Learn how others approach problems.&lt;/li&gt;
&lt;li&gt;Networking : Build relationships that can lead to collaborations or career opportunities.&lt;/li&gt;
&lt;li&gt;Motivation : Seeing others' achievements can inspire you to push further.&lt;/li&gt;
&lt;li&gt;Support
: Find help when you're stuck on a problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Looking Forward
&lt;/h2&gt;

&lt;p&gt;As we celebrate milestones like reaching 60K+ views, it's important to remember that the journey of a developer is ongoing. Each article written, each problem solved, and  each interaction with the community is a step forward in our collective growth.&lt;/p&gt;

&lt;p&gt;I invite you to join me in this journey of continuous learning and sharing. Check out my articles on Dev.to, where I cover topics ranging from cloud technologies to DevOps practices, and let's continue to grow together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Keeping the developer inside you alive is about maintaining that spark of curiosity and the drive to create. It's about seeing every challenge as an opportunity to learn and grow. By engaging with the community, sharing our knowledge, and staying open to new ideas, we not only enhance our own careers but also contribute to the advancement of our field as a whole.&lt;/p&gt;

&lt;p&gt;Thank you once again for being part of this incredible journey. Here's to many more milestones, breakthroughs, and shared learnings in the future!&lt;/p&gt;

</description>
      <category>shortposts</category>
      <category>beginners</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>IceCream: A Sweet Alternative to Print Debugging in Python</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Wed, 20 Nov 2024 22:57:03 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/icecream-a-sweet-alternative-to-print-debugging-in-python-1lhg</link>
      <guid>https://forem.com/vidyasagarmsc/icecream-a-sweet-alternative-to-print-debugging-in-python-1lhg</guid>
      <description>&lt;p&gt;Tired of cluttering your code with print statements for debugging? Enter IceCream, a Python library that makes debugging effortless and more readable. Let's explore how IceCream can sweeten your debugging experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;First, install IceCream using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;icecream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic Usage
&lt;/h2&gt;

&lt;p&gt;To use IceCream, import the &lt;code&gt;ic&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;icecream&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ic&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's compare traditional print debugging with IceCream:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Traditional print debugging
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x + y:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="c1"&gt;# Using IceCream
&lt;/span&gt;&lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x: 5
y: 10
x + y: 15

ic| x: 5
ic| y: 10
ic| x + y: 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, IceCream automatically prints both the variable names and their values, making the output more informative and easier to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debugging Functions
&lt;/h2&gt;

&lt;p&gt;IceCream really shines when debugging functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;

&lt;span class="c1"&gt;# Traditional print debugging
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;square(4):&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Using IceCream
&lt;/span&gt;&lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;square(4): 16

ic| square(4): 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;IceCream displays the function call along with its result, providing more context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pretty-Printing Data Structures
&lt;/h2&gt;

&lt;p&gt;IceCream formats complex data structures for better readability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Alice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;age&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scores&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;92&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;

&lt;span class="c1"&gt;# Traditional print debugging
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Using IceCream
&lt;/span&gt;&lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data: {'name': 'Alice', 'age': 30, 'scores': [85, 90, 92]}

ic| data: {
    'name': 'Alice',
    'age': 30,
    'scores': [85, 90, 92]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The IceCream output is much easier to read, especially for nested structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Including Context
&lt;/h2&gt;

&lt;p&gt;IceCream can optionally include file, line number, and function context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configureOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;includeContext&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;example_function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;
    &lt;span class="nf"&gt;ic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;example_function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ic| example.py:3 in example_function()- x: 42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This feature is invaluable when debugging larger codebases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;IceCream offers a more efficient and readable alternative to traditional print debugging. By automatically including variable names, formatting complex structures, and optionally providing context, IceCream can significantly speed up your debugging process. Give it a try in your next Python project and experience the difference for yourself!&lt;/p&gt;

</description>
      <category>python</category>
      <category>shortposts</category>
      <category>code</category>
    </item>
    <item>
      <title>Chain of Trust: Decoding SSL Certificate Security Architecture</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Mon, 18 Nov 2024 14:01:50 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/chain-of-trust-decoding-ssl-certificate-security-architecture-9lo</link>
      <guid>https://forem.com/vidyasagarmsc/chain-of-trust-decoding-ssl-certificate-security-architecture-9lo</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Chain of Trust
&lt;/h3&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Root Certificate Authority (Root CA)&lt;/li&gt;
&lt;li&gt;Intermediate Certificate Authority (Intermediate CA)&lt;/li&gt;
&lt;li&gt;End-entity Certificate (Server or Client Certificate)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Root Certificate Authority (Root CA)
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Key characteristics of Root CAs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Self-signed certificates&lt;/li&gt;
&lt;li&gt;Stored securely offline to prevent compromise&lt;/li&gt;
&lt;li&gt;Long validity periods (typically 20–30 years)&lt;/li&gt;
&lt;li&gt;Highly trusted and recognized globally&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intermediate Certificate Authority (Intermediate CA)
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Key characteristics of Intermediate CAs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Issued by Root CAs&lt;/li&gt;
&lt;li&gt;Can issue certificates to end-entities or other Intermediate CAs&lt;/li&gt;
&lt;li&gt;Shorter validity periods than Root CAs (typically 10–15 years)&lt;/li&gt;
&lt;li&gt;Enhance security and flexibility in certificate management&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  End-entity Certificate
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Key characteristics of End-entity Certificates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Issued by Intermediate CAs or, occasionally, Root CAs&lt;/li&gt;
&lt;li&gt;Shortest validity period (typically 1–2 years)&lt;/li&gt;
&lt;li&gt;Contains information about the entity it represents (e.g., domain name for websites)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gn8ra0zrli4wmlvui8g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0gn8ra0zrli4wmlvui8g.png" width="669" height="1653"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;SSL Chain of trust generated using Eraser&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Role in Security
&lt;/h3&gt;

&lt;p&gt;The chain of trust plays a crucial role in ensuring the security and integrity of online communications:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; : It verifies the identity of the certificate holder, ensuring that you’re communicating with the intended party.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrity&lt;/strong&gt; : It ensures that the certificate hasn’t been tampered with or altered in transit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encryption&lt;/strong&gt; : While not directly responsible for encryption, a valid certificate chain is necessary for establishing encrypted connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revocation&lt;/strong&gt; : If a certificate in the chain is compromised, it can be revoked, invalidating all certificates below it in the chain.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Tools to Check Chain of Trust and Certificate Validity
&lt;/h3&gt;

&lt;p&gt;Several tools are available to verify the chain of trust and validate certificates:&lt;/p&gt;
&lt;h3&gt;
  
  
  OpenSSL
&lt;/h3&gt;

&lt;p&gt;OpenSSL is a versatile command-line tool that can perform various SSL/TLS-related tasks.&lt;/p&gt;

&lt;p&gt;To check a certificate chain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl s_client -connect example.com:443 -showcerts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will display the entire certificate chain and highlight any issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Certificate Checker Tools
&lt;/h3&gt;

&lt;p&gt;Many online services provide comprehensive certificate checking capabilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SSL Labs Server Test&lt;/strong&gt; : Offers in-depth analysis of SSL/TLS configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DigiCert Certificate Inspector&lt;/strong&gt; : Scans for certificate issues across your entire network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qualys SSL Server Test&lt;/strong&gt; : Provides detailed information about SSL/TLS configuration and potential vulnerabilities.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Browser Developer Tools
&lt;/h3&gt;

&lt;p&gt;Modern web browsers include developer tools that can display certificate information:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the padlock icon in the address bar.&lt;/li&gt;
&lt;li&gt;Select “Certificate” or a similar option.&lt;/li&gt;
&lt;li&gt;Review the certificate details, including the chain of trust.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Certificate Validation Process
&lt;/h3&gt;

&lt;p&gt;When a client connects to a server, it performs several checks to validate the certificate:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Signature Verification&lt;/strong&gt; : The client verifies each certificate’s digital signature in the chain, starting from the end-entity certificate up to the Root CA.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust Anchor Check&lt;/strong&gt; : The client checks if the Root CA is in its list of trusted root certificates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validity Period&lt;/strong&gt; : The client ensures all certificates in the chain are within their validity periods.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revocation Check&lt;/strong&gt; : The client may check if any certificates in the chain have been revoked using Certificate Revocation Lists (CRLs) or Online Certificate Status Protocol (OCSP).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name Matching&lt;/strong&gt; : 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.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Common Issues in Certificate Chain Validation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Incomplete Chain&lt;/strong&gt; : The server doesn’t provide all necessary intermediate certificates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expired Certificates&lt;/strong&gt; : One or more certificates in the chain have expired.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revoked Certificates&lt;/strong&gt; : A certificate in the chain has been revoked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name Mismatch&lt;/strong&gt; : The server’s certificate doesn’t match the domain name being accessed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Untrusted Root&lt;/strong&gt; : The Root CA isn’t in the client’s list of trusted roots.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;a href="https://testssl.sh/" rel="noopener noreferrer"&gt;testssl.sh tool&lt;/a&gt; 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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./testssl.sh --jsonfile-pretty SSL_test.json https://example.com:443/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While running ./testssl.sh, if you see an error &lt;em&gt;Chain of trust — NOT ok ,&lt;/em&gt; you need to check whether intermediate certificates are supplied and are part of the chain of trust.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft31wv8rx837o81nvo2ut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft31wv8rx837o81nvo2ut.png" width="800" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are supplying all the certificates including the intermediate certificate but still seeing the error, supply the certificates to the testssh using the &lt;em&gt;add-ca&lt;/em&gt; flag pointing to the folder with all the certificates in the chain of trust&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./testssl.sh --add-ca ~/Downloads/amc-private-certificate --jsonfile-pretty SSL_test.json https://example.com:443/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result should now be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "id": "cert_chain_of_trust",
    "severity": "OK",
    "finding": "passed."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;




</description>
      <category>ssl</category>
      <category>security</category>
    </item>
    <item>
      <title>Git push: fatal: the remote end hung up unexpectedly</title>
      <dc:creator>Vidyasagar SC Machupalli</dc:creator>
      <pubDate>Tue, 10 Sep 2024 04:26:05 +0000</pubDate>
      <link>https://forem.com/vidyasagarmsc/git-push-fatal-the-remote-end-hung-up-unexpectedly-29bi</link>
      <guid>https://forem.com/vidyasagarmsc/git-push-fatal-the-remote-end-hung-up-unexpectedly-29bi</guid>
      <description>&lt;p&gt;Everthing was working as expected when I closed my laptop yesterday and today morning when I try running &lt;code&gt;mkdocs gh-deploy&lt;/code&gt;. I see the below error &lt;/p&gt;

&lt;h2&gt;
  
  
  Error
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Enumerating objects: 101, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Counting objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;101/101&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Delta compression using up to 16 threads
Compressing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;32/32&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
send-pack: unexpected disconnect &lt;span class="k"&gt;while &lt;/span&gt;reading sideband packet
Writing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;54/54&lt;span class="o"&gt;)&lt;/span&gt;, 1.30 MiB | 1.73 MiB/s, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
Total 54 &lt;span class="o"&gt;(&lt;/span&gt;delta 23&lt;span class="o"&gt;)&lt;/span&gt;, reused 0 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
Traceback &lt;span class="o"&gt;(&lt;/span&gt;most recent call last&lt;span class="o"&gt;)&lt;/span&gt;:
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/bin/mkdocs"&lt;/span&gt;, line 8, &lt;span class="k"&gt;in&lt;/span&gt; &amp;lt;module&amp;gt;
    sys.exit&lt;span class="o"&gt;(&lt;/span&gt;cli&lt;span class="o"&gt;())&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/click/core.py"&lt;/span&gt;, line 1157, &lt;span class="k"&gt;in &lt;/span&gt;__call__
    &lt;span class="k"&gt;return &lt;/span&gt;self.main&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;args, &lt;span class="k"&gt;**&lt;/span&gt;kwargs&lt;span class="o"&gt;)&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/click/core.py"&lt;/span&gt;, line 1078, &lt;span class="k"&gt;in &lt;/span&gt;main
    rv &lt;span class="o"&gt;=&lt;/span&gt; self.invoke&lt;span class="o"&gt;(&lt;/span&gt;ctx&lt;span class="o"&gt;)&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/click/core.py"&lt;/span&gt;, line 1688, &lt;span class="k"&gt;in &lt;/span&gt;invoke
    &lt;span class="k"&gt;return &lt;/span&gt;_process_result&lt;span class="o"&gt;(&lt;/span&gt;sub_ctx.command.invoke&lt;span class="o"&gt;(&lt;/span&gt;sub_ctx&lt;span class="o"&gt;))&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/click/core.py"&lt;/span&gt;, line 1434, &lt;span class="k"&gt;in &lt;/span&gt;invoke
    &lt;span class="k"&gt;return &lt;/span&gt;ctx.invoke&lt;span class="o"&gt;(&lt;/span&gt;self.callback, &lt;span class="k"&gt;**&lt;/span&gt;ctx.params&lt;span class="o"&gt;)&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/click/core.py"&lt;/span&gt;, line 783, &lt;span class="k"&gt;in &lt;/span&gt;invoke
    &lt;span class="k"&gt;return &lt;/span&gt;__callback&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;args, &lt;span class="k"&gt;**&lt;/span&gt;kwargs&lt;span class="o"&gt;)&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/mkdocs/__main__.py"&lt;/span&gt;, line 318, &lt;span class="k"&gt;in &lt;/span&gt;gh_deploy_command
    gh_deploy.gh_deploy&lt;span class="o"&gt;(&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/mkdocs/commands/gh_deploy.py"&lt;/span&gt;, line 129, &lt;span class="k"&gt;in &lt;/span&gt;gh_deploy
    ghp_import.ghp_import&lt;span class="o"&gt;(&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/ghp_import.py"&lt;/span&gt;, line 285, &lt;span class="k"&gt;in &lt;/span&gt;ghp_import
    git.check_call&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'push'&lt;/span&gt;, opts[&lt;span class="s1"&gt;'remote'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, opts[&lt;span class="s1"&gt;'branch'&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/site-packages/ghp_import.py"&lt;/span&gt;, line 119, &lt;span class="k"&gt;in &lt;/span&gt;check_call
    sp.check_call&lt;span class="o"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'git'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; + list&lt;span class="o"&gt;(&lt;/span&gt;args&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;**&lt;/span&gt;kwargs&lt;span class="o"&gt;)&lt;/span&gt;
  File &lt;span class="s2"&gt;"/Users/vmac/.pyenv/versions/3.9.13/lib/python3.9/subprocess.py"&lt;/span&gt;, line 373, &lt;span class="k"&gt;in &lt;/span&gt;check_call
    raise CalledProcessError&lt;span class="o"&gt;(&lt;/span&gt;retcode, cmd&lt;span class="o"&gt;)&lt;/span&gt;
subprocess.CalledProcessError: Command &lt;span class="s1"&gt;'['&lt;/span&gt;git&lt;span class="s1"&gt;', '&lt;/span&gt;push&lt;span class="s1"&gt;', '&lt;/span&gt;origin&lt;span class="s1"&gt;', '&lt;/span&gt;gh-pages&lt;span class="s1"&gt;']'&lt;/span&gt; returned non-zero &lt;span class="nb"&gt;exit &lt;/span&gt;status 1.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is this error?
&lt;/h2&gt;

&lt;p&gt;The error message &lt;strong&gt;"fatal: The remote end hung up unexpectedly"&lt;/strong&gt; typically occurs during a Git operation when the server unexpectedly terminates the connection. This issue is often related to the size of the data being pushed or network-related problems. Here are some common causes and solutions:&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Causes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Large File Size&lt;/strong&gt;: The most frequent reason for this error is that the size of the files being pushed exceeds the server's configured limits. This can happen if the repository contains large files or if you're trying to push a large number of changes at once.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Issues&lt;/strong&gt;: High-latency networks or unstable connections can lead to this error, especially if the connection drops during the data transfer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Proxy Server Configuration&lt;/strong&gt;: If you're behind a proxy, it may not support the chunked transfer encoding used by Git, leading to connection issues.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Solutions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Increase the Git Buffer Size&lt;/strong&gt;: You can increase the buffer size to accommodate larger files. Run the following commands in your terminal:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For HTTP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git config &lt;span class="nt"&gt;--global&lt;/span&gt; http.postBuffer 524288000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git config &lt;span class="nt"&gt;--global&lt;/span&gt; ssh.postBuffer 524288000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may adjust the buffer size up to 2 GB if necessary.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check Proxy Settings&lt;/strong&gt;: If you're using a proxy, try bypassing it or adjusting the proxy settings. You can push directly to the server's IP address and port to see if that resolves the issue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduce the Size of the Push&lt;/strong&gt;: If possible, try breaking down your push into smaller commits. This can help avoid exceeding the server limits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Stability&lt;/strong&gt;: Ensure your internet connection is stable. If you're on a high-latency network, consider using a more reliable connection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Configuration&lt;/strong&gt;: If you have control over the server, check the server's configuration to ensure it allows for larger file uploads. This may involve adjusting settings like &lt;code&gt;client_max_body_size&lt;/code&gt; in Nginx or similar configurations in other web servers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following these steps, you should be able to resolve the "fatal: The remote end hung up unexpectedly" error and successfully push your changes to the remote repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional configurations
&lt;/h2&gt;

&lt;p&gt;If setting the &lt;code&gt;http.postBuffer&lt;/code&gt; configuration alone doesn't work, try the additional commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config http.postBuffer 524288000
git config http.lowSpeedTime 600
git config &lt;span class="nt"&gt;--global&lt;/span&gt; pack.window 1
git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.compression 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;http.postBuffer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For other git-config options &lt;a href="https://git-scm.com/docs/git-config" rel="noopener noreferrer"&gt;check the documentation here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>shortposts</category>
      <category>mkdocs</category>
    </item>
  </channel>
</rss>
