diff --git a/2026/day-01/learning-plan.md b/2026/day-01/learning-plan.md new file mode 100644 index 000000000..4c3a7f4bf --- /dev/null +++ b/2026/day-01/learning-plan.md @@ -0,0 +1,3 @@ +My name is Om Sanjay Deshmukh, and I am a second-year IT Engineering student at Pillai HOC College of Engineering and Technology. +My primary goal over the next 90 days is to become job-ready in DevOps by building strong technical and professional skills. I am actively focusing on Docker, Kubernetes, and CI/CD pipelines, as these tools are in high demand across modern organizations. Alongside technical expertise, I am also working on improving my communication skills and building a strong, professional LinkedIn profile. +Due to my college schedule, I dedicate 1.5 to 2 hours on weekdays to consistent learning and hands-on practice. On weekends, I invest 4 to 5 hours in deeper study, project work, and skill enhancement. I strongly believe that consistent effort, practical implementation, and continuous learning will help me achieve my goal of securing a DevOps internship and becoming industry-ready \ 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 000000000..18f3108e5 --- /dev/null +++ b/2026/day-02/linux-architecture-notes.md @@ -0,0 +1,24 @@ +## Linux Architecture Notes + +### Process + +In Linux, a **process** is a program that is currently running or waiting to run. +Each process exists in **one state at a time**, such as running, sleeping, or zombie. + +The state of a process can be checked using Linux commands like **ps**, **top**, and **systemctl**. + +Process states are represented by the following codes: + +- **Running (R)** – The process is currently executing or ready to execute. +- **Sleeping (S)** – The process is waiting for an event (input, I/O, or request). +- **Zombie (Z)** – The process has finished execution but is not yet removed. + +--- + +### Commands I Use Daily + +- **ls** – Lists directories and files. +- **cat** – Displays the content of a file. +- **vim** – Used to edit files. +- **touch** – Creates a new empty file. +- **mkdir** – Creates a new directory. diff --git a/2026/day-03/linux-commands-cheatsheet.md b/2026/day-03/linux-commands-cheatsheet.md new file mode 100644 index 000000000..093235636 --- /dev/null +++ b/2026/day-03/linux-commands-cheatsheet.md @@ -0,0 +1,47 @@ +# Linux Commands Practice. + + +--- + + +## Process management. +Process management commands in Linux are used to view, monitor, control, and manage running processes. + +1. **ps** = Used to displays a sanpshot of currently running processes. +2. **top** = To monitor the CPU and memory. +3. **systemctl** = Used for services like Docker,Jenkins and Nginx whether it is running. +4. **kill** = Terminates a process. +5. **job** = Displays background and stopped jobs. + +--- + + +## Common File System Commands. + +1. **ls** – Lists files and directories. +2. **pwd** – Shows the current directory path. +3. **cd** – Changes directory. +4. **mkdir** – Creates a new directory. +5. **rmdir** – Deletes an empty directory. +6. **touch** – Creates a new empty file. +7. **rm** – Deletes files or directories. +8. **cp** – Copies files or directories. +9. **mv** – Moves or renames files. +10. **df** – Displays disk space usage. +11. **du** – Shows directory size. + + + +## Networking troubleshooting. + +1. **ping** - Check connectivity between system and host. +2. **ip a** - Display IP and netwok interfacs. +3. **ip route** - Show routing table. +4. **ifconfig** - Display network interfase. +5. **netstat** - Shows network connection,port and routing table. +6. **ss** - Same as netstat. +7. **traceroute** - show path to take to reach destination. +8. **nslookup** - Used in troubleshoot DNS. +9. **dig** - Same as nslookup. +10. **curl** - Used to test web services and APIs. +11. **wget** - Downloads files from the internet and checks connectivity. \ No newline at end of file diff --git a/2026/day-04/README.md b/2026/day-04/README.md index 12fd91c7c..0e3f3249d 100644 --- a/2026/day-04/README.md +++ b/2026/day-04/README.md @@ -15,7 +15,7 @@ This is hands-on. Keep it simple and focused on fundamentals. ## Expected Output By the end of today, you should have: -- A markdown file named: +- A markdown file named: `linux-practice.md` or diff --git a/2026/day-04/linux-practice.md b/2026/day-04/linux-practice.md new file mode 100644 index 000000000..dbea7d298 --- /dev/null +++ b/2026/day-04/linux-practice.md @@ -0,0 +1,56 @@ +# Linux Practice – Processes, Services, Logs + +--- + +## Process Checks + +**input** +om@Om-Deshmukh:~$ ps +**ouput** +om@Om-Deshmukh:~$ ps + PID TTY TIME CMD + 655 pts/0 00:00:00 bash + 1965 pts/0 00:00:00 ps + +**input** +top +**ouput** +top - 09:38:51 up 32 min, 1 user, load average: 0.00, 0.00, 0.00 +Tasks: 41 total, 1 running, 40 sleeping, 0 stopped, 0 zombie +%Cpu(s): 0.0 us, 0.1 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 s +MiB Mem : 7785.2 total, 7016.5 free, 534.9 used, 385.1 buff +MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 7250.3 avai + + PID USER PR NI VIRT RES SHR S %CPU %MEM + 1 root 20 0 21920 12116 9044 S 0.0 0.2 + +**input** +systemctl status +**ouput** +Om-Deshmukh + State: running + Units: 368 loaded (incl. loaded aliases) + Jobs: 0 queued + Failed: 0 units + Since: Tue 2026-02-03 09:05:59 UTC; 34min ago + systemd: 255.4-1ubuntu8.12 + CGroup: / + ├─init.scope + + +**input** +systemctl list-units +**ouput** + UNIT > + sys-devices-LNXSYSTM:00-LNXSYBUS:00-ACPI0004:00-MSFT1000:00-a773ed0> + sys-devices-LNXSYSTM:00-LNXSYBUS:00-ACPI0004:00-MSFT1000:00-c4b741f> + +**input** +om@Om-Deshmukh:~$ journalctl -u docker +**ouput** +Dec 07 13:02:25 Om-Deshmukh systemd[1]: Starting docker.service - Doc> +Dec 07 13:02:25 Om-Deshmukh dockerd[771]: time="2025-12-07T13:02:25.8> +Dec 07 13:02:25 Om-Deshmukh dockerd[771]: time="2025-12-07T13:02:25.8> +Dec 07 13:02:25 Om-Deshmukh dockerd[771]: time="2025-12-07T13:02:25.8> +Dec 07 13:02:25 Om-Deshmukh dockerd[771]: time="2025-12-07T13:02:25.9> + diff --git a/2026/day-05/README.md b/2026/day-05/README.md index 03b0b49f0..5b61286a0 100644 --- a/2026/day-05/README.md +++ b/2026/day-05/README.md @@ -100,3 +100,5 @@ Use hashtags: Happy Learning **TrainWithShubham** + + diff --git a/2026/day-05/linux-troubleshooting-runbook.md b/2026/day-05/linux-troubleshooting-runbook.md new file mode 100644 index 000000000..952c02347 --- /dev/null +++ b/2026/day-05/linux-troubleshooting-runbook.md @@ -0,0 +1,97 @@ +## STEP 1: System ka base check kiya. + +om@Om-Deshmukh:~$ uname -a +Linux Om-Deshmukh 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux +om@Om-Deshmukh:~$ lsb_release -a +No LSB modules are available. +Distributor ID: Ubuntu +Description: Ubuntu 24.04.3 LTS +Release: 24.04 +Codename: noble + + +## STEP 2: Disk sahi kaam kar rahi hai ya nahi + + mkdir /tmp/runbook-demo +mkdir: cannot create directory ‘/tmp/runbook-demo’: File exists +om@Om-Deshmukh:~$ cp /etc/hosts /tmp/runbook-demo/hosts-copy && ls -l /tmp/runbook-demo +total 4 +-rw-r--r-- 1 om om 419 Feb 3 10:34 hosts-copy +om@Om-Deshmukh:~$ ps -C dockerd -o pid,pcpu,pmem,comm + PID %CPU %MEM COMMAND + 2519 0.4 1.0 dockerd + +## STEP 3: Docker service alive hai ya nahi + +$ sudo docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +598bb49b59f2 nginx "/docker-entrypoint.…" 6 minutes ago Up 6 minutes 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp demo-nginx + + + STEP 4: Active service create ki + + +## STEP 5: Docker error aaya — troubleshoot kiya + +om@Om-Deshmukh:~$ sudo docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +598bb49b59f2 nginx "/docker-entrypoint.…" 6 minutes ago Up 6 minutes 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp demo-nginx + + + +## STEP 6: Performance check ki + +om@Om-Deshmukh:~$ ps -C dockerd -o pid,pcpu,pmem,comm + PID %CPU %MEM COMMAND + 2519 0.4 1.0 dockerd + + + +om@Om-Deshmukh:~$ free -h + total used free shared buff/cache available +Mem: 7.6Gi 566Mi 6.5Gi 3.7Mi 683Mi 7.0Gi +Swap: 2.0Gi 0B 2.0Gi + + +## STEP 7: Disk space verify ki + +om@Om-Deshmukh:~$ df -h +Filesystem Size Used Avail Use% Mounted on +none 3.9G 0 3.9G 0% /usr/lib/modules/6.6.87.2-microsoft-standard-WSL2 +none 3.9G 4.0K 3.9G 1% /mnt/wsl +drivers 476G 125G 352G 27% /usr/lib/wsl/drivers + + + +om@Om-Deshmukh:~$ sudo du -sh /var/lib/docker +332M /var/lib/docker + + + +## STEP 8: Network ka real test kiya + + +om@Om-Deshmukh:~$ curl http://localhost:8080 + + + +Welcome to nginx! + + + +

