<?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: Eshan Roy (eshanized)</title>
    <description>The latest articles on Forem by Eshan Roy (eshanized) (@eshanized).</description>
    <link>https://forem.com/eshanized</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%2F1353443%2F73ae79ba-7ffd-47f8-8d9b-9e96eed29261.jpg</url>
      <title>Forem: Eshan Roy (eshanized)</title>
      <link>https://forem.com/eshanized</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/eshanized"/>
    <language>en</language>
    <item>
      <title>I Built an Automated SLM Fine-Tuning Engine with Python and Unsloth 🚀</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 19 Jan 2026 21:15:36 +0000</pubDate>
      <link>https://forem.com/eshanized/i-built-an-automated-slm-fine-tuning-engine-with-python-and-unsloth-257j</link>
      <guid>https://forem.com/eshanized/i-built-an-automated-slm-fine-tuning-engine-with-python-and-unsloth-257j</guid>
      <description>&lt;p&gt;Fine-tuning Small Language Models (SLMs) like Llama 3.2 or Phi-4 is easier than ever thanks to tools like Unsloth. But the &lt;em&gt;setup&lt;/em&gt; is still a pain. You have to find the right Colab notebook, format your data into JSONL, debug generic errors, and figure out which model actually fits your use case.&lt;/p&gt;

&lt;p&gt;I wanted to fix that friction. So I built &lt;a href="https://github.com/eshanized/slmgen" rel="noopener noreferrer"&gt;&lt;strong&gt;SLMGen&lt;/strong&gt;&lt;/a&gt;, an open-source tool that automates the entire process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your Data → Best Model → Matched. One notebook. Zero setup.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how I built it and how it works under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Architecture
&lt;/h2&gt;

&lt;p&gt;SLMGen is a full-stack application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Python 3.11 with FastAPI (because Python is the language of AI).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js 16 (for a snappy, modern UI).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication:&lt;/strong&gt; Supabase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engine:&lt;/strong&gt; A custom Recommendation Engine &amp;amp; Notebook Generator.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core magic happens in &lt;code&gt;libslmgen&lt;/code&gt;, the Python backend. Let's dive into the cool parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 1. The Recommendation Engine
&lt;/h2&gt;

&lt;p&gt;Most people don't know which model to pick. "Should I use Phi-4 or Llama 3.2? Is Mistral 7B too big for my edge device?"&lt;/p&gt;

&lt;p&gt;I built a &lt;strong&gt;100-point scoring system&lt;/strong&gt; to mathematically answer that question. It analyzes your dataset and intent to pick the perfect model.&lt;/p&gt;

&lt;p&gt;Here is the scoring logic from &lt;code&gt;core/recommender.py&lt;/code&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_recommendations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;characteristics&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="c1"&gt;# 50 points: Does the model fit the task? (e.g. Code vs Creative Writing)
&lt;/span&gt;    &lt;span class="n"&gt;task_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_task_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 30 points: Does it fit the hardware? (e.g. Edge vs Cloud)
&lt;/span&gt;    &lt;span class="n"&gt;deploy_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_deployment_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 20 points: Does the data match the model strengths? (e.g. Multilingual -&amp;gt; Qwen)
&lt;/span&gt;    &lt;span class="n"&gt;data_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_score_data_fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;characteristics&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;task_score&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;deploy_score&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;data_score&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It doesn't just guess. It looks at your &lt;strong&gt;data&lt;/strong&gt; features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multilingual?&lt;/strong&gt; → Bonus for Qwen 2.5 (it's great at non-English).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSON Output?&lt;/strong&gt; → Bonus for Phi-4 or Qwen (strong structured output).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge Deployment?&lt;/strong&gt; → Big penalty for 7B models, big bonus for Gemma 2B or SmolLM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔍 2. Dataset Intelligence
&lt;/h2&gt;

&lt;p&gt;Before you train, you should know what you're training on. SLMGen scans your JSONL file for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality Issues:&lt;/strong&gt; Duplicates, empty responses, short inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personality:&lt;/strong&gt; Is your data "Formal &amp;amp; Expert" or "Casual &amp;amp; Helpful"?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hallucination Risk:&lt;/strong&gt; It scans for vague language ("might," "probably") vs. grounded language ("according to," numbers/dates).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is done via heuristic analysis in &lt;code&gt;core/personality.py&lt;/code&gt; and &lt;code&gt;core/risk.py&lt;/code&gt;. It's not an LLM judging an LLM—it's fast, deterministic signal processing on text.&lt;/p&gt;

&lt;h2&gt;
  
  
  🪄 3. Self-Contained Notebooks
&lt;/h2&gt;

&lt;p&gt;This is my favorite feature. Usually, to run a Colab notebook, you have to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download a notebook.&lt;/li&gt;
&lt;li&gt;Upload your JSONL file to Colab.&lt;/li&gt;
&lt;li&gt;Fix the file path in the code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SLMGen removes steps 2 and 3. It &lt;strong&gt;embeds your dataset directly into the notebook&lt;/strong&gt; as a base64 string.&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;# From core/notebook.py
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_notebook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset_jsonl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...):&lt;/span&gt;
    &lt;span class="c1"&gt;# Encode dataset
&lt;/span&gt;    &lt;span class="n"&gt;dataset_b64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset_jsonl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Generate Python code cell
&lt;/span&gt;    &lt;span class="n"&gt;code_cell&lt;/span&gt; &lt;span class="o"&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;
    import base64
    import json

    DATASET_B64 = &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;dataset_b64&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;

    # Decode on the fly
    dataset_str = base64.b64decode(DATASET_B64).decode()
    raw_data = [json.loads(line) for line in dataset_str.splitlines()]
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you open the notebook, you just click "Run All". No file uploads. No path errors. It just works.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡ 4. Unsloth Integration
&lt;/h2&gt;

&lt;p&gt;For the actual training, I rely on &lt;a href="https://github.com/unslothai/unsloth" rel="noopener noreferrer"&gt;Unsloth&lt;/a&gt;. It makes fine-tuning 2x faster and uses 70% less memory.&lt;/p&gt;

&lt;p&gt;SLMGen automatically configures the correct LoRA target modules for every supported model structure (Llama, Phi, Gemma, etc.), so you never face a "layer not found" error.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Supported Models
&lt;/h2&gt;

&lt;p&gt;Right now, SLMGen supports 11 top-tier SLMs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Phi-4 Mini&lt;/strong&gt; (Reasoning powerhouse)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Llama 3.2&lt;/strong&gt; (1B/3B)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 2&lt;/strong&gt; (2B)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mistral 7B&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen 2.5&lt;/strong&gt; (Best for coding/multilingual)&lt;/li&gt;
&lt;li&gt;And more...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💻 Try it out
&lt;/h2&gt;

&lt;p&gt;The project is fully open source. You can run it locally or deploy it yourself.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/eshanized/slmgen" rel="noopener noreferrer"&gt;https://github.com/eshanized/slmgen&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://slmgen.vercel.app" rel="noopener noreferrer"&gt;https://slmgen.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear your feedback! If this helps you fine-tune your first model, drop a star on the repo! ⭐&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>nlp</category>
    </item>
    <item>
      <title>MultiGit: One repository. Infinite destinations</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Wed, 05 Nov 2025 23:20:32 +0000</pubDate>
      <link>https://forem.com/eshanized/multigit-one-repository-infinite-destinations-2adj</link>
      <guid>https://forem.com/eshanized/multigit-one-repository-infinite-destinations-2adj</guid>
      <description>&lt;p&gt;MultiGit is a production-ready, cross-platform Git multi-remote synchronization tool built in Rust. It lets you push, pull, and sync your repository across multiple Git hosting platforms—GitHub, GitLab, Bitbucket, Codeberg, and Gitea/Forgejo—with one command.&lt;/p&gt;

&lt;p&gt;Available as both &lt;code&gt;multigit&lt;/code&gt; and &lt;code&gt;mg&lt;/code&gt; commands for your convenience.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/TIVerse/multigit" rel="noopener noreferrer"&gt;https://github.com/TIVerse/multigit&lt;/a&gt;&lt;br&gt;
Crate: &lt;a href="https://crates.io/crates/multigit" rel="noopener noreferrer"&gt;https://crates.io/crates/multigit&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://docs.rs/multigit" rel="noopener noreferrer"&gt;https://docs.rs/multigit&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why MultiGit?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You want redundancy and resilience across platforms.&lt;/li&gt;
&lt;li&gt;You contribute to both public (GitHub) and internal (GitLab) repos.&lt;/li&gt;
&lt;li&gt;You need reliable backups and continuous mirroring.&lt;/li&gt;
&lt;li&gt;You want a single workflow to manage many platforms without brittle scripts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Multi-Remote Sync: push/pull/sync to/from multiple remotes simultaneously&lt;/li&gt;
&lt;li&gt;Secure by Default: OS keyring integration with encrypted fallback&lt;/li&gt;
&lt;li&gt;Fast and Concurrent: Tokio-based async operations with proper concurrency limits&lt;/li&gt;
&lt;li&gt;Smart Conflict Handling: detection, reporting, and guided resolution strategies&lt;/li&gt;
&lt;li&gt;Daemon Mode: background sync with scheduling, logs, and health checks&lt;/li&gt;
&lt;li&gt;Rich CLI UX: progress indicators, pretty output, and JSON mode for automation&lt;/li&gt;
&lt;li&gt;Cross-Platform: Linux, macOS, and Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Backed by a comprehensive test suite (unit + integration + workflow) and CI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;Install from crates.io:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Build from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/TIVerse/multigit.git
&lt;span class="nb"&gt;cd &lt;/span&gt;multigit
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;
./target/release/multigit &lt;span class="nt"&gt;--version&lt;/span&gt;
./target/release/mg &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize in a repository and add remotes:&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;cd &lt;/span&gt;your-repo
mg init

mg remote add github your-username
mg remote add gitlab your-username

&lt;span class="c"&gt;# Commit with the interactive Conventional Commit helper&lt;/span&gt;
mg cc

&lt;span class="c"&gt;# Sync to all remotes&lt;/span&gt;
mg &lt;span class="nb"&gt;sync&lt;/span&gt;

