<?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>DEV Community: Bharath Aaleti</title>
    <description>The latest articles on DEV Community by Bharath Aaleti (@bharath_018).</description>
    <link>https://dev.to/bharath_018</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%2F3546950%2F15cda542-daf6-4755-9dc5-9394d47fb50b.jpg</url>
      <title>DEV Community: Bharath Aaleti</title>
      <link>https://dev.to/bharath_018</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bharath_018"/>
    <language>en</language>
    <item>
      <title>Building a Real DevOps Project from Scratch: A Beginner-Friendly Walkthrough</title>
      <dc:creator>Bharath Aaleti</dc:creator>
      <pubDate>Mon, 24 Nov 2025 11:35:47 +0000</pubDate>
      <link>https://dev.to/bharath_018/building-a-real-devops-project-from-scratch-a-beginner-friendly-walkthrough-2c2j</link>
      <guid>https://dev.to/bharath_018/building-a-real-devops-project-from-scratch-a-beginner-friendly-walkthrough-2c2j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;How a Simple 2-Tier Flask App Became a Full CI/CD + Docker + AWS Pipeline&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When I started working on this project, I wasn’t trying to build something “big.”&lt;br&gt;
I simply wanted a clean, practical way to help beginners understand DevOps, not through theory, but through a &lt;strong&gt;real, working cloud project&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that’s how this 2-Tier Flask + MySQL + Docker + Jenkins + AWS project began.&lt;/p&gt;

&lt;p&gt;What it ended up becoming is much more than a demo app, it’s a complete end-to-end DevOps learning path.&lt;/p&gt;




&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🧠 First, What Are We Actually Building?&lt;/li&gt;
&lt;li&gt;🌩️ Understanding the DevOps Concepts (Beginner-Friendly Explanations)&lt;/li&gt;
&lt;li&gt;🏗️ Architecture &amp;amp; CI/CD Pipeline&lt;/li&gt;
&lt;li&gt;🚀 What a Beginner Learns&lt;/li&gt;
&lt;li&gt;🔍 Real Challenges You’ll Face&lt;/li&gt;
&lt;li&gt;🚀 Quick Start&lt;/li&gt;
&lt;li&gt;🎨 Customization&lt;/li&gt;
&lt;li&gt;📚 What’s Next?&lt;/li&gt;
&lt;li&gt;🤝 Contributing&lt;/li&gt;
&lt;li&gt;🙏 Acknowledgments&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  First, What Are We Actually Building?
&lt;/h2&gt;

&lt;p&gt;This project is a &lt;strong&gt;2-Tier Web Application&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  ✔️ Tier 1 → Flask Web App
&lt;/h3&gt;

&lt;p&gt;Handles UI, routing, and basic logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✔️ Tier 2 → MySQL Database
&lt;/h3&gt;

&lt;p&gt;Stores messages, data, and user inputs.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✔️ Both running as &lt;strong&gt;Docker containers&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;(So there are no “it works on my machine” issues.)&lt;/p&gt;

&lt;p&gt;And the entire thing is deployed automatically using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jenkins&lt;/strong&gt; for CI/CD
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS EC2&lt;/strong&gt; as the host
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt; for version control
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Understanding the DevOps Concepts (Beginner-Friendly Explanations)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🐳 &lt;strong&gt;Docker (Containerization)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; A way to package your app and its environment into a portable unit.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; If it works inside a container, it will work anywhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔄 &lt;strong&gt;CI/CD with Jenkins&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CI:&lt;/strong&gt; Auto-build on each code push&lt;br&gt;&lt;br&gt;
&lt;strong&gt;CD:&lt;/strong&gt; Auto-deploy to server&lt;br&gt;&lt;br&gt;
&lt;strong&gt;In this project:&lt;/strong&gt; Jenkins pulls code → builds Docker images → deploys on AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  ☁️ &lt;strong&gt;AWS EC2&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Your cloud server where everything runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  📦 &lt;strong&gt;Git + GitHub&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Version control + triggers Jenkins pipeline.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture (Simplified)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer → GitHub → Jenkins → Docker → AWS EC2 → Live App


