Skip to content

Commit d6b0190

Browse files
committed
added new docs for os for devOps...
1 parent 0fd2145 commit d6b0190

File tree

7 files changed

+492
-0
lines changed

7 files changed

+492
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Operating System",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Master the heart of the cloud. Learn how Linux manages memory, processes, and files to host your applications reliably."
7+
}
8+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
sidebar_position: 2
3+
title: "The Linux File System"
4+
sidebar_label: "2. Linux File System"
5+
description: "Understand the unique Everything is a File philosophy and the standard directory structure of a Linux server."
6+
---
7+
8+
Before we look at folders, let’s answer the most common question: **What exactly is Linux?**
9+
10+
:::info What is Linux?
11+
**Linux** is not a single "app" or a company product like Windows. It is an **Open-Source Kernel** (the core engine of an OS).
12+
13+
Think of Linux as the **Engine** of a car. Different companies take that engine, add a different "body" (UI), "seats" (Apps), and "paint" (Themes), and call it a **Distribution** (or **Distro**).
14+
* **Ubuntu:** The friendly "Sedan" for beginners.
15+
* **CentOS/RHEL:** The heavy-duty "Truck" for big companies.
16+
* **Kali Linux:** The "Spy Car" for security experts.
17+
:::
18+
19+
## The "Everything is a File" Philosophy
20+
21+
This is the most important concept in Linux.
22+
* Your **Hard Drive**? It's a file located at `/dev/sda`.
23+
* Your **Keyboard**? It's a file located at `/dev/input/event0`.
24+
* Your **Process**? It’s a folder full of files in `/proc`.
25+
26+
**Why does this matter?** Because it means you can use the same simple tools (like `cat`, `grep`, or `nano`) to fix a website, check your RAM, or configure a database. You don't need a special "Dashboard" for everything.
27+
28+
## The Linux Tree Structure (FHS)
29+
30+
In Windows, you have `C:\` and `D:\`. In Linux, everything starts from a single point called the **Root**, represented by a forward slash: `/`.
31+
32+
### The Essential Directories for DevOps:
33+
34+
| Directory | Human Name | What's inside? |
35+
| :--- | :--- | :--- |
36+
| `/` | **Root** | The parent of every other folder on the system. |
37+
| `/bin` | **Binaries** | The "Power Tools" (commands like `ls`, `cp`, `mkdir`). |
38+
| `/etc` | **Et Cetera** | The **Control Room**. Almost all configuration files live here. |
39+
| `/home` | **Home** | The personal "Apartment" for each user (e.g., `/home/ajay`). |
40+
| `/var/log` | **Logs** | The "Black Box." If an app crashes, the reason is written here. |
41+
| `/tmp` | **Temporary** | The "Trash Can." Files here are usually deleted on reboot. |
42+
| `/root` | **Root Home** | The private home for the "God Mode" (Superuser) user. |
43+
| `/dev` | **Devices** | Where your hardware "files" live (Hard drives, USBs). |
44+
45+
## Absolute vs. Relative Paths
46+
47+
As a new coder at **CodeHarborHub**, you must know how to navigate the tree.
48+
49+
1. **Absolute Path:** The full address starting from the Root.
50+
* *Example:* `/home/ajay/projects/codeharborhub`
51+
* (Like giving someone your full mailing address: Country, City, Street, House No.)
52+
53+
2. **Relative Path:** The address starting from where you are **now**.
54+
* *Example:* If you are already in `/home/ajay`, the relative path is just `projects/codeharborhub`.
55+
* (Like telling someone in your house, "The kitchen is the next door on the left.")
56+
57+
:::info The Symbols
58+
* `.` (Single Dot): Refers to the **Current** directory.
59+
* `..` (Double Dot): Refers to the **Parent** directory (one level up).
60+
* `~` (Tilde): Refers to your **Home** directory.
61+
:::
62+
63+
## Why DevOps Engineers Love This Structure
64+
65+
Imagine you are deploying a website.
66+
1. You put your code in `/var/www/html`.
67+
2. You configure the webserver (Nginx) in `/etc/nginx`.
68+
3. You check why it’s not working in `/var/log/nginx/error.log`.
69+
70+
Because every Linux server follows this **Filesystem Hierarchy Standard (FHS)**, once you learn it, you can manage any server in the world—whether it's at Google, Amazon, or on your local machine.
71+
72+
## How to "Look" at the File System
73+
74+
When you open your terminal, use these three magic commands to explore:
75+
76+
* `pwd`: **P**rint **W**orking **D**irectory (Where am I?).
77+
* `ls`: **L**ist (What's in here?).
78+
* `cd`: **C**hange **D**irectory (Move me somewhere else).
79+
80+
:::info Why this matters for you
81+
As a developer at **CodeHarborHub**, you will spend a lot of time in the `/etc` folder configuring web servers like Nginx and in the `/var/log` folder debugging why your Node.js app won't start. Mastering this "Map" is 50% of the battle!
82+
:::
83+
84+
## Summary Checklist
85+
* [x] I understand that Linux is a "Kernel" and Ubuntu is a "Distro."
86+
* [x] I know that `/` is the root of the entire system.
87+
* [x] I can explain why `/etc` and `/var/log` are important for DevOps.
88+
* [x] I know the difference between an Absolute and a Relative path.
89+
90+
:::success Mastery Moment
91+
You now know the "Map" of the Linux world. You won't get lost anymore! Next, we need to learn who is allowed to open these files.
92+
:::
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
sidebar_position: 6
3+
title: "Networking Basics for DevOps"
4+
sidebar_label: "6. Networking Basics"
5+
description: "Learn how servers communicate using IP addresses, Ports, DNS, and the magic of SSH."
6+
---
7+
8+
Imagine you want to send a physical letter to a friend. You need:
9+
1. **A House Address** (IP Address).
10+
2. **A Specific Room Number** (Port).
11+
3. **A Delivery Service** (Protocols like TCP/UDP).
12+
13+
In the world of **CodeHarborHub**, understanding these three things is the difference between a working website and a "Site Can't Be Reached" error.
14+
15+
## 1. The IP Address (The Home Address)
16+
17+
Every machine connected to the internet has a unique **IP (Internet Protocol) Address**.
18+
19+
* **Public IP:** Your server's "Global" address that the whole world can see.
20+
* **Private IP:** The "Internal" address used only inside your private cloud (like AWS VPC).
21+
* **Localhost (`127.0.0.1`):** A special address that means "This machine right here."
22+
23+
:::info The Apartment Analogy
24+
The **IP Address** gets the mail to the building (The Server). The **Port** tells the mail which apartment (The App) to go to.
25+
:::
26+
27+
## 2. Ports: The Digital Doors
28+
29+
Your server can run many apps at once (a Web Server, a Database, and an Email server). How does the computer know which traffic belongs to which app? **Ports.**
30+
31+
| Common Port | Service | What it does |
32+
| :--- | :--- | :--- |
33+
| **22** | **SSH** | Securely login to your server remotely. |
34+
| **80** | **HTTP** | Standard, unencrypted web traffic. |
35+
| **443** | **HTTPS** | Secure, encrypted web traffic (The Gold Standard). |
36+
| **3000 / 8080** | **Dev** | Common ports for Node.js or React apps in development. |
37+
| **5432** | **Postgres** | The "door" for your Database. |
38+
39+
## 3. DNS: The Internet's Phonebook
40+
41+
Humans are bad at remembering numbers like `142.250.190.46`. We are good at remembering names like `google.com` or `codeharborhub.com`.
42+
43+
**DNS (Domain Name System)** is a giant database that translates a "URL" into an "IP Address." When you type a website name, your computer asks a DNS server: *"Hey, what's the IP for this name?"* and then connects you.
44+
45+
## 4. SSH: The DevOps Magic Wand
46+
47+
**SSH (Secure Shell)** is the most important tool for a DevOps engineer. It allows you to open a terminal on a server that is thousands of miles away as if you were sitting right in front of it.
48+
49+
```bash
50+
# How to login to your server
51+
ssh username@your-server-ip
52+
```
53+
54+
:::info Keys vs. Passwords
55+
Professional servers don't use passwords for SSH; they use **SSH Keys**.
56+
57+
* **Public Key:** Stays on the server (The Lock).
58+
* **Private Key:** Stays on your laptop (The Key).
59+
60+
Only the person with the private key can get in!
61+
:::
62+
63+
## Resources for Deeper Learning
64+
65+
Ready to become a networking pro? Here are the best places to go next:
66+
67+
### Official Documentation & Guides
68+
69+
* **[Cloudflare Learning Center](https://www.cloudflare.com/learning/):** The best beginner-friendly explanations of DNS, IP, and Web Security.
70+
* **[Linux Journey - Networking](https://linuxjourney.com/lesson/network-basics):** A fantastic, free interactive site for learning Linux networking commands.
71+
* **[MDN Web Docs - How the Web Works](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/How_the_web_works):** Great for understanding the request/response cycle.
72+
73+
### Video Tutorials
74+
75+
* **[NetworkChuck (YouTube)](https://www.youtube.com/@NetworkChuck):** Extremely high-energy and visual explanations of IP addresses and Subnetting.
76+
77+
## Summary Checklist
78+
79+
* [x] I can explain the difference between an IP and a Port.
80+
* [x] I know that Port 80/443 are for Web traffic and Port 22 is for SSH.
81+
* [x] I understand that DNS translates names into numbers.
82+
* [x] I know that SSH Keys are safer than passwords.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
sidebar_position: 1
3+
title: "OS Fundamentals: The Heart of the Machine"
4+
sidebar_label: "1. OS Fundamentals"
5+
description: "A beginner-friendly guide to understanding how Operating Systems work, focusing on the Linux architecture used in DevOps."
6+
---
7+
8+
Welcome to the foundation of DevOps! Before you can automate a server, you need to understand what a server actually *is*.
9+
10+
Think of a computer without an Operating System (OS) as a library full of books but with **no librarian**. The books (data) are there, and the shelves (hardware) are there, but there is no one to help you find a book, check it out, or make sure the shelves don't collapse.
11+
12+
**The OS is your Librarian.**
13+
14+
## The 4-Layer Architecture
15+
16+
In DevOps, we primarily use **Linux**. To understand Linux, imagine an onion with four layers. To get to the center (the hardware), you have to go through the software layers.
17+
18+
### 1. The Hardware (The Physical Body)
19+
This is the "Metal." It includes your **CPU** (The Brain), **RAM** (Short-term Memory), and **Hard Drive** (Long-term Storage). Hardware is powerful but "dumb"—it doesn't know how to run a Python script by itself.
20+
21+
### 2. The Kernel (The Boss)
22+
The Kernel is the most important part of the OS. It is the only layer that can talk directly to the hardware.
23+
* **What it does:** It decides which program gets to use the CPU and how much RAM each app can have.
24+
* **In DevOps:** When your "Container" or "App" crashes, it’s usually because the Kernel stepped in and said, "No, you're using too much memory!"
25+
26+
### 3. The Shell (The Translator)
27+
Since humans can't speak "Binary" (0s and 1s), we use the **Shell**. The Shell is a program that takes your typed commands (like `mkdir` or `git push`) and translates them into instructions the Kernel understands.
28+
* **Common Shells:** Bash (Standard), Zsh (Fancy), Fish (User-friendly).
29+
30+
### 4. User Space (The Playground)
31+
This is where **you** live. Your web browser, your VS Code, your Docker containers, and your Node.js APIs all run here. These apps are "restricted"—they aren't allowed to touch the hardware directly; they must ask the Kernel for permission.
32+
33+
## The Multi-Tasking Magic
34+
35+
How can your server run a Database, a Web Server, and a Logging tool all at the same time?
36+
37+
The OS uses a concept called **Process Scheduling**.
38+
Imagine a chef (The CPU) cooking 10 different meals. The chef doesn't finish one meal before starting the next. Instead, they chop onions for 5 seconds, then flip a pancake for 5 seconds, then stir the soup for 5 seconds.
39+
40+
The OS switches between tasks so fast (millions of times per second) that it *looks* like everything is happening at once. This is called **Concurrency**.
41+
42+
## Why Linux for DevOps?
43+
44+
You might use Windows or Mac at home, but in the world of Cloud and DevOps, **Linux is King**. Here is why:
45+
46+
1. **Open Source:** It's free! You don't have to pay Microsoft for every server you spin up.
47+
2. **Lightweight:** A Windows server needs a lot of RAM just to show a desktop. A Linux server can run with no "screen" (Headless), saving all its power for your app.
48+
3. **The Package System:** Installing software on Linux is as easy as typing `apt install nginx`. It was built for automation.
49+
50+
## Key Concepts to Remember
51+
52+
| Concept | Human-Friendly Explanation |
53+
| :--- | :--- |
54+
| **Booting** | The process of the Kernel waking up the hardware and starting the OS. |
55+
| **Root User** | The "God Mode" user who has permission to do *anything* on the system. |
56+
| **File Descriptor** | A unique ID the OS gives to every open file or network connection. |
57+
| **Drivers** | Small pieces of code that teach the Kernel how to talk to new hardware (like a printer). |
58+
59+
## Summary Checklist
60+
* [x] I know that the **Kernel** is the bridge between software and hardware.
61+
* [x] I understand that the **Shell** is my interface to talk to the OS.
62+
* [x] I can explain why Linux is better for servers than Windows.
63+
* [x] I understand that "User Space" is where my applications run safely.
64+
65+
:::tip Mindset Shift
66+
As a DevOps engineer at **CodeHarborHub**, don't think of Linux as an "Operating System." Think of it as a **Set of APIs**. Every command you learn is just a way to ask the Kernel to do work for you.
67+
:::
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
sidebar_position: 5
3+
title: "Package Management"
4+
sidebar_label: "5. Package Management"
5+
description: "Learn how to install, update, and manage software on Linux using APT, YUM, and Snap."
6+
---
7+
8+
When you want to install a web server like **Nginx**, a database like **PostgreSQL**, or a tool like **Git**, you don't go to a website and click "Download." Instead, you ask your OS to go to a **Repository** (a trusted library of software) and grab it for you.
9+
10+
## What is a "Package"?
11+
12+
In Linux, a "Package" is a compressed file that contains:
13+
1. **The Application:** The actual code/binary.
14+
2. **Metadata:** Information about the version and who built it.
15+
3. **Dependencies:** A list of *other* software the app needs to run.
16+
17+
:::info The Dependency Chain
18+
Imagine you want to install a "Book" (The App). But the book requires a "Shelf" (Dependency A) to stand on, and the shelf requires "Screws" (Dependency B) to be built.
19+
A **Package Manager** is smart enough to see this and say: *"I will download the Book, the Shelf, and the Screws all at once for you."*
20+
:::
21+
22+
## The Different "App Stores" (Managers)
23+
24+
Because there are different "Distros" of Linux, there are different managers. As a **CodeHarborHub** engineer, you should know the two most common ones:
25+
26+
<Tabs>
27+
<TabItem value="apt" label="APT (Ubuntu/Debian)" default>
28+
Used by the most popular server OS, **Ubuntu**.
29+
* **Command:** `apt` (Advanced Package Tool)
30+
* **File Type:** `.deb`
31+
</TabItem>
32+
<TabItem value="yum" label="YUM/DNF (CentOS/RHEL)">
33+
Used by "Enterprise" grade Linux systems like Red Hat.
34+
* **Command:** `yum` or `dnf`
35+
* **File Type:** `.rpm`
36+
</TabItem>
37+
</Tabs>
38+
39+
## Essential Commands for Every Day
40+
41+
Let's look at how to use `apt` (the most common tool you'll use).
42+
43+
### 1. Update the "Catalog"
44+
Before installing anything, you must tell Linux to check if there are new versions of software available in the online library.
45+
```bash
46+
sudo apt update
47+
```
48+
49+
### 2. Install Software
50+
51+
Want to install the Nginx web server? It's one line:
52+
53+
```bash
54+
sudo apt install nginx
55+
```
56+
57+
### 3. Remove Software
58+
59+
If you no longer need a tool, clean it up:
60+
61+
```bash
62+
sudo apt remove git
63+
```
64+
65+
### 4. Upgrade Everything
66+
67+
To keep your server secure, you should upgrade all your installed apps to the latest versions:
68+
69+
```bash
70+
sudo apt upgrade
71+
```
72+
73+
## What are Snaps and Flatpaks?
74+
75+
Sometimes, an app is very complex and needs very specific versions of dependencies that might break your system. To solve this, developers created **Snaps**.
76+
77+
:::info The Bento Box Analogy
78+
Think of a regular package like a meal on a plate where all the food touches. A **Snap** is like a **Bento Box**. It puts the app and all its specific dependencies in a "box" so they don't interfere with the rest of your system.
79+
**Common Snaps:** Docker, Certbot (for SSL), and VS Code.
80+
:::
81+
82+
## Safety Rules for Package Management
83+
84+
1. **Always `sudo`:** You are changing the system, so you need "Manager" powers.
85+
2. **Update before Install:** Always run `apt update` first so you don't install an old, buggy version of a tool.
86+
3. **Read the Output:** Linux will tell you if it's about to delete something important. **Read before you press "Y"!**
87+
88+
## Summary Checklist
89+
90+
* [x] I understand that a Package Manager handles dependencies automatically.
91+
* [x] I know that **APT** is for Ubuntu and **YUM** is for CentOS.
92+
* [x] I can explain the difference between `apt update` and `apt upgrade`.
93+
* [x] I understand that Snaps are "isolated" versions of apps.
94+
95+
:::info Why this matters for DevOps
96+
In the next module, we will build a **CI/CD Pipeline**. Your pipeline will need to "Spin up" a server and automatically run `apt install` to set up your environment. If you don't understand how packages work, your automated deployments will fail\!
97+
:::

0 commit comments

Comments
 (0)