&lt;span class="c"&gt;# Check status across remotes&lt;/span&gt;
mg status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip: Use &lt;code&gt;mg&lt;/code&gt; for quick typing or &lt;code&gt;multigit&lt;/code&gt; in scripts—they are identical binaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Multi-remote operations: &lt;code&gt;push&lt;/code&gt;, &lt;code&gt;pull&lt;/code&gt;, &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;sync&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remote lifecycle: &lt;code&gt;remote add/remove/list/test/update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Conflicts: &lt;code&gt;conflict list&lt;/code&gt; and interactive &lt;code&gt;conflict resolve&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Automation: &lt;code&gt;daemon start/stop/status/logs&lt;/code&gt; with interval-based scheduling&lt;/li&gt;
&lt;li&gt;Health and diagnostics: &lt;code&gt;doctor&lt;/code&gt; to auto-detect common issues&lt;/li&gt;
&lt;li&gt;Developer UX: &lt;code&gt;cc&lt;/code&gt; (Conventional Commit helper), &lt;code&gt;log&lt;/code&gt;, &lt;code&gt;switch&lt;/code&gt;, &lt;code&gt;stash&lt;/code&gt;, &lt;code&gt;undo&lt;/code&gt;, &lt;code&gt;amend&lt;/code&gt;, &lt;code&gt;changelog&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Compatibility: pass-through to native git for everything else&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage Cheatsheet
&lt;/h2&gt;

&lt;p&gt;Initialize and add platforms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit init
multigit remote add github your-username
multigit remote add gitlab your-username
multigit remote add bitbucket your-username
multigit remote add mygitea your-username &lt;span class="nt"&gt;--url&lt;/span&gt; https://gitea.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sync safely:&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="c"&gt;# Interactive sync with conflict detection&lt;/span&gt;
multigit &lt;span class="nb"&gt;sync&lt;/span&gt;

&lt;span class="c"&gt;# Dry run to preview&lt;/span&gt;
multigit &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nt"&gt;--dry-run&lt;/span&gt;

&lt;span class="c"&gt;# To force push history (use with caution), use push or mirror:&lt;/span&gt;
multigit push &lt;span class="nt"&gt;--force&lt;/span&gt;
multigit mirror &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit conflict list
multigit conflict resolve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Daemon mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit daemon start &lt;span class="nt"&gt;--interval&lt;/span&gt; 5
multigit daemon status
multigit daemon logs &lt;span class="nt"&gt;--lines&lt;/span&gt; 100
multigit daemon stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conventional commits (interactive):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mg cc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSON output for automation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit &lt;span class="nt"&gt;--json&lt;/span&gt; status
multigit &lt;span class="nt"&gt;--json&lt;/span&gt; remote list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;MultiGit uses a hierarchical configuration system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CLI Flags (highest priority)&lt;/li&gt;
&lt;li&gt;Repository config: &lt;code&gt;.multigit/config.toml&lt;/code&gt; (project)&lt;/li&gt;
&lt;li&gt;User config: &lt;code&gt;~/.config/multigit/config.toml&lt;/code&gt; (global)&lt;/li&gt;
&lt;li&gt;Built-in defaults (lowest)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example &lt;code&gt;~/.config/multigit/config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[settings]&lt;/span&gt;
&lt;span class="py"&gt;default_branch&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"main"&lt;/span&gt;
&lt;span class="py"&gt;parallel_push&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;max_parallel&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="py"&gt;colored_output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[sync]&lt;/span&gt;
&lt;span class="py"&gt;auto_sync&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="py"&gt;strategy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fast-forward"&lt;/span&gt;
&lt;span class="py"&gt;detect_conflicts&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[security]&lt;/span&gt;
&lt;span class="py"&gt;auth_backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"keyring"&lt;/span&gt;  &lt;span class="c"&gt;# or "encrypted-file"&lt;/span&gt;
&lt;span class="py"&gt;audit_log&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[remotes.github]&lt;/span&gt;
&lt;span class="py"&gt;username&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your-username"&lt;/span&gt;
&lt;span class="py"&gt;enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"github"&lt;/span&gt;

&lt;span class="nn"&gt;[remotes.gitlab]&lt;/span&gt;
&lt;span class="py"&gt;username&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your-username"&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://gitlab.com"&lt;/span&gt;
&lt;span class="py"&gt;enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gitlab"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your repository-local config (created by &lt;code&gt;mg init&lt;/code&gt;) lives at &lt;code&gt;.multigit/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Model
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OS Keyring Integration: macOS Keychain, Windows Credential Manager, Linux Secret Service&lt;/li&gt;
&lt;li&gt;Encrypted Fallback: age-encrypted local storage when keyring is unavailable&lt;/li&gt;
&lt;li&gt;No Plain-Text Secrets: tokens are never stored in plain text&lt;/li&gt;
&lt;li&gt;Audit Logging: optional, configurable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Credentials are stored when you add a remote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit remote add github your-username
&lt;span class="c"&gt;# You’ll be prompted for a token, stored securely&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Architecture (High-Level)
&lt;/h2&gt;