+-----------------+      +----------------------+      +-----------------------------+
|   Developer     |-----&amp;gt;|     GitHub Repo      |-----&amp;gt;|        Jenkins Server       |
| (pushes code)   |      | (Source Code Mgmt)   |      |         (on AWS EC2)        |
+-----------------+      +----------------------+      |                             |
                                                       | 1. Clones Repo              |
                                                       | 2. Builds Docker Image      |
                                                       | 3. Runs Docker Compose      |
                                                       +--------------+--------------+
                                                                      |
                                                                      | Deploys
                                                                      v
                                                       +-----------------------------+
                                                       |      Application Server     |
                                                       |        (Same AWS EC2)       |
                                                       |                             |
                                                       | +-------------------------+ |
                                                       | | Docker Container: Flask | |
                                                       | +-------------------------+ |
                                                       |              |              |
                                                       |              v              |
                                                       | +-------------------------+ |
                                                       | | Docker Container: MySQL | |
                                                       | +-------------------------+ |
                                                       +-----------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Architecture diagram generated with AI assistance&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What a Beginner Learns
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Containerization
&lt;/li&gt;
&lt;li&gt;Docker Compose networking
&lt;/li&gt;
&lt;li&gt;CI/CD automation
&lt;/li&gt;
&lt;li&gt;Cloud deployment
&lt;/li&gt;
&lt;li&gt;Debugging pipelines
&lt;/li&gt;
&lt;li&gt;Security groups + networking
&lt;/li&gt;
&lt;li&gt;Real project structure
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Real Challenges You’ll Face
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins not having Docker permissions
&lt;/li&gt;
&lt;li&gt;Database containers failing
&lt;/li&gt;
&lt;li&gt;Networking issues inside Docker
&lt;/li&gt;
&lt;li&gt;Wrong GitHub credentials
&lt;/li&gt;
&lt;li&gt;Security group misconfigurations
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These experiences teach faster than tutorials.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Full Project Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python/Flask
&lt;/li&gt;
&lt;li&gt;MySQL
&lt;/li&gt;
&lt;li&gt;HTML/CSS/JS
&lt;/li&gt;
&lt;li&gt;Docker + Compose
&lt;/li&gt;
&lt;li&gt;Jenkins
&lt;/li&gt;
&lt;li&gt;AWS EC2
&lt;/li&gt;
&lt;li&gt;GitHub Webhooks
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Server Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Launch a EC2 Instance

&lt;ul&gt;
&lt;li&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%2Fs1hazen8crsez6atybtl.png" alt="server creation" width="800" height="471"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure Security Group 

&lt;ul&gt;
&lt;li&gt;Allow ports 5000 (App), 8080 (Jenkins) in Inbound-Rules.&lt;/li&gt;
&lt;li&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%2Fww8b9ciirvy73w1mtnqc.png" alt="editing-security-group" width="800" height="476"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Connect to EC2 Instance 
&lt;code&gt;ssh -i /path/to/key.pem ubuntu@&amp;lt;ec2-public-ip&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2️⃣ Environment Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install Dependencies on EC2&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update System Packages:&lt;br&gt;
&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Git, Docker, and Docker Compose:&lt;br&gt;
&lt;code&gt;sudo apt install git docker.io docker-compose-v2 -y&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start and Enable Docker:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;docker
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add User to Docker Group (to run docker without sudo):
&lt;/li&gt;
&lt;/ol&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;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; docker &lt;span class="nv"&gt;$USER&lt;/span&gt;
   newgrp docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3️⃣ Jenkins Installation and Setup
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.jenkins.io/doc/book/installing/linux/#debianubuntu" rel="noopener noreferrer"&gt;Installation docs - Official jenkins link&lt;/a&gt;&lt;/em&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update the Debian apt repositories, install OpenJDK 21, and check the installation with the commands:
&lt;/li&gt;
&lt;/ol&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="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fontconfig openjdk-21-jre
   java &lt;span class="nt"&gt;-version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Adding Jenkins Repository and Install:
