<?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: Vansh Tyagi</title>
    <description>The latest articles on Forem by Vansh Tyagi (@vansh_tyagi24).</description>
    <link>https://forem.com/vansh_tyagi24</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%2F3153772%2F075ecdf8-1d7a-47b7-a139-0a86de5c179d.jpg</url>
      <title>Forem: Vansh Tyagi</title>
      <link>https://forem.com/vansh_tyagi24</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vansh_tyagi24"/>
    <language>en</language>
    <item>
      <title>Understanding the Git Staging Area — One Step You Shouldn’t Skip</title>
      <dc:creator>Vansh Tyagi</dc:creator>
      <pubDate>Fri, 16 May 2025 10:24:09 +0000</pubDate>
      <link>https://forem.com/vansh_tyagi24/understanding-the-git-staging-area-one-step-you-shouldnt-skip-29m</link>
      <guid>https://forem.com/vansh_tyagi24/understanding-the-git-staging-area-one-step-you-shouldnt-skip-29m</guid>
      <description>&lt;p&gt;If you’re new to Git, you might’ve seen this flow:&lt;br&gt;
&lt;code&gt;git add .&lt;br&gt;
git commit -m "message"&lt;/code&gt;&lt;br&gt;
But have you ever wondered what happens between add and commit? That middle ground is called the staging area — and it's more powerful than you think.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the Staging Area?&lt;/strong&gt;&lt;br&gt;
The staging area (also known as the index) is like a buffer zone. It’s where Git holds your changes temporarily before you officially commit them.&lt;br&gt;
Think of it like a “draft” section in your email you prepare your message, double-check it, and only then hit send.&lt;/p&gt;

&lt;p&gt;** Why is it Important?**&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Control&lt;/strong&gt;&lt;br&gt;
You can choose exactly which files to commit. Modify 10 files but only want to commit 2? Staging makes that easy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safe Checkpoint&lt;/strong&gt;&lt;br&gt;
It lets you pause, review, and revise what’s going in your next commit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clean Commit History&lt;/strong&gt;&lt;br&gt;
Break your changes into logical commits, instead of dumping everything in one big commit.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Key Commands to Know&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What You Want to Do&lt;/th&gt;
&lt;th&gt;Git Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Add a specific file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git add filename&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add all modified files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Check what’s staged&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unstage a file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git restore --staged filename&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Commit staged files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git commit -m "message"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What If You Don’t Use the Staging Area?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Skipping the staging step isn’t “wrong,” but you lose control. You might:&lt;br&gt;
• Commit files you didn’t mean to&lt;br&gt;
• Push code that’s half-baked&lt;br&gt;
• End up with messy history that’s hard to read (or debug!)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Recap&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• Staging area = Preparation zone&lt;br&gt;
• Gives you control, clarity, and clean commits&lt;br&gt;
• Learn it early, and your future self (and team) will thank you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Author’s Note:&lt;/strong&gt;&lt;br&gt;
If you’re still confused between git add and git commit, you’re not alone, I was too! Drop your doubts or favorite Git tips in the comments. Let’s grow together.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Every DevOps Engineer Should Know About /etc/hosts</title>
      <dc:creator>Vansh Tyagi</dc:creator>
      <pubDate>Thu, 15 May 2025 11:20:24 +0000</pubDate>
      <link>https://forem.com/vansh_tyagi24/why-every-devops-engineer-should-know-about-etchosts-4eck</link>
      <guid>https://forem.com/vansh_tyagi24/why-every-devops-engineer-should-know-about-etchosts-4eck</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