&lt;p&gt;MultiGit follows a modular architecture with a clear separation of concerns. Source files referenced are in the &lt;code&gt;src/&lt;/code&gt; tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph TB
  UI[CLI Commands] --&amp;gt; CORE[Core Engine]
  CORE --&amp;gt; PROVIDERS[Provider Layer]
  CORE --&amp;gt; GIT[Git Operations (git2)]
  CORE --&amp;gt; SECURITY[Security]
  CORE --&amp;gt; DAEMON[Daemon &amp;amp; Scheduler]

  subgraph Core
    CONFIG[core/config.rs]
    AUTH[core/auth.rs]
    SYNC[core/sync_manager.rs]
    CONFLICT[core/conflict_resolver.rs]
    HEALTH[core/health_checker.rs]
  end

  subgraph Providers
    FACTORY[providers/factory.rs]
    GH[providers/github.rs]
    GL[providers/gitlab.rs]
    BB[providers/bitbucket.rs]
    CB[providers/codeberg.rs]
    GE[providers/gitea.rs]
  end

  subgraph Daemon
    SERVICE[daemon/service.rs]
    SCHED[daemon/scheduler.rs]
  end

  UI --&amp;gt; CONFIG
  CONFIG --&amp;gt; SYNC
  AUTH --&amp;gt; PROVIDERS
  SYNC --&amp;gt; GIT
  SYNC --&amp;gt; PROVIDERS
  SYNC --&amp;gt; CONFLICT
  SERVICE --&amp;gt; SYNC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notable modules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src/main.rs&lt;/code&gt;: CLI command tree (push/pull/fetch/sync/status/remote/daemon/conflict/etc.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/core/&lt;/code&gt;: configuration, authentication, sync orchestration, conflict resolution&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/providers/&lt;/code&gt;: provider trait + concrete implementations (GitHub, GitLab, Bitbucket, Codeberg, Gitea), created via &lt;code&gt;providers::factory&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/daemon/&lt;/code&gt;: daemon service and scheduler&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/git/&lt;/code&gt;: thin wrapper around &lt;code&gt;git2&lt;/code&gt; for reliable Git operations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/ui/&lt;/code&gt;: formatting, progress indicators, output helpers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/utils/&lt;/code&gt;: error handling, logging (&lt;code&gt;tracing&lt;/code&gt;), helpers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Sync Works
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;sync&lt;/code&gt; command orchestrates a safe flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load config and current branch&lt;/li&gt;
&lt;li&gt;Ensure working directory is clean&lt;/li&gt;
&lt;li&gt;Fetch from all enabled remotes&lt;/li&gt;
&lt;li&gt;Detect conflicts/divergence&lt;/li&gt;
&lt;li&gt;Push to all remotes in parallel with sane concurrency limits&lt;/li&gt;
&lt;li&gt;Report per-remote results and update state
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/cli/commands/sync.rs (excerpt)&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;SyncManager&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="nf"&gt;.with_max_parallel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="py"&gt;.settings.max_parallel&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="nf"&gt;.enabled_remotes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.keys&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.cloned&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.collect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;fetch_results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="nf"&gt;.fetch_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;push_results&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="nf"&gt;.push_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;branch_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Interactive Setup &amp;amp; Conventional Commits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;multigit setup&lt;/code&gt; launches a friendly wizard: select providers, guided token prompts, connection testing, and config persistence. See &lt;code&gt;src/cli/commands/setup.rs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mg cc&lt;/code&gt; opens an interactive Conventional Commit helper with:

&lt;ul&gt;
&lt;li&gt;File staging (All or Selectively)&lt;/li&gt;
&lt;li&gt;Type, scope (auto-suggestions), and description validation&lt;/li&gt;
&lt;li&gt;Optional body, breaking change flag, and footer (issues/refs)&lt;/li&gt;
&lt;li&gt;Preview and edit-before-commit&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Daemon Mode
&lt;/h2&gt;

&lt;p&gt;Run background syncs on a schedule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;multigit daemon start &lt;span class="nt"&gt;--interval&lt;/span&gt; 5
multigit daemon status
multigit daemon logs &lt;span class="nt"&gt;--lines&lt;/span&gt; 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood (&lt;code&gt;src/daemon/&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interval-based scheduler&lt;/li&gt;
&lt;li&gt;Proper termination and PID handling&lt;/li&gt;
&lt;li&gt;Invokes real syncs and logs results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a minimal reproducible pattern, see &lt;code&gt;examples/scheduler_example.rs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;examples/basic_usage.rs&lt;/code&gt;: configure remotes with the &lt;code&gt;Config&lt;/code&gt; API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;examples/scheduler_example.rs&lt;/code&gt;: periodic tasks with the scheduler&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;examples/ui_formatting.rs&lt;/code&gt;: pretty terminal output helpers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; basic_usage
cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; scheduler_example
cargo run &lt;span class="nt"&gt;--example&lt;/span&gt; ui_formatting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing &amp;amp; CI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tests: &lt;code&gt;tests/unit/&lt;/code&gt; and &lt;code&gt;tests/integration/&lt;/code&gt; cover core logic, providers, UI formatting, sync manager, and workflows&lt;/li&gt;
&lt;li&gt;CI: GitHub Actions build, test, and verify on each change&lt;/li&gt;
&lt;li&gt;Developer utilities: &lt;code&gt;verify.sh&lt;/code&gt;, coverage reports, and a structured changelog&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance &amp;amp; Reliability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Concurrency: tokio + semaphore-based parallelism for bounded concurrency&lt;/li&gt;
&lt;li&gt;Timeouts: network operations include sensible timeouts and progress callbacks&lt;/li&gt;
&lt;li&gt;Accurate metrics: fetch/push feedback and improved commit counting&lt;/li&gt;
&lt;li&gt;Robust error model: typed errors (&lt;code&gt;anyhow&lt;/code&gt;, &lt;code&gt;thiserror&lt;/code&gt;) and structured logging (&lt;code&gt;tracing&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Roadmap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Terminal UI (TUI) dashboard with &lt;code&gt;ratatui&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Workspace management for multiple repos&lt;/li&gt;
&lt;li&gt;Git LFS and Submodules&lt;/li&gt;
&lt;li&gt;Webhook server for push notifications&lt;/li&gt;
&lt;li&gt;GUI app (Tauri)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Contributions are welcome—check &lt;code&gt;CONTRIBUTING.md&lt;/code&gt; and open a PR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started Today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install: &lt;code&gt;cargo install multigit&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Initialize: &lt;code&gt;mg init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add providers: &lt;code&gt;mg remote add &amp;lt;provider&amp;gt; &amp;lt;username&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sync: &lt;code&gt;mg sync&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find MultiGit useful, star the repo and share feedback or ideas. Happy syncing!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>git</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Unlock clearer Rust dependency insight with dep-insight</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Tue, 04 Nov 2025 22:35:38 +0000</pubDate>
      <link>https://forem.com/eshanized/unlock-clearer-rust-dependency-insight-with-dep-insight-16kl</link>
      <guid>https://forem.com/eshanized/unlock-clearer-rust-dependency-insight-with-dep-insight-16kl</guid>
      <description>&lt;p&gt;If you’ve ever felt buried under a sprawling &lt;code&gt;Cargo.lock&lt;/code&gt;, wondered &lt;em&gt;“Which crate dragged in all these transitive deps?”&lt;/em&gt; or &lt;em&gt;“Why do I have two versions of &lt;code&gt;foo-crate&lt;/code&gt; in my workspace?”&lt;/em&gt;, then meet &lt;strong&gt;dep-insight&lt;/strong&gt;: a CLI + library tool designed to give you clear, actionable visibility into your Rust project’s dependency graph.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;In many non-trivial Rust codebases I work or consult on, I keep seeing the same patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate crate versions sneaking in (hello, &lt;code&gt;serde 1.0.130&lt;/code&gt; and &lt;code&gt;serde 1.0.131&lt;/code&gt; side by side)&lt;/li&gt;
&lt;li&gt;One transitive ancestor crate pulling in dozens of downstream modules, silently ballooning compile times and binary size&lt;/li&gt;
&lt;li&gt;License rustle: “Wait, is this dependency licensed permissively? Or do I need to worry?”&lt;/li&gt;
&lt;li&gt;Security: “Do we have known vulnerabilities via &lt;code&gt;rustsec&lt;/code&gt; in our dependencies?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short: I needed clarity. I needed &lt;strong&gt;dep-insight&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What it does — and how
&lt;/h2&gt;

&lt;p&gt;At its core, dep-insight does three important jobs:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Analyze
&lt;/h3&gt;

&lt;p&gt;You run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;dep-insight
&lt;span class="nb"&gt;cd &lt;/span&gt;your-rust-workspace/
cargo dep-insight analyze
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It walks your &lt;code&gt;Cargo.toml&lt;/code&gt; + lockfile, builds the dependency graph, finds duplicates (same crate, multiple versions), flags crates with &lt;em&gt;large&lt;/em&gt; transitive footprints, and gathers metadata (licenses, optional RustSec vulnerabilities) when configured.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Visualize
&lt;/h3&gt;

&lt;p&gt;Need to show the team a picture rather than a wall of text?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo dep-insight visualize &lt;span class="nt"&gt;--out&lt;/span&gt; deps.html &lt;span class="nt"&gt;--no-open&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generates a self-contained HTML file with an interactive D3.js graph of your crate-dependencies. You can hover, zoom, see “aha” moments like “this one crate is pulling in 45 others”.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Integrate &amp;amp; Automate
&lt;/h3&gt;

&lt;p&gt;It outputs JSON too — perfect for CI checks. Want your pull requests to fail if duplicate versions appear? Build automation on top of the JSON output. Want a nightly audit report? Plug it in.&lt;br&gt;
You can also enable the &lt;code&gt;audit&lt;/code&gt; feature to incorporate &lt;code&gt;rustsec&lt;/code&gt; vulnerability scanning and license checks.&lt;/p&gt;


&lt;h2&gt;
  
  
  When &amp;amp; how to use it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pre-release audits&lt;/strong&gt;: Before tagging a release, run &lt;code&gt;analyze&lt;/code&gt; + &lt;code&gt;visualize&lt;/code&gt;, inspect large dependency clusters, ask: “Do we really need &lt;em&gt;that&lt;/em&gt; crate dragging in a hundred deps?”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/PR gate&lt;/strong&gt;: Hook into the JSON output; fail if duplicates &amp;gt; 0 or forbid non-permissive licenses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team onboarding / documentation&lt;/strong&gt;: Use the HTML visualization as a baseline snapshot of your project’s dependencies—so new devs get a big-picture view fast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency cleanup sprints&lt;/strong&gt;: Pick an analysis report, pick the “top heavy” crate(s), ask “Can we remove / replace this with a lighter alternative?” and track progress over time.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What it gets right
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It’s written in Rust and built for Rust projects — no awkward cross-language adaptation.&lt;/li&gt;
&lt;li&gt;Works offline (by default) unless you enable online features — good for locked-down CI environments.&lt;/li&gt;
&lt;li&gt;A dual interface: CLI for devs, JSON for machines, HTML for humans and teams.&lt;/li&gt;
&lt;li&gt;Strong “refactoring value”: duplicates + footprint flags directly correlate to maintenance and build-time savings.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What’s still worth improving
&lt;/h2&gt;

&lt;p&gt;Nothing’s perfect, and I see a few areas where dep-insight can push further:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;GitHub Action&lt;/strong&gt; integration would be killer — e.g., automatically generate the HTML, upload as an artifact, comment on PRs with a summary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incremental caching&lt;/strong&gt; of crates.io metadata would speed large workspace analyses.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;SARIF&lt;/strong&gt; or compatible standard format for vulnerability/license results (so security dashboards can ingest them) would enhance enterprise adoption.&lt;/li&gt;
&lt;li&gt;More &lt;strong&gt;examples&lt;/strong&gt; or boilerplate code showing how to embed the library in custom tooling or dashboards could lower the barrier for consumers.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Bottom line
&lt;/h2&gt;

&lt;p&gt;If your Rust project is more than “a handful of crates”, you’ll likely uncover hidden debt: duplicate versions, unintended heavy subgraphs, license surprises. Half the battle is &lt;strong&gt;visibility&lt;/strong&gt; — &lt;em&gt;knowing what you depend on&lt;/em&gt;. dep-insight gives you that visibility, and makes it usable (and shareable) across your team.&lt;/p&gt;

&lt;p&gt;Give it a spin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;dep-insight
cargo dep-insight analyze &lt;span class="nt"&gt;--json&lt;/span&gt; report.json
cargo dep-insight visualize &lt;span class="nt"&gt;--out&lt;/span&gt; deps.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the output, share the HTML, ask your team “Do we &lt;em&gt;really&lt;/em&gt; need that crate?” and start trimming the unseen baggage.&lt;/p&gt;

&lt;p&gt;If you try it and hit weird results, or have ideas for integrations (like GitHub Actions, dashboard plugins, etc), I’d love to hear about them!&lt;/p&gt;

&lt;p&gt;Happy refactoring 🙂&lt;br&gt;
— Eshan (CEO @ Tonmoy Infrastructure)&lt;/p&gt;

</description>
      <category>rust</category>
      <category>dependencyinversion</category>
      <category>crates</category>
    </item>
    <item>
      <title>9 Must-Know Python-Pandas Operations for Working with Data</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 11 Aug 2025 02:42:15 +0000</pubDate>
      <link>https://forem.com/eshanized/9-must-know-python-pandas-operations-for-working-with-data-1h5o</link>
      <guid>https://forem.com/eshanized/9-must-know-python-pandas-operations-for-working-with-data-1h5o</guid>
      <description>&lt;p&gt;Hey folks 👋&lt;br&gt;
It’s been a while since my last post here — but I’m back! 🚀&lt;/p&gt;

&lt;p&gt;Today I’m sharing a one-stop Pandas cheat sheet + explanations that I’ve been using in my own projects. Whether you’re importing, cleaning, analyzing, or exporting data, this guide will save you time and clicks.&lt;/p&gt;



&lt;p&gt;📥 1. Data Import — Get data into Pandas&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;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.csv&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load CSV
&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;read_excel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.xlsx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sheet_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sheet1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load Excel
&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;read_sql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Run SQL query
&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;read_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load JSON
&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;read_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file.parquet&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Load Parquet
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Bring data from almost anywhere into your DataFrame.&lt;/p&gt;




&lt;p&gt;🔍 2. Data Selection — Access what you need&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;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;column&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                &lt;span class="c1"&gt;# Single column
&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;row&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;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;        &lt;span class="c1"&gt;# By label
&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;5&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="c1"&gt;# By position
&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;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col &amp;gt; 5&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# SQL-like filter
&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;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;isin&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;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])]&lt;/span&gt;  &lt;span class="c1"&gt;# Multiple matches
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Quickly filter and grab specific rows or columns.&lt;/p&gt;




&lt;p&gt;🔄 3. Data Manipulation — Shape your data&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col2&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;mean&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;sum&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;  &lt;span class="c1"&gt;# Group stats
&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;merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;left&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Join data
&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;pivot_table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;val&lt;/span&gt;&lt;span class="sh"&gt;'&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="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;idx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# Pivot table
&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;sort_values&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col1&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;col2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;ascending&lt;/span&gt;&lt;span class="o"&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;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# Sort
&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;melt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id_vars&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;id&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;value_vars&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;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;B&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;    &lt;span class="c1"&gt;# Unpivot
&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;apply&lt;/span&gt;&lt;span class="p"&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="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                         &lt;span class="c1"&gt;# Apply func
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Transform your dataset to match your analysis goals.&lt;/p&gt;




&lt;p&gt;📊 4. Statistics — Quick insights&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                          &lt;span class="c1"&gt;# Summary stats
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mean&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;median&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;std&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# Key metrics
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;value_counts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;normalize&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;# Value %s
&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;corr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pearson&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Correlation
&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;cov&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                               &lt;span class="c1"&gt;# Covariance
&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;quantile&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;         &lt;span class="c1"&gt;# Quartiles
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Get instant understanding of your data distribution.&lt;/p&gt;




&lt;p&gt;🧹 5. Data Cleaning — Make it usable&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dropna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&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;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;any&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# Remove NaNs
&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;fillna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ffill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                  &lt;span class="c1"&gt;# Fill forward
&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;drop_duplicates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&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;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;         &lt;span class="c1"&gt;# Deduplicate
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;old&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;new&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;           &lt;span class="c1"&gt;# Replace values
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# Convert type
&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;interpolate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;linear&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="c1"&gt;# Fill by trend
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Reliable data means reliable analysis.&lt;/p&gt;