&lt;/li&gt;
&lt;/ol&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;wget &lt;span class="nt"&gt;-O&lt;/span&gt; /etc/apt/keyrings/jenkins-keyring.asc &lt;span class="se"&gt;\&lt;/span&gt;
   https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
   https://pkg.jenkins.io/debian-stable binary/ | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
   /etc/apt/sources.list.d/jenkins.list &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable and Start Jenkins:
&lt;/li&gt;
&lt;/ol&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;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;jenkins
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start jenkins
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Access Jenkins:

&lt;ul&gt;
&lt;li&gt;Open your browser and navigate to &lt;code&gt;http://&amp;lt;ec2-public-ip&amp;gt;:8080&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Follow the on-screen instructions to unlock Jenkins using the initial admin password:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo cat&lt;/span&gt; /var/lib/jenkins/secrets/initialAdminPassword
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Suggested Plugins and Create Admin User.&lt;/li&gt;
&lt;li&gt;Install &lt;strong&gt;Pipeline: Stage View&lt;/strong&gt; plugin.

&lt;ul&gt;
&lt;li&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%2F2oeo67qqqolc79wscpza.png" alt="stage-view-plugin" width="800" height="478"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4️⃣ Jenkins Pipeline.
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a New Pipeline Job in Jenkins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From the Jenkins dashboard, select New Item.&lt;/li&gt;
&lt;li&gt;Name the project, choose Pipeline, and click OK.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the Pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the configuration, provide description, &lt;/li&gt;
&lt;li&gt;Triggers select - GitHub hook trigger for GITScm polling&lt;/li&gt;
&lt;li&gt;Setup a webhook on github

&lt;ul&gt;
&lt;li&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%2Fqwd44yth1t07y8r3caeu.png" alt="webhook" width="800" height="500"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Pipeline: Pipeline script from SCM.&lt;/li&gt;
&lt;li&gt;Choose Git as the SCM.&lt;/li&gt;
&lt;li&gt;Enter your GitHub repository URL, add Credentials&lt;/li&gt;
&lt;li&gt;In Branches to build, select your &lt;/li&gt;
&lt;li&gt;Verify the Script Path is Jenkinsfile.&lt;/li&gt;
&lt;li&gt;Save the configuration.&lt;/li&gt;
&lt;li&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%2Fcpf03f5iax1gxe47pbqj.png" alt="config" width="800" height="475"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Testing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initally click on &lt;strong&gt;Build Now&lt;/strong&gt; from the left panel&lt;/li&gt;
&lt;li&gt;You may encounter &lt;em&gt;Your pipeline failed because Jenkins does NOT have permission to access Docker&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;This is the most common Jenkins + Docker error.&lt;/li&gt;
&lt;li&gt;Run these commands on your Jenkins server:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; docker jenkins
  &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart jenkins
  &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Now try again.
&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%2Fm799wk639zj4irazni0c.png" alt="jenkins" width="800" height="473"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open your browser and navigate to -&amp;gt; &lt;code&gt;http://your-ec2-ip:5000&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Confirm the containers are running on the EC2 instance with &lt;code&gt;docker ps&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Demo
&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%2Fm7ov81nnxumnae37lh0n.gif" 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%2Fm7ov81nnxumnae37lh0n.gif" alt="demo" width="400" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Personalizing the Application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update Profile Information&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;   &lt;span class="c"&gt;&amp;lt;!-- In templates/index.html --&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Your Name&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Your Title&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"bio"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Your bio here...&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Modify Tech Stack&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;   &lt;span class="c"&gt;&amp;lt;!-- Add/remove tech tags --&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tech-tag"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Your Tech&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Customize Styling&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="c"&gt;/* In templates/index.html */&lt;/span&gt;
   &lt;span class="c"&gt;/* Modify colors, fonts, animations */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Add monitoring
