diff --git a/2026/day-01/learning-plan.md b/2026/day-01/learning-plan.md new file mode 100644 index 0000000000..95ac4ca115 --- /dev/null +++ b/2026/day-01/learning-plan.md @@ -0,0 +1,59 @@ +# Learning Plan + +--- + +**What is your understanding of DevOps & Cloud Engineering?** + +**A:-** DevOps is a methodology that combines cultural philosophies, practices & tools. +→ It's a combination of Development & Operations. + +--- + +**Why you are starting learning DevOps & cloud?** + +**A:-** +- To get the first job. +- To start my career, make my career. + +--- + +**Where do you want to reach?** + +**A:-** DevOps Engineer Level. + +--- + +**How you will stay consistent every single day?** + +**A:-** +- After Fajr: **2 hours/1** on weekdays +- **4 to 6 hours** on weekends. + +--- + +**Current Level:** Student. + +--- + +### 3 Clear Goals: + +1. Containerize a project. +2. Automate testing & deployment. +3. Deploy to a cloud (AWS / Azure). + +--- + +### 3-Core-DevOps Skills: + +1. Linux administration & Bash scripting. +2. Containerization (Docker). +3. CI/CD pipelines (or) Kubernetes. + +--- + +### Weekly Time Budget + +- **Weekdays:** 1.5 to 2 hours +- **Weekends:** 3 – 6 hours + +> *(Incl's: making of notes, understanding concepts by watching lectures – Doing practice & Building stuff)* \ No newline at end of file diff --git a/2026/day-02/linux-architecture-notes.md b/2026/day-02/linux-architecture-notes.md new file mode 100644 index 0000000000..7f0c5add1f --- /dev/null +++ b/2026/day-02/linux-architecture-notes.md @@ -0,0 +1,22 @@ +# Day 02 – Linux Architecture, Processes, and systemd + +## Core Components of Linux +* **Kernel:** It’s an intermediary between the hardware and the software which manages the hardware resources for the software. +* **User Space:** It’s a layer where all the applications and the users exist. The users cannot directly access the hardware from here. +* **Init / systemd:** (Stands for "system daemon"). When the Linux system boots up, it first loads the kernel. The kernel then starts this very first process to manage everything else. It is always assigned **PID 1**. + +## Processes +A **process** is any program that is currently in execution. Every running process is assigned a unique identifier called a **PID** (Process ID). + +### Types of Process States: +* **Running:** The process is active and executing. +* **Sleeping:** The process is currently waiting for something to happen. +* **Stopped:** The process is stopped or suspended. +* **Zombie:** The process has finished executing and is dead, but it still has a record in the system. + +## 5 Daily Commands (Processes & systemd) +* `top`: Shows a live dashboard of running processes. +* `ps`: Takes a snapshot of active processes. +* `kill`: Stops a process using its PID. +* `systemctl`: Manages systemd background services. +* `journalctl`: Views system logs for debugging. \ No newline at end of file diff --git a/2026/day-03/linux-commands-cheatsheet.md b/2026/day-03/linux-commands-cheatsheet.md new file mode 100644 index 0000000000..5dcfef07fc --- /dev/null +++ b/2026/day-03/linux-commands-cheatsheet.md @@ -0,0 +1,36 @@ +# Day 03 – Linux Commands Cheatsheet + +## 📁 File System & Navigation +* `pwd` - Prints the absolute path of the current working directory. +* `cd` - Changes the current directory. +* `cd ..` - Moves you up one directory level. +* `ls` - Lists files and folders in the current directory. +* `ls -l` - Lists files with detailed information (permissions, size, owner, timestamp). +* `ls -a` - Lists all files in a directory, including hidden ones (files starting with a dot). +* `mkdir` - Creates a new directory (folder). +* `touch` - Creates a new empty file or updates the timestamp of an existing one. +* `vim` - Opens the Vim command-line text editor to view or edit files. +* `cat` - Displays the entire contents of a file directly in the terminal. +* `echo` - Prints text or variables to the terminal screen. +* `>` - Redirects command output into a file (overwriting the file's current contents). + +## ⚙️ Process & System Management +* `top` - Displays a live, constantly updating dashboard of running processes and system resources. +* `systemctl` - Manages systemd background services (start, stop, restart, enable). +* `free -h` - Shows available and used system memory (RAM) in a human-readable format. +* `df -h` - Displays the available and used disk space on your file systems. +* `uptime` - Shows how long the system has been running without a reboot. +* `sudo` - Allows you to execute commands with administrative (root) privileges. +* `sudo apt-get update` - Refreshes the local list of available package updates from the repositories. +* `sudo apt-get upgrade` - Installs the newest versions of all packages currently installed on the system. + +## 🌐 Networking Troubleshooting +* `ping` - Tests network connectivity to a specific IP address or domain name. +* `dig` - Queries DNS servers to find information about domain names (like resolving a domain to an IP). +* `ip addr` - Displays your machine's active network interfaces and their assigned IP addresses. + +## 🛠️ General Utilities +* `clear` - Clears the terminal screen for a cleaner workspace. +* `whoami` - Displays the username of the currently logged-in user. +* `date` - Shows the current system date and time. +* `man` - Opens the official manual page for any given command (e.g., `man ls`). \ No newline at end of file diff --git a/2026/day-04/linux-practice.md b/2026/day-04/linux-practice.md new file mode 100644 index 0000000000..ca1dc55e9f --- /dev/null +++ b/2026/day-04/linux-practice.md @@ -0,0 +1,110 @@ +# Day 04 - Linux Practice: Processes and Services + +**Target Service Inspected:** `cron` (Task Scheduler) + +## Process Checks +Checking for active processes running on my local WSL environment. + +**1. Command:** `ps aux | grep cron` +```text +root 151 0.0 0.0 4464 2816 ? Ss 05:35 0:00 /usr/sbin/cron -f -P +huzefa 2147 0.0 0.0 4120 2304 pts/0 S+ 06:41 0:00 grep --color=auto cron +``` +**2. Command:** `top -n 1 -b | head -n 15` +```text +top - 06:41:23 up 1:05, 1 user, load average: 0.00, 0.00, 0.00 +Tasks: 24 total, 1 running, 23 sleeping, 0 stopped, 0 zombie +%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni, 98.8 id, 0.6 wa, 0.0 hi, 0.6 si, 0.0 st +MiB Mem : 7776.2 total, 7205.6 free, 521.6 used, 204.9 buff/cache +MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 7254.6 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 24148 14464 10880 S 0.0 0.2 0:01.38 systemd + 2 root 20 0 3072 1664 1664 S 0.0 0.0 0:00.01 init-sy+ + 10 root 20 0 3072 1792 1792 S 0.0 0.0 0:00.00 init + 53 root 19 -1 50396 15744 14720 S 0.0 0.2 0:00.40 systemd+ + 92 systemd+ 20 0 22400 13952 11520 S 0.0 0.2 0:00.14 systemd+ + 101 root 20 0 35324 11648 8832 S 0.0 0.1 0:01.29 systemd+ + 151 root 20 0 4464 2816 2688 S 0.0 0.0 0:00.02 cron + 157 message+ 20 0 8796 4864 4480 S 0.0 0.1 0:00.12 dbus-da+ +``` +**1. Command:** `systemctl status cron` +```text + ● cron.service - Regular background program processing daemon + Loaded: loaded (/usr/lib/systemd/system/cron.service; enabled; preset: enabled) + Active: active (running) since Fri 2026-07-31 05:11:51 UTC; 1h 29min ago + Invocation: 439aa67cae1f495399add4c0b4c264f4 + Docs: man:cron(8) + Main PID: 151 (cron) + Tasks: 1 (limit: 9319) + Memory: 508K (peak: 4.5M) + CPU: 158ms + CGroup: /system.slice/cron.service + └─151 /usr/sbin/cron -f -P + +Jul 31 05:11:51 huzefa cron[151]: (CRON) INFO (Running @reboot jobs) +Jul 31 05:17:01 huzefa CRON[564]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 05:17:01 huzefa CRON[566]: (root) CMD (cd / && run-parts --report /etc/cron.hourly) +Jul 31 05:17:01 huzefa CRON[564]: pam_unix(cron:session): session closed for user root +Jul 31 06:17:01 huzefa CRON[795]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 06:17:01 huzefa CRON[797]: (root) CMD (cd / && run-parts --report /etc/cron.hourly) +Jul 31 06:17:01 huzefa CRON[795]: pam_unix(cron:session): session closed for user root +Jul 31 06:25:01 huzefa CRON[811]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 06:25:01 huzefa CRON[813]: (root) CMD (test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.daily> +Jul 31 06:25:01 huzefa CRON[811]: pam_unix(cron:session): session closed for user root +``` +**2. Command:** `systemctl list-units --type=service --state=running` +```text +UNIT LOAD ACTIVE SUB DESCRIPTION + console-getty.service loaded active running Console Getty + cron.service loaded active running Regular background program processing daemon + dbus.service loaded active running D-Bus System Message Bus + getty@tty1.service loaded active running Getty on tty1 + polkit.service loaded active running Authorization Manager + rsyslog.service loaded active running System Logging Service + systemd-journald.service loaded active running Journal Service + systemd-logind.service loaded active running User Login Management + systemd-resolved.service loaded active running Network Name Resolution + systemd-udevd.service loaded active running Rule-based Manager for Device Events and Files + unattended-upgrades.service loaded active running Unattended Upgrades Shutdown + user@1000.service loaded active running User Manager for UID 1000 + wsl-pro.service loaded active running Bridge to Ubuntu Pro agent on Windows + +Legend: LOAD → Reflects whether the unit definition was properly loaded. + ACTIVE → The high-level unit activation state, i.e. generalization of SUB. + SUB → The low-level unit activation state, values depend on unit type. + +13 loaded units listed. +``` +**1. Command:** `journalctl -u cron -n 10 --no-pager` +```text +Jul 31 05:11:51 huzefa cron[151]: (CRON) INFO (Running @reboot jobs) +Jul 31 05:17:01 huzefa CRON[564]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 05:17:01 huzefa CRON[566]: (root) CMD (cd / && run-parts --report /etc/cron.hourly) +Jul 31 05:17:01 huzefa CRON[564]: pam_unix(cron:session): session closed for user root +Jul 31 06:17:01 huzefa CRON[795]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 06:17:01 huzefa CRON[797]: (root) CMD (cd / && run-parts --report /etc/cron.hourly) +Jul 31 06:17:01 huzefa CRON[795]: pam_unix(cron:session): session closed for user root +Jul 31 06:25:01 huzefa CRON[811]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 06:25:01 huzefa CRON[813]: (root) CMD (test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.daily; }) +Jul 31 06:25:01 huzefa CRON[811]: pam_unix(cron:session): session closed for user root +``` +**2. Command:** `sudo tail -n 15 /var/log/syslog` +```text +[sudo: authenticate] Password: +2026-07-31T06:29:10.155625+00:00 huzefa systemd[379]: Reexecuting. +2026-07-31T06:29:10.164178+00:00 huzefa systemd[1]: Received SIGRTMIN+25 from PID 2016 (kill). +2026-07-31T06:29:10.169252+00:00 huzefa systemd[1]: Reexecuting. +2026-07-31T06:29:10.243000+00:00 huzefa (generators)[2036]: '/run/systemd/user-generators/wsl-user-generator' is marked world-writable, which is a security risk as it is executed with privileges. Please remove world writability permission bits. Proceeding anyway. +2026-07-31T06:29:12.026290+00:00 huzefa systemd[1]: apt-daily-upgrade.service: Deactivated successfully. +2026-07-31T06:29:12.026583+00:00 huzefa systemd[1]: Finished apt-daily-upgrade.service - Daily apt upgrade and clean activities. +2026-07-31T06:29:12.027129+00:00 huzefa systemd[1]: apt-daily-upgrade.service: Consumed 8.710s CPU time over 11.651s wall clock time, 329.5M memory peak. +2026-07-31T06:34:18.944633+00:00 huzefa PackageKit: daemon quit +2026-07-31T06:34:18.959207+00:00 huzefa systemd[1]: packagekit.service: Deactivated successfully. +2026-07-31T06:37:54.415958+00:00 huzefa systemd[1]: wsl-pro.service: Scheduled restart job, restart counter is at 2. +2026-07-31T06:37:54.425856+00:00 huzefa systemd[1]: Starting wsl-pro.service - Bridge to Ubuntu Pro agent on Windows... +2026-07-31T06:37:54.613873+00:00 huzefa wsl-pro-service[2112]: #033[36mINFO#033[0m Starting WSL Pro Service version wsl-pro-service/0.1.19 +2026-07-31T06:37:54.786185+00:00 huzefa systemd[1]: Started wsl-pro.service - Bridge to Ubuntu Pro agent on Windows. +2026-07-31T06:37:55.919062+00:00 huzefa wsl-pro-service[2112]: #033[33mWARNING#033[0m Daemon: could not connect to Windows Agent: could not get address: could not read agent port file "/mnt/c/Users/Huzef/.ubuntupro/.address": open /mnt/c/Users/Huzef/.ubuntupro/.address: no such file or directory +2026-07-31T06:43:59.279978+00:00 huzefa wsl-pro-service[2112]: message repeated 11 times: [ #033[33mWARNING#033[0m Daemon: could not connect to Windows Agent: could not get address: could not read agent port file "/mnt/c/Users/Huzef/.ubuntupro/.address": open /mnt/c/Users/Huzef/.ubuntupro/.address: no such file or directory] +``` diff --git a/2026/day-05/linux-troubleshooting-runbook.md b/2026/day-05/linux-troubleshooting-runbook.md new file mode 100644 index 0000000000..4a7f1b8b33 --- /dev/null +++ b/2026/day-05/linux-troubleshooting-runbook.md @@ -0,0 +1,93 @@ +# Day 05 - Linux Troubleshooting Drill: CPU, Memory, and Logs + +**Target service / process:** `cron` + +## Environment Basics +**Commands:** `uname -a` and `cat /etc/os-release` +```text +Linux huzefa 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux +``` + +**Command:** `mkdir -p /tmp/runbook-demo && cp /etc/hosts /tmp/runbook-demo/hosts-copy && ls -l /tmp/runbook-demo` + +```text +total 4 +-rw-r--r-- 1 huzefa huzefa 409 Aug 1 07:52 hosts-copy +``` + +**Commands:** `free -h and ps -C cron -o pid,%cpu,%mem,cmd` + +```text + total used free shared buff/cache available +Mem: 7.6Gi 523Mi 6.9Gi 4.4Mi 351Mi 7.1Gi +Swap: 2.0Gi 0B 2.0Gi + + PID %CPU %MEM CMD + 151 0.0 0.0 /usr/sbin/cron -f -P + +``` + +**Command:** `df -h` + +```text +Filesystem Size Used Avail Use% Mounted on +none 3.8G 0 3.8G 0% /usr/lib/modules/6.6.87.2-microsoft-standard-WSL2 +none 3.8G 4.0K 3.8G 1% /mnt/wsl +drivers 294G 182G 113G 62% /usr/lib/wsl/drivers +/dev/sdd 1007G 2.0G 954G 1% / +none 3.8G 228K 3.8G 1% /mnt/wslg +none 3.8G 0 3.8G 0% /usr/lib/wsl/lib +rootfs 3.8G 2.7M 3.8G 1% /init +none 3.8G 544K 3.8G 1% /run +none 3.8G 0 3.8G 0% /run/lock +none 3.8G 0 3.8G 0% /run/shm +none 3.8G 76K 3.8G 1% /mnt/wslg/versions.txt +none 3.8G 76K 3.8G 1% /mnt/wslg/doc +C:\ 294G 182G 113G 62% /mnt/c +D:\ 141G 2.2G 139G 2% /mnt/d +E:\ 245G 32G 213G 13% /mnt/e +F:\ 176G 277M 176G 1% /mnt/f +G:\ 99G 4.8G 94G 5% /mnt/g +tmpfs 3.8G 4.0K 3.8G 1% /tmp +none 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service +none 1.0M 0 1.0M 0% /run/credentials/systemd-resolved.service +none 1.0M 0 1.0M 0% /run/credentials/getty@tty1.service +none 1.0M 0 1.0M 0% /run/credentials/console-getty.service +tmpfs 778M 12K 778M 1% /run/user/1000 +``` + +**Command:** `ping -c 3 google.com` +```text +PING google.com (142.251.223.14) 56(84) bytes of data. +64 bytes from lcmaaa-ao-in-f14.1e100.net (142.251.223.14): icmp_seq=1 ttl=117 time=20.3 ms +64 bytes from lcmaaa-ao-in-f14.1e100.net (142.251.223.14): icmp_seq=2 ttl=117 time=17.4 ms +64 bytes from lcmaaa-ao-in-f14.1e100.net (142.251.223.14): icmp_seq=3 ttl=117 time=18.1 ms + +--- google.com ping statistics --- +3 packets transmitted, 3 received, 0% packet loss, time 2003ms +rtt min/avg/max/mdev = 17.449/18.631/20.299/1.212 ms +``` + +**Command:** `journalctl -u cron -n 10 --no-pager` +```text +Jul 31 14:17:01 huzefa CRON[2559]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 14:17:01 huzefa CRON[2561]: (root) CMD (cd / && run-parts --report /etc/cron.hourly) +Jul 31 14:17:01 huzefa CRON[2559]: pam_unix(cron:session): session closed for user root +Jul 31 16:17:01 huzefa CRON[2640]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Jul 31 16:17:01 huzefa CRON[2640]: pam_unix(cron:session): session closed for user root +Aug 01 06:52:01 huzefa CRON[2863]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Aug 01 06:52:01 huzefa CRON[2865]: (root) CMD (test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.monthly; }) +Aug 01 06:52:01 huzefa CRON[2863]: pam_unix(cron:session): session closed for user root +Aug 01 07:17:01 huzefa CRON[2955]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0) +Aug 01 07:17:01 huzefa CRON[2955]: pam_unix(cron:session): session closed for user root +``` +```text +If this worsens (next steps) +If cron were to start failing or spiking the CPU, I would follow these 3 steps:[cite: 4] + +Restart Strategy: Attempt a graceful restart using sudo systemctl restart cron and immediately monitor systemctl status cron. + +Increase Log Verbosity: Check the master system logs (sudo tail -n 50 /var/log/syslog) for deeper, system-wide errors that might be affecting cron. + +Resource Isolation: Use top to verify if a specific rogue cron job (a scheduled script) is the actual culprit consuming the CPU, rather than the cron daemon itself. +``` diff --git a/2026/day-06/file-io-practice.md b/2026/day-06/file-io-practice.md new file mode 100644 index 0000000000..36ea4d8485 --- /dev/null +++ b/2026/day-06/file-io-practice.md @@ -0,0 +1,23 @@ +```text + +huzefa@huzefa:~$ touch notes.txt +huzefa@huzefa:~$ ls +notes.txt +huzefa@huzefa:~$ echo "Line 1: Learning basic file creation." > notes.txt +huzefa@huzefa:~$ echo "Line 2: This line is appended." >> notes.txt +huzefa@huzefa:~$ cat notes.txt +Line 1: Learning basic file creation. +Line 2: This line is appended. +huzefa@huzefa:~$ echo "Line 3: Writing and displaying at the same time." | tee -a notes.txt +Line 3: Writing and displaying at the same time. +huzefa@huzefa:~$ cat notes.txt +Line 1: Learning basic file creation. +Line 2: This line is appended. +Line 3: Writing and displaying at the same time. +huzefa@huzefa:~$ head -n 2 notes.txt +Line 1: Learning basic file creation. +Line 2: This line is appended. +huzefa@huzefa:~$ tail -n 2 notes.txt +Line 2: This line is appended. +Line 3: Writing and displaying at the same time. +``` diff --git a/2026/day-07/package-management-practice.md b/2026/day-07/package-management-practice.md new file mode 100644 index 0000000000..94dcaccd17 --- /dev/null +++ b/2026/day-07/package-management-practice.md @@ -0,0 +1,69 @@ +# Day 07 - Package Management and Service Control + +## 1. Package Installation +Installed Docker on Ubuntu using the native `apt` package manager: + +```bash +sudo apt update +sudo apt install docker.io -y +``` + +```text +huzefa@huzefa:~$ docker --version +Docker version 29.1.3, build 29.1.3-0ubuntu4.1 +``` +**Command:** `sudo systemctl status docker` +```text +● docker.service - Docker Application Container Engine + Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled) + Active: active (running) since Mon 2026-08-03 14:06:10 UTC; 9s ago + Main PID: 1332 (dockerd) + Tasks: 12 + Memory: 26.3M (peak: 28.1M) + CPU: 433ms + CGroup: /system.slice/docker.service + └─1332 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock +``` +**command:** `sudo systemctl stop docker` +```text +Stopping 'docker.service', but its triggering units are still active: +docker.socket + +``` +**command:** `sudo systemctl start docker` +```text +● docker.service - Docker Application Container Engine + Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled) + Active: active (running) since Mon 2026-08-03 14:11:03 UTC; 10s ago + Invocation: 6fae7ef700864a89ac816cf4d72c668b +TriggeredBy: ● docker.socket + Docs: https://docs.docker.com + Main PID: 1690 (dockerd) + Tasks: 12 + Memory: 48.8M (peak: 50.9M) + CPU: 727ms + CGroup: /system.slice/docker.service + └─1690 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock + +Aug 03 14:11:02 huzefa dockerd[1690]: time="2026-08-03T14:11:02.099333585Z" level=info msg="Restoring containers: start> +Aug 03 14:11:02 huzefa dockerd[1690]: time="2026-08-03T14:11:02.130045109Z" level=info msg="Deleting nftables IPv4 rule> +Aug 03 14:11:02 huzefa dockerd[1690]: time="2026-08-03T14:11:02.153351689Z" level=info msg="Deleting nftables IPv6 rule> +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.282132202Z" level=info msg="Loading containers: done." +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.296966135Z" level=info msg="Docker daemon" commit=29.1.> +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.297052423Z" level=info msg="Initializing buildkit" +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.313432496Z" level=info msg="Completed buildkit initiali> +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.321643851Z" level=info msg="Daemon has completed initia> +Aug 03 14:11:03 huzefa dockerd[1690]: time="2026-08-03T14:11:03.321744839Z" level=info msg="API listen on /run/docker.s> +Aug 03 14:11:03 huzefa systemd[1]: Started docker.service - Docker Application Container Engine. +``` + +**command:** ` sudo systemctl enable docker` + +```text verification whether it's enable or not :- +``` + +**command:** `systemctl is-enabled docker + +```text output :- +enabled +``` diff --git a/2026/day-08/day-08-cloud-deployment.md b/2026/day-08/day-08-cloud-deployment.md new file mode 100644 index 0000000000..e7f94ecbce --- /dev/null +++ b/2026/day-08/day-08-cloud-deployment.md @@ -0,0 +1,9 @@ +![alt text](ssh-connection.png) +![alt text]() + +![alt text]() +```text +Nginx logs :- +``` + +![text](nginx-logs.txt) \ No newline at end of file diff --git a/2026/day-09/day-09-user-management.md b/2026/day-09/day-09-user-management.md new file mode 100644 index 0000000000..52f4bb0d9a --- /dev/null +++ b/2026/day-09/day-09-user-management.md @@ -0,0 +1,29 @@ +# Day 09 Challenge - Linux User & Group Management + +## Users & Groups Created +* **Users:** tokyo, berlin, professor, nairobi +* **Groups:** developers, admins, project-team + +## Group Assignments +* **developers:** tokyo, berlin +* **admins:** professor, berlin[cite: 2] +* **project-team:** nairobi, tokyo[cite: 2] + +## Directories Created +* `/opt/dev-project` - Group owner: `developers`, Permissions: `775`[cite: 2] +* `/opt/team-workspace` - Group owner: `project-team`, Permissions: `775`[cite: 2] + +## Commands Used +* `sudo useradd -m `: Created users with home directories. +* `sudo passwd `: Set passwords for the new users. +* `sudo groupadd `: Created new groups. +* `sudo usermod -aG `: Added users to specific groups without removing their default groups. +* `sudo mkdir /opt/`: Created shared directories at the system root. +* `sudo chgrp /path/`: Changed the group ownership of a directory. +* `sudo chmod 775 /path/`: Granted read/write/execute access to the owner and group, and read/execute to others. +* `sudo -u touch `: Executed a command as a specific user to test permissions. + +## What I Learned +* **Absolute vs. Relative Paths:** I learned the hard way that missing the leading `/` when making a directory will create it inside the current folder instead of the root system! +* **Permission Testing:** Using `sudo -u ` is a fantastic way to quickly test if folder permissions are working correctly without having to fully log out and log back in. +* **Group Synergy:** Setting a folder's group owner and applying `775` permissions is a clean, secure way to let multiple specific users collaborate in a single directory. \ No newline at end of file diff --git a/2026/day-10/day-10-file-permissions.md b/2026/day-10/day-10-file-permissions.md new file mode 100644 index 0000000000..08532dd2b3 --- /dev/null +++ b/2026/day-10/day-10-file-permissions.md @@ -0,0 +1,74 @@ +````md +# Day 10 Challenge + +## Files Created +- `devops.txt` +- `notes.txt` +- `script.sh` +- `project/` + +## Permission Changes +- `devops.txt` + - Before: `-rw-rw-r--` + - After: `-r--------` (`chmod 400 devops.txt`) + +- `notes.txt` + - Before: `-rw-rw-r--` + - After: `-rw-r-----` (`chmod 640 notes.txt`) + +- `script.sh` + - Before: `-rw-rw-r--` + - After: `---x------` (`chmod 100 script.sh`) + - Then: `-rwx------` (`chmod 700 script.sh`) + +- `project/` + - `drwxrwxr-x` (`chmod 775 project/`) + - Later: `drwxr-xr-x` (`chmod 755 project/`) + +## Commands Used + +```bash +touch devops.txt +touch notes.txt +echo "hello mars" > notes.txt +cat notes.txt +touch script.sh +ls +ls -l + +view script.sh + +head -n 5 /etc/passwd +tail -n 5 /etc/passwd +fg + +chmod 100 script.sh +ls -l +./script.sh +sudo ./script.sh + +chmod 400 devops.txt +chmod 640 notes.txt + +mkdir project +chmod 775 project/ +ls -l + +chmod 700 script.sh +./script.sh + +echo "test" > devops.txt +./notes.txt + +chmod 755 project/ +ll +```` + +## What I Learned + +1. `head -n 5 /etc/passwd` is used to display the first 5 lines of a file. +2. `tail -n 5 /etc/passwd` is used to display the last 5 lines of a file. +3. When a `.sh` file is opened in read-only mode using `view`, it can be closed using `:q`. + +``` +``` diff --git a/2026/day-11/day-11-file-ownership.md b/2026/day-11/day-11-file-ownership.md new file mode 100644 index 0000000000..fce6e67967 --- /dev/null +++ b/2026/day-11/day-11-file-ownership.md @@ -0,0 +1,232 @@ +# Day 11 Challenge - File Ownership Challenge + +## Files & Directories Created +* `devops-file.txt`, `team-notes.txt`, `project-config.yaml`. +* `app-logs/` directory. +* `heist-project/` recursive directory structure (`vault/` and `plans/`)[cite: 2]. +* `bank-heist/` directory with `access-codes.txt`, `blueprints.pdf`, and `escape-plan.txt`[cite: 2]. + +## Ownership Changes +* `devops-file.txt`: Changed owner to `tokyo`, then `berlin`[cite: 2]. +* `team-notes.txt`: Changed group to `heist-team`[cite: 2]. +* `project-config.yaml` & `app-logs/`: Changed both owner and group simultaneously (e.g., `professor:heist-team`)[cite: 2]. +* `heist-project/`: Applied recursive ownership (`professor:planners`) to all subfolders and files[cite: 2]. +* `bank-heist/` files: Assigned specific cross-functional teams (`tokyo:vault-team`, `berlin:tech-team`, `nairobi:vault-team`)[cite: 2]. + +## Commands Used +* `ls -l`: To view ownership and group assignments[cite: 2]. +* `sudo chown `: To change the user who owns a file[cite: 2]. +* `sudo chgrp `: To change the group assigned to a file[cite: 2]. +* `sudo chown : `: To change both owner and group in a single command[cite: 2]. +* `sudo chown -R : /`: To recursively apply ownership to a directory and everything inside it[cite: 2]. + +## What I Learned +1. **Owner vs. Group:** An owner is a single user account with explicit control, whereas a group is a collection of multiple users who share the same access level. +2. **Efficiency:** Using `chown user:group` is significantly faster than running `chown` and `chgrp` separately. +3. **Recursive Power:** The `-R` flag is incredibly powerful for applying ownership changes to entire project trees all at once, ensuring no deeply nested files are left behind. +---------------------------------------------------------------------------------------- + + +### logging my task's output :- + +# Day 11 Challenge + +## Files Created +- `devops-file.txt` +- `team-notes.txt` +- `project-config.yaml` +- `app-logs/` +- `heist-project/` + - `vault/gold.txt` + - `plans/strategy.conf` +- `bank-heist/` + - `access-codes.txt` + - `blueprints.pdf` + - `escape-plan.txt` + +## Ownership Changes + +### `devops-file.txt` +- Initially owned by `ubuntu` +- Changed owner to `tokyo` +- Then changed owner to `berlin` + +### `team-notes.txt` +- Owner: `ubuntu` +- Group changed to `heist-team` + +### `project-config.yaml` +- Owner changed to `professor` +- Group changed to `heist-team` + +### `app-logs/` +- Owner changed to `berlin` +- Group changed to `heist-team` + +### `heist-project/` +- Ownership recursively changed to `professor:planners` +- `plans/` and `vault/` inherited the ownership + +### `bank-heist/` +- `access-codes.txt` → owner `tokyo`, group `vault-team` +- `blueprints.pdf` → owner `berlin`, group `tech-team` +- `escape-plan.txt` → owner `nairobi`, group `vault-team` + +## Commands Used + +### Task 1 + +```bash +ls -l +```` + +**Output:** + +```text +total 48 +-rw-rw-r-- 1 ubuntu ubuntu 5503 Aug 7 12:45 app.log +drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 15 10:50 backup +drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 31 09:31 day10 +-rw-rw-r-- 1 ubuntu ubuntu 49 Aug 8 01:43 demo-password.txt +drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 8 08:22 devops +-rw-rw-r-- 1 ubuntu ubuntu 23 Aug 8 08:22 hardSpecial.txt +-rw-rw-r-- 1 ubuntu ubuntu 75 Jul 26 15:30 hello.txt +drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 16 06:42 lvm-demo +-rw-rw-r-- 1 ubuntu ubuntu 0 Jul 26 15:30 my-new-file.txt +-rw-rw-r-- 1 ubuntu ubuntu 440 Aug 4 16:25 nginx-logs.txt +drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 15 16:14 scripts +lrwxrwxrwx 1 ubuntu ubuntu 26 Aug 8 07:49 soft-special.txt -> devops/my-special-file.txt +-rw-rw-r-- 1 ubuntu ubuntu 53 Aug 8 07:34 special.txt +``` + +### Task 2 + +```bash +mkdir day11 +cd day11 + +touch devops-file.txt +ls -l devops-file.txt + +sudo chown tokyo devops-file.txt +ls -l devops-file.txt + +sudo chown berlin devops-file.txt +ls -l devops-file.txt +``` + +**Output:** + +```text +-rw-rw-r-- 1 ubuntu ubuntu 0 Aug 31 11:57 devops-file.txt + +-rw-rw-r-- 1 tokyo ubuntu 0 Aug 31 11:57 devops-file.txt + +total 0 +-rw-rw-r-- 1 berlin ubuntu 0 Aug 31 11:57 devops-file.txt +``` + +### Task 3 + +```bash +touch team-notes.txt +ls -l team-notes.txt + +sudo groupadd heist-team +sudo chgrp heist-team team-notes.txt + +ls -l team-notes.txt +``` + +**Output:** + +```text +-rw-rw-r-- 1 ubuntu ubuntu 0 Aug 31 12:00 team-notes.txt + +-rw-rw-r-- 1 ubuntu heist-team 0 Aug 31 12:00 team-notes.txt +``` + +### Task 4 + +```bash +touch project-config.yaml +sudo chown professor:heist-team project-config.yaml + +mkdir app-logs/ +sudo chown berlin:heist-team app-logs/ + +sudo chown berlin:heist-team app-logs/ + +ls -l +``` + +**Output:** + +```text +total 4 +drwxrwxr-x 2 berlin heist-team 4096 Aug 31 12:06 app-logs +-rw-rw-r-- 1 berlin ubuntu 0 Aug 31 11:57 devops-file.txt +-rw-rw-r-- 1 professor heist-team 0 Aug 31 12:04 project-config.yaml +-rw-rw-r-- 1 ubuntu heist-team 0 Aug 31 12:00 team-notes.txt +``` + +### Task 5 + +```bash +mkdir -p heist-project/vault +mkdir -p heist-project/plans + +touch heist-project/vault/gold.txt +touch heist-project/plans/strategy.conf + +sudo chown -R professor:planners heist-project/ + +ls -lR heist-project/ +``` + +**Output:** + +```text +heist-project/: +total 8 +drwxrwxr-x 2 professor planners 4096 Aug 31 12:13 plans +drwxrwxr-x 2 professor planners 4096 Aug 31 12:13 vault + +heist-project/plans: +total 0 +-rw-rw-r-- 1 professor planners 0 Aug 31 12:13 strategy.conf + +heist-project/vault: +total 0 +-rw-rw-r-- 1 professor planners 0 Aug 31 12:12 gold.txt +``` + +### Task 6 + +```bash +sudo groupadd vault-team +sudo groupadd tech-team + +mkdir bank-heist/ +cd bank-heist/ + +touch access-codes.txt +touch blueprints.pdf +touch escape-plan.txt + +sudo chown tokyo:vault-team access-codes.txt +sudo chown berlin:tech-team blueprints.pdf +sudo chown nairobi:vault-team escape-plan.txt + +ls -l bank-heist/ +``` + +**Output:** + +```text +total 0 +-rw-rw-r-- 1 tokyo vault-team 0 Aug 31 12:57 access-codes.txt +-rw-rw-r-- 1 berlin tech-team 0 Aug 31 12:57 blueprints.pdf +-rw-rw-r-- 1 nairobi vault-team 0 Aug 31 12:57 escape-plan.txt +``` + diff --git a/2026/day-12/day-12-revision.md b/2026/day-12/day-12-revision.md new file mode 100644 index 0000000000..35f588d33d --- /dev/null +++ b/2026/day-12/day-12-revision.md @@ -0,0 +1,24 @@ +# Day 12 - Breather & Revision (Days 01-11) + +## The "Active Recall" Drill +* **Service Management:** Verified the `ssh` service is active using `systemctl status ssh`. +* **Process Monitoring:** Filtered active running processes using `ps aux | head -n 5`[cite: 2]. +* **File Security:** Created a practice directory and locked down file permissions to `600` using `chmod` and `chown`[cite: 2]. +* **Key Takeaway:** If `chmod` throws an "Operation not permitted" error, it's often because the current user no longer owns the file. Linux security works! + +## Mini Self-Check + +**1. Which 3 commands save you the most time right now, and why?**[cite: 2] +* `ls -la`: Essential for seeing all files, including hidden ones, and checking permissions at a glance. +* `df -h`: The fastest way to check used and remaining storage space in a human-readable format. +* `cat `: Saves time by displaying file contents directly in the terminal without having to open an editor. + +**2. How do you check if a service is healthy? List the exact 2-3 commands you'd run first.**[cite: 2] +* `sudo systemctl status `: The primary command to see if a service is active, running, or failed. +* `journalctl -eu `: The best follow-up command to check the actual error logs if a service is crashing. + +**3. How do you safely change ownership and permissions without breaking access?**[cite: 2] +* By using `chown` and `chmod`. Specifically, using the numeric octal system with `chmod` (like `644` for standard safe files, or `600` for strict lockdown) ensures you know exactly who has `rwx` access. + +**4. What will you focus on improving in the next 3 days?**[cite: 2] +* Focusing entirely on the *essential, day-to-day* Linux shell commands required for DevOps tasks (like service management, log reading, and process monitoring), rather than getting lost in the weeds of general Linux trivia.git \ No newline at end of file diff --git a/2026/day-13/day-13-lvm.md b/2026/day-13/day-13-lvm.md new file mode 100644 index 0000000000..72c4ab09dc --- /dev/null +++ b/2026/day-13/day-13-lvm.md @@ -0,0 +1,26 @@ +# Day 13 - Linux Volume Management (LVM) + +## Overview & Setup +* **Virtual Disk Creation:** Created a 1GB raw image file at `/home/ubuntu/disk1.img` using `dd` and mapped it to a loop device (`/dev/loop6`) to safely practice LVM without risking the root filesystem. + +## LVM Implementation Steps +1. **Physical Volume (PV):** Initialized the loop device using `pvcreate /dev/loop6`. Verified via `pvs`. +2. **Volume Group (VG):** Created a storage pool named `devops2-vg` using `vgcreate devops2-vg /dev/loop6`. Verified via `vgs`[cite: 2]. +3. **Logical Volume (LV):** Carved out a 500MB partition named `app-data` using `lvcreate -L 500M -n app-data devops2-vg`. Verified via `lvs`. +4. **Formatting & Mounting:** Formatted the volume with `mkfs.ext4`, created the mount point `/mnt/app-data`, and mounted it[cite: 2]. Verified storage availability using `df -h`. +5. **Volume Extension:** Dynamically extended the volume by +200M using `lvextend` and resized the filesystem online using `resize2fs` without unmounting or restarting. + +## Commands Used +* `losetup`: To map raw image files to loop devices. +* `pvcreate`, `pvs`: To initialize and view physical volumes. +* `vgcreate`, `vgs`: To create and view volume groups. +* `lvcreate`, `lvs`: To carve and view logical volumes. +* `mkfs.ext4`: To apply a Linux filesystem format. +* `mount`: To attach the volume to a directory path. +* `lvextend` & `resize2fs`: To dynamically expand storage and resize filesystems on the fly. + +## What I Learned +1. **Flexibility:** LVM decouples physical hardware limits from logical partitions, making storage management infinitely more flexible. +2. **Safety First:** Using loop devices on file images is a great way to safely practice destructive disk operations on cloud instances. +3. **Zero-Downtime Scaling:** Being able to extend a volume and resize its filesystem online means applications can scale storage without experiencing maintenance downtime. + diff --git a/2026/day-14/day-14-networking.md b/2026/day-14/day-14-networking.md new file mode 100644 index 0000000000..973a2c594e --- /dev/null +++ b/2026/day-14/day-14-networking.md @@ -0,0 +1,24 @@ +# Day 14 - Networking Fundamentals & Hands-on Checks + +## Quick Concepts +* **OSI vs TCP/IP Models:** + * **OSI (7 Layers):** Application, Presentation, Session, Transport, Network, Data Link, Physical. + * **TCP/IP (4 Layers):** Application, Transport, Internet, Network Access. +* **Where Protocols Sit:** + * **Application:** HTTP/HTTPS, DNS. + * **Transport:** TCP, UDP. + * **Internet/Network:** IP (IPv4, IPv6). +* **Real Example:** Running `curl https://example.com` is making an **Application layer (HTTPS)** request, wrapped in a **Transport layer (TCP)** connection, routed via the **Internet layer (IP)**. + +## Hands-on Checklist & Observations +* **Identity (`hostname -I`):** Identified my local EC2 IP addresses (172.31.15.111 and 172.17.0.1). +* **Reachability (`ping google.com`):** Reached Google with 0% packet loss and an incredibly fast ~3.2ms latency. +* **Path (`traceroute google.com`):** Mapped the exact server hops it took to reach Google's servers. +* **Name Resolution (`dig google.com`):** Queried the DNS server and successfully resolved google.com to `172.217.20.174` in 1 millisecond. +* **HTTP Check (`curl -I https://google.com`):** Discovered that Google uses an `HTTP/2 301` redirect to push traffic to `www.google.com`. +* **Ports & Probe (`ss -tulpn` & `nc -zv`):** Identified a listening Redis service on port `6379` and successfully probed it using `netcat` to confirm it was accepting connections. + +## Reflection +* **Fastest broken signal:** `ping` gives the fastest indication if a host is completely offline or unreachable. +* **Next check for DNS failure:** If DNS fails (domain doesn't ping but IP does), check the `/etc/resolv.conf` file or the local DNS resolver. +* **Next check for HTTP 500:** If an HTTP 500 occurs, inspect the Application layer—specifically the backend application logs (using `journalctl` or `/var/log/`) to see why the code crashed. \ No newline at end of file diff --git a/2026/day-15/day-15-networking-concepts.md b/2026/day-15/day-15-networking-concepts.md new file mode 100644 index 0000000000..a792b3e6f3 --- /dev/null +++ b/2026/day-15/day-15-networking-concepts.md @@ -0,0 +1,46 @@ +# Day 15 - Networking Concepts: DNS, IP, Subnets & Ports + +## Task 1: DNS - How Names Become IPs +1. **What happens when you type google.com?** The browser doesn't know where "google.com" is, so it queries a DNS (Domain Name System) server. The DNS server acts as a phonebook, looks up the name, and returns the underlying IP address so the browser can make the connection. +2. **DNS Record Types:** + * **A:** Maps a domain name to an IPv4 address. + * **AAAA:** Maps a domain name to an IPv6 address. + * **CNAME:** An alias that maps one domain name to another domain name. + * **MX:** Directs email to a mail server. + * **NS:** Delegates a domain to a specific Name Server. +3. **dig Output:** Ran `dig google.com`. The DNS server returned an A record pointing to `142.251.142.238` with a TTL (Time To Live) of 122 seconds. + +## Task 2: IP Addressing +1. **IPv4 Structure:** An IPv4 address is a 32-bit numeric address written as four numbers separated by periods (e.g., 192.168.1.10). +2. **Public vs Private IPs:** A Public IP is like the street address of a building (routable on the global internet). A Private IP is like a room number inside that building (only routable within the local network). +3. **Private IP Ranges:** 10.x.x.x, 172.16.x.x - 172.31.x.x, 192.168.x.x. +4. **My Server's Private IPs:** Running `ip addr show` revealed my EC2 instance uses the private IP `172.31.15.111` (ens5), and my Docker network uses `172.17.0.1` (docker0). + +## Task 3: CIDR & Subnetting +1. **What does /24 mean?** In `192.168.1.0/24`, the `/24` indicates that the first 24 bits of the IP address are locked in for the network routing, leaving the remaining 8 bits available for assigning to individual host machines. +2. **Why do we subnet?** Subnetting breaks a massive network down into smaller, more efficient, and more secure chunks, preventing broadcast traffic from overwhelming the entire system. +3. **CIDR Table:** + +| CIDR | Subnet Mask | Total IPs | Usable Hosts | +|------|-----------------|-----------|--------------| +| /24 | 255.255.255.0 | 256 | 254 | +| /16 | 255.255.0.0 | 65,536 | 65,534 | +| /28 | 255.255.255.240 | 16 | 14 | + +## Task 4: Ports - The Doors to Services +1. **What is a port?** If an IP address is a building, a port is the specific door you use to enter. Ports allow a single server to handle multiple different types of traffic (web, database, SSH) simultaneously without mixing them up. +2. **Common Ports:** + +| Port | Service | +|-------|---------| +| 22 | SSH | +| 80 | HTTP | +| 443 | HTTPS | +| 53 | DNS | +| 3306 | MySQL | +| 6379 | Redis | +| 27017 | MongoDB | + +## Task 5: Putting It Together +1. **`curl http://myapp.com:8080`**: This involves DNS (resolving myapp.com to an IP), making an HTTP request (Application Layer) over TCP/IP (Transport/Network layers), and routing the traffic specifically to port 8080 instead of the default port 80. +2. **Database at 10.0.1.50:3306 is unreachable**: First, I would use `ping 10.0.1.50` to check if the private IP is reachable on the network. If it pings successfully, I would use `nc -zv 10.0.1.50 3306` to check if the MySQL port is open, or if a firewall (Security Group) is blocking it. \ No newline at end of file