&lt;p&gt;⏳ 6. Time Series — Work with dates&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;M&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                     &lt;span class="c1"&gt;# Monthly avg
&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;rolling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                 &lt;span class="c1"&gt;# Rolling avg
&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;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                          &lt;span class="c1"&gt;# Shift data
&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;date_range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2024&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;freq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;M&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Date range
&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;asfreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;D&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ffill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# Daily freq
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;date1&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&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&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-%m-%d&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Format date
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Time-based data often needs resampling or shifting.&lt;/p&gt;




&lt;p&gt;✂ 7. String Operations — Text wrangling&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;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pattern&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Match
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;extract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;(\d+)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# Extract nums
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="sh"&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="nb"&gt;str&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="c1"&gt;# Split text
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                       &lt;span class="c1"&gt;# Lowercase
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                       &lt;span class="c1"&gt;# Trim spaces
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&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="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;\s+&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; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Normalize spaces
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Clean messy text fields directly in Pandas.&lt;/p&gt;




&lt;p&gt;🚀 8. Advanced Features — Power moves&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                              &lt;span class="c1"&gt;# Chain funcs
&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;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;df1 + df2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                       &lt;span class="c1"&gt;# Fast eval
&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;memory_usage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deep&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;# Memory check
&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;select_dtypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;include&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;number&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;       &lt;span class="c1"&gt;# Filter types
&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;nlargest&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="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                      &lt;span class="c1"&gt;# Top values
&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;explode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                          &lt;span class="c1"&gt;# Expand lists
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Write cleaner, faster, and more efficient code.&lt;/p&gt;




&lt;p&gt;💾 9. Data Export — Save your work&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;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.csv&lt;/span&gt;&lt;span class="sh"&gt;'&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="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# CSV
&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;to_excel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.xlsx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sheet_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sheet1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# Excel
&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;to_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.parquet&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                    &lt;span class="c1"&gt;# Parquet
&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;to_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orient&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;records&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# JSON
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Why: Share results in the right format instantly.&lt;/p&gt;




&lt;p&gt;💡 Pro Tips&lt;/p&gt;

&lt;p&gt;📝 Use &lt;code&gt;.copy()&lt;/code&gt; to avoid accidental changes.&lt;/p&gt;

&lt;p&gt;🔗 Chain methods for cleaner code.&lt;/p&gt;

&lt;p&gt;🗂 Use &lt;code&gt;dtype='category'&lt;/code&gt; to save memory.&lt;/p&gt;

&lt;p&gt;❌ Avoid &lt;code&gt;inplace=True&lt;/code&gt; — reassign instead.&lt;/p&gt;




&lt;p&gt;💬 Question for you: Which Pandas trick here do you use the most? Or do you have a favorite that’s not listed? Let’s share and make this an even better cheat sheet. 🚀&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>cheatsheet</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mastering Python Virtual Environments: A Complete Guide</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 10 Mar 2025 15:27:13 +0000</pubDate>
      <link>https://forem.com/eshanized/mastering-python-virtual-environments-a-complete-guide-578d</link>
      <guid>https://forem.com/eshanized/mastering-python-virtual-environments-a-complete-guide-578d</guid>
      <description>&lt;p&gt;Python is a powerful and versatile language, but managing dependencies across multiple projects can become a challenge. This is where &lt;strong&gt;Python virtual environments&lt;/strong&gt; come in handy. In this guide, we’ll explore virtual environments in depth, including their benefits, setup, inner workings, and best practices.  &lt;/p&gt;

&lt;h2&gt;
  
  
  📌 What is a Python Virtual Environment?
&lt;/h2&gt;

&lt;p&gt;A virtual environment is an isolated Python environment where dependencies are installed separately from the system-wide Python installation.  &lt;/p&gt;

&lt;p&gt;It allows you to:  &lt;/p&gt;

&lt;p&gt;✅ Maintain project-specific dependencies.&lt;br&gt;&lt;br&gt;
✅ Avoid conflicts between different projects.&lt;br&gt;&lt;br&gt;
✅ Experiment with different package versions safely.&lt;br&gt;&lt;br&gt;
✅ Ensure reproducibility across different environments.  &lt;/p&gt;
&lt;h2&gt;
  
  
  ❓ Why Do We Need Virtual Environments?
&lt;/h2&gt;

&lt;p&gt;Without a virtual environment, all Python packages are installed globally, meaning:  &lt;/p&gt;

&lt;p&gt;🚨 &lt;strong&gt;Dependency Conflicts&lt;/strong&gt; – If two projects require different versions of the same package, one will break.&lt;br&gt;&lt;br&gt;
🚨 &lt;strong&gt;System Pollution&lt;/strong&gt; – Installing packages globally can clutter the system and cause unexpected issues.&lt;br&gt;&lt;br&gt;
🚨 &lt;strong&gt;Reproducibility Issues&lt;/strong&gt; – A project might work on one machine but fail on another due to different package versions.  &lt;/p&gt;

&lt;p&gt;Using virtual environments ensures each project has &lt;strong&gt;its own dependencies&lt;/strong&gt;, preventing conflicts and improving maintainability.&lt;/p&gt;
&lt;h2&gt;
  
  
  ⚙️ How Does a Virtual Environment Work?
&lt;/h2&gt;

&lt;p&gt;When you create a virtual environment, it essentially &lt;strong&gt;replicates&lt;/strong&gt; the structure of a Python installation but in an isolated manner. Here's how:  &lt;/p&gt;
&lt;h3&gt;
  
  
  1️⃣ &lt;strong&gt;Directory Structure&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Creating a virtual environment generates a folder (e.g., &lt;code&gt;myenv/&lt;/code&gt;) with the following structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myenv/
│── bin/ (or Scripts/ on Windows) → Contains the Python binary &amp;amp; activation scripts  
│── lib/ → Contains installed Python packages  
│── include/ → Contains C headers for compiled dependencies  
│── pyvenv.cfg → Configuration file linking the environment to the correct Python version  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ &lt;strong&gt;Activation Mechanism&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you activate a virtual environment:&lt;br&gt;&lt;br&gt;
✔️ The system &lt;strong&gt;modifies the &lt;code&gt;PATH&lt;/code&gt;&lt;/strong&gt; to use the Python binary inside &lt;code&gt;myenv/bin&lt;/code&gt; (or &lt;code&gt;Scripts/&lt;/code&gt; on Windows).&lt;br&gt;&lt;br&gt;
✔️ &lt;code&gt;pip&lt;/code&gt; and all installed packages are scoped within &lt;code&gt;myenv/&lt;/code&gt; instead of affecting global Python.  &lt;/p&gt;
&lt;h3&gt;
  
  
  3️⃣ &lt;strong&gt;Installing Packages&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you run:&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;requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It installs &lt;strong&gt;only inside the &lt;code&gt;lib/&lt;/code&gt; folder of the virtual environment&lt;/strong&gt; and doesn't affect system-wide Python.&lt;/p&gt;

&lt;h3&gt;
  
  
  4️⃣ &lt;strong&gt;Deactivation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you deactivate the environment, your shell restores the original &lt;code&gt;PATH&lt;/code&gt;, reverting back to system Python.  &lt;/p&gt;

&lt;p&gt;This isolation ensures each project has its own dependencies and doesn't interfere with others.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 How to Set Up a Python Virtual Environment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Check Your Python Version
&lt;/h3&gt;

&lt;p&gt;Before creating a virtual environment, ensure Python is installed on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ Create a Virtual Environment
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;venv&lt;/code&gt; (Recommended for Python 3.3+)
&lt;/h4&gt;

&lt;p&gt;The built-in &lt;strong&gt;venv&lt;/strong&gt; module is the recommended way to create virtual environments in Python 3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a directory named &lt;code&gt;myenv&lt;/code&gt; containing the isolated Python environment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;virtualenv&lt;/code&gt; (For older versions)
&lt;/h4&gt;

&lt;p&gt;If you're using an older Python version (&amp;lt;3.3) or want additional features, install &lt;strong&gt;virtualenv&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;pip &lt;span class="nb"&gt;install &lt;/span&gt;virtualenv
virtualenv myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3️⃣ Activate the Virtual Environment
&lt;/h3&gt;

&lt;h4&gt;
  
  
  On macOS/Linux
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source &lt;/span&gt;myenv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  On Windows (Command Prompt)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myenv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\a&lt;/span&gt;ctivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  On Windows (PowerShell)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myenv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\A&lt;/span&gt;ctivate.ps1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once activated, your terminal will show the virtual environment name, indicating that it's active:&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="o"&gt;(&lt;/span&gt;myenv&lt;span class="o"&gt;)&lt;/span&gt; user@machine:~&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4️⃣ Install Dependencies
&lt;/h3&gt;

&lt;p&gt;Now that your virtual environment is active, install dependencies using &lt;code&gt;pip&lt;/code&gt;:&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;requests flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check installed packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5️⃣ Deactivate the Virtual Environment
&lt;/h3&gt;

&lt;p&gt;When you're done working in the virtual environment, deactivate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔄 Managing Dependencies with &lt;code&gt;requirements.txt&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To make your project reproducible, store dependencies in a &lt;code&gt;requirements.txt&lt;/code&gt; file.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Save Installed Packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install from &lt;code&gt;requirements.txt&lt;/code&gt;
&lt;/h3&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; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🗑️ Deleting a Virtual Environment
&lt;/h2&gt;

&lt;p&gt;To remove a virtual environment, simply delete the directory:&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;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; myenv  &lt;span class="c"&gt;# macOS/Linux&lt;/span&gt;
rd /s /q myenv  &lt;span class="c"&gt;# Windows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🛠️ Advanced Virtual Environment Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Using &lt;code&gt;pyenv&lt;/code&gt; for Managing Python Versions
&lt;/h3&gt;

&lt;p&gt;If you work with multiple Python versions, &lt;strong&gt;pyenv&lt;/strong&gt; helps you switch between them. Install &lt;strong&gt;pyenv&lt;/strong&gt; and create virtual environments with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pyenv &lt;span class="nb"&gt;install &lt;/span&gt;3.11.2
pyenv virtualenv 3.11.2 myenv
pyenv activate myenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ Using &lt;code&gt;pipenv&lt;/code&gt; for Simplified Dependency Management
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;pipenv&lt;/strong&gt; combines &lt;code&gt;pip&lt;/code&gt; and &lt;code&gt;venv&lt;/code&gt; into a single tool. Install and use it like this:&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;pipenv
pipenv &lt;span class="nb"&gt;install &lt;/span&gt;requests
pipenv shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🚀 Best Practices for Virtual Environments
&lt;/h2&gt;