&lt;/li&gt;
&lt;li&gt;Add load balancer
&lt;/li&gt;
&lt;li&gt;Move deployment to Kubernetes
&lt;/li&gt;
&lt;li&gt;Add Terraform for IaC
&lt;/li&gt;
&lt;li&gt;Add automated testing inside pipeline
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;Contributions are welcome! Here's how you can help:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fork the repository&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a feature branch&lt;/strong&gt;: &lt;code&gt;git checkout -b feature/amazing-feature&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit your changes&lt;/strong&gt;: &lt;code&gt;git commit -m 'Add amazing feature'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Push to the branch&lt;/strong&gt;: &lt;code&gt;git push origin feature/amazing-feature&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open a Pull Request&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Development Guidelines
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Follow PEP 8 for Python code&lt;/li&gt;
&lt;li&gt;Use meaningful commit messages&lt;/li&gt;
&lt;li&gt;Add comments for complex logic&lt;/li&gt;
&lt;li&gt;Test your changes locally&lt;/li&gt;
&lt;li&gt;Update documentation as needed&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🙌 Final Note
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DevOps is not about memorizing tools, it’s about understanding how systems connect.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This project helps beginners experience that connection in a real, hands-on way.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 GitHub Repository
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/bHARATHaALETI018/2Tier_flask_app-Python-MySql-Jenkins-AWS-Docker.git" rel="noopener noreferrer"&gt;https://github.com/bHARATHaALETI018/2Tier_flask_app-Python-MySql-Jenkins-AWS-Docker.git&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Acknowledgments
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flask Community&lt;/strong&gt; for the amazing web framework&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker&lt;/strong&gt; for containerization technology&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS&lt;/strong&gt; for reliable cloud infrastructure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jenkins&lt;/strong&gt; for CI/CD automation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Source Community&lt;/strong&gt; for inspiration and tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📞 Contact &amp;amp; Support
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bharath Aaleti&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💼 DevOps Engineer&lt;/li&gt;
&lt;li&gt;🌐 LinkedIn: &lt;a href="https://linkedin.com/in/bharathaaleti" rel="noopener noreferrer"&gt;Connect with me&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📧 Email: &lt;a href="mailto:aaletibharath@gmail.com"&gt;aaletibharath@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐙 GitHub: &lt;a href="https://github.com/bHARATHaALETI018/" rel="noopener noreferrer"&gt;@bHARATHaALETI018&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;⭐ If you found this project helpful, share your thoughts, experience, I would really appreciate a LIKE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built with ❤️ by Bharath Aaleti&lt;/em&gt;&lt;/p&gt;




</description>
      <category>aws</category>
      <category>cicd</category>
      <category>devops</category>
      <category>containers</category>
    </item>
    <item>
      <title>The 3 Commands That Turn Chaos into Clarity in DevOps</title>
      <dc:creator>Bharath Aaleti</dc:creator>
      <pubDate>Sun, 05 Oct 2025 17:45:07 +0000</pubDate>
      <link>https://dev.to/bharath_018/the-3-commands-that-turn-chaos-into-clarity-in-devops-2l1h</link>
      <guid>https://dev.to/bharath_018/the-3-commands-that-turn-chaos-into-clarity-in-devops-2l1h</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;“You don’t need fancy monitoring tools to troubleshoot production issues.&lt;br&gt;&lt;br&gt;
Sometimes, all you need is a terminal., and three magical commands: &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;awk&lt;/code&gt;, and &lt;code&gt;sed&lt;/code&gt;.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These three commands can turn gigabytes of messy logs into clear insights within seconds.&lt;br&gt;&lt;br&gt;
Once you master them, you’ll handle on-call like a pro.&lt;/p&gt;
&lt;h4&gt;
  
  
  Note: The examples below are just a few to get you started.
