<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammad Khizr Khan</title>
    <description>The latest articles on DEV Community by Muhammad Khizr Khan (@mkhizerkhan208).</description>
    <link>https://dev.to/mkhizerkhan208</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269750%2F0b249be2-27f8-4e22-81b6-84eb5dba7412.jpg</url>
      <title>DEV Community: Muhammad Khizr Khan</title>
      <link>https://dev.to/mkhizerkhan208</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkhizerkhan208"/>
    <language>en</language>
    <item>
      <title>DevOps from Zero #4: Git and GitHub, beyond add, commit and push</title>
      <dc:creator>Muhammad Khizr Khan</dc:creator>
      <pubDate>Fri, 27 Nov 2026 22:27:16 +0000</pubDate>
      <link>https://dev.to/mkhizerkhan208/devops-from-zero-4-git-and-github-beyond-add-commit-and-push-4c4b</link>
      <guid>https://dev.to/mkhizerkhan208/devops-from-zero-4-git-and-github-beyond-add-commit-and-push-4c4b</guid>
      <description>&lt;p&gt;I'm &lt;strong&gt;Muhammad Khizr Khan&lt;/strong&gt;, a computer science student and full-stack/DevOps developer, learning DevOps in public one class at a time. This is Class 04.&lt;/p&gt;

&lt;p&gt;Every CI/CD pipeline, every automatic deploy and every code review starts in the same place: a &lt;strong&gt;Git push&lt;/strong&gt;. So this class goes beyond &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;commit&lt;/code&gt; and &lt;code&gt;push&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git vs GitHub
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt; is a program on your computer that saves the history of a folder. It works offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt; (or GitLab, Bitbucket) is a website that keeps a shared copy, plus pull requests, issues and CI/CD.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;final_v2_REAL_final.zip&lt;/code&gt; is not a version control system. Git is.&lt;/p&gt;

&lt;h2&gt;
  
  
  First-time setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config --global user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config --global user.email &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;