&lt;p&gt;✅ Always create a virtual environment for each project.&lt;br&gt;&lt;br&gt;
✅ Use &lt;code&gt;requirements.txt&lt;/code&gt; for reproducibility.&lt;br&gt;&lt;br&gt;
✅ Keep virtual environments outside your project directory (e.g., &lt;code&gt;~/venvs/&lt;/code&gt;).&lt;br&gt;&lt;br&gt;
✅ Add &lt;code&gt;myenv/&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt; to avoid committing unnecessary files.  &lt;/p&gt;

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

&lt;p&gt;Python virtual environments are a must-have for efficient project management. By isolating dependencies, they help prevent conflicts and ensure smooth development. Whether you're working on a personal project or collaborating with a team, using virtual environments is a best practice you shouldn't ignore!  &lt;/p&gt;

&lt;p&gt;🔹 Do you use virtual environments in your projects? Share your experience in the comments! 🚀 &lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why I Developed Snigdha OS?</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Wed, 08 Jan 2025 13:31:30 +0000</pubDate>
      <link>https://forem.com/eshanized/why-i-developed-snigdha-os-3b2o</link>
      <guid>https://forem.com/eshanized/why-i-developed-snigdha-os-3b2o</guid>
      <description>&lt;p&gt;Developing &lt;strong&gt;Snigdha OS&lt;/strong&gt; has been a journey that combines personal loss, technical passion, and a desire to leave a meaningful legacy. Here’s the story behind why I decided to create this operating system.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. A Tribute to Mubasshira Snigdha
&lt;/h3&gt;

&lt;p&gt;Life has a way of presenting us with moments that change everything. For me, one such moment was the loss of &lt;strong&gt;Mubasshira Snigdha&lt;/strong&gt;, my late girlfriend. Her untimely passing left a void in my life, but it also ignited a desire to honor her memory in a way that would truly reflect her influence on me.&lt;/p&gt;

&lt;p&gt;I named this operating system &lt;strong&gt;Snigdha OS&lt;/strong&gt; as a tribute to her. It is more than just a software project; it’s a testament to the love and inspiration she brought into my life. Every line of code, every feature, and every decision behind Snigdha OS is a way of preserving her legacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Passion for Open Source and Innovation
&lt;/h3&gt;

&lt;p&gt;As an open-source enthusiast, I’ve always believed in the power of technology to empower people. I wanted Snigdha OS to be more than just another Linux distribution; I envisioned it as a system that combines performance, flexibility, and simplicity to cater to a wide range of users, from developers to cybersecurity professionals to everyday users.&lt;/p&gt;

&lt;p&gt;I saw an opportunity to create something unique—an operating system that aligns with modern needs while staying true to the ethos of open source. Snigdha OS embodies my commitment to building a platform that is lightweight, customizable, and accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Addressing Gaps in Existing Linux Distributions
&lt;/h3&gt;

&lt;p&gt;While working with various Linux distributions over the years, I noticed certain gaps—whether it was performance issues, lack of customization, or limited usability for specific workflows. With Snigdha OS, I wanted to bridge these gaps by creating a distribution that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance-Optimized&lt;/strong&gt;: Leveraging the Linux Zen and LTS kernels for improved responsiveness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Highly Customizable&lt;/strong&gt;: Offering a modular approach that allows users to tailor the OS to their needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer-Friendly&lt;/strong&gt;: Pre-configured with tools and frameworks that make it ideal for software development and penetration testing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By focusing on these aspects, I aimed to create a system that not only meets user expectations but exceeds them.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Pushing My Technical Boundaries
&lt;/h3&gt;

&lt;p&gt;Developing an operating system is no small feat, and I saw it as a challenge to push my technical boundaries. It was an opportunity to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Demonstrate my expertise in Linux systems, shell scripting, and software development.&lt;/li&gt;
&lt;li&gt;Learn and grow as a developer while solving complex problems.&lt;/li&gt;
&lt;li&gt;Build something that reflects my skills and passion for technology.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snigdha OS became my playground for experimentation and innovation, allowing me to explore new ideas and bring them to life.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Building a Legacy
&lt;/h3&gt;

&lt;p&gt;Beyond the technical and emotional aspects, I wanted Snigdha OS to stand as a lasting legacy. It’s not just an operating system; it’s a story. A story of love, loss, and the determination to create something meaningful out of life’s most challenging moments.&lt;/p&gt;

&lt;p&gt;I hope Snigdha OS inspires others to pursue their passions and create projects that matter. It’s a reminder that even in the face of adversity, we can build something beautiful and impactful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Last Words
&lt;/h3&gt;

&lt;p&gt;Snigdha OS is more than just an Arch-based Linux distribution. It’s a reflection of my journey, a tribute to someone I deeply loved, and a contribution to the open-source community. Creating it has been a labor of love, a technical challenge, and a deeply personal mission.&lt;/p&gt;

&lt;p&gt;If you’re looking for a performance-driven, customizable, and user-centric operating system, I invite you to try Snigdha OS. It’s not just software; it’s a story, and I’d be honored for you to be part of it.&lt;/p&gt;

</description>
      <category>eshanized</category>
      <category>snigdhaos</category>
    </item>
    <item>
      <title>Install and use VirtualBox on Arch Linux &amp; Snigdha OS</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Tue, 07 Jan 2025 20:47:46 +0000</pubDate>
      <link>https://forem.com/snigdhaos/install-and-use-virtualbox-on-arch-linux-snigdha-os-5cb3</link>
      <guid>https://forem.com/snigdhaos/install-and-use-virtualbox-on-arch-linux-snigdha-os-5cb3</guid>
      <description>&lt;p&gt;To install and use VirtualBox on Arch Linux, you can follow these steps. VirtualBox is available in the Arch User Repository (AUR), and you can install it using &lt;code&gt;pacman&lt;/code&gt; or an AUR helper like &lt;code&gt;yay&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install VirtualBox
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Using &lt;code&gt;pacman&lt;/code&gt; (Official Arch repository):
&lt;/h4&gt;

&lt;p&gt;If you're using the VirtualBox version from the official Arch repository, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update your system&lt;/strong&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;pacman &lt;span class="nt"&gt;-Syu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install VirtualBox&lt;/strong&gt;:
Install VirtualBox and the required dependencies:
&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;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install VirtualBox and related tools. However, you will also need to install the kernel headers for your specific kernel version.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install Kernel Headers:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you are using the default &lt;code&gt;linux&lt;/code&gt; kernel:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; linux-headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are using another kernel, like &lt;code&gt;linux-lts&lt;/code&gt;, install the corresponding headers:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; linux-lts-headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load the VirtualBox kernel module&lt;/strong&gt;:
After installing VirtualBox, load the necessary kernel modules by running:
&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;modprobe vboxdrv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you encounter errors, try to ensure that the correct kernel headers are installed and that your system is using the correct kernel.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start VirtualBox&lt;/strong&gt;:
Now, you can start VirtualBox from the terminal by typing:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Using the AUR (if you prefer the AUR version):
&lt;/h4&gt;