&lt;/h4&gt;
&lt;h4&gt;
  
  
  You can explore more scenario-based examples by asking ChatGPT or searching online.
&lt;/h4&gt;


&lt;h2&gt;
  
  
  🧠 Why Text Processing Matters in DevOps
&lt;/h2&gt;

&lt;p&gt;In DevOps and SRE, every log line tells a story. But when you’re knee-deep in 2GB of logs, you need quick, powerful tools to extract meaning.&lt;br&gt;&lt;br&gt;
This is where &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;awk&lt;/code&gt;, and &lt;code&gt;sed&lt;/code&gt; shine.&lt;/p&gt;

&lt;p&gt;Imagine this: you’re SSH’d into a production server. The application is down. Logs are huge. Instead of downloading them, you filter and extract what you need &lt;em&gt;right there&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  🔍 grep - The Search Engine of Your Terminal
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; Quickly find patterns in massive text files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;grep&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;OPTIONS] PATTERN &lt;span class="o"&gt;[&lt;/span&gt;FILE...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔹 Common Examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find all error lines in logs&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; /var/log/app.log

&lt;span class="c"&gt;# Search recursively in directory&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="s2"&gt;"timeout"&lt;/span&gt; /etc/nginx/

&lt;span class="c"&gt;# Case-insensitive + show line numbers&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-in&lt;/span&gt; &lt;span class="s2"&gt;"failed"&lt;/span&gt; auth.log

&lt;span class="c"&gt;# Highlight matches&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;--color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto &lt;span class="s2"&gt;"warning"&lt;/span&gt; server.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💡 How it works:
&lt;/h3&gt;

&lt;p&gt;grep scans text line by line and prints only those containing "ERROR". It’s the fastest way to find specific keywords in huge log files.&lt;/p&gt;

&lt;h4&gt;
  
  
  💡 Pro Tip:
&lt;/h4&gt;

&lt;p&gt;Combine tail -f and grep to monitor logs live:&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;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; app.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧰 Real-World Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Extracting failed pod names from Kubernetes logs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  kubectl get pods | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Searching for error traces in CI/CD pipelines:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;cat &lt;/span&gt;build.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Exception"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Monitoring real-time logs for failures:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; app.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"500"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Alternatives:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ripgrep (rg)&lt;/code&gt; - faster alternative, written in Rust.
👉 But &lt;code&gt;grep&lt;/code&gt; remains the universal standard.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ awk - The Swiss Army Knife for Structured Data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; Process and analyze structured text line by line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;awk&lt;/span&gt; &lt;span class="s1"&gt;'pattern {action}'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔹 Practical Examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Print specific columns&lt;/span&gt;
&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $1, $4}'&lt;/span&gt; access.log

&lt;span class="c"&gt;# Filter based on condition&lt;/span&gt;
&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'$3 == "ERROR" {print $0}'&lt;/span&gt; app.log

&lt;span class="c"&gt;# Calculate average CPU usage&lt;/span&gt;
&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{sum += $2} END {print "Avg:", sum/NR}'&lt;/span&gt; cpu.txt

&lt;span class="c"&gt;# Show top 5 largest files&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt; | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $5, $9}'&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-rh&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💡 How it works:
&lt;/h3&gt;

&lt;p&gt;Each line in access.log represents one request, and the 5th column ($5) stores its response time (in ms, for example).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sum+=$5 → adds up all response times&lt;/li&gt;
&lt;li&gt;NR → built-in variable for the total number of lines processed&lt;/li&gt;
&lt;li&gt;END {print sum/NR} → prints the average at the end&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧰 Real-World Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Extracting pod memory usage:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  kubectl top pods | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $1, $3}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Summarizing response times:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{sum += $5} END {print "Avg Response:", sum/NR}'&lt;/span&gt; access.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Counting unique IPs from access logs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $1}'&lt;/span&gt; access.log | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Alternatives:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cut&lt;/code&gt; (simpler but limited)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jq&lt;/code&gt; (great for JSON)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;csvkit&lt;/code&gt; (for CSVs)
👉 &lt;code&gt;awk&lt;/code&gt; remains the most versatile for text streams.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✂️ sed - The Stream Editor
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; Edit, replace, and transform text on the fly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&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;sed&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;OPTIONS] &lt;span class="s1"&gt;'command'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔹 Common Examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Replace all “foo” with “bar”&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s/foo/bar/g'&lt;/span&gt; input.txt