Welcome to nginx!

+ +## STEP 9: Logs dekhe (sabse important) + + +om@Om-Deshmukh:~$ sudo journalctl -u docker -n 50 +Feb 03 10:18:10 Om-Deshmukh systemd[1]: docker.service: Deactivated su> +Feb 03 10:18:10 Om-Deshmukh systemd[1]: Stopped docker.service + + sudo docker logs demo-nginx +/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration +/docker-entrypoint.sh: Looking for shell scripts in /docker-en diff --git a/2026/day-06/file-io-practice.md b/2026/day-06/file-io-practice.md new file mode 100644 index 000000000..f5ce3900e --- /dev/null +++ b/2026/day-06/file-io-practice.md @@ -0,0 +1,26 @@ +# Creating and Updating file with linux commands + +--- + +touch notes.txt + + +echo "I’m a passionate learner with a strong interest in Linux, DevOps, and Cloud technologies." > notes.txt +echo "I enjoy working hands-on with tools and solving real-world technical problems." >> notes.txt + + +echo "Currently focused on DevOps practices, Git & GitHub, cloud, and system administration." | tee -a notes.txt + + +echo "I believe in learning by doing and staying consistent every day." >> notes.txt +echo "My goal is to grow into a skilled DevOps professional." >> notes.txt +echo "I want to build, automate, and manage reliable systems." >> notes.txt +echo "Linux commands and cloud tools are my daily practice." >> notes.txt +echo "Step by step improvement is my learning strategy." >> notes.txt + + +cat notes.txt + +head -n 2 notes.txt + +tail -n 2 notes.txt diff --git a/2026/day-07/day-07-linux-fs-and-scenarios.md b/2026/day-07/day-07-linux-fs-and-scenarios.md new file mode 100644 index 000000000..bef3529bc --- /dev/null +++ b/2026/day-07/day-07-linux-fs-and-scenarios.md @@ -0,0 +1,61 @@ +# Day 07 – Linux File System Hierarchy & Scenario-Based Practice + +--- + + +## Scenario 1: Service Not Starting +systemctl status myapp +To check whether the service is running, stopped, or failed after reboot. + + +journalctl -u myapp -n 50 +To view the recent logs and identify the reason for the failure. + + + +journalctl -u myapp -b +To check service logs from the current boot to diagnose reboot-related issues. + + +systemctl is-enabled myapp +To verify whether the service is configured to start automatically on boot. + + +## Scenario 2: High CPU Usage + +Step 1: top + +Why: Shows live CPU usage and running processes in real time. + + +Step 2: htop + +Why: Provides an interactive, easy-to-read view of CPU usage with process details. + + +Step 3: ps aux --sort=-%cpu | head -10 + +Why: Lists the top CPU-consuming processes and helps identify the PID. + + +## Scenario 3: Finding Service Logs + + +Step 1: journalctl -u docker -n 50 + +Why: Displays the last 50 log entries for the Docker service managed by systemd. + + +Step 2: journalctl -u docker -f + +Why: Follows Docker logs in real time to observe live activity and errors. + + +Step 3: systemctl status docker + +Why: Shows service status along with recent log messages for quick context. + + +Step 4: journalctl -u docker -b + +Why: Displays Docker logs from the current boot to diagnose startup issues. diff --git a/2026/day-08/WhatsApp Image 2026-02-07 at 6.13.39 PM.jpeg b/2026/day-08/WhatsApp Image 2026-02-07 at 6.13.39 PM.jpeg new file mode 100644 index 000000000..0fe4ed390 Binary files /dev/null and b/2026/day-08/WhatsApp Image 2026-02-07 at 6.13.39 PM.jpeg differ diff --git a/2026/day-08/WhatsApp Image 2026-02-07 at 6.18.29 PM.jpeg b/2026/day-08/WhatsApp Image 2026-02-07 at 6.18.29 PM.jpeg new file mode 100644 index 000000000..04c3eb62b Binary files /dev/null and b/2026/day-08/WhatsApp Image 2026-02-07 at 6.18.29 PM.jpeg differ 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 000000000..c82e61ab0 --- /dev/null +++ b/2026/day-08/day-08-cloud-deployment.md @@ -0,0 +1,51 @@ +# Day 08 – Cloud Server Setup: Docker, Nginx & Web Deployment + +--- + + +## Commands Used + +- sudo apt install nginx -y + +- sudo systemctl start nginx + +- sudo systemctl enable nginx + +- systemctl status nginx + +- curl http://localhost + +- sudo cat /var/log/nginx/access.log + +- sudo tail -f /var/log/nginx/access.log + +- journalctl -u nginx -n 50 + +## Challenges Faced + +**Service & log location confusion** +At first, it wasn’t clear where Nginx logs are stored (/var/log/nginx vs journalctl), which is common for beginners. + +**Placeholder & IP mistakes** +Using placeholders like EC2-PUBLIC-IP and private IPs caused connection errors when trying to access the server from your local machine. + +**SSH key issues** +Problems included missing .pem files, wrong file paths, and incorrect permissions, leading to Permission denied (publickey) errors. + +**File permission problems on the server** +Log files copied with sudo were owned by root, so the ubuntu user couldn’t read them until ownership was fixed with chown. + +**Local vs remote command confusion** +Some commands needed to be run on the EC2 server, while others (like scp) had to be run on the local machine, which caused errors initially. + +## What I Learned +I +- learned how to install and verify Nginx on an EC2 server, how to check and understand access logs, and how to download logs securely using SSH and SCP. +- During this, I faced issues with IP addresses, SSH keys, and file permissions, and I learned how to troubleshoot them step by step instead of guessing. + + + +--- + + + 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 000000000..d250acc33 --- /dev/null +++ b/2026/day-09/day-09-user-management.md @@ -0,0 +1,104 @@ +# Day 09 – Linux User & Group Management Challenge + +--- + +## Users & Groups Created +- Users: tokyo, berlin, professor, nairobi +- Groups: developers, admins, project-team + +## Group Assignments +ubuntu@ip-172-31-158-11:~$ groups tokyo +tokyo : tokyo developers project-team +ubuntu@ip-172-31-158-11:~$ groups berlin +berlin : berlin developers admins +ubuntu@ip-172-31-158-11:~$ groups professor +professor : professor admins +ubuntu@ip-172-31-158-11:~$ groups nairobi +nairobi : nairobi project-team + +## Directories Created +ubuntu@ip-172-31-158-11:~$ ls -ld /opt/dev-project +drwxrwxr-x 2 root developers 4096 Feb 8 05:41 /opt/dev-project +ubuntu@ip-172-31-158-11:~$ ls -ld /opt/team-workspace +drwxrwxr-x 2 root project-team 4096 Feb 8 05:49 /opt/team-workspace + +## Commands Used +- sudo useradd -m berlin +- sudo useradd -m tokyo +- sudo useradd -m professor +- sudo useradd -m nairobi + +- sudo passwd tokyo +- sudo passwd berlin +- sudo passwd professor +- sudo passwd nairobi + +- sudo groupadd developers +- sudo groupadd admins +- sudo groupadd project-team + +- sudo usermod -aG developers tokyo +- sudo usermod -aG developers,admins berlin +- sudo usermod -aG admins professor +- sudo usermod -aG project-team tokyo +- sudo usermod -aG project-team nairobi + +- cat /etc/passwd | grep -E "tokyo|berlin|professor|nairobi" +- cut -d: -f1 /etc/passwd | grep -E "tokyo|berlin|professor|- nairobi" + +- cat /etc/group | grep -E "developers|admins|project-team" +- cut -d: -f1 /etc/group | grep -E "developers|admins|project-team" + +- groups tokyo +- groups berlin +- groups professor +- groups nairobi + +- sudo mkdir /opt/dev-project +- sudo mkdir /opt/team-workspace + +- sudo chgrp developers /opt/dev-project +- sudo chgrp project-team /opt/team-workspace + +- sudo chmod 775 /opt/dev-project +- sudo chmod 775 /opt/team-workspace +- sudo chmod 2775 /opt/team-workspace + +- ls -ld /opt/dev-project +- ls -ld /opt/team-workspace + +- ls /opt/dev-project +- ls /opt/team-workspace + +- sudo -u tokyo touch /opt/dev-project/tokyo.txt +- sudo -u berlin touch /opt/dev-project/berlin.txt + +- sudo -u tokyo touch /opt/team-workspace/tokyo_test.txt +- sudo -u nairobi touch /opt/team-workspace/nairobi.txt +- sudo -u nairobi touch /opt/team-workspace/nairobi_final_check.txt + +- cat /opt/team-workspace/nairobi_final_check.txt + + +## What I Learned +1. User aur Group alag hote hain + +User login ke liye hota hai + +Group permission manage karne ke liye hota hai + +User ko group me add karte hain: usermod -aG + +2. Shared directory group aur permission se control hoti hai + +chgrp se directory ka group set hota hai + +chmod 775 se group members ko write access milta hai + +3. Group change turant active nahi hota + +User ko group me add karne ke baad + +newgrp ya logout/login zaroori hota hai + +Nahi to Permission denied aata hai \ 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 000000000..50baab312 --- /dev/null +++ b/2026/day-10/day-10-file-permissions.md @@ -0,0 +1,81 @@ +# Day 10 – File Permissions & File Operations Challenge + +--- + +## Files Created +- devops.txt + +- notes.txt + +- script.sh +## Permission Changes +devops.txt + +**Before** + +-rw-r--r-- + +After + +-r--r--r-- + +notes.txt + +**Before** + +-rw-r--r-- + +**After** + +-rw-r----- + +script.sh + +**Before** + +-rw-r--r-- + +Execute permission: none + +**After** + +-rwxr-xr-x + +project/ (directory) + +**After** + +drwxr-xr-x + +## Commands Used +touch devops.txt +echo "Linux file permissions practice" > notes.txt +vim script.sh + +ls -l + +cat notes.txt +vim -R script.sh +head -n 5 /etc/passwd +tail -n 5 /etc/passwd + +ls -l devops.txt notes.txt script.sh + +chmod +x script.sh +./script.sh + +chmod -w devops.txt +chmod 640 notes.txt + +mkdir project +chmod 755 project + +echo "test" >> devops.txt +chmod -x script.sh +./script.sh + +ls -l +ls -ld project + +## What I Learned +Day 10 me maine file creation, reading aur permission management seekha aur chmod ka use karke access control samjha. 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 000000000..7d8e8e9ea --- /dev/null +++ b/2026/day-11/day-11-file-ownership.md @@ -0,0 +1,157 @@ +# Day 11 – File Ownership Challenge (chown & chgrp) + +--- + +**Difference Between Owner and Group** +- Owner ek single user hota hai jo file ya directory ka main controller hota hai. + +- Group users ka collection hota hai. + + +## Files & Directories Created + +**Directories Created** +1. app-logs/ + +2. heist-project/ + +3. heist-project/vault/ + +4. heist-project/plans/ + +5. bank-heist/ + +**Files Created** + +1. devops-file.txt + +2. team-notes.txt + +3. project-config.yaml + +4. heist-project/vault/gold.txt + +5. heist-project/plans/strategy.conf + +6. bank-heist/access-codes.txt + +7. bank-heist/blueprints.pdf + +8. bank-heist/escape-plan.txt + +## Ownership Changes + +**devops-file.txt:** om:om → berlin:berlin + +**team-notes.txt:** om:om → om:heist-team + +**project-config.yaml:** om:om → professor:heist-team + +**app-logs/ (directory):** +om:om → berlin:heist-team + +**heist-project/ (recursive):** +om:om → professor:planners + +**heist-project/vault/gold.txt:** +om:om → professor:planners + +**heist-project/plans/strategy.conf:** +om:om → professor:planners + +**bank-heist/access-codes.txt:** +om:om → tokyo:vault-team + +**bank-heist/blueprints.pdf:** +om:om → berlin:tech-team + +**bank-heist/escape-plan.txt:** +om:om → nairobi:vault-team + +## Commands Used +ls -l + +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 + +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 + +touch project-config.yaml +ls -l project-config.yaml + +sudo chown professor:heist-team project-config.yaml +ls -l project-config.yaml + +mkdir app-logs +ls -ld app-logs + +sudo chown berlin:heist-team app-logs +ls -ld app-logs + +mkdir -p heist-project/vault +mkdir -p heist-project/plans + +touch heist-project/vault/gold.txt +touch heist-project/plans/strategy.conf + +sudo groupadd planners +sudo chown -R professor:planners heist-project/ + +ls -lR heist-project/ + +sudo useradd -m tokyo +sudo useradd -m berlin +sudo useradd -m nairobi + +sudo groupadd vault-team +sudo groupadd tech-team + +mkdir bank-heist + +touch bank-heist/access-codes.txt +touch bank-heist/blueprints.pdf +touch bank-heist/escape-plan.txt + +sudo chown tokyo:vault-team bank-heist/access-codes.txt +sudo chown berlin:tech-team bank-heist/blueprints.pdf +sudo chown nairobi:vault-team bank-heist/escape-plan.txt + +ls -l bank-heist/ + + + +## What I Learned +1. **Har file aur directory ka ek owner aur ek group hota hai** + +Owner = single user jiske paas main control hota hai + +Group = users ka collection jinko shared access milta hai + +2. **chown se file/directory ka owner change hota hai** + +chown user file → sirf owner change + +chown user:group file → owner + group dono change + +3. **chgrp sirf group ownership change karta hai** + +Group-based access control ke liye use hota hai + +4. **Recursive ownership (-R) poori directory tree par apply hota hai** + +Ek command me saare subfolders aur files ka owner/group change ho jata hai + +5. **Ownership change ke baad verification zaroori hota hai** + +ls -l aur ls -lR se before/after check kiya \ No newline at end of file diff --git a/2026/day-12/day-12-revision.md b/2026/day-12/day-12-revision.md new file mode 100644 index 000000000..fc3e0d60c --- /dev/null +++ b/2026/day-12/day-12-revision.md @@ -0,0 +1,34 @@ +# Day 12 – Breather & Revision (Days 01–11) + +--- + +1. **Which 3 commands save you the most time right now, and why?** + +- ls -l – quick permission & ownership check + +- systemctl status – instant service health + +- + +2. **How do you check if a service is healthy?** + +systemctl status +ps -ef | grep +journalctl -u + + +3. **How do you safely change ownership and permissions without breaking access?** + +sudo chown user:group file +chmod 640 file +ls -l file + +4. **What will you focus on improving in the next 3 days?** + +- Faster permission calculation (chmod numbers) + +- Better log reading with journalctl + +- More real-world troubleshooting practice + + diff --git a/2026/day-13/day-13-lvm.md b/2026/day-13/day-13-lvm.md new file mode 100644 index 000000000..5490b0886 --- /dev/null +++ b/2026/day-13/day-13-lvm.md @@ -0,0 +1,40 @@ +# Day 13 – Linux Volume Management (LVM) + +```bash +lsblk +sudo lvm +pvs +pvcreate /dev/xvdf /dev/xvdg /dev/xvdh +pvs +vgcreate tws_vg /dev/xvdf /dev/xvdg +vgs +lvcreate -L 10G -n tws_lv tws_vg +pvdisplay +vgdisplay +exit +lsblk +sudo lvs +sudo mkdir /mnt/tws_lv_mount +mkfs.ext4 /dev/tws_vg/tws_lv +sudo mount /dev/tws_vg/tws_lv /mnt/tws_lv_mount +df -h +sudo mkdir /mnt/tws_disk_mount +sudo mkfs -t ext4 /dev/xvdh +sudo mount /dev/xvdh /mnt/tws_disk_mount/ +df -h +sudo lvm +lvextend -L +5G /dev/tws_vg/tws_lv +exit +df -h +lsblk +``` + + +**What i learn** +1. LVM makes disk management easy – I learned how to join multiple disks and use them as one storage. + +2. Disk size can be increased anytime – I learned how to increase disk space without stopping the system. + +3. Storage works in steps – I understood that Linux storage works as Disk → PV → VG → LV. + + diff --git a/2026/day-14/day-14-networking.md b/2026/day-14/day-14-networking.md new file mode 100644 index 000000000..76bd9c321 --- /dev/null +++ b/2026/day-14/day-14-networking.md @@ -0,0 +1,53 @@ +# Day 14 – Networking Fundamentals & Hands-on Checks + + + +**OSI vs TCP/IP** +OSI model (7 layers) ek theoretical reference hai; TCP/IP (4 layers) practical networking stack hai jo real systems use karte hain. + +TCP/IP OSI ke multiple layers ko combine karke simple banata hai. + +--- + +**Protocol placement** +- IP → Network layer (OSI) / Internet layer (TCP/IP) +- TCP / UDP → Transport layer +- HTTP / HTTPS, DNS → Application layer + +## Hands-on Checklist. +1. **hostname -I** = System ka IP address show karta hai. +2. **ping** = Network connectivity check karta hai. +3. **tracepath** or **traceroute** = Source se destination tak ke network hops dikhata hai. +4. **ss-tulpn** or **netstat -tulpn** = System par kaun-si services kaun-se ports par listen kar rahi hain. +5. **dig** or **nslookup** = Domain name ko IP address me resolve karta hai. +DNS working hai ya nahi ye confirm hota hai. +6. **curl -I https://google.com** =HTTP response headers show karta hai. +200 OK ka matlab service reachable hai. +7. **netstat -an | head** = Active network connections ka quick snapshot deta hai. +LISTEN aur ESTABLISHED states ka idea milta hai. + + +## Mini Task: Port Probe & Interpret + +- ss -tulpn +- curl -I http://localhost:80 or nc -zv localhost 80 +- (if it is not reachable then next step) systemctl status apache2/nginx.Firewall rules (ufw status) + + +## Reflection + +- **Fastest signal when something is broken:** +ping and curl give the quickest indication of network and service availability. + +- **If DNS fails:** +Check the Application layer (DNS) first, then verify IP/Network layer connectivity. + +- **If HTTP 500 error appears:** +It is an Application layer issue; inspect the web service and application logs. + +- **Two follow-up checks in a real incident:** +1. systemctl status +2. journalctl -u + + + 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 000000000..1b0476921 --- /dev/null +++ b/2026/day-15/day-15-networking-concepts.md @@ -0,0 +1,180 @@ +# Day 15 – Networking Concepts: DNS, IP, Subnets & Ports + + +## Task 1: DNS – How Names Become IPs + +**What happens when you type google.com in a browser?** +- Browser pehle DNS se poochta hai: google.com ka IP address kya hai. +- DNS se IP milne ke baad browser us IP par TCP connection banata hai. +- Phir HTTP/HTTPS request bhejta hai server ko. +- Server response bhejta hai aur webpage browser me load ho jata hai. + +**DNS Record Types** + +- **A record** = Domain name ko IPv4 address se map karta hai. +- **AAAA record** = Domain name ko IPv6 address se map karta hai. +- **CNAME record** = Ek domain ko dusre domain ka alias banata hai. +- **MX record** = Batata hai kaunsa mail server emails receive karega. +- **NS record** = Batata hai kaunse name servers domain ke liye authoritative hain. + +**dig google.com — A record aur TTL kaise identify karein** + +- Command = dig google.com +- Output = google.com. 300 IN A 142.250.183.14 +- A record (IP address) → 142.250.183.14 +- TTL (Time To Live) → 300 seconds + +## Task 2: IP Addressing + +**What is an IPv4 address? How is it structured?** +- IPv4 address ek 32-bit numeric address hota hai jo network par device ko uniquely identify karta hai. +- Ye 4 octets (numbers) me hota hai, har octet 0–255 ke beech hota hai. +- Example: 192.168.1.10 + +**Difference between Public IP and Private IP** + +- **Public IP:** + - Internet par globally reachable hota hai + - ISP assign karta hai + - Example: 8.8.8.8 +- **Private IP:** + - Internal networks (LAN) me use hota hai + - Internet par directly reachable nahi hota + - Example: 192.168.1.10 + +**What are the private IP ranges?** + +- 10.0.0.0 – 10.255.255.255 → 10.x.x.x +- 172.16.0.0 – 172.31.255.255 → 172.16.x.x – 172.31.x.x +- 192.168.0.0 – 192.168.255.255 → 192.168.x.x + +**Run: `ip addr show` — identify which of your IPs are private** + +**Command:** ip addr show + +**Example output se:** +- inet 192.168.1.10/24 + +**Identification:** + +- 192.168.1.10 → Private IP +(kyunki ye 192.168.x.x range me aata hai) + + Agar IP in ranges me ho: + +- 10.x.x.x +- 172.16.x.x – 172.31.x.x +- 192.168.x.x + +to wo **Private IP** hota hai + +## Task 3: CIDR & Subnetting + +**1. What does `/24` mean in `192.168.1.0/24`?** +/24 CIDR notation me batata hai ki network ke liye 24 bits reserved hain, jiska subnet mask 255.255.255.0 hota hai. +- Network address → 192.168.1.0 +- Broadcast address → 192.168.1.255 +- Usable IPs → 192.168.1.1 to 192.168.1.254 + +**2. How many usable hosts in a `/24`? A `/16`? A `/28`?** +Usable hosts = 2^(host bits) − 2 +1. /24 + - Host bits = 32 − 24 = 8 + - Usable hosts = 2^8 − 2 = 256 − 2 = 254 + +/24 → 254 usable hosts + +2. /16 + - Host bits = 32 − 16 = 16 + - Usable hosts = 2^16 − 2 = 65,536 − 2 = 65,534 + +/16 → 65,534 usable hosts + +3. /28 + - Host bits = 32 − 28 = 4 + - Usable hosts = 2^4 − 2 = 16 − 2 = 14 + +/28 → 14 usable hosts + +**3. Explain in your own words: why do we subnet?** + +- Subnetting ka use large network ko chhote, manageable parts me divide karne ke liye hota hai. +- Isse network traffic kam hota hai aur performance better hoti hai. +- Subnetting se security improve hoti hai, kyunki access ko alag-alag subnets me control kiya ja sakta hai. +- Ye IP addresses ko efficiently use karne me madad karta hai, waste kam hota hai. + +**4. Quick exercise — fill in:** + +| 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? Why do we need them?** + +- Port ek logical number hota hai jo batata hai kaunsa service/application network traffic receive karega. +- Ek hi IP par multiple services chal sakti hain, ports unko differentiate karte hain (jaise HTTP, SSH, FTP). +- Ports ke bina system ko pata nahi chalega data kis application ko dena hai. +- IP = building ka address +- Port = building ka flat number +- 192.168.1.10:80 → Web server (HTTP) +- 192.168.1.10:22 → SSH + +**2. Document these common ports:** + +| Port | Service | +| ----- | ------- | +| 22 | SSH | +| 80 | HTTP | +| 443 | HTTPS | +| 53 | DNS | +| 3306 | MySQL | +| 6379 | Redis | +| 27017 | MongoDB | + +**3. Run `ss -tulpn` — match at least 2 listening ports to their services** + +**ss -tulpn** + +- Example observations (match at least 2) +- Port 22 → SSH + - Service: sshd + - Use: Remote login and server administration + +- Port 80 → HTTP + - Service: apache2 / nginx + - Use: Web traffic (unencrypted) + +(Agar HTTPS ho to) + +- Port 443 → HTTPS + - Service: nginx / apache2 + - Use: Secure web traffic + +## Task 5: Putting It Together + +**- You run `curl http://myapp.com:8080` — what networking concepts from today are involved?** + +**curl http://myapp.com:8080 — networking concepts involved:** +- DNS resolves myapp.com to an IP address, and port 8080 identifies the specific application/service. +- The request uses HTTP at the Application layer over TCP (Transport layer) and IP (Network layer). +- If it fails, checks include DNS resolution, port reachability, and whether the service is listening on port 8080. + +**- Your app can't reach a database at `10.0.1.50:3306` — what would you check first?** + +**App can’t reach DB at 10.0.1.50:3306 — first checks:** + +- Verify network reachability to the private IP (ping 10.0.1.50) and confirm port 3306 is listening (ss -tulpn on DB server or nc -zv 10.0.1.50 3306). +- Check MySQL service status on the DB host and ensure firewall/security rules allow traffic to port 3306. + +--- + + +## **What I Learned** +1. Networking works layer by layer. +2. Ports and services are tightly linked. +3. Linux networking tools give fast signals. \ No newline at end of file diff --git a/2026/day-16/day-16-shell-scripting.md b/2026/day-16/day-16-shell-scripting.md new file mode 100644 index 000000000..9ed73f33a --- /dev/null +++ b/2026/day-16/day-16-shell-scripting.md @@ -0,0 +1,117 @@ +# Day 16 – Shell Scripting Basics + +--- + +- om@Om-Deshmukh:~$ vim hello.sh. +- om@Om-Deshmukh:~$ chmod +x hello.sh +- om@Om-Deshmukh:~$ ./hello.sh +Hello, DevOps! + + +```bash +#!/bin/bash +echo "Hello, DevOps!" +``` + + +**Document: Shebang hata do to kya hota hai?** +- Script run karte time error aa sakta hai +- Shebang system ko batata hai: ye bash script hai + +--- + +- om@Om-Deshmukh:~$ vim variables.sh +- om@Om-Deshmukh:~$ chmod +x variables.sh +- om@Om-Deshmukh:~$ ./variables.sh +Hello, I am OM and I am DevOps Engineer + +```bash +#!/bin/bash + +NAME="Om" +ROLE="DevOps Engineer" + +echo "Hello, I am $NAME and I am a $ROLE" +``` + +--- + +- om@Om-Deshmukh:~$ vim greet.sh +- om@Om-Deshmukh:~$ chmod +x greet.sh +- om@Om-Deshmukh:~$ ./greet.sh +- Enter your name :om +- Enter your favorite tool: Docker +- Hello om, your favourite tool is Docker + +```bash + +#!/bin/bash + +read -p "Enter your name: " NAME +read -p "Enter your favourite tool: " TOOL + +echo "Hello $NAME, your favourite tool is $TOOL" +``` + + +**Number check** + + +```bash + +#!/bin/bash + +read -p "Enter a number: " NUM + +if [ "$NUM" -gt 0 ]; then + echo "Positive number" +elif [ "$NUM" -lt 0 ]; then + echo "Negative number" +else + echo "Zero" +fi +``` + +**FIle Check** + + +```bash + +#!/bin/bash + +read -p "Enter filename: " FILE + +if [ -f "$FILE" ]; then + echo "File exists" +else + echo "File does not exist" +fi + +``` + + +**Combine It All (server_check.sh)** + + +```bash + +#!/bin/bash + +SERVICE="sshd" + +read -p "Do you want to check the status? (y/n): " ANSWER + +if [ "$ANSWER" = "y" ]; then + systemctl is-active --quiet $SERVICE + if [ $? -eq 0 ]; then + echo "$SERVICE is active" + else + echo "$SERVICE is not active" + fi +else + echo "Skipped." +fi + +``` +**What you learned** +I learned how to create basic bash scripts using shebang, variables with user input, and if-else logic to automate simple tasks. diff --git a/2026/day-17/day-17-scripting.md b/2026/day-17/day-17-scripting.md new file mode 100644 index 000000000..94395ff1b --- /dev/null +++ b/2026/day-17/day-17-scripting.md @@ -0,0 +1,197 @@ +# Day 17 – Shell Scripting: Loops, Arguments & Error Handling + + +### Task 1: For Loop + +1. Create `for_loop.sh` that: + - Loops through a list of 5 fruits and prints each one + +```bash +#!/bin/bash + +fruits=("Apple" "Banana" "Mango" "Orange" "Grapes") + +for fruit in "${fruits[@]}" +do + echo "$fruit" +done +``` +2. Create `count.sh` that: + - Prints numbers 1 to 10 using a for loop + +```bash + +#!/bin/bash + +for i in {1..10} +do + echo "$i" +done + +``` + + +### Task 2: While Loop + +1. Create `countdown.sh` that: + - Takes a number from the user + - Counts down to 0 using a while loop + - Prints "Done!" at the end + +```bash +#!/bin/bash + +echo "Enter a number:" +read num + +while [ "$num" -ge 0 ] +do + echo "$num" + num=$((num - 1)) +done + +echo "Done!" + +``` + +### Task 3: Command-Line Arguments + +1. Create `greet.sh` that: + - Accepts a name as `$1` + - Prints `Hello, !` + - If no argument is passed, prints "Usage: ./greet.sh " + +```bash +#!/bin/bash + +if [ -z "$1" ] +then + echo "Usage: ./greet.sh " +else + echo "Hello, $1!" +fi + +``` + +2. Create `args_demo.sh` that: + - Prints total number of arguments (`$#`) + - Prints all arguments (`$@`) + - Prints the script name (`$0`) + +```bash +#!/bin/bash + +echo "Script name: $0" +echo "Total number of arguments: $#" +echo "All arguments: $@" + +``` + +### Task 4: Install Packages via Script +1. Create `install_packages.sh` that: + - Defines a list of packages: `nginx`, `curl`, `wget` + - Loops through the list + - Checks if each package is installed (use `dpkg -s` or `rpm -q`) + - Installs it if missing, skips if already present + - Prints status for each package + +```bash +#!/bin/bash + +packages="nginx curl wget" + +for pkg in $packages +do + echo "Checking package: $pkg" + + if dpkg -s $pkg >/dev/null 2>&1 + then + echo "$pkg is already installed. Skipping..." + else + echo "$pkg is not installed. Installing now..." + + apt install -y $pkg + + echo "$pkg installation completed." + fi + + echo "-----------------------------" +done + + +``` + +### Task 5: Error Handling +1. Create `safe_script.sh` that: + - Uses `set -e` at the top (exit on error) + - Tries to create a directory `/tmp/devops-test` + - Tries to navigate into it + - Creates a file inside + - Uses `||` operator to print an error if any step fails + +```bash +#!/bin/bash + +set -e + +echo "Script is starting..." + +mkdir /tmp/devops-test || echo "Directory already exists" + +cd /tmp/devops-test || echo "Error while entering the directory" + +touch demo.txt || echo "File could not be created" + +echo "File and directory created successfully " + + +``` + +2. Modify your `install_packages.sh` to check if the script is being run as root — exit with a message if not. + +--- + +## Hints +- For loop: `for item in list; do ... done` +- While loop: `while [ condition ]; do ... done` +- Arguments: `$1` first arg, `$#` count, `$@` all args +- Check root: `if [ "$EUID" -ne 0 ]; then echo "Run as root"; exit 1; fi` +- Check package: `dpkg -s &> /dev/null && echo "installed"` + +```bash +#!/bin/bash + +if [ "$EUID" -ne 0 ] +then + echo "This script must be run as root user" + echo "Please use 'sudo -i' or 'sudo ./install_packages.sh'" + exit 1 +fi + +packages="nginx curl wget" + +echo "✅ Script is running as root user" +echo "-----------------------------" + +for pkg in $packages +do + echo "Checking package: $pkg" + + if dpkg -s $pkg &> /dev/null + then + echo "$pkg is already installed. Skipping..." + else + echo "$pkg is not installed. Installing now..." + + apt install -y $pkg + + echo "$pkg installation completed." + fi + + echo "-----------------------------" +done + +echo "All packages process completed" + + +``` diff --git a/2026/day-17/image-1.png b/2026/day-17/image-1.png new file mode 100644 index 000000000..69efb2933 Binary files /dev/null and b/2026/day-17/image-1.png differ diff --git a/2026/day-17/image-2.png b/2026/day-17/image-2.png new file mode 100644 index 000000000..49fef73cb Binary files /dev/null and b/2026/day-17/image-2.png differ diff --git a/2026/day-17/image-3.png b/2026/day-17/image-3.png new file mode 100644 index 000000000..5c85b464d Binary files /dev/null and b/2026/day-17/image-3.png differ diff --git a/2026/day-17/image-4.png b/2026/day-17/image-4.png new file mode 100644 index 000000000..8d7c98819 Binary files /dev/null and b/2026/day-17/image-4.png differ diff --git a/2026/day-17/image-5.png b/2026/day-17/image-5.png new file mode 100644 index 000000000..4832a722f Binary files /dev/null and b/2026/day-17/image-5.png differ diff --git a/2026/day-17/image-6.png b/2026/day-17/image-6.png new file mode 100644 index 000000000..eaee40131 Binary files /dev/null and b/2026/day-17/image-6.png differ diff --git a/2026/day-17/image-7.png b/2026/day-17/image-7.png new file mode 100644 index 000000000..93451fcf1 Binary files /dev/null and b/2026/day-17/image-7.png differ diff --git a/2026/day-17/image.png b/2026/day-17/image.png new file mode 100644 index 000000000..e7808ef7b Binary files /dev/null and b/2026/day-17/image.png differ diff --git a/2026/day-18/README.md b/2026/day-18/README.md index a467197e3..1033e0f17 100644 --- a/2026/day-18/README.md +++ b/2026/day-18/README.md @@ -37,14 +37,22 @@ You will: ### Task 3: Strict Mode — `set -euo pipefail` 1. Create `strict_demo.sh` with `set -euo pipefail` at the top + 2. Try using an **undefined variable** — what happens with `set -u`? + -Because set -u prevents the use of variables that are not defined. + 3. Try a command that **fails** — what happens with `set -e`? + -The script immediately exits and does not execute any further commands. + 4. Try a **piped command** where one part fails — what happens with `set -o pipefail`? + -If any command in the pipeline fails, the entire pipeline fails and the script exits. **Document:** What does each flag do? -- `set -e` → -- `set -u` → -- `set -o pipefail` → +- `set -e` →Exits the script immediately if any command returns a non-zero (error) status. + +- `set -u` →Treats the use of undefined variables as an error and exits the script. + +- `set -o pipefail` →Returns a failure status if any command in a pipeline fails, not just the last command. --- diff --git a/2026/day-18/WhatsApp Image 2026-02-11 at 3.37.50 PM.jpeg b/2026/day-18/WhatsApp Image 2026-02-11 at 3.37.50 PM.jpeg new file mode 100644 index 000000000..76c81ea48 Binary files /dev/null and b/2026/day-18/WhatsApp Image 2026-02-11 at 3.37.50 PM.jpeg differ diff --git a/2026/day-18/WhatsApp Image 2026-02-11 at 3.39.52 PM.jpeg b/2026/day-18/WhatsApp Image 2026-02-11 at 3.39.52 PM.jpeg new file mode 100644 index 000000000..7ff41ac98 Binary files /dev/null and b/2026/day-18/WhatsApp Image 2026-02-11 at 3.39.52 PM.jpeg differ diff --git a/2026/day-18/WhatsApp Image 2026-02-11 at 3.41.00 PM.jpeg b/2026/day-18/WhatsApp Image 2026-02-11 at 3.41.00 PM.jpeg new file mode 100644 index 000000000..0cfb4798c Binary files /dev/null and b/2026/day-18/WhatsApp Image 2026-02-11 at 3.41.00 PM.jpeg differ diff --git a/2026/day-18/day-18-scripting.md b/2026/day-18/day-18-scripting.md new file mode 100644 index 000000000..d9d7fb990 --- /dev/null +++ b/2026/day-18/day-18-scripting.md @@ -0,0 +1,112 @@ +# Day 18 – Shell Scripting: Functions & Slightly Advanced Concepts + + +### Task 1: Basic Functions +1. Create `functions.sh` with: + - A function `greet` that takes a name as argument and prints `Hello, !` + - A function `add` that takes two numbers and prints their sum + - Call both functions from the script + +```bash +#!/bin/bash + +greet() { + read -p "Enter the name: " name + read -p "Enter the first-number: " a + read -p "Enter the second-number: " b + echo "sum of two number $((a+b))" +} + +greet +``` + +### Task 2: Functions with Return Values +1. Create `disk_check.sh` with: + - A function `check_disk` that checks disk usage of `/` using `df -h` + - A function `check_memory` that checks free memory using `free -h` + - A main section that calls both and prints the results + +```bash + +#!/bin/bash + +check_disk() { + echo "Disk Usage Report" + df -h / + +} +check_memory() { + echo "Memory Usage Report" + free -h + +} +check_disk +check_memory +``` + +### Task 3: Strict Mode — `set -euo pipefail` +1. Create `strict_demo.sh` with `set -euo pipefail` at the top + +2. Try using an **undefined variable** — what happens with `set -u`? + -Because set -u prevents the use of variables that are not defined. + +3. Try a command that **fails** — what happens with `set -e`? + -The script immediately exits and does not execute any further commands. + +4. Try a **piped command** where one part fails — what happens with `set -o pipefail`? + -If any command in the pipeline fails, the entire pipeline fails and the script exits. + +**Document:** What does each flag do? +- `set -e` →Exits the script immediately if any command returns a non-zero (error) status. + +- `set -u` →Treats the use of undefined variables as an error and exits the script. + +- `set -o pipefail` →Returns a failure status if any command in a pipeline fails, not just the last command. + + +### Task 4: Local Variables +1. Create `local_demo.sh` with: + - A function that uses `local` keyword for variables + - Show that `local` variables don't leak outside the function + - Compare with a function that uses regular variables + +```bash +--------------------------LOCAL---------------------------------- +INPUT: +#!/bin/bash +my_function() { + name="Om" + echo "Inside function: $name" +} +my_function +echo "Outside function: $name" +OUTPUT: +Inside function: Om +Outside function: Om + +-----------------------GLOBAL------------------------------------ +INPUT: +#!/bin/bash +my_function() { + local name="Om" + echo "Inside function: $name" +} +my_function +echo "Outside function: $name" +OUTPUT: +Inside function: Om +Outside function:Nothing will print + +``` + + +### Task 5: Build a Script — System Info Reporter +Create `system_info.sh` that uses functions for everything: +1. A function to print **hostname and OS info** +2. A function to print **uptime** +3. A function to print **disk usage** (top 5 by size) +4. A function to print **memory usage** +5. A function to print **top 5 CPU-consuming processes** +6. A `main` function that calls all of the above with section headers +7. Use `set -euo pipefail` at the top +