If you are new to Linux or DevOps, you might think DNS (domain name system) is something only big servers or cloud services handle. But there is a simple file on your computer that helps your system know which IP address matches a website name or server name.&lt;br&gt;
That file is called &lt;strong&gt;/etc/hosts.&lt;/strong&gt; It’s small but very important!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is /etc/hosts?&lt;/strong&gt;&lt;br&gt;
/etc/hosts is a text file on your computer that connects names to IP addresses.&lt;br&gt;
&lt;strong&gt;For example:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;127.0.0.1   localhost&lt;br&gt;
192.168.1.10   myserver.local&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This means your computer knows:&lt;/strong&gt;&lt;br&gt;
• localhost is your own computer (IP 127.0.0.1)&lt;br&gt;
• myserver.local is at IP address 192.168.1.10&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Should You Care?&lt;/strong&gt;&lt;br&gt;
Here are some easy reasons why &lt;strong&gt;/etc/hosts&lt;/strong&gt; is useful for beginners learning DevOps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Test websites or services locally&lt;/strong&gt;
You can pretend that a website or server is at a specific address on your own computer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example: &lt;code&gt;127.0.0.1    mytestsite.local&lt;/code&gt;&lt;br&gt;
Now if you open a browser and go to mytestsite.local, your computer looks for it on your own machine.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fix name problems quickly&lt;/strong&gt;&lt;br&gt;
If your internet’s DNS server has issues, your system won’t find websites by name. Using /etc/hosts, you can tell your computer where to find important servers without relying on the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Redirect websites for testing&lt;/strong&gt;&lt;br&gt;
Say you want to see how your app works if it connects to a different server. You can change &lt;strong&gt;/etc/hosts&lt;/strong&gt; to make the name point somewhere else, like a test server.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How to Edit /etc/hosts?&lt;/strong&gt;&lt;br&gt;
• You need admin rights (use sudo on Linux)&lt;br&gt;
• Open the file with a text editor, for example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo nano /etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;• Add or change lines like:&lt;br&gt;
&lt;code&gt;127.0.0.1    mylocalapp.local&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;• Save and exit the editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important Tips&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• This file only works on your computer — it won’t affect other machines.&lt;br&gt;
• Be careful while editing; a wrong entry can cause connection problems.&lt;br&gt;
• Always backup before making big changes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo cp /etc/hosts /etc/hosts.backup&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Even though it’s simple, /etc/hosts is one of the most powerful tools in your DevOps toolbox. It helps you understand how computers find each other on a network — a very important concept for anyone working with servers, cloud, or containers.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>learning</category>
      <category>docker</category>
      <category>linux</category>
    </item>
    <item>
      <title>Can’t Login as Root on Ubuntu? Here’s the Real Reason and How to Fix It.</title>
      <dc:creator>Vansh Tyagi</dc:creator>
      <pubDate>Tue, 13 May 2025 12:19:58 +0000</pubDate>
      <link>https://forem.com/vansh_tyagi24/cant-login-as-root-on-ubuntu-heres-the-real-reason-and-how-to-fix-it-3d3m</link>
      <guid>https://forem.com/vansh_tyagi24/cant-login-as-root-on-ubuntu-heres-the-real-reason-and-how-to-fix-it-3d3m</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
If you’ve worked with CentOS or other RHEL-based systems, you're probably used to logging in directly as root no extra setup needed. But when you switch to Ubuntu, things are different. You try to login as root and get blocked. Even sudo su - might throw permission errors if you're not careful.&lt;br&gt;
So what's going on here? Is it a bug? A restriction? No — it’s a security feature. Ubuntu disables direct root login by default to prevent unauthorized or accidental system damage. But if you're setting up a lab environment, testing on local, or just want full control here’s how you can enable root login on Ubuntu (safely and responsibly).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to Enable Root Login in Ubuntu&lt;/strong&gt;&lt;br&gt;
Use this only in testing, learning, or non-production environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 1:&lt;/u&gt;&lt;/strong&gt; Allow Root Login via SSH.&lt;br&gt;
Open the SSH configuration file using a text editor.&lt;br&gt;
&lt;code&gt;sudo vi /etc/ssh/sshd_config&lt;/code&gt;&lt;br&gt;
Find this line: &lt;code&gt;PermitRootLogin prohibit-password&lt;/code&gt;&lt;br&gt;
Change it to: &lt;code&gt;PermitRootLogin yes&lt;/code&gt;&lt;br&gt;
This line tells SSH that root login is now allowed using a password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 2:&lt;/u&gt;&lt;/strong&gt; Restart the SSH Service.&lt;br&gt;
&lt;code&gt;sudo systemctl restart ssh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 3:&lt;/u&gt;&lt;/strong&gt; Set Root Password.&lt;br&gt;
&lt;code&gt;sudo passwd root&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Step 4:&lt;/u&gt;&lt;/strong&gt; Switch to Root User&lt;br&gt;
&lt;code&gt;su -&lt;/code&gt;&lt;br&gt;
Here, You'll be prompted to enter the root password you set earlier.&lt;br&gt;
Boom — you're now logged in as root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt; &lt;br&gt;
• Never enable root login on a public-facing production server.&lt;br&gt;
• Use strong passwords if enabling this temporarily.&lt;br&gt;
• Consider reverting the changes once you're done with your learning/test session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Ubuntu disables root login by default not because it lacks the capability, but as a deliberate security measure. Once you understand this philosophy, you can confidently enable root access when needed and use it wisely.&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>devops</category>
      <category>learning</category>
    </item>
    <item>
      <title>Hidden Gem for Linux Learners: Install Linux on Windows with wsl --install (No VM, No Cloud, No Cost!)</title>
      <dc:creator>Vansh Tyagi</dc:creator>
      <pubDate>Mon, 12 May 2025 11:59:03 +0000</pubDate>
      <link>https://forem.com/vansh_tyagi24/hidden-gem-for-linux-learners-install-linux-on-windows-with-wsl-install-no-vm-no-cloud-no-15d3</link>
      <guid>https://forem.com/vansh_tyagi24/hidden-gem-for-linux-learners-install-linux-on-windows-with-wsl-install-no-vm-no-cloud-no-15d3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt; &lt;br&gt;