&lt;span class="c"&gt;# Delete blank lines&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'/^$/d'&lt;/span&gt; file.txt

&lt;span class="c"&gt;# Replace in place (useful for config changes)&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/localhost/127.0.0.1/g'&lt;/span&gt; config.yml

&lt;span class="c"&gt;# Prints lines starting from 5-10&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s1"&gt;'5,10p'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💡 How it works:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;sed (stream editor) searches and replaces text directly in files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;'s/dev/prod/g' → replace all instances of “dev” with “prod”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;-i → edit the file in place (no need to open a text editor)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧰 Real-World Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Update IPs or URLs in config files:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/dev.example.com/prod.example.com/g'&lt;/span&gt; nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Remove comments before deployment:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'/^#/d'&lt;/span&gt; .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Bulk change environment variables in CI/CD:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/DEBUG=True/DEBUG=False/'&lt;/span&gt; settings.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Alternatives:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;perl -pe&lt;/code&gt; (more powerful but heavier)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tr&lt;/code&gt; (for simple character replacement)
👉 &lt;code&gt;sed&lt;/code&gt; is lightweight and available by default everywhere.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Combining Them for Power One-Liners
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Extract failed requests with response time &amp;gt; 500ms:&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;grep&lt;/span&gt; &lt;span class="s2"&gt;"FAILED"&lt;/span&gt; app.log | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'$5 &amp;gt; 500'&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s/FAILED/ERROR/g'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Monitor errors in real time:&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;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; app.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Find all 404s and count them:&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;grep&lt;/span&gt; &lt;span class="s2"&gt;"404"&lt;/span&gt; access.log | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Extract usernames from access log and sort by frequency:&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;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $3}'&lt;/span&gt; access.log | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-nr&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Replace all IPs with placeholders (for redaction):&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;sed&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'s/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[REDACTED]/g'&lt;/span&gt; access.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Once you start combining these three, you’ll realize you can transform any text stream into usable insights without ever leaving the terminal.&lt;/p&gt;

&lt;p&gt;Whether you're debugging a failed deployment, analyzing performance logs, or cleaning config files, these commands will make your life easier.&lt;/p&gt;

&lt;p&gt;Learn them once. Use them forever.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;👋 I'm Bharath Aaleti&lt;/strong&gt;, DevOps Engineer - learning DevOps and sharing everything I know/learn.&lt;br&gt;&lt;br&gt;
If you found this helpful, connect or drop your favorite one-liner below 👇&lt;/p&gt;




</description>
      <category>devops</category>
      <category>linux</category>
      <category>ubuntu</category>
      <category>sre</category>
    </item>
    <item>
      <title>🔐Raise your hand if you use SSH every day without actually knowing what it does. Yeah, me too😁 you’re definitely not alone.</title>
      <dc:creator>Bharath Aaleti</dc:creator>
      <pubDate>Sun, 05 Oct 2025 16:19:21 +0000</pubDate>
      <link>https://dev.to/bharath_018/raise-your-hand-if-you-use-ssh-every-day-without-actually-knowing-what-it-does-yeah-me-too-56oc</link>
      <guid>https://dev.to/bharath_018/raise-your-hand-if-you-use-ssh-every-day-without-actually-knowing-what-it-does-yeah-me-too-56oc</guid>
      <description>

&lt;blockquote&gt;
&lt;p&gt;The spy-movie handshake of cryptography and trust that makes remote login possible.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🟢 In simple terms
&lt;/h3&gt;