&lt;p&gt;The AUR version is often up-to-date with the latest VirtualBox releases. You can install it using an AUR helper such as &lt;code&gt;yay&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install yay (if you haven't already)&lt;/strong&gt;:
If you don’t have &lt;code&gt;yay&lt;/code&gt; installed, you can install it using the following command:
&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;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; yay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install VirtualBox from AUR&lt;/strong&gt;:
Run the following command to install VirtualBox from the AUR:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   yay &lt;span class="nt"&gt;-S&lt;/span&gt; virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will also handle dependencies and kernel headers.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add Your User to the vboxusers Group
&lt;/h3&gt;

&lt;p&gt;To allow your user to use VirtualBox without needing to run it as root, add your user to the &lt;code&gt;vboxusers&lt;/code&gt; group:&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;gpasswd &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nv"&gt;$USER&lt;/span&gt; vboxusers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to log out and log back in for the changes to take effect.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Create a Virtual Machine (VM)
&lt;/h3&gt;

&lt;p&gt;Once VirtualBox is installed and the necessary modules are loaded, you can start creating and managing virtual machines using the VirtualBox GUI or the command line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start VirtualBox GUI&lt;/strong&gt;: &lt;br&gt;
You can launch VirtualBox from the applications menu or by running &lt;code&gt;virtualbox&lt;/code&gt; in the terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a VM&lt;/strong&gt;:&lt;br&gt;
In the VirtualBox GUI, click on "New" to create a new virtual machine. You will need to specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name and type of OS.&lt;/li&gt;
&lt;li&gt;Memory size.&lt;/li&gt;
&lt;li&gt;Virtual hard disk (you can create a new one or use an existing one).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install an OS on your VM&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Once the VM is created, you can start it and install an operating system on the virtual hard disk.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. (Optional) Install Extension Pack
&lt;/h3&gt;

&lt;p&gt;To unlock additional features such as USB 2.0/3.0 support, better video support, and remote desktop capabilities, you may want to install the VirtualBox Extension Pack.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Download the Extension Pack&lt;/strong&gt; from the VirtualBox website: &lt;a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener noreferrer"&gt;VirtualBox Extension Pack&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the Extension Pack&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After downloading, you can add it to VirtualBox from the GUI by going to &lt;strong&gt;File &amp;gt; Preferences &amp;gt; Extensions&lt;/strong&gt; and clicking the &lt;strong&gt;Add&lt;/strong&gt; button to browse and select the downloaded extension pack file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Troubleshooting:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kernel module issues&lt;/strong&gt;: If you run into issues with loading the &lt;code&gt;vboxdrv&lt;/code&gt; module, ensure that you have the correct kernel headers installed and that your kernel matches the one you're using.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check VirtualBox version compatibility&lt;/strong&gt;: Ensure that you're running the appropriate version of VirtualBox for your kernel and system setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once everything is set up, you can start using VirtualBox to create and manage virtual machines on your Arch Linux system!&lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>snigdhaos</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Start Shell Programming: A Beginner's Guide ⚙ [Part-I]</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Sun, 05 Jan 2025 03:50:08 +0000</pubDate>
      <link>https://forem.com/eshanized/start-shell-programming-a-beginners-guide-part-i-20oo</link>
      <guid>https://forem.com/eshanized/start-shell-programming-a-beginners-guide-part-i-20oo</guid>
      <description>&lt;p&gt;Shell programming is a powerful skill for automating tasks, managing systems, and improving your productivity as a developer. If you're new to shell programming, this guide will provide you with a strong foundation to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Shell Programming? 🔧
&lt;/h3&gt;

&lt;p&gt;A shell is a command-line interface (CLI) that allows users to interact with the operating system. Shell programming involves writing scripts in shell scripting languages to automate tasks such as file manipulation, process management, and system monitoring. Popular shells include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bash&lt;/strong&gt; (Bourne Again Shell): Common in Linux and macOS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zsh&lt;/strong&gt;: An enhanced shell with additional features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fish&lt;/strong&gt;: A user-friendly shell with great defaults.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PowerShell&lt;/strong&gt;: Primarily for Windows but also available on Linux and macOS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Learn Shell Programming? 🌐
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Automate Repetitive Tasks:&lt;/strong&gt; Save time by automating tasks like file backups, deployments, and system monitoring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System Administration:&lt;/strong&gt; Manage system processes, users, and configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Productivity:&lt;/strong&gt; Create custom scripts to streamline your workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foundational Skill:&lt;/strong&gt; Knowledge of shell programming is invaluable for DevOps, cloud computing, and software development.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Getting Started with Shell Scripting ✨
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step 1: Set Up Your Environment
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Choose Your Shell:&lt;/strong&gt; Most systems use Bash by default. To check your default shell, run:
&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;echo&lt;/span&gt; &lt;span class="nv"&gt;$SHELL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Editor:&lt;/strong&gt; Use a text editor like &lt;code&gt;vim&lt;/code&gt;, &lt;code&gt;nano&lt;/code&gt;, or an IDE like VS Code for scripting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Permissions:&lt;/strong&gt; Make your script executable with the &lt;code&gt;chmod&lt;/code&gt; command:&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;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Write Your First Script 🚀
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create a file named &lt;code&gt;hello.sh&lt;/code&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="c"&gt;#!/bin/bash&lt;/span&gt;
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, World!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the script:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ./hello.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3: Understand Basic Concepts 🔄
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Shebang:&lt;/strong&gt; The first line (&lt;code&gt;#!/bin/bash&lt;/code&gt;) specifies the interpreter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comments:&lt;/strong&gt; Add comments with &lt;code&gt;#&lt;/code&gt; to document your script.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variables:&lt;/strong&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="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User Input:&lt;/strong&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;read&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"Enter your name: "&lt;/span&gt; USERNAME
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$USERNAME&lt;/span&gt;&lt;span class="s2"&gt;!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Arithmetic Operations:&lt;/strong&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="nv"&gt;NUM1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5
   &lt;span class="nv"&gt;NUM2&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
   &lt;span class="nv"&gt;SUM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;NUM1 &lt;span class="o"&gt;+&lt;/span&gt; NUM2&lt;span class="k"&gt;))&lt;/span&gt;
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Sum: &lt;/span&gt;&lt;span class="nv"&gt;$SUM&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Essential Commands and Syntax 🔗
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Control Structures
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Conditional Statements:&lt;/strong&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="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; condition &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
       &lt;span class="c"&gt;# commands&lt;/span&gt;
   &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; condition &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
       &lt;span class="c"&gt;# commands&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;
       &lt;span class="c"&gt;# commands&lt;/span&gt;
   &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&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="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"file.txt"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
       &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"file.txt exists."&lt;/span&gt;
   &lt;span class="k"&gt;else
       &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"file.txt does not exist."&lt;/span&gt;
   &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Loops:&lt;/strong&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="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;1..5&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
       &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Iteration &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
   &lt;span class="k"&gt;done

   while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; condition &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
       &lt;span class="c"&gt;# commands&lt;/span&gt;
   &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&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="nv"&gt;COUNT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
   &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$COUNT&lt;/span&gt; &lt;span class="nt"&gt;-le&lt;/span&gt; 5 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
       &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Count: &lt;/span&gt;&lt;span class="nv"&gt;$COUNT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
       &lt;span class="nv"&gt;COUNT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;COUNT &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
   &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Functions
&lt;/h4&gt;

&lt;p&gt;Encapsulate reusable code:&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="k"&gt;function &lt;/span&gt;greet&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;!"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

greet &lt;span class="s2"&gt;"Alice"&lt;/span&gt;
greet &lt;span class="s2"&gt;"Bob"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Best Practices 🚀
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use Meaningful Variable Names:&lt;/strong&gt; Avoid confusion with descriptive names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling:&lt;/strong&gt; Check the success of commands using &lt;code&gt;$?&lt;/code&gt; or &lt;code&gt;set -e&lt;/code&gt; to exit on errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Readability:&lt;/strong&gt; Use consistent indentation and comments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid Hardcoding:&lt;/strong&gt; Use variables and arguments for flexibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Your Scripts:&lt;/strong&gt; Always test in a safe environment before deploying.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Common Use Cases 🛠
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File Management:&lt;/strong&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="k"&gt;for &lt;/span&gt;file &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;.txt&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
       &lt;/span&gt;&lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="p"&gt;%.txt&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.bak"&lt;/span&gt;
   &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;System Monitoring:&lt;/strong&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"Disk Usage:"&lt;/span&gt;
   &lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Active Processes:"&lt;/span&gt;
   ps aux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Processing:&lt;/strong&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;awk&lt;/span&gt; &lt;span class="s1"&gt;'/pattern/ {print $1}'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Backup Automation:&lt;/strong&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="nv"&gt;BACKUP_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"backup_&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y%m%d&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
   &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKUP_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
   &lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;.txt &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKUP_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Backup completed to &lt;/span&gt;&lt;span class="nv"&gt;$BACKUP_DIR&lt;/span&gt;&lt;span class="s2"&gt;."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Task Scheduling:&lt;/strong&gt;
Use &lt;code&gt;cron&lt;/code&gt; for periodic task execution:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   crontab &lt;span class="nt"&gt;-e&lt;/span&gt;
   &lt;span class="c"&gt;# Example cron job to run a script every day at 2 AM&lt;/span&gt;
   0 2 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /path/to/script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Learning Resources 📚
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Books:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;"Linux Shell Scripting Cookbook" by Shantanu Tushar&lt;/li&gt;
&lt;li&gt;"Learning the bash Shell" by Cameron Newham&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Online Courses:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Udemy: Bash Scripting and Shell Programming&lt;/li&gt;
&lt;li&gt;Codecademy: Learn the Command Line&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.gnu.org/software/bash/manual/" rel="noopener noreferrer"&gt;GNU Bash Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zsh.sourceforge.io/Doc/" rel="noopener noreferrer"&gt;Zsh Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Shell programming opens up a world of automation and efficiency. By mastering the basics and gradually exploring advanced concepts, you can unlock the full potential of your operating system. Start small, practice often, and don’t hesitate to experiment. Happy scripting! 🚀&lt;/p&gt;

</description>
      <category>shell</category>
      <category>cli</category>
      <category>linux</category>
      <category>programming</category>
    </item>
    <item>
      <title>🌟 Introducing My Open-Source Resume: A Step Toward Transparency and Contribution 🚀</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 30 Dec 2024 09:27:18 +0000</pubDate>
      <link>https://forem.com/eshanized/introducing-my-open-source-resume-a-step-toward-transparency-and-contribution-2o7o</link>
      <guid>https://forem.com/eshanized/introducing-my-open-source-resume-a-step-toward-transparency-and-contribution-2o7o</guid>
      <description>&lt;p&gt;Hello, Dev.to! 👋&lt;/p&gt;

&lt;p&gt;I’m excited to share my &lt;strong&gt;open-source resume&lt;/strong&gt; project, available on GitHub at &lt;a href="https://github.com/eshanized/resume" rel="noopener noreferrer"&gt;eshanized/resume&lt;/a&gt;. This project is an attempt to create a personal, transparent, and easily maintainable resume using modern web technologies. 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Open Source? 🤔
&lt;/h3&gt;

&lt;p&gt;In an ever-changing tech landscape, your personal brand and resume should be as dynamic and customizable as the tools we use every day. By open-sourcing my resume, I aim to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Promote transparency&lt;/strong&gt;: Make my career achievements and projects publicly accessible to peers, recruiters, and anyone interested in my work. 🌐&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contribute to the community&lt;/strong&gt;: By providing a template that others can fork, modify, and use for their own resumes. 💡&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Showcase my skills&lt;/strong&gt;: This project serves as a technical demonstration of my proficiency in frontend development with &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Vite&lt;/strong&gt;, &lt;strong&gt;Tailwind CSS&lt;/strong&gt;, and &lt;strong&gt;GitHub Pages&lt;/strong&gt;. 💻&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Features ✨
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modern Design&lt;/strong&gt;: My resume is built with clean, minimal, and responsive design principles using &lt;strong&gt;Tailwind CSS&lt;/strong&gt;. 🎨&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personalized&lt;/strong&gt;: It's not just a static resume — it’s a living, breathing document that reflects my professional journey, tech skills, and projects. 📈&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable&lt;/strong&gt;: You can fork it and personalize it for your own use, making it an open-source solution for those who want a customizable web-based resume. 🔧&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessible&lt;/strong&gt;: Hosted on &lt;strong&gt;GitHub Pages&lt;/strong&gt;, so it’s accessible anytime, anywhere. 🌍&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technologies Used ⚙️
&lt;/h3&gt;

&lt;p&gt;This project utilizes some amazing technologies to ensure that the website is fast, responsive, and easy to maintain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt;: A popular JavaScript library for building user interfaces. ⚛️&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vite&lt;/strong&gt;: A build tool that significantly improves the development experience with its fast bundling capabilities. ⚡&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt;: A utility-first CSS framework that makes styling faster and more efficient. 💨&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Pages&lt;/strong&gt;: For easy hosting of the static site. 🌐&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How It Works ⚡
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Clone or fork the repository:
&lt;a href="https://github.com/eshanized/resume" rel="noopener noreferrer"&gt;https://github.com/eshanized/resume&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Customize the &lt;code&gt;src/data/resume.json&lt;/code&gt; file to reflect your own career information. 📝&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;pnpm dev&lt;/code&gt; to view your changes locally. 🌱&lt;/li&gt;
&lt;li&gt;Deploy your updated resume on GitHub Pages for free. 🌍&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Roadmap 🛣️
&lt;/h3&gt;

&lt;p&gt;Here are a few features I’m planning to implement in future releases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multilingual support&lt;/strong&gt;: Adding different language options for a wider audience. 🌏&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF Export&lt;/strong&gt;: Allow users to download their resume as a PDF. 📄&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced UI&lt;/strong&gt;: Improving the overall design and adding more sections like portfolio highlights, certifications, and volunteer work. 🎨&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How You Can Contribute 🤝
&lt;/h3&gt;