Many beginners believe that to learn Linux, they must rent an EC2 instance on AWS or create a virtual machine on Azure or GCP. These cloud options work, but let’s be real they come with a price tag and internet dependency. But what if I told you there’s a pocket-friendly, offline, and genuine way to run Linux directly on your Windows system? &lt;br&gt;
Yes, it's called WSL (Windows Subsystem for Linux) and in most cases, a single command gets the job done: &lt;br&gt;
&lt;strong&gt;wsl --install&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;But wait... it’s not always that simple. Let’s walk through the full, real-world guide including the common error traps and how to fix them. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is WSL?&lt;/strong&gt;&lt;br&gt;
WSL allows you to run a real Linux environment natively on Windows, without dual-booting or installing a separate virtual machine. It supports tools like Bash, Git, apt, and even Docker right from your Windows machine. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites Before You Run wsl --install&lt;/strong&gt; &lt;br&gt;
Here’s where most people trip up (yes, me too!). Even though Microsoft says “just run the command,” WSL depends on your system’s BIOS and hardware settings. Make sure to:&lt;br&gt;
&lt;strong&gt;Enable Virtualization in BIOS&lt;/strong&gt;&lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 1:&lt;/u&gt;&lt;/strong&gt; Reboot your system.&lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 2:&lt;/u&gt;&lt;/strong&gt; Enter in your BIOS/UEFI (usually by pressing F2, Del, or Esc) &lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 3:&lt;/u&gt;&lt;/strong&gt; Navigate to the Configuration Tab.&lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 4:&lt;/u&gt;&lt;/strong&gt; Select Virtualization. &lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 5:&lt;/u&gt;&lt;/strong&gt; Press Enter, and change the status "Enabled" &lt;br&gt;
 &lt;strong&gt;&lt;u&gt;Step 6:&lt;/u&gt;&lt;/strong&gt; Navigate to Save &amp;amp; Exit &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What after enabling Virtualization in BIOS ?&lt;/strong&gt; &lt;br&gt;
&lt;strong&gt;&lt;u&gt;Step 1:&lt;/u&gt;&lt;/strong&gt; Go to your computer's Command Prompt (CMD)&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Step 2:&lt;/u&gt;&lt;/strong&gt; Execute wsl --install command.&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Step 3:&lt;/u&gt;&lt;/strong&gt; Give username of your Linux environment.&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Step 4:&lt;/u&gt;&lt;/strong&gt; Provide password to your Linux user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This is a Hidden Gem (And Cost-Saver!)&lt;/strong&gt; &lt;br&gt;
• No cloud fees.&lt;br&gt;
• No internet dependency after setup.&lt;br&gt;
• No need for heavy VMs like VirtualBox or VMware.&lt;br&gt;
• Fully functional Linux terminal inside Windows.&lt;br&gt;
• Works great even on mid-range laptops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
 In a world where people are renting servers and spinning up costly VMs to “learn Linux,” WSL stands out as a free, fast, and frictionless alternative. Just configure your BIOS, run wsl --install, and you're good to go. Trust me — if you're learning Linux, this is the most underrated tool on your machine. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Author’s Note:&lt;/strong&gt; &lt;br&gt;
Tried this out? Got stuck? Let me know in the comments or connect with me — I’ve been through the errors and figured out the tweaks.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cloud</category>
      <category>devops</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