&lt;p&gt;An SSH connection is a secure tunnel between your computer and another computer (usually a server) over the internet.&lt;/p&gt;

&lt;p&gt;It’s like a private, encrypted walkie-talkie:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You type commands → they get encrypted → sent to the server.&lt;/li&gt;
&lt;li&gt;The server runs them → sends results back → also encrypted.
So even if someone is watching your network, all they see is gibberish.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🚨 The Problem SSH Solved (And Why We Almost Lost the Internet)
&lt;/h3&gt;

&lt;p&gt;Back then, system administrators were sending ROOT PASSWORDS across the internet in PLAIN TEXT.&lt;/p&gt;

&lt;p&gt;Yes, you read that right.&lt;/p&gt;

&lt;p&gt;Every login, every command, every sensitive operation. Completely visible to anyone sniffing network traffic.&lt;/p&gt;

&lt;p&gt;Protocols like Telnet, rsh, and FTP were basically handing over your servers to attackers on a silver platter.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛡️ How SSH Actually Works (The Magic Behind The Scenes)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  💻🕵️ What Actually Happens When You Hit ssh user@server
&lt;/h4&gt;

&lt;p&gt;SSH isn’t just remote login. It’s a secure negotiation, identity verification, and a puzzle-solving protocol, all happening in milliseconds. When you type ssh &lt;a href="mailto:user@server.com"&gt;user@server.com&lt;/a&gt;, here’s what happens in milliseconds:&lt;/p&gt;

&lt;p&gt;The beautiful part? Even if someone intercepts your traffic, they see gibberish.&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%2F6t4hlxxcdio0n8crf2or.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%2F6t4hlxxcdio0n8crf2or.png" alt="SSH illustration" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ 1. Client says: “Yo, can we talk?”
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh user@server.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your SSH client tries to open a TCP connection on port 22 to server.com.&lt;/p&gt;

&lt;p&gt;It’s like your laptop walking up to the server and knocking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧑‍💻💬 “Hey, you open for secure chat?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🔐 2. The server replies: “Let’s talk, but securely.”
&lt;/h3&gt;

&lt;p&gt;The server responds with: A list of encryption algorithms it supports&lt;/p&gt;

&lt;p&gt;Its public host key (used to verify its identity)&lt;/p&gt;

&lt;p&gt;This is the server’s way of saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🖥️💬 “Cool! but first, here’s my ID and my preferred encryption dance moves.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Check server fingerprint manually (first time only):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🕵️‍♂️ 3. Client checks: “Do I know you?”
&lt;/h3&gt;

&lt;p&gt;SSH compares the server’s fingerprint with your ~/.ssh/known_hosts.&lt;/p&gt;

&lt;p&gt;✅ If it’s already known → we’re chill&lt;/p&gt;

&lt;p&gt;❌ If not → SSH warns you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Are you sure you want to continue connecting (yes/no)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You type yes, and it gets saved for next time.&lt;/p&gt;

&lt;p&gt;Basically:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Hey, this guy’s new. You sure this isn’t a trap server?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🔄 4. Encryption Negotiation (the handshake)
&lt;/h3&gt;

&lt;p&gt;Now the client and server agree on a common encryption algorithm (like AES, ChaCha20, etc.) and key exchange method (like Diffie-Hellman or ECDH).&lt;/p&gt;

&lt;p&gt;They perform a key exchange to generate a shared session key (used to encrypt the session).&lt;/p&gt;

&lt;p&gt;Both solve the same crypto puzzle, ending with the same session key.&lt;/p&gt;

&lt;p&gt;⚠️ The cool part?&lt;/p&gt;

&lt;p&gt;They both end up with the same session key, but no one else on the network can figure it out.&lt;/p&gt;

&lt;p&gt;It’s like solving the same puzzle separately and both ending up with the same secret phrase.&lt;/p&gt;

&lt;p&gt;This is what makes SSH secure even over open networks.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No command here — it’s all under the hood.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  👤 5. User Authentication (Prove you’re you)
&lt;/h3&gt;