&lt;p&gt;I believe open-source thrives on collaboration, and I’d love to get feedback, ideas, and contributions from others. Here’s how you can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fork the repository&lt;/strong&gt; and submit pull requests with improvements or fixes. 🍴&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report issues&lt;/strong&gt; if you encounter bugs or have suggestions for enhancements. 🐛&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Star the repository&lt;/strong&gt; if you find it useful or just want to show some support. ⭐&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can contribute by simply visiting the repository at &lt;a href="https://github.com/eshanized/resume" rel="noopener noreferrer"&gt;https://github.com/eshanized/resume&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you find this project helpful and that it sparks your own ideas for building and sharing your resume in a more dynamic and open way. Feel free to reach out with any questions, feedback, or suggestions! 😊&lt;/p&gt;

&lt;p&gt;Thanks for reading, and happy coding! 🎉👨‍💻&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>tailwindcss</category>
      <category>vite</category>
    </item>
    <item>
      <title>🚀 Introducing **Preadme**: Your Ultimate README Generator!</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Sat, 28 Dec 2024 00:21:45 +0000</pubDate>
      <link>https://forem.com/eshanized/introducing-preadme-your-ultimate-readme-generator-2p0g</link>
      <guid>https://forem.com/eshanized/introducing-preadme-your-ultimate-readme-generator-2p0g</guid>
      <description>&lt;p&gt;Are you tired of manually writing README files for your projects? Does creating a polished, well-structured README feel like a chore? Say hello to &lt;strong&gt;Preadme&lt;/strong&gt;, an open-source web application designed to simplify the process of crafting professional, Markdown-ready README files.&lt;/p&gt;

&lt;p&gt;Check out the live demo here: &lt;a href="https://eshanized.github.io/preadme" rel="noopener noreferrer"&gt;&lt;strong&gt;Preadme Demo&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
GitHub repository: &lt;a href="https://github.com/eshanized/preadme" rel="noopener noreferrer"&gt;&lt;strong&gt;Preadme on GitHub&lt;/strong&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;h3&gt;
  
  
  What is &lt;strong&gt;Preadme&lt;/strong&gt;?
&lt;/h3&gt;

&lt;p&gt;Preadme is a powerful tool for developers, created to streamline the process of README creation. With an intuitive interface, customizable sections, and live preview capabilities, Preadme eliminates the hassle of creating README files manually, ensuring your project documentation always looks professional and comprehensive.  &lt;/p&gt;
&lt;h3&gt;
  
  
  🌟 Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interactive UI&lt;/strong&gt;: Craft your README step-by-step with a user-friendly interface.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Sections&lt;/strong&gt;: Add, edit, or remove sections like Project Description, Features, Installation, Usage, and more.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Markdown Support&lt;/strong&gt;: Automatically generates content in Markdown format, ready to be used on GitHub.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Preview&lt;/strong&gt;: Instantly see how your README will look as you customize it.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download &amp;amp; Export&lt;/strong&gt;: Save your README as a &lt;code&gt;.md&lt;/code&gt; file or copy it directly.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default Templates&lt;/strong&gt;: Kickstart your README with pre-defined templates.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Source&lt;/strong&gt;: Contribute to the project and help make it better for everyone!
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🛠️ Tech Stack
&lt;/h3&gt;

&lt;p&gt;Preadme is built with modern technologies to ensure performance and scalability:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; for dynamic and interactive user interfaces.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; for responsive and elegant design.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vite&lt;/strong&gt; for fast builds and modern tooling.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Router&lt;/strong&gt; for seamless navigation.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zustand&lt;/strong&gt; for efficient state management.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lucide Icons&lt;/strong&gt; for crisp, modern SVG icons.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Markdown&lt;/strong&gt; for parsing and rendering Markdown.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  📚 How to Use
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://eshanized.github.io/preadme" rel="noopener noreferrer"&gt;&lt;strong&gt;live demo&lt;/strong&gt;&lt;/a&gt; or set up the app locally by cloning the repository.
&lt;/li&gt;
&lt;li&gt;Fill out the sections (Project Name, Description, Tech Stack, etc.) in the intuitive form interface.
&lt;/li&gt;
&lt;li&gt;Preview your README in real-time and make edits as needed.
&lt;/li&gt;
&lt;li&gt;Once satisfied, download the &lt;code&gt;.md&lt;/code&gt; file or copy the generated content.
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  💻 Installation
&lt;/h3&gt;

&lt;p&gt;Want to contribute or customize Preadme? Here’s how to set it up locally:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/eshanized/preadme.git
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Navigate to the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;preadme  
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Install the dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Start the development server:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev  
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Open &lt;code&gt;&lt;a href="http://localhost:5173/preadme" rel="noopener noreferrer"&gt;http://localhost:5173/preadme&lt;/a&gt;&lt;/code&gt; in your browser to see the application in action.  &lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  🧑‍💻 Contributing
&lt;/h3&gt;

&lt;p&gt;Preadme is open source, and we’d love your contributions!  &lt;/p&gt;

&lt;h4&gt;
  
  
  How to contribute:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Fork the repository.
&lt;/li&gt;
&lt;li&gt;Clone your fork to your local machine.
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a feature branch for your changes:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature-name  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Commit and push your changes:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin feature-name  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a pull request to the main repository.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We welcome bug fixes, feature enhancements, or even ideas for new functionality!  &lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Example Output
&lt;/h3&gt;

&lt;p&gt;Here’s a sample README generated with &lt;strong&gt;Preadme&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project Name  &lt;/span&gt;

&lt;span class="gu"&gt;## Description  &lt;/span&gt;

A brief description of the project.  

&lt;span class="gu"&gt;## Features  &lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Feature 1  
&lt;span class="p"&gt;-&lt;/span&gt; Feature 2  
&lt;span class="p"&gt;-&lt;/span&gt; Feature 3  

&lt;span class="gu"&gt;## Tech Stack  &lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; React  
&lt;span class="p"&gt;-&lt;/span&gt; Tailwind CSS  
&lt;span class="p"&gt;-&lt;/span&gt; Zustand  
&lt;span class="p"&gt;-&lt;/span&gt; Vite  

&lt;span class="gu"&gt;## Installation  &lt;/span&gt;
&lt;span class="p"&gt;
1.&lt;/span&gt; Clone the repository:  
    &lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;
&lt;/span&gt;
bash  
    git clone https://github.com/user/project-name.git


    &lt;span class="p"&gt;```&lt;/span&gt;  
&lt;span class="p"&gt;
2.&lt;/span&gt; Install dependencies:  
    &lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;
&lt;/span&gt;
bash  
    npm install


    &lt;span class="p"&gt;```&lt;/span&gt;  
&lt;span class="p"&gt;
3.&lt;/span&gt; Start the server:  
    &lt;span class="p"&gt;```&lt;/span&gt;&lt;span class="nl"&gt;
&lt;/span&gt;
bash  
    npm run dev


    &lt;span class="p"&gt;```&lt;/span&gt;  

&lt;span class="gu"&gt;## License  &lt;/span&gt;

This project is licensed under the MIT License.  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎉 Why Use Preadme?
&lt;/h3&gt;

&lt;p&gt;With Preadme, you can save time, maintain consistency, and focus on building amazing projects instead of spending hours writing documentation. Whether you’re a solo developer or working on a team, Preadme ensures your project always starts with a great README.  &lt;/p&gt;

&lt;h3&gt;
  
  
  🔗 Useful Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Live Demo: &lt;a href="https://eshanized.github.io/preadme" rel="noopener noreferrer"&gt;https://eshanized.github.io/preadme&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub Repository: &lt;a href="https://github.com/eshanized/preadme" rel="noopener noreferrer"&gt;https://github.com/eshanized/preadme&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Report Issues: &lt;a href="https://github.com/eshanized/preadme/issues" rel="noopener noreferrer"&gt;https://github.com/eshanized/preadme/issues&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us know your thoughts in the comments or open an issue on GitHub. We’d love your feedback and contributions! 🚀  &lt;/p&gt;

</description>
      <category>webapp</category>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Mastering `sed` Commands and Flags: A Guide to Stream Editing in Linux 🖥️</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Mon, 09 Dec 2024 09:03:02 +0000</pubDate>
      <link>https://forem.com/eshanized/mastering-sed-commands-and-flags-a-guide-to-stream-editing-in-linux-29jj</link>
      <guid>https://forem.com/eshanized/mastering-sed-commands-and-flags-a-guide-to-stream-editing-in-linux-29jj</guid>
      <description>&lt;p&gt;&lt;code&gt;sed&lt;/code&gt; (Stream Editor) is one of the most powerful text processing tools in Linux. Whether you're performing basic text replacement, deleting lines, or transforming entire files, &lt;code&gt;sed&lt;/code&gt; provides a variety of commands and flags that can be used to manipulate text streams effectively.&lt;/p&gt;