git config --global init.defaultBranch main
git init                  &lt;span class="c"&gt;# new repo in this folder&lt;/span&gt;
git clone &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;url&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;           &lt;span class="c"&gt;# copy an existing repo + its history&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hidden &lt;code&gt;.git/&lt;/code&gt; folder &lt;strong&gt;is&lt;/strong&gt; the repository. Never edit or delete it by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three areas
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;What lives there&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Working directory&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The files you are editing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Staging area&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Changes chosen for the next commit (&lt;code&gt;git add&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Repository&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Saved snapshots, called commits (&lt;code&gt;git commit&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The daily loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status                &lt;span class="c"&gt;# what changed?&lt;/span&gt;
git diff                  &lt;span class="c"&gt;# exact lines, not staged yet&lt;/span&gt;
git add file.txt          &lt;span class="c"&gt;# or: git add .&lt;/span&gt;
git diff --staged         &lt;span class="c"&gt;# what will be committed&lt;/span&gt;
git commit -m &lt;span class="s2"&gt;"Fix broken link on pricing page"&lt;/span&gt;
git log --oneline --graph --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small commits, one idea each, with a message that says &lt;strong&gt;what and why&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  .gitignore, and what to do if you commit a secret
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
*.pem
node_modules/
venv/
dist/
*.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Committed a key or password by mistake? Deleting the file is not enough: &lt;strong&gt;it's still in the history&lt;/strong&gt;. Rotate it first (create a new key, revoke the old one), then clean the history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branches: a parallel timeline for every feature
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch -c feature/x   &lt;span class="c"&gt;# create a branch and move to it&lt;/span&gt;
git branch                &lt;span class="c"&gt;# list; * marks the current one&lt;/span&gt;
git switch main           &lt;span class="c"&gt;# go back&lt;/span&gt;
git branch -d feature/x   &lt;span class="c"&gt;# delete after merging&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;main&lt;/code&gt; should always work. New features and fixes happen on branches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Merging, and what &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;/code&gt; actually means
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git switch main
git merge feature/x
# CONFLICT? Open the file and you'll see:
&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD        # main's version
=======             # --- divider ---
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature/x   # the branch's version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the right code, delete the three marker lines, then &lt;code&gt;git add&lt;/code&gt; and &lt;code&gt;git commit&lt;/code&gt;. To cancel the merge: &lt;code&gt;git merge --abort&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rebase&lt;/strong&gt; (&lt;code&gt;git rebase main&lt;/code&gt;) replays your branch on top of main for a straight history. Only rebase branches nobody else uses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stash&lt;/strong&gt;: &lt;code&gt;git stash&lt;/code&gt; parks unfinished work, &lt;code&gt;git stash pop&lt;/code&gt; brings it back.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The undo menu
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git restore f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Drop unstaged edits to a file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git restore --staged f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unstage, keep the edits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git commit --amend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix the last commit (before pushing)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git reset --soft HEAD~1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Undo the commit, changes stay staged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git reset --mixed HEAD~1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Undo the commit, changes stay unstaged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git reset --hard HEAD~1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Undo the commit &lt;strong&gt;and delete the changes&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git revert &amp;lt;id&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A new commit that cancels an old one (safe after pushing)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Remotes: push, pull vs fetch, SSH keys
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen -t ed25519 -C &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;   &lt;span class="c"&gt;# then add the .pub key on GitHub&lt;/span&gt;
git remote add origin git@github.com:user/app.git
git push -u origin main
git fetch                 &lt;span class="c"&gt;# download only&lt;/span&gt;
git pull                  &lt;span class="c"&gt;# fetch + merge&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pull requests and team rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The flow&lt;/strong&gt;: branch → commit → push → open a PR → review + CI tests → merge → deploy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch protection&lt;/strong&gt;: nobody pushes straight to &lt;code&gt;main&lt;/code&gt;. A PR and green tests are required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trunk-based&lt;/strong&gt; development (short branches, merged daily) is common today; &lt;strong&gt;GitFlow&lt;/strong&gt; (develop and release branches) shows up in older teams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic versions&lt;/strong&gt;: &lt;code&gt;1.4.2&lt;/code&gt; = major . minor . patch. Mark releases with &lt;code&gt;git tag v1.4.2&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧪 Lab (45 minutes)
&lt;/h2&gt;

&lt;p&gt;Create a merge conflict &lt;strong&gt;on purpose&lt;/strong&gt;, then fix it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make a repo with a &lt;code&gt;README.md&lt;/code&gt; and commit it.&lt;/li&gt;
&lt;li&gt;On a branch, change line 1 and commit.&lt;/li&gt;
&lt;li&gt;Back on &lt;code&gt;main&lt;/code&gt;, change the same line differently and commit.&lt;/li&gt;
&lt;li&gt;Merge the branch, resolve the conflict by hand, and commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's the fastest way to stop being scared of conflicts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next class
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;YAML &amp;amp; JSON&lt;/strong&gt;: the language every DevOps tool speaks.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Muhammad Khizr Khan, a full-stack &amp;amp; DevOps developer and the founder of Axelink Systems. More of my work is on my &lt;a href="https://mkhizerkhan208.github.io/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/muhammadkhizrkhan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/mkhizerkhan208" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Questions about Git? Ask in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevOps from Zero #3: Networking, and how to fix "the site is down"</title>
      <dc:creator>Muhammad Khizr Khan</dc:creator>
      <pubDate>Fri, 27 Nov 2026 22:20:30 +0000</pubDate>
      <link>https://dev.to/mkhizerkhan208/devops-from-zero-3-networking-and-how-to-fix-the-site-is-down-11ng</link>
      <guid>https://dev.to/mkhizerkhan208/devops-from-zero-3-networking-and-how-to-fix-the-site-is-down-11ng</guid>
      <description>&lt;p&gt;I'm &lt;strong&gt;Muhammad Khizr Khan&lt;/strong&gt;, a computer science student and full-stack/DevOps developer, learning DevOps in public one class at a time. This is Class 03.&lt;/p&gt;

&lt;p&gt;"The site is down" is the most common message in DevOps. Almost every time, the cause is one of a handful of steps between a browser and a server. Today: those steps, and how to check each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when you open a website
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;DNS&lt;/strong&gt; turns the name into an IP address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP&lt;/strong&gt; opens a connection to that IP on a port (443 for HTTPS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS&lt;/strong&gt; checks the certificate and encrypts the line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP&lt;/strong&gt; sends the request, and the server sends back a status code and the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An outage is almost always one of these steps failing. Your job is to find &lt;strong&gt;which one&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  IP addresses
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Public&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reachable from the internet: your server's address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Private&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;10.0.0.0/8&lt;/code&gt;, &lt;code&gt;172.16.0.0/12&lt;/code&gt;, &lt;code&gt;192.168.0.0/16&lt;/code&gt;: only inside a network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Loopback, "this machine" (localhost)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;When a program listens on it: "every network on this machine"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip -br addr            &lt;span class="c"&gt;# this machine's IPs&lt;/span&gt;
curl -s ifconfig.me    &lt;span class="c"&gt;# the public IP the internet sees&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ports: the IP is the building, the port is the door
&lt;/h2&gt;

&lt;p&gt;One IP, many services. Each service listens on its own port (0–65535).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Port&lt;/th&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;22 / 80 / 443&lt;/td&gt;
&lt;td&gt;SSH / HTTP / HTTPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5432 / 3306 / 6379&lt;/td&gt;
&lt;td&gt;Postgres / MySQL / Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ss -tulpn   &lt;span class="c"&gt;# list listening ports and the program behind each&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  DNS: how a name becomes a number
&lt;/h2&gt;

&lt;p&gt;Your computer asks a &lt;strong&gt;resolver&lt;/strong&gt; (your ISP, &lt;code&gt;1.1.1.1&lt;/code&gt; or &lt;code&gt;8.8.8.8&lt;/code&gt;). The resolver asks the root servers, then the &lt;code&gt;.com&lt;/code&gt; servers, then the domain's own (authoritative) DNS, and caches the answer for the record's &lt;strong&gt;TTL&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;A&lt;/code&gt; / &lt;code&gt;AAAA&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Name → IPv4 / IPv6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CNAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Name → another name (&lt;code&gt;www&lt;/code&gt; → &lt;code&gt;example.com&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Which servers receive the domain's email&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TXT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Text: proof of domain ownership, email security (SPF)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short example.com
dig +short MX example.com
nslookup example.com     &lt;span class="c"&gt;# also works on Windows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tip: &lt;code&gt;/etc/hosts&lt;/code&gt; overrides DNS on one machine, which is handy for testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  TCP vs UDP
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TCP&lt;/strong&gt;: connection first (SYN → SYN-ACK → ACK, the "3-way handshake"), delivery checked and in order. Used for the web, SSH and databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UDP&lt;/strong&gt;: no connection, no checking, faster. Used for DNS lookups, video calls and games.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTTP and HTTPS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Methods&lt;/strong&gt;: &lt;code&gt;GET&lt;/code&gt; read, &lt;code&gt;POST&lt;/code&gt; create, &lt;code&gt;PUT&lt;/code&gt; replace, &lt;code&gt;DELETE&lt;/code&gt; remove.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status codes&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;2xx&lt;/code&gt; it worked&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3xx&lt;/code&gt; go somewhere else&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;4xx&lt;/code&gt; the client asked wrong (404 not found, 403 forbidden)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;5xx&lt;/code&gt; the server failed (500, 502, 503)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS&lt;/strong&gt; is HTTP inside TLS. The certificate proves identity and &lt;strong&gt;expires&lt;/strong&gt; (Let's Encrypt: 90 days), so renewal must be automatic.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Subnets (CIDR) in plain English
&lt;/h2&gt;

&lt;p&gt;The number after the slash is how many bits are fixed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/16&lt;/code&gt; = 65,536 addresses&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/24&lt;/code&gt; = 256 addresses&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/32&lt;/code&gt; = exactly one&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the cloud, a VPC (say &lt;code&gt;10.0.0.0/16&lt;/code&gt;) is split into a &lt;strong&gt;public subnet&lt;/strong&gt; for web servers and a &lt;strong&gt;private subnet&lt;/strong&gt; for databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Firewalls with ufw (without locking yourself out)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw default deny incoming
sudo ufw allow 22/tcp        &lt;span class="c"&gt;# BEFORE enabling, or you're locked out of SSH&lt;/span&gt;
sudo ufw allow 80,443/tcp
sudo ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
sudo ufw status numbered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open only what you use. Databases should listen on &lt;code&gt;127.0.0.1&lt;/code&gt; or a private subnet, never on the open internet. On AWS these rules are called &lt;strong&gt;Security Groups&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "site is down" troubleshooting ladder
&lt;/h2&gt;

&lt;p&gt;Climb it from the top. The first step that fails is your problem.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 · DNS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dig +short site.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 · Reachable&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ping -c3 IP&lt;/code&gt; (some servers block ping)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 · Path&lt;/td&gt;
&lt;td&gt;&lt;code&gt;traceroute site.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 · Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nc -zv site.com 443&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 · HTTP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;curl -I https://site.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6 · Server&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;sudo ss -tulpn&lt;/code&gt;, then the app's logs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Install the tools: &lt;code&gt;sudo apt install dnsutils traceroute netcat-openbsd&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Next class
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt;: never lose your work again.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Muhammad Khizr Khan, a full-stack &amp;amp; DevOps developer and the founder of Axelink Systems. More of my work is on my &lt;a href="https://mkhizerkhan208.github.io/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/muhammadkhizrkhan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/mkhizerkhan208" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Tried the ladder on a real site? Drop your &lt;code&gt;dig&lt;/code&gt; or &lt;code&gt;curl -I&lt;/code&gt; output in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>networking</category>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevOps from Zero #2: Bash Scripting, your first automation</title>
      <dc:creator>Muhammad Khizr Khan</dc:creator>
      <pubDate>Fri, 27 Nov 2026 22:19:32 +0000</pubDate>
      <link>https://dev.to/mkhizerkhan208/devops-from-zero-2-bash-scripting-your-first-automation-2h93</link>
      <guid>https://dev.to/mkhizerkhan208/devops-from-zero-2-bash-scripting-your-first-automation-2h93</guid>
      <description>&lt;p&gt;I'm &lt;strong&gt;Muhammad Khizr Khan&lt;/strong&gt;, a computer science student and full-stack/DevOps developer, learning DevOps in public one class at a time. In &lt;a href="https://dev.to/mkhizerkhan208/devops-from-zero-1-linux-and-the-terminal-explained-simply-5h98"&gt;Class 01&lt;/a&gt; we typed Linux commands one by one. Today we put them in a file and let the computer do the work: our first real automation.&lt;/p&gt;

&lt;p&gt;The rule I'm following: &lt;strong&gt;if you type it twice, script it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What a Bash script is
&lt;/h2&gt;

&lt;p&gt;A plain text file of commands that Bash runs from top to bottom. Scripts are &lt;strong&gt;repeatable&lt;/strong&gt; (same steps every time), &lt;strong&gt;fast&lt;/strong&gt;, and &lt;strong&gt;shareable&lt;/strong&gt;: the whole team runs exactly the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anatomy of a script, and how to run it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash              # shebang: run this with Bash (must be line 1)&lt;/span&gt;
&lt;span class="c"&gt;# a comment              # ignored by Bash&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, DevOps!"&lt;/span&gt;    &lt;span class="c"&gt;# commands, top to bottom&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chmod +x hello.sh   &lt;span class="c"&gt;# once: make it runnable&lt;/span&gt;
./hello.sh          &lt;span class="c"&gt;# ./ means "the file in this folder"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variables
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Khizr"&lt;/span&gt;             &lt;span class="c"&gt;# NO spaces around =&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hi $name"&lt;/span&gt;          &lt;span class="c"&gt;# double quotes fill in the value&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Hi $name'&lt;/span&gt;          &lt;span class="c"&gt;# single quotes print it literally&lt;/span&gt;
&lt;span class="nv"&gt;today&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;date +%F&lt;span class="o"&gt;)&lt;/span&gt;        &lt;span class="c"&gt;# save a command's output&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"${name}-$today"&lt;/span&gt;    &lt;span class="c"&gt;# braces separate the name from text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The classic beginner bug: &lt;code&gt;name = "Khizr"&lt;/code&gt; (with spaces) fails. &lt;code&gt;name="Khizr"&lt;/code&gt; works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arguments and input: one script, many jobs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Syntax&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The script's own name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt; …&lt;/td&gt;
&lt;td&gt;First, second argument: &lt;code&gt;./deploy.sh staging v2.1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$#&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;How many arguments were given&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;${1:-default}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;$1&lt;/code&gt;, or a default if it's empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read -p "Q? " v&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ask the user and store the answer in &lt;code&gt;v&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conditions: scripts that make decisions
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -f &lt;span class="s2"&gt;"config.txt"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"found"&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -d &lt;span class="s2"&gt;"config"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"it's a folder"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"missing"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;-f&lt;/code&gt; / &lt;code&gt;-d&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Is a file / is a folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-z "$x"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Text is empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-eq -ne -gt -lt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Numbers: equal, not equal, greater, less&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;"$a" = "$b"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Text is the same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;!&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Not: &lt;code&gt;[ ! -d "$dir" ]&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;⚠️ Spaces matter: &lt;code&gt;[ -f "x" ]&lt;/code&gt; works, &lt;code&gt;[-f "x"]&lt;/code&gt; fails. And always quote your variables: &lt;code&gt;"$file"&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loops: do it to 1,000 files, write it once
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; file &lt;span class="k"&gt;in&lt;/span&gt; *.log&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;         &lt;span class="c"&gt;# each item in a list&lt;/span&gt;
    gzip &lt;span class="s2"&gt;"$file"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$count&lt;/span&gt; -le 3 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;    &lt;span class="c"&gt;# while the test is true&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Attempt $count"&lt;/span&gt;
    &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;count + 1&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;      &lt;span class="c"&gt;# maths goes inside $(( ))&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Exit codes: how every command says "it worked"
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every command returns a number, stored in &lt;code&gt;$?&lt;/code&gt;. &lt;strong&gt;0 = success&lt;/strong&gt;, 1–255 = failure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a &amp;amp;&amp;amp; b&lt;/code&gt; runs &lt;code&gt;b&lt;/code&gt; only if &lt;code&gt;a&lt;/code&gt; worked. &lt;code&gt;a || b&lt;/code&gt; runs &lt;code&gt;b&lt;/code&gt; only if &lt;code&gt;a&lt;/code&gt; failed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exit 1&lt;/code&gt; ends your script with a failure code, so other tools (like CI pipelines) know it failed.&lt;/li&gt;
&lt;li&gt;Put &lt;code&gt;set -euo pipefail&lt;/code&gt; at the top of serious scripts: stop at the first error, treat unset variables as errors, and catch failures inside pipes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;log&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"[$(date +%T)] $1"&lt;/span&gt;     &lt;span class="c"&gt;# $1 = the function's own argument&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
log &lt;span class="s2"&gt;"Starting checks"&lt;/span&gt;           &lt;span class="c"&gt;# call it like a command&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;local&lt;/code&gt; for variables that should only live inside the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two real-world scripts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;backup.sh&lt;/strong&gt;: checks that the folder exists, packs it with &lt;code&gt;tar -czf&lt;/code&gt; into a dated file, then deletes backups older than 7 days with &lt;code&gt;find … -mtime +7 -delete&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;health.sh&lt;/strong&gt;: asks a website for its status code with &lt;code&gt;curl -s -o /dev/null -w "%{http_code}"&lt;/code&gt; and appends &lt;code&gt;UP&lt;/code&gt; or &lt;code&gt;DOWN&lt;/code&gt; to a log with &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scheduling with cron: let the server work while you sleep
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;crontab -e&lt;/code&gt; and add one line per job: &lt;code&gt;minute hour day month weekday command&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;*/5 * * * *  ~/health.sh     &lt;span class="c"&gt;# every 5 minutes&lt;/span&gt;
0 2 * * *    ~/backup.sh     &lt;span class="c"&gt;# every night at 2:00&lt;/span&gt;
0 9 * * 1    ~/report.sh     &lt;span class="c"&gt;# every Monday at 9:00&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧪 Lab (30 minutes)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;greet.sh&lt;/strong&gt;: print &lt;code&gt;Hello, NAME&lt;/code&gt; using &lt;code&gt;$1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Usage check&lt;/strong&gt;: if &lt;code&gt;[ -z "$1" ]&lt;/code&gt;, print how to use the script and &lt;code&gt;exit 1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;count.sh&lt;/strong&gt;: &lt;code&gt;for f in *.txt&lt;/code&gt;, run &lt;code&gt;wc -l "$f"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;backup.sh&lt;/strong&gt;: back up &lt;code&gt;~/devops/class-01&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bonus&lt;/strong&gt;: schedule it daily with &lt;code&gt;crontab -e&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next class
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Networking&lt;/strong&gt;: how the internet actually reaches your server.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Muhammad Khizr Khan, a full-stack &amp;amp; DevOps developer and the founder of Axelink Systems. More of my work is on my &lt;a href="https://mkhizerkhan208.github.io/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/muhammadkhizrkhan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/mkhizerkhan208" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Did the lab? Post your first script in the comments and I'll review it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>bash</category>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevOps from Zero #1: Linux and the Terminal, explained simply</title>
      <dc:creator>Muhammad Khizr Khan</dc:creator>
      <pubDate>Fri, 27 Nov 2026 22:13:17 +0000</pubDate>
      <link>https://dev.to/mkhizerkhan208/devops-from-zero-1-linux-and-the-terminal-explained-simply-5h98</link>
      <guid>https://dev.to/mkhizerkhan208/devops-from-zero-1-linux-and-the-terminal-explained-simply-5h98</guid>
      <description>&lt;p&gt;I'm &lt;strong&gt;Muhammad Khizr Khan&lt;/strong&gt;, a computer science student and full-stack/DevOps developer. I'm learning DevOps in public, one class at a time, and writing each class up so a complete beginner can follow it. This is Class 01.&lt;/p&gt;

&lt;h2&gt;
  
  
  What DevOps actually is
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Developers&lt;/strong&gt; build software. &lt;strong&gt;Operations&lt;/strong&gt; keep it running. DevOps joins the two into one loop and automates every step:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;plan → code → build → test → release → deploy → operate → monitor → (back to plan)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Without DevOps&lt;/th&gt;
&lt;th&gt;With DevOps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Manual deploys&lt;/td&gt;
&lt;td&gt;Automated pipelines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Works on my machine"&lt;/td&gt;
&lt;td&gt;The same environment everywhere&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A release every few months&lt;/td&gt;
&lt;td&gt;Safe releases many times a day&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The roadmap for this series
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Linux &amp;amp; Bash ← &lt;em&gt;you are here&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Git &amp;amp; GitHub&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;CI/CD&lt;/li&gt;
&lt;li&gt;AWS cloud&lt;/li&gt;
&lt;li&gt;Terraform&lt;/li&gt;
&lt;li&gt;Kubernetes&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Linux comes first
&lt;/h2&gt;

&lt;p&gt;Your code doesn't run on your laptop. It runs on &lt;strong&gt;servers&lt;/strong&gt;, and most internet servers, almost every container and the machines under Kubernetes run Linux. If you can't move around a Linux terminal, everything later in DevOps feels like magic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layers: you → shell → kernel → hardware
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;You&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Type commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Shell&lt;/strong&gt; (&lt;code&gt;bash&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Reads your command and asks the kernel to do it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Kernel&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Manages CPU, memory, files and network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CPU, RAM, disk, network card&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;strong&gt;terminal&lt;/strong&gt; is the window you type in. The &lt;strong&gt;shell&lt;/strong&gt; is the program inside it that understands what you type.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to read any command
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -la /var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command&lt;/strong&gt; &lt;code&gt;ls&lt;/code&gt;: &lt;em&gt;what&lt;/em&gt; to do (list files)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Options&lt;/strong&gt; &lt;code&gt;-la&lt;/code&gt;: &lt;em&gt;how&lt;/em&gt; to do it. &lt;code&gt;-l&lt;/code&gt; is the long format, &lt;code&gt;-a&lt;/code&gt; includes hidden files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Argument&lt;/strong&gt; &lt;code&gt;/var/log&lt;/code&gt;: &lt;em&gt;what&lt;/em&gt; to do it on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three rules that save hours:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Linux is &lt;strong&gt;case-sensitive&lt;/strong&gt;. &lt;code&gt;File.txt&lt;/code&gt; and &lt;code&gt;file.txt&lt;/code&gt; are different files.&lt;/li&gt;
&lt;li&gt;Options start with &lt;code&gt;-&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Stuck? Run &lt;code&gt;man ls&lt;/code&gt; or &lt;code&gt;ls --help&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The filesystem: one tree, no drive letters
&lt;/h2&gt;

&lt;p&gt;There is no &lt;code&gt;C:&lt;/code&gt; or &lt;code&gt;D:&lt;/code&gt;. Everything hangs off a single tree that starts at &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/home&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Users' files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Logs and data that changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/usr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installed programs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/tmp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Temporary files, wiped on reboot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/root&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The admin's home folder&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two places you'll open again and again as a DevOps engineer: &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; and &lt;code&gt;/var/log/syslog&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving around
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;            &lt;span class="c"&gt;# where am I?&lt;/span&gt;
ls             &lt;span class="c"&gt;# what's here?&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; projects    &lt;span class="c"&gt;# go into a folder&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ..          &lt;span class="c"&gt;# up one level&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /var/log    &lt;span class="c"&gt;# absolute path (starts with /)&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~           &lt;span class="c"&gt;# home&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; -           &lt;span class="c"&gt;# back to the previous folder&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An &lt;strong&gt;absolute&lt;/strong&gt; path starts with &lt;code&gt;/&lt;/code&gt; and works from anywhere. A &lt;strong&gt;relative&lt;/strong&gt; path starts from where you are now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with files
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir app          &lt;span class="c"&gt;# new folder (mkdir -p a/b/c for nested folders)&lt;/span&gt;
touch app.log      &lt;span class="c"&gt;# empty file&lt;/span&gt;
cp a.txt b.txt     &lt;span class="c"&gt;# copy (cp -r for folders)&lt;/span&gt;
mv a.txt docs/     &lt;span class="c"&gt;# move or rename&lt;/span&gt;
cat notes.txt      &lt;span class="c"&gt;# print a file&lt;/span&gt;
rm old.txt         &lt;span class="c"&gt;# delete (rm -r for folders)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ &lt;code&gt;rm&lt;/code&gt; deletes &lt;strong&gt;forever&lt;/strong&gt;. There is no Recycle Bin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Permissions: what does 754 mean?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ls -l&lt;/code&gt; shows something like &lt;code&gt;-rwxr-xr--&lt;/code&gt;. Split it into three groups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Owner&lt;/strong&gt; &lt;code&gt;rwx&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group&lt;/strong&gt; &lt;code&gt;r-x&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Others&lt;/strong&gt; &lt;code&gt;r--&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each letter is worth a number: &lt;strong&gt;r = 4, w = 2, x = 1&lt;/strong&gt;. Add them up per group:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Owner &lt;code&gt;rwx&lt;/code&gt; = 4 + 2 + 1 = &lt;strong&gt;7&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Group &lt;code&gt;r-x&lt;/code&gt; = 4 + 0 + 1 = &lt;strong&gt;5&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Others &lt;code&gt;r--&lt;/code&gt; = 4 + 0 + 0 = &lt;strong&gt;4&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the file is &lt;strong&gt;754&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chmod 754 deploy.sh
chmod +x deploy.sh   &lt;span class="c"&gt;# make a script runnable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pipes: small tools become superpowers
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;|&lt;/code&gt; sends one command's output into the next one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat access.log &lt;span class="o"&gt;|&lt;/span&gt; grep &lt;span class="s2"&gt;" 404 "&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; wc -l   &lt;span class="c"&gt;# how many "page not found" errors?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three tiny tools, one useful answer. This idea shows up everywhere in DevOps.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧪 Lab (20 minutes)
&lt;/h2&gt;

&lt;p&gt;On Windows, install Linux first: open &lt;strong&gt;PowerShell as administrator&lt;/strong&gt;, run &lt;code&gt;wsl --install&lt;/code&gt;, then restart.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Print your username and current folder: &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;pwd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;~/devops/class-01/notes&lt;/code&gt; in &lt;strong&gt;one&lt;/strong&gt; command: &lt;code&gt;mkdir -p ~/devops/class-01/notes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make &lt;code&gt;hello.sh&lt;/code&gt;, copy it, then rename the copy (&lt;code&gt;touch&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;mv&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Set its permissions to &lt;code&gt;754&lt;/code&gt; and check them: &lt;code&gt;chmod 754 hello.sh&lt;/code&gt;, then &lt;code&gt;ls -l&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Count the entries in &lt;code&gt;/etc&lt;/code&gt; with a pipe: &lt;code&gt;ls /etc | wc -l&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next class
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bash scripting&lt;/strong&gt;: putting these commands in a file and letting the computer do the work. That's your first real automation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Muhammad Khizr Khan, a full-stack &amp;amp; DevOps developer and the founder of Axelink Systems. More of my work is on my &lt;a href="https://mkhizerkhan208.github.io/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/muhammadkhizrkhan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; and &lt;a href="https://github.com/mkhizerkhan208" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Questions about the lab? Leave a comment and I'll answer.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>beginners</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