&lt;p&gt;Once the tunnel is encrypted, the client says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🧑💬 “Okay server, now let me in.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The server asks for user authentication, which could be:&lt;/p&gt;

&lt;p&gt;🛑 Password (not recommended)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh user@server.com

# Then enter password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Public Key (much better)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-copy-id user@server.com # one-time setup

ssh user@server.com # passwordless login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your client proves it has the private key that matches a public key on the server (usually in ~/.ssh/authorized_keys).&lt;/p&gt;

&lt;p&gt;It signs a challenge, and the server verifies it with your public key.&lt;/p&gt;

&lt;p&gt;No passwords fly over the wire. 🛡️&lt;/p&gt;

&lt;h3&gt;
  
  
  🎉 6. Session Established: Let the magic begin
&lt;/h3&gt;

&lt;p&gt;Now the secure session is live:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every keystroke → encrypted&lt;br&gt;
Every response from the server → encrypted&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You’re inside the Matrix 🧠🔒&lt;/p&gt;

&lt;p&gt;This tunnel can now be used for:&lt;/p&gt;

&lt;p&gt;🧑‍💻 Interactive shell&lt;/p&gt;

&lt;p&gt;📂 File transfer (SCP, SFTP)&lt;/p&gt;

&lt;p&gt;🔄 Port forwarding&lt;/p&gt;

&lt;p&gt;🧰 Tunneling other protocols (Git, DB access, etc.)&lt;/p&gt;

&lt;h4&gt;
  
  
  &amp;gt; Here a video by @ByteByteGo, really helpful.
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://youtu.be/rlMfRa7vfO8" rel="noopener noreferrer"&gt;How SSH Really Works&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;🔧 SSH Config —&amp;gt; Stop Memorizing Commands!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i ~/.ssh/prod-key.pem -p 2222 deployer@203.0.113.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create ~/.ssh/config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host prod
  HostName 203.0.113.10
  User rhel
  IdentityFile “~/.ssh/prod-key.pem”
  Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Now just type: &lt;code&gt;ssh prod&lt;/code&gt; 🎯
&lt;/h4&gt;

&lt;h3&gt;
  
  
  But SSH wins because:
&lt;/h3&gt;

&lt;p&gt;✅ Universal (works everywhere)&lt;/p&gt;

&lt;p&gt;✅ Lightweight (minimal resources)&lt;/p&gt;

&lt;p&gt;✅ Scriptable (perfect for automation)&lt;/p&gt;

&lt;p&gt;✅ Battle-tested (years of security hardening)&lt;/p&gt;

&lt;p&gt;✅ Port forwarding (tunnel ANY protocol)&lt;/p&gt;

&lt;h3&gt;
  
  
  🔄 TL;DR -&amp;gt; for my scroll-happy friends:
&lt;/h3&gt;

&lt;p&gt;SSH is still around because it’s 🔒 simple + powerful + everywhere&lt;/p&gt;

&lt;p&gt;It’s not magic, It’s a full-on encrypted handshake, identity check, cryptographic puzzle, and channel manager, all rolled into one elegant protocol.&lt;/p&gt;

&lt;p&gt;Alternatives exist, but SSH is the OG and still undefeated.&lt;/p&gt;

&lt;h4&gt;
  
  
  Next time you type ssh, remember:
&lt;/h4&gt;

&lt;p&gt;You’re starting a secret spy mission over port 22. And your terminal?&lt;/p&gt;

&lt;p&gt;It’s the encrypted walkie-talkie.&lt;/p&gt;

&lt;p&gt;Let’s hear the horror stories. Bonus points if it involves &lt;code&gt;rm -rf&lt;/code&gt; or &lt;code&gt;scp&lt;/code&gt; to the wrong server. 😂👇👇&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is my first post in here, this piece is my small step toward learning in public and giving back to the community that’s taught me so much.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Found this helpful? Hit that Like and share your story.🚀&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>sre</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