&lt;p&gt;In this post, we’ll dive into &lt;code&gt;sed&lt;/code&gt; commands and their flags, explore common use cases, and look at examples to make you a &lt;code&gt;sed&lt;/code&gt; master! 🛠️&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Common &lt;code&gt;sed&lt;/code&gt; Commands &amp;amp; Flags Explained
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Substitution Command (&lt;code&gt;s&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;substitution&lt;/strong&gt; command is by far the most commonly used in &lt;code&gt;sed&lt;/code&gt;. It searches for a pattern and replaces it with a replacement string.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'s/pattern/replacement/flags'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Basic Substitution
&lt;/h4&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;'s/foo/bar/'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This replaces the first occurrence of &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; in each line of &lt;code&gt;file.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Global Substitution
&lt;/h4&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;'s/foo/bar/g'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces &lt;strong&gt;all&lt;/strong&gt; occurrences of &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; in each line.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Case-Insensitive Substitution
&lt;/h4&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;'s/foo/bar/i'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; regardless of case (i.e., &lt;code&gt;Foo&lt;/code&gt;, &lt;code&gt;fOO&lt;/code&gt;, etc., are also replaced).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: N-th Occurrence Substitution
&lt;/h4&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;'s/foo/bar/2'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces the &lt;strong&gt;second&lt;/strong&gt; occurrence of &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; in each line.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Delete Command (&lt;code&gt;d&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;delete&lt;/strong&gt; command removes lines that match a given pattern or condition.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'/pattern/d'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Delete Lines with a Specific Word
&lt;/h4&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;'/error/d'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This deletes all lines containing the word &lt;code&gt;error&lt;/code&gt; from &lt;code&gt;file.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Delete Blank Lines
&lt;/h4&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; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deletes &lt;strong&gt;blank lines&lt;/strong&gt; (lines with no content).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Delete Lines Starting with a Number
&lt;/h4&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;'/^[0-9]/d'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deletes all lines starting with a digit.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Print Command (&lt;code&gt;p&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;print&lt;/strong&gt; command allows you to print lines matching a given pattern. It is often used with the &lt;code&gt;-n&lt;/code&gt; flag to suppress the default behavior of printing all lines.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;-n&lt;/span&gt; &lt;span class="s1"&gt;'/pattern/p'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Print Lines Containing a Specific Word
&lt;/h4&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;-n&lt;/span&gt; &lt;span class="s1"&gt;'/error/p'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This prints only the lines containing the word &lt;code&gt;error&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Print Matching Lines with the Next Line
&lt;/h4&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;-n&lt;/span&gt; &lt;span class="s1"&gt;'/error/{N; p}'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Prints the matching lines along with the &lt;strong&gt;next line&lt;/strong&gt; (this uses the &lt;code&gt;N&lt;/code&gt; command to append the next line to the pattern space).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Insert Command (&lt;code&gt;i&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;insert&lt;/strong&gt; command adds a line &lt;strong&gt;before&lt;/strong&gt; the specified line number or pattern.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'line_number i\text_to_insert'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Insert Text Before a Line
&lt;/h4&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;'2i\This is inserted before line 2'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Inserts text &lt;strong&gt;before&lt;/strong&gt; line 2.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Insert Text Before a Matching Pattern
&lt;/h4&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;'/error/i\This is an error message'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Inserts "This is an error message" before every line containing &lt;code&gt;error&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Append Command (&lt;code&gt;a&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;append&lt;/strong&gt; command adds a new line &lt;strong&gt;after&lt;/strong&gt; the specified line number or pattern.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'line_number a\text_to_append'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Append Text After a Line
&lt;/h4&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;'2a\This is appended after line 2'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Appends text &lt;strong&gt;after&lt;/strong&gt; line 2.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Append Text After a Matching Pattern
&lt;/h4&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;'/error/a\This is an error resolution step'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Appends "This is an error resolution step" after every line containing &lt;code&gt;error&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;Change Command (&lt;code&gt;c&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;change&lt;/strong&gt; command replaces the entire content of a line with new text.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'line_number c\new_text'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Change Content of a Line
&lt;/h4&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;'2c\This is the new content for line 2'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces the content of line 2 with &lt;code&gt;This is the new content for line 2&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: Replace Lines Matching a Pattern
&lt;/h4&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;'/error/c\Critical error occurred'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces all lines containing &lt;code&gt;error&lt;/code&gt; with &lt;code&gt;Critical error occurred&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. &lt;strong&gt;Address Ranges&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You can apply &lt;code&gt;sed&lt;/code&gt; commands to a &lt;strong&gt;range of lines&lt;/strong&gt; using either line numbers or patterns.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax for Line Numbers:
&lt;/h4&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;'start_line,end_line command'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Delete Lines 2 to 4
&lt;/h4&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;'2,4d'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deletes lines 2 to 4 from &lt;code&gt;file.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Syntax for Pattern-based Range:
&lt;/h4&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;'/start_pattern/,/end_pattern/d'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: Delete Lines Between Patterns
&lt;/h4&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;'/start/,/end/d'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deletes lines between (and including) the first occurrence of &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. &lt;strong&gt;Multiple Commands with &lt;code&gt;-e&lt;/code&gt; Flag&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;-e&lt;/code&gt; flag allows you to execute multiple commands sequentially.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;'command1'&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'command2'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example:
&lt;/h4&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/foo/bar/'&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'s/baz/qux/'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;First, it replaces &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt;, then it replaces &lt;code&gt;baz&lt;/code&gt; with &lt;code&gt;qux&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  9. &lt;strong&gt;Suppress Output with &lt;code&gt;-n&lt;/code&gt; Flag&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;By default, &lt;code&gt;sed&lt;/code&gt; prints every line. The &lt;code&gt;-n&lt;/code&gt; flag suppresses this, allowing you to print only the lines you need.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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;-n&lt;/span&gt; &lt;span class="s1"&gt;'pattern p'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example:
&lt;/h4&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;-n&lt;/span&gt; &lt;span class="s1"&gt;'/pattern/p'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Prints only the lines containing &lt;code&gt;pattern&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  10. &lt;strong&gt;In-Place Editing with &lt;code&gt;-i&lt;/code&gt; Flag&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;-i&lt;/code&gt; flag enables &lt;strong&gt;in-place editing&lt;/strong&gt;, meaning the file is modified directly without needing redirection.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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/foo/bar/g'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example: In-Place Substitution
&lt;/h4&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/foo/bar/g'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces all occurrences of &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; and saves the changes to &lt;code&gt;file.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example: In-Place Editing with Backup
&lt;/h4&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;.bak &lt;span class="s1"&gt;'s/foo/bar/g'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Creates a backup file &lt;code&gt;file.txt.bak&lt;/code&gt; before making the substitution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  11. &lt;strong&gt;Extended Regular Expressions with &lt;code&gt;-E&lt;/code&gt; Flag&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To enable &lt;strong&gt;extended regular expressions&lt;/strong&gt; (ERE) in &lt;code&gt;sed&lt;/code&gt;, use the &lt;code&gt;-E&lt;/code&gt; flag. ERE allows more powerful patterns, such as &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt;, and &lt;code&gt;|&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax:
&lt;/h4&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]+/number/'&lt;/span&gt; file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Example:
&lt;/h4&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/\b[0-9]{3}\b/NUMBER/'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces any 3-digit number with &lt;code&gt;NUMBER&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  12. &lt;strong&gt;Escaping Special Characters&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;sed&lt;/code&gt; treats certain characters (like &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt;, and &lt;code&gt;\&lt;/code&gt;) as special. To use them literally, you must escape them with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example with Special Characters:
&lt;/h4&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;'s/foo/bar\&amp;amp;baz/'&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaces &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&amp;amp;baz&lt;/code&gt; (escaping &lt;code&gt;&amp;amp;&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;code&gt;sed&lt;/code&gt; is an incredibly versatile tool for text manipulation in Linux. From simple substitutions to complex pattern matching and file modifications, &lt;code&gt;sed&lt;/code&gt; can handle almost any task related to text processing. By mastering the commands and flags covered here, you can greatly enhance your text manipulation skills.&lt;/p&gt;

&lt;p&gt;Don’t hesitate to experiment with these commands to solve your text processing needs, and let me know in the comments if you have any questions or need further clarification! 👨‍💻👩‍💻&lt;/p&gt;

&lt;p&gt;Happy editing with &lt;code&gt;sed&lt;/code&gt;! ✂️&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cli</category>
      <category>sed</category>
      <category>guide</category>
    </item>
    <item>
      <title>How to Install BlackArch on Top of Arch Linux 🖤🐧</title>
      <dc:creator>Eshan Roy (eshanized)</dc:creator>
      <pubDate>Thu, 05 Dec 2024 16:05:49 +0000</pubDate>
      <link>https://forem.com/snigdhaos/how-to-install-blackarch-on-top-of-arch-linux-6oh</link>
      <guid>https://forem.com/snigdhaos/how-to-install-blackarch-on-top-of-arch-linux-6oh</guid>
      <description>&lt;p&gt;Are you an Arch Linux enthusiast looking to dive into the world of ethical hacking and pentesting? 🕵️‍♂️💻 BlackArch is here to level up your Arch system with over &lt;strong&gt;2,800+ hacking tools&lt;/strong&gt;. Here’s how you can install BlackArch on top of your existing Arch Linux system, step by step, with a sprinkle of emojis to make it fun! 🎉&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 Prerequisites
&lt;/h2&gt;

&lt;p&gt;Make sure your Arch Linux system is updated and running smoothly. Run:&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;pacman &lt;span class="nt"&gt;-Syu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s get started! 🚀  &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Add the BlackArch Repository 🗂️
&lt;/h2&gt;

&lt;p&gt;BlackArch provides an easy way to add its repository to your system. Just execute the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://blackarch.org/strap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the downloaded script to ensure its authenticity: 🛡️&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://blackarch.org/strap.sha256&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;  strap.sh"&lt;/span&gt; | &lt;span class="nb"&gt;sha256sum&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything’s good, you’ll see &lt;code&gt;strap.sh: OK&lt;/code&gt;. 👍  &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Run the Installer 🛠️
&lt;/h2&gt;

&lt;p&gt;Now, make the script executable and run it:&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;chmod&lt;/span&gt; +x strap.sh
&lt;span class="nb"&gt;sudo&lt;/span&gt; ./strap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add the BlackArch repository and key to your system. 📥✨  &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Sync the Package Database 📋
&lt;/h2&gt;

&lt;p&gt;To make sure everything is updated:&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;pacman &lt;span class="nt"&gt;-Syyu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures you have the latest package listings from both Arch and BlackArch repositories. 🔄  &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Install BlackArch Tools 🛡️
&lt;/h2&gt;

&lt;p&gt;You can now install BlackArch tools in various ways:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Everything&lt;/strong&gt; (Warning: It’s a lot! 😅):
&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;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; blackarch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Specific Groups&lt;/strong&gt; (e.g., web, network):
&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;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; blackarch-web
   &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; blackarch-network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install a Single Tool&lt;/strong&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;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; &amp;lt;tool-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out the list of tools here: &lt;a href="https://blackarch.org/tools.html" rel="noopener noreferrer"&gt;BlackArch Tools&lt;/a&gt; 🔗  &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Start Hacking (Ethically!) 🕶️
&lt;/h2&gt;

&lt;p&gt;You’re now ready to explore the world of ethical hacking! Whether you’re testing networks, analyzing malware, or exploring cryptography, BlackArch has got you covered. 🎯  &lt;/p&gt;




&lt;h2&gt;
  
  
  Bonus Tip 🌟
&lt;/h2&gt;

&lt;p&gt;Not ready to install everything? You can run BlackArch tools in a container or virtual machine for testing. This keeps your main system clutter-free. 🛡️🖥️  &lt;/p&gt;




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

&lt;p&gt;With BlackArch on top of your Arch Linux, you now have a pentesting powerhouse! ⚡ Remember, with great power comes great responsibility—always use these tools ethically and responsibly. 🕊️  &lt;/p&gt;

&lt;p&gt;Happy hacking! 💻🐧✨  &lt;/p&gt;

&lt;p&gt;Got questions or tips? Drop them in the comments below! ⬇️  &lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>blackarch</category>
      <category>pentesting</category>
      <category>ethicalhacking</category>
    </item>
  </channel>
</rss>
