<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Tahsin Abrar</title>
    <description>The latest articles on Forem by Tahsin Abrar (@tahsin000).</description>
    <link>https://forem.com/tahsin000</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1084553%2Fd57c59ef-8617-4868-a1e8-7fe07493b0be.png</url>
      <title>Forem: Tahsin Abrar</title>
      <link>https://forem.com/tahsin000</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tahsin000"/>
    <language>en</language>
    <item>
      <title>DNS Made Simple: What Really Happens Before Your Browser Opens a Website</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Thu, 23 Apr 2026 16:25:15 +0000</pubDate>
      <link>https://forem.com/tahsin000/dns-made-simple-what-really-happens-before-your-browser-opens-a-website-2281</link>
      <guid>https://forem.com/tahsin000/dns-made-simple-what-really-happens-before-your-browser-opens-a-website-2281</guid>
      <description>&lt;p&gt;We use domain names every day.&lt;/p&gt;

&lt;p&gt;We type &lt;code&gt;google.com&lt;/code&gt;, &lt;code&gt;facebook.com&lt;/code&gt;, or &lt;code&gt;linkedin.com&lt;/code&gt; into a browser, press Enter, and the website opens in seconds. It feels simple. Almost boring.&lt;/p&gt;

&lt;p&gt;But under the hood, something very important happens before your browser can even start talking to that website.&lt;/p&gt;

&lt;p&gt;That thing is &lt;strong&gt;DNS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And here is the part many developers miss early on: if you want to understand &lt;strong&gt;TLS/SSL&lt;/strong&gt;, networking, deployment, or even why a request is slow, you need to understand DNS first.&lt;/p&gt;

&lt;p&gt;Because before secure communication begins, your browser has to answer one basic question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Where is this website actually hosted?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's break it down in the simplest possible way.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnc27hy9g7ncv0a7f3on1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnc27hy9g7ncv0a7f3on1.png" alt=" " width="800" height="771"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  First, let's understand the URL
&lt;/h2&gt;

&lt;p&gt;Take this URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://blog.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It has a few parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;https&lt;/code&gt; → the scheme or protocol&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;blog&lt;/code&gt; → the subdomain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;example&lt;/code&gt; → the main domain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.com&lt;/code&gt; → the top-level domain (TLD)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://engineering.linkedin.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;https&lt;/code&gt; is the protocol&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;engineering&lt;/code&gt; is the subdomain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;linkedin&lt;/code&gt; is the domain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.com&lt;/code&gt; is the TLD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure matters because DNS works with these names.&lt;/p&gt;

&lt;p&gt;Before we go into DNS, we need to understand one thing clearly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a domain name is not the real machine address.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is the human-friendly name for that machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why domain names exist
&lt;/h2&gt;

&lt;p&gt;Humans are good at remembering words.&lt;/p&gt;

&lt;p&gt;Machines are good at working with numbers.&lt;/p&gt;

&lt;p&gt;That is the heart of the whole idea.&lt;/p&gt;

&lt;p&gt;You can easily remember:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;facebook.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But remembering something like this is much harder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;157.240.22.35
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That number is an IP address.&lt;/p&gt;

&lt;p&gt;An IP address is the real network address of a machine or server.&lt;/p&gt;

&lt;p&gt;So when you type a domain name into a browser, your system has to find the IP address behind that name.&lt;/p&gt;

&lt;p&gt;That translation is what DNS does.&lt;/p&gt;




&lt;h2&gt;
  
  
  A simple real-life example
&lt;/h2&gt;

&lt;p&gt;Think about your home address.&lt;/p&gt;

&lt;p&gt;If someone knows your address, they can find your house.&lt;/p&gt;

&lt;p&gt;Computers work in a similar way.&lt;/p&gt;

&lt;p&gt;Every machine connected to a network needs an address. On the internet, that address is the &lt;strong&gt;IP address&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now imagine you built an app locally on your laptop. Maybe it runs on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That works on your own machine because your machine knows what &lt;code&gt;localhost&lt;/code&gt; means.&lt;/p&gt;

&lt;p&gt;But if you deploy that app to a server on AWS, DigitalOcean, or anywhere else, people cannot visit it using &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;They need the address of that server.&lt;/p&gt;

&lt;p&gt;That real address is the IP address.&lt;/p&gt;

&lt;p&gt;But asking users to remember IP addresses is a terrible experience.&lt;/p&gt;

&lt;p&gt;So instead of telling people:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Visit 142.250.183.206
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we give the server a domain name like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now people can remember the name, and machines can still connect using the IP.&lt;/p&gt;

&lt;p&gt;That mapping between a human-friendly name and a machine-friendly IP is the whole point of DNS.&lt;/p&gt;




&lt;h2&gt;
  
  
  So what is DNS?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DNS stands for Domain Name System.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's keep it simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS is the system that converts a domain name into an IP address.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You type &lt;code&gt;facebook.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;DNS finds the IP address behind &lt;code&gt;facebook.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Your browser uses that IP to contact the correct server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is called a &lt;strong&gt;system&lt;/strong&gt; because it is not just one thing.&lt;/p&gt;

&lt;p&gt;It involves multiple parts working together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;your browser&lt;/li&gt;
&lt;li&gt;your operating system&lt;/li&gt;
&lt;li&gt;DNS caches&lt;/li&gt;
&lt;li&gt;a DNS resolver&lt;/li&gt;
&lt;li&gt;root name servers&lt;/li&gt;
&lt;li&gt;TLD name servers&lt;/li&gt;
&lt;li&gt;authoritative name servers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why it is not called just "domain name lookup.”&lt;/p&gt;

&lt;p&gt;It is a &lt;strong&gt;system&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Before DNS goes to the internet, it checks cache
&lt;/h2&gt;

&lt;p&gt;This is one of the most useful things to understand.&lt;/p&gt;

&lt;p&gt;When you visit a website, your computer does not always start from scratch.&lt;/p&gt;

&lt;p&gt;It first checks whether the answer is already stored somewhere.&lt;/p&gt;

&lt;p&gt;This stored answer is called &lt;strong&gt;cache&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of cache like a shortcut memory.&lt;/p&gt;

&lt;p&gt;If the system already knows the IP address for a domain, it can skip a lot of work.&lt;/p&gt;

&lt;p&gt;That makes everything faster.&lt;/p&gt;

&lt;p&gt;Usually, the lookup goes through these layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Browser cache&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Operating system cache&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS resolver cache&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;If not found, then the full DNS lookup starts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is why websites often open very quickly the second time you visit them.&lt;/p&gt;




&lt;h2&gt;
  
  
  The full DNS journey, step by step
&lt;/h2&gt;

&lt;p&gt;Now let's walk through what actually happens when you type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;facebook.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into your browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The browser checks its own cache
&lt;/h3&gt;

&lt;p&gt;Your browser first asks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Do I already know the IP for this domain?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If yes, great. It uses that IP immediately.&lt;/p&gt;

&lt;p&gt;If not, it moves to the next step.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. The operating system checks its cache
&lt;/h3&gt;

&lt;p&gt;If the browser does not have the answer, your operating system checks whether it has that domain-to-IP mapping stored.&lt;/p&gt;

&lt;p&gt;If the OS already knows it, it returns the IP to the browser.&lt;/p&gt;

&lt;p&gt;If not, the request continues.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. The system asks a DNS resolver
&lt;/h3&gt;

&lt;p&gt;Now the request goes to a &lt;strong&gt;DNS resolver&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In many cases, this resolver belongs to your ISP, though it could also be a public DNS service.&lt;/p&gt;

&lt;p&gt;Its job is to find the answer for you.&lt;/p&gt;

&lt;p&gt;And just like the browser and OS, the resolver also checks its own cache first.&lt;/p&gt;

&lt;p&gt;If the resolver already knows the IP for &lt;code&gt;facebook.com&lt;/code&gt;, it returns it immediately.&lt;/p&gt;

&lt;p&gt;If not, now the real DNS lookup begins.&lt;/p&gt;




&lt;h2&gt;
  
  
  The resolver starts asking other DNS servers
&lt;/h2&gt;

&lt;p&gt;This is where many learners get confused, but the logic is actually very clean.&lt;/p&gt;

&lt;p&gt;The resolver does not magically know every IP address in the world.&lt;/p&gt;

&lt;p&gt;Instead, it asks the right servers in the right order.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. It asks a root name server
&lt;/h3&gt;

&lt;p&gt;The resolver asks a root name server something like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I need information about &lt;code&gt;.com&lt;/code&gt;. Where should I go next?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Notice something important:&lt;/p&gt;

&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; asking for the final IP address yet.&lt;/p&gt;

&lt;p&gt;It is asking where the &lt;code&gt;.com&lt;/code&gt; information is managed.&lt;/p&gt;

&lt;p&gt;The root server replies with the address of the &lt;strong&gt;TLD name server&lt;/strong&gt; for &lt;code&gt;.com&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. It asks the TLD name server
&lt;/h3&gt;

&lt;p&gt;Now the resolver goes to the &lt;code&gt;.com&lt;/code&gt; TLD server and asks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Who is responsible for &lt;code&gt;facebook.com&lt;/code&gt;?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again, this server usually does not return the final website IP directly.&lt;/p&gt;

&lt;p&gt;Instead, it returns the address of the &lt;strong&gt;authoritative name server&lt;/strong&gt; for that domain.&lt;/p&gt;

&lt;p&gt;That server is the source of truth for the domain's DNS records.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. It asks the authoritative name server
&lt;/h3&gt;

&lt;p&gt;Now the resolver asks the authoritative name server:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What is the IP address for &lt;code&gt;facebook.com&lt;/code&gt;?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This server returns the actual DNS record, such as the IP address.&lt;/p&gt;

&lt;p&gt;Now the resolver finally has the answer it needs.&lt;/p&gt;




&lt;h3&gt;
  
  
  7. The answer comes back and gets cached
&lt;/h3&gt;

&lt;p&gt;Once the resolver gets the IP address, it does two useful things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it returns the answer to your operating system&lt;/li&gt;
&lt;li&gt;it stores the answer in cache for future requests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then the OS may cache it too.&lt;/p&gt;

&lt;p&gt;Then the browser may cache it too.&lt;/p&gt;

&lt;p&gt;That means the next lookup can be much faster.&lt;/p&gt;




&lt;h3&gt;
  
  
  8. The browser can finally contact the server
&lt;/h3&gt;

&lt;p&gt;Now your browser has the IP address.&lt;/p&gt;

&lt;p&gt;At this point, it can finally open a network connection to the actual server and send the real HTTP or HTTPS request.&lt;/p&gt;

&lt;p&gt;That is the moment when the website request truly begins.&lt;/p&gt;

&lt;p&gt;So yes, DNS happens &lt;strong&gt;before&lt;/strong&gt; the browser can talk to the web server.&lt;/p&gt;

&lt;p&gt;And that is exactly why DNS matters when learning TLS/SSL.&lt;/p&gt;




&lt;h2&gt;
  
  
  A simple mental model
&lt;/h2&gt;

&lt;p&gt;If all the server names sound too abstract, use this mental model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Root server&lt;/strong&gt; → "I do not know the full answer, but I know who handles &lt;code&gt;.com&lt;/code&gt;.”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLD server&lt;/strong&gt; → "I do not know the full answer, but I know who handles &lt;code&gt;facebook.com&lt;/code&gt;.”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authoritative server&lt;/strong&gt; → "I am responsible for this domain. Here is the actual answer.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the chain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why DNS is called "resolution”
&lt;/h2&gt;

&lt;p&gt;You may hear the phrase:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS resolution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This simply means:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the process of resolving a domain name into an IP address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So if someone says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The DNS resolution failed”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;they mean:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The system could not turn the domain name into an IP address”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No IP, no connection.&lt;br&gt;
No connection, no website.&lt;/p&gt;


&lt;h2&gt;
  
  
  Where subdomains fit into this
&lt;/h2&gt;

&lt;p&gt;Let's say you have a domain like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can create subdomains like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;blog.example.com
api.example.com
admin.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful because one domain can support multiple services.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;blog.example.com&lt;/code&gt; → blog website&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;api.example.com&lt;/code&gt; → backend API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;admin.example.com&lt;/code&gt; → internal admin dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same parent domain.&lt;br&gt;
Different subdomains.&lt;br&gt;
Different purposes.&lt;/p&gt;

&lt;p&gt;That is why learning domain structure matters before learning DNS deeply.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why websites feel fast after the first visit
&lt;/h2&gt;

&lt;p&gt;A lot of developers notice this but do not always connect it to DNS.&lt;/p&gt;

&lt;p&gt;The first request may take a bit longer because the system needs to find the IP.&lt;/p&gt;

&lt;p&gt;Later requests are faster because the answer may already exist in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;browser cache&lt;/li&gt;
&lt;li&gt;OS cache&lt;/li&gt;
&lt;li&gt;resolver cache&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means the system can skip most of the lookup chain.&lt;/p&gt;

&lt;p&gt;So if a website opens instantly the second time, caching is often part of the reason.&lt;/p&gt;




&lt;h2&gt;
  
  
  Does DNS use TCP or UDP?
&lt;/h2&gt;

&lt;p&gt;In simple learning material, DNS is often explained with &lt;strong&gt;UDP&lt;/strong&gt;, and that is a good starting point.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because UDP is lightweight and fast. It does not need a full connection setup like TCP.&lt;/p&gt;

&lt;p&gt;For many standard DNS queries, that makes it a great fit.&lt;/p&gt;

&lt;p&gt;A simple way to think about it is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DNS wants to ask a quick question&lt;/li&gt;
&lt;li&gt;get a quick answer&lt;/li&gt;
&lt;li&gt;and move on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That said, in real systems, DNS can also use TCP in some cases.&lt;/p&gt;

&lt;p&gt;But when you are first learning how DNS feels fast and lightweight, starting with UDP gives you the right intuition.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why DNS matters before TLS/SSL
&lt;/h2&gt;

&lt;p&gt;This is the part many people skip.&lt;/p&gt;

&lt;p&gt;They jump into HTTPS, SSL certificates, and TLS handshakes without asking a more basic question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How did the browser even find the server in the first place?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before secure communication starts, the browser needs to know where to connect.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;resolve the domain name into an IP address&lt;/li&gt;
&lt;li&gt;connect to the server&lt;/li&gt;
&lt;li&gt;then begin TLS/SSL and HTTP communication&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So if DNS is unclear, TLS/SSL will always feel a little foggy too.&lt;/p&gt;

&lt;p&gt;Understanding DNS first makes the next networking topics much easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why developers should care about this
&lt;/h2&gt;

&lt;p&gt;It is easy to think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Do I really need to know all this? I can just build apps.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can. For a while.&lt;/p&gt;

&lt;p&gt;But sooner or later, deeper understanding starts to matter.&lt;/p&gt;

&lt;p&gt;Maybe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;your production request is slow&lt;/li&gt;
&lt;li&gt;your domain is not pointing to the right server&lt;/li&gt;
&lt;li&gt;your subdomain is broken&lt;/li&gt;
&lt;li&gt;your SSL setup is failing&lt;/li&gt;
&lt;li&gt;your infrastructure behaves differently across environments&lt;/li&gt;
&lt;li&gt;a tool's official docs feel harder than they should&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where fundamentals help.&lt;/p&gt;

&lt;p&gt;When you understand DNS, you stop treating networking like magic.&lt;/p&gt;

&lt;p&gt;You start seeing the path.&lt;/p&gt;

&lt;p&gt;And once you can see the path, debugging becomes easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  A small story every developer can relate to
&lt;/h2&gt;

&lt;p&gt;Imagine this.&lt;/p&gt;

&lt;p&gt;You deploy your app.&lt;br&gt;
The code is fine.&lt;br&gt;
The server is running.&lt;br&gt;
But the site still does not open.&lt;/p&gt;

&lt;p&gt;At first, you think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;is the backend broken?&lt;/li&gt;
&lt;li&gt;is the port wrong?&lt;/li&gt;
&lt;li&gt;is Nginx failing?&lt;/li&gt;
&lt;li&gt;is HTTPS misconfigured?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the real problem turns out to be simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the domain is not resolving correctly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That one small DNS issue can make the whole app feel "down.”&lt;/p&gt;

&lt;p&gt;This is why solid developers do not only learn frameworks.&lt;/p&gt;

&lt;p&gt;They learn what happens around the request too.&lt;/p&gt;




&lt;h2&gt;
  
  
  The big lesson: do not skip the basics
&lt;/h2&gt;

&lt;p&gt;A lot of hard topics become easier when your basics are strong.&lt;/p&gt;

&lt;p&gt;Docker makes more sense.&lt;br&gt;
Kubernetes makes more sense.&lt;br&gt;
TLS/SSL makes more sense.&lt;br&gt;
Load balancers, CDNs, proxies, reverse proxies, and hosting all make more sense.&lt;/p&gt;

&lt;p&gt;Not because they are easy.&lt;/p&gt;

&lt;p&gt;But because you already understand the ground they stand on.&lt;/p&gt;

&lt;p&gt;Many developers struggle with official docs not because their English is bad, but because the underlying computer science concepts are still shaky.&lt;/p&gt;

&lt;p&gt;That is normal.&lt;/p&gt;

&lt;p&gt;And the fix is not shortcuts.&lt;/p&gt;

&lt;p&gt;The fix is going back, learning the core ideas properly, and revisiting them again and again until they feel natural.&lt;/p&gt;

&lt;p&gt;That is how real confidence is built.&lt;/p&gt;

</description>
      <category>dns</category>
      <category>networking</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Demystifying TCP: How the Internet Actually Sends Your Data (Without Losing It)</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Mon, 13 Apr 2026 07:58:22 +0000</pubDate>
      <link>https://forem.com/tahsin000/demystifying-tcp-how-the-internet-actually-sends-your-data-without-losing-it-53le</link>
      <guid>https://forem.com/tahsin000/demystifying-tcp-how-the-internet-actually-sends-your-data-without-losing-it-53le</guid>
      <description>&lt;p&gt;Let’s be honest for a second. When we write code to fetch data from a server, we usually don't think twice about how it gets there. We write a simple JavaScript &lt;code&gt;fetch()&lt;/code&gt; call, hit save, and boom our frontend talks to our backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To us, it feels like magic. We just say "send this," and it arrives. But the Application Layer (where our code lives) is blissfully unaware of the chaotic, noisy, and unpredictable journey that data takes across the internet.&lt;/p&gt;

&lt;p&gt;The real unsung hero making sure your "Hello World" doesn't turn into a corrupted mess of random bytes is the Transport Layer specifically, the TCP (Transmission Control Protocol).&lt;/p&gt;

&lt;p&gt;Today, we are going to look under the hood. No dry, boring textbook definitions. Just a practical, developer-friendly look at how TCP actually works, how it keeps our data safe, and why understanding it will make you a much better software engineer.&lt;/p&gt;




&lt;h3&gt;
  
  
  What is TCP, Really?
&lt;/h3&gt;

&lt;p&gt;Imagine you are mailing a 1,000-page manuscript to a publisher, but the post office only allows you to send one page per envelope.&lt;/p&gt;

&lt;p&gt;If you just dump 1,000 envelopes into the mailbox, what happens? Some might get lost. Some might arrive out of order. The publisher would be hopelessly confused.&lt;/p&gt;

&lt;p&gt;TCP is the ultimate postal manager. It chops your big data into smaller pieces called &lt;strong&gt;segments&lt;/strong&gt;, numbers them, sends them, and waits for a receipt. If a piece goes missing or gets corrupted, TCP demands that it be sent again.&lt;/p&gt;

&lt;p&gt;That’s why the "C" in TCP stands for &lt;strong&gt;Control&lt;/strong&gt;. It controls the transmission so you don't have to.&lt;/p&gt;

&lt;p&gt;To do this, TCP breaks communication down into three distinct phases:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hgjwqpxfeigd7h87mlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hgjwqpxfeigd7h87mlj.png" alt=" " width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;The Setup&lt;/strong&gt; (Three-way Handshake)&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;The Data Transfer&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;The Teardown&lt;/strong&gt; (Four-way Finishing)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s walk through them.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 1: The Three-Way Handshake 🤝
&lt;/h3&gt;

&lt;p&gt;Before TCP sends a single byte of your actual data, it needs to make sure the server is awake, willing, and ready to talk. It does this using a process called the Three-Way Handshake.&lt;/p&gt;

&lt;p&gt;Imagine calling a friend on the phone:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "Hey, are you there? Can you hear me?" &lt;em&gt;(SYN)&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Friend:&lt;/strong&gt; "Yeah, I hear you! Can you hear me?" &lt;em&gt;(SYN-ACK)&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;You:&lt;/strong&gt; "Loud and clear. Let's talk." &lt;em&gt;(ACK)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In TCP terms, it looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SYN (Synchronize):&lt;/strong&gt; The Client sends a packet with the SYN flag turned on. It says, "I want to connect, and I'm starting my sequence at number 1000."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SYN-ACK (Synchronize-Acknowledge):&lt;/strong&gt; The Server replies. "I got your request (ACK 1001), and I also want to connect. My sequence starts at 2000" (SYN).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ACK (Acknowledge):&lt;/strong&gt; The Client sends one final confirmation. "Got it. I'm ready for your data starting at 2001."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Boom. The connection is established. Now, they can safely send data.&lt;/p&gt;




&lt;h3&gt;
  
  
  What’s Inside a TCP Segment? (The Anatomy of a Header)
&lt;/h3&gt;

&lt;p&gt;When TCP chops up your data, it doesn't just send raw text. It wraps your data in a &lt;strong&gt;Header&lt;/strong&gt; a block of metadata that contains all the instructions for delivery.&lt;/p&gt;

&lt;p&gt;A TCP header is usually between 20 and 60 bytes. Let's break down the coolest parts of this header.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The Ports (Source &amp;amp; Destination)
&lt;/h4&gt;

&lt;p&gt;You probably know that an HTTP server runs on port 80, HTTPS on 443, and your local React app maybe on 3000. But have you ever wondered what port the client (your browser) uses to make the request?&lt;/p&gt;

&lt;p&gt;The TCP header reserves 16 bits each for the Source Port and the Destination Port. 16 bits means $2^{16} - 1$, which gives us a maximum of 65,535 possible ports.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Well-known ports (0 - 1023):&lt;/strong&gt; Reserved for big stuff. (80 for HTTP, 443 for HTTPS, 22 for SSH).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registered ports (1024 - 49151):&lt;/strong&gt; Used by specific apps (like MySQL on 3306).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ephemeral / Dynamic ports (49152 - 65535):&lt;/strong&gt; This is the secret sauce! &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When your browser makes a request to Facebook (port 443), your Operating System randomly grabs an unused Ephemeral port (let's say 50153) and assigns it to your browser. So the request goes from &lt;code&gt;Your_IP:50153&lt;/code&gt; to &lt;code&gt;Facebook_IP:443&lt;/code&gt;. When Facebook replies, it knows exactly to send the data back to port 50153, so it reaches your exact browser tab!&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Sequence &amp;amp; Acknowledgment Numbers
&lt;/h4&gt;

&lt;p&gt;These are the page numbers of our manuscript analogy.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sequence Number:&lt;/strong&gt; "This is byte number 1001 of my data."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ACK Number:&lt;/strong&gt; "I successfully received up to byte 1005. Please send byte 1006 next."&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Window Size (Flow Control)
&lt;/h4&gt;

&lt;p&gt;Imagine trying to drink from a firehose. You'd drown. Servers can experience the same thing if a client sends data too fast.&lt;/p&gt;

&lt;p&gt;The Window Size is the server politely saying: "Listen, I can only handle 10,000 bytes at a time right now. Don't send me more than that until I acknowledge receipt, or I'll crash." This prevents overwhelming the receiver.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. The Checksum (Error Detection)
&lt;/h4&gt;

&lt;p&gt;As data travels across the ocean through fiber optic cables, routers, and Wi-Fi signals, electrical interference can flip a bit (turn a 0 into a 1). Your "I love you" might suddenly turn into "I hate you".&lt;/p&gt;

&lt;p&gt;To fix this, TCP uses a Checksum. Before sending, the sender takes all the data, adds it up in a specific binary way, flips the bits (One's Complement), and puts that value in the Checksum field.&lt;/p&gt;

&lt;p&gt;When the receiver gets it, they do the exact same math. If their result doesn't perfectly match, they know the data got corrupted in transit. They silently drop the corrupted segment, forcing the sender to re-transmit it.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Flags
&lt;/h4&gt;

&lt;p&gt;These are tiny 1-bit switches that tell the receiver what kind of segment this is. Is it a setup request (SYN)? Is it an acknowledgment (ACK)? Or is it time to close the connection (FIN)?&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 2: Sending the Data
&lt;/h3&gt;

&lt;p&gt;Once the handshake is done, the actual data transfer begins.&lt;/p&gt;

&lt;p&gt;Let's say we are sending the string "Hello World". Based on the Maximum Segment Size (MSS) agreed upon during the handshake, TCP might split this into multiple segments.&lt;/p&gt;

&lt;p&gt;The client sends "Hell", the server ACKs it. The client sends "o Wo", the server ACKs it.&lt;/p&gt;

&lt;p&gt;Because of the Window Size, the client doesn't actually have to wait for an ACK after every single segment. If the window is large enough, it can blast 10 segments at once, and the server can send a single ACK saying, "Yep, got all 10!"&lt;/p&gt;

&lt;p&gt;If an ACK never arrives, the sender's internal timer runs out, and it assumes the data was lost in the void. It then resends the data. That's the beauty of it it guarantees delivery.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 3: The Four-Way Teardown 👋
&lt;/h3&gt;

&lt;p&gt;When the client is done sending data, it doesn't just hang up the phone. It's polite. It initiates a Four-Way Teardown.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client:&lt;/strong&gt; Sends a FIN (Finish) flag. &lt;em&gt;"I'm done sending data."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; Sends an ACK. &lt;em&gt;"Understood, you're done."&lt;/em&gt; (At this point, the server might still have a little bit of its own data left to send back to the client. The client will wait and listen).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; Sends its own FIN. &lt;em&gt;"Okay, I'm done sending data too."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client:&lt;/strong&gt; Sends a final ACK. &lt;em&gt;"Got it. Goodbye forever."&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The connection is closed, and the OS frees up the ephemeral port to be used by another application later.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why Should You Care as a Developer?
&lt;/h3&gt;

&lt;p&gt;You might be thinking, "This is cool, but my framework handles this. Why do I need to know it?"&lt;/p&gt;

&lt;p&gt;Because things break.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When your API requests start timing out, understanding the Three-way Handshake helps you debug if a firewall is blocking your SYN packets.&lt;/li&gt;
&lt;li&gt;When you wonder why you can't run two node servers on port 3000, you now understand how Ports bind to processes.&lt;/li&gt;
&lt;li&gt;When you design high-traffic systems, understanding Window Size helps you realize why servers get overwhelmed and drop connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding TCP is like moving from driving an automatic car to a manual transmission. You don't have to think about the gears every day, but when you're stuck in the mud, knowing exactly how the engine connects to the wheels is what gets you out.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>tcp</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why We Talk OSI but Live in a TCP/IP World (A Developer’s Guide)</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Sun, 12 Apr 2026 10:55:37 +0000</pubDate>
      <link>https://forem.com/tahsin000/why-we-talk-osi-but-live-in-a-tcpip-world-a-developers-guide-140o</link>
      <guid>https://forem.com/tahsin000/why-we-talk-osi-but-live-in-a-tcpip-world-a-developers-guide-140o</guid>
      <description>&lt;p&gt;If you’ve ever sat in a tech meeting and nodded along while another engineer threw around terms like "Layer 7 load balancing" or "L4 routing," you aren't alone. &lt;/p&gt;

&lt;p&gt;We talk about networking a lot in software development, but there’s a funny quirk in our industry: the model we learn in textbooks isn't exactly the model that runs the internet. &lt;/p&gt;

&lt;p&gt;In our last deep dive, we talked about the OSI model a beautiful, theoretical 7-layer philosophy. But out in the wild? The entire world runs on the &lt;strong&gt;TCP/IP model&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Today, let's bridge the gap between theory and reality, figure out how data actually moves across the internet, and look at the only layers you actually need to care about as a software engineer.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Reality Check: 7 Layers vs. 5 Layers
&lt;/h3&gt;

&lt;p&gt;The OSI model breaks networking down into 7 distinct layers. But the TCP/IP model, which is what actually powers the internet today, condenses things down to just 5 layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Application Layer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transport Layer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network Layer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Link Layer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Physical Layer&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wait, what happened to the &lt;strong&gt;Presentation&lt;/strong&gt; and &lt;strong&gt;Session&lt;/strong&gt; layers from the OSI model? &lt;/p&gt;

&lt;p&gt;In the real world, they didn't disappear; they just got absorbed. When you are building a modern web app say, a Nuxt.js frontend communicating with a Laravel backend your browser and framework handle everything at once. &lt;/p&gt;

&lt;p&gt;When you type "Hello" in a chat app, the Application Layer formats that text into JSON (what the Presentation layer used to do), compresses it, converts it to binary, and even checks if the other person is online with that little green dot (what the Session layer used to do). Because the Application Layer handles all of this heavy lifting, the TCP/IP model just groups them together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Crucial Developer Rule:&lt;/strong&gt; Even though the TCP/IP model condensed the top layers, we still use OSI numbering in our everyday developer conversations! We still call the Application Layer &lt;strong&gt;L7&lt;/strong&gt;. We call the Transport layer &lt;strong&gt;L4&lt;/strong&gt;, Network is &lt;strong&gt;L3&lt;/strong&gt;, and Data Link is &lt;strong&gt;L2&lt;/strong&gt;. If you ever call the Application layer "L5," other engineers will look at you funny. Always stick to the L7 terminology!&lt;/p&gt;




&lt;h3&gt;
  
  
  Layer 4: The Transport Layer (TCP vs. UDP)
&lt;/h3&gt;

&lt;p&gt;Once your application has prepped the data, it hits the Transport Layer. This is where we decide &lt;em&gt;how&lt;/em&gt; the data is going to travel, and you have two main choices: &lt;strong&gt;TCP&lt;/strong&gt; or &lt;strong&gt;UDP&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  TCP (Transmission Control Protocol)
&lt;/h4&gt;

&lt;p&gt;Think of TCP as the highly reliable, slightly slower courier who requires a signature on delivery. It is 100% controlled. &lt;/p&gt;

&lt;p&gt;Imagine you are sending a text message that says "I LOVE YOU." If the data gets scrambled and arrives as "O I V E U Y," you're going to have a bad time. For text, JSON payloads, important API requests, or critical database transactions, we use TCP. It ensures every single piece of data arrives in the exact right order. When using TCP, your data is broken down into chunks called &lt;strong&gt;Segments&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  UDP (User Datagram Protocol)
&lt;/h4&gt;

&lt;p&gt;UDP is the fast, reckless delivery driver throwing newspapers onto your porch without stopping. It doesn't care if a few get lost in the bushes. &lt;/p&gt;

&lt;p&gt;We use UDP for things like live video streaming. If a stream contains 10 million frames and a couple of them drop out, your screen might glitch for a fraction of a second, but the video keeps playing. You wouldn't want the whole live stream to pause just to retrieve one missing frame. When using UDP, your data is broken down into chunks called &lt;strong&gt;Datagrams&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Moving Down the Stack: L3 to L1
&lt;/h3&gt;

&lt;p&gt;After the Transport Layer, the data keeps moving down the chain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network Layer (L3):&lt;/strong&gt; This is where IP addresses come in. Your data (the Segment or Datagram) gets tagged with the Sender's IP and the Receiver's IP. Once those are attached, the whole package is now called a &lt;strong&gt;Packet&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Link Layer (L2):&lt;/strong&gt; Here, we attach MAC addresses to figure out the physical hardware hops the packet needs to take.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Physical Layer (L1):&lt;/strong&gt; Finally, everything is converted into 1s and 0s raw electrical signals or light pulses shooting through cables. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;A quick note for my fellow software engineers:&lt;/em&gt; You really only need to master L7, L4, L3, and L2. Unless you have a burning desire to become an electrical engineer, you can safely let the hardware folks worry about the Physical Layer!&lt;/p&gt;




&lt;h3&gt;
  
  
  A Quick Trip Back to 1969
&lt;/h3&gt;

&lt;p&gt;You might be wondering: if OSI is the standard, why is TCP/IP so different? &lt;/p&gt;

&lt;p&gt;It actually comes down to the Cold War. In 1969, the US Defense Department created an organization called ARPANET. They needed a decentralized network where data could survive even if computers or physical locations were destroyed in a war. Over the next decade, they actively developed the TCP/IP model. &lt;/p&gt;

&lt;p&gt;It was messy, organic, and random. In fact, TCP was being used to send data long before IP addresses were even a standard! The beautifully organized, perfectly logical OSI model didn't actually come along until 1984 to try and make sense of it all. We teach OSI first because it's fundamentally easier to understand, but TCP/IP is the battle-tested system that won the internet.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>webdev</category>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Demystifying Linux: How GNU, Shells, and Terminals Actually Work Together</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Tue, 07 Apr 2026 10:09:39 +0000</pubDate>
      <link>https://forem.com/tahsin000/demystifying-linux-how-gnu-shells-and-terminals-actually-work-together-4975</link>
      <guid>https://forem.com/tahsin000/demystifying-linux-how-gnu-shells-and-terminals-actually-work-together-4975</guid>
      <description>&lt;p&gt;If you've been working with Linux for a while, you probably know that "Linux" technically just refers to the kernel. But a kernel alone is not enough to give you a working computer. To get a complete Operating System (what we call a Linux Distribution, like Ubuntu or Fedora), you need a lot of other moving parts.&lt;/p&gt;

&lt;p&gt;Today, we're going to peel back the layers of a Linux operating system. We'll look at where the tools we use every day actually come from, the difference between a terminal and a shell, and what happens behind the scenes when you type a simple command.&lt;/p&gt;

&lt;p&gt;Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Origin Story: Enter Richard Stallman and GNU
&lt;/h2&gt;

&lt;p&gt;To understand how Linux works today, we have to travel back to 1983. Back then, an operating system called Unix was highly popular among universities and large companies. The problem? Unix was proprietary and expensive.&lt;/p&gt;

&lt;p&gt;A programmer named &lt;strong&gt;Richard Stallman&lt;/strong&gt; didn't like this. He believed software, especially operating systems, should be free and accessible to everyone. So, he started the &lt;strong&gt;Free Software Foundation (FSF)&lt;/strong&gt; and launched the &lt;strong&gt;GNU Project&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fun fact: GNU is a recursive acronym that stands for "GNU's Not Unix!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Stallman's team began building free, open-source replacements for all the essential pieces of Unix. Their plan was to build everything needed for an OS, so that anyone students, devs, or companies could piece together a free operating system.&lt;/p&gt;

&lt;p&gt;If you use open-source tools today, you owe a huge "thank you" to Stallman and the FSF.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Essential GNU Toolkit
&lt;/h2&gt;

&lt;p&gt;So, what exactly did the GNU project build? They created a massive bundle of tools that bridge the gap between human developers and the kernel. Here are the heavy hitters:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. GCC (GNU Compiler Collection)
&lt;/h3&gt;

&lt;p&gt;If you've ever written a C program, you know you can't just run the raw text. You need to compile it into binary machine code that the computer understands. GCC is the legendary compiler that makes this happen. Without it, the open-source world as we know it wouldn't exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. glibc (GNU C Library)
&lt;/h3&gt;

&lt;p&gt;This one is fascinating. When you write a simple &lt;code&gt;printf("Hello World");&lt;/code&gt; in C, did you know that &lt;code&gt;printf&lt;/code&gt; isn't actually a native part of the C language?&lt;/p&gt;

&lt;p&gt;Native C handles things like &lt;code&gt;if/else' statements and&lt;/code&gt;for' loops. But interacting with hardware (like printing to a screen, allocating memory, or reading files) requires talking to the kernel. &lt;strong&gt;glibc&lt;/strong&gt; is the massive library that provides functions like &lt;code&gt;printf&lt;/code&gt;, &lt;code&gt;scanf&lt;/code&gt;, and &lt;code&gt;malloc&lt;/code&gt;. It acts as a translator, taking your code and making the complex "system calls" to the kernel on your behalf.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. GNU Coreutils
&lt;/h3&gt;

&lt;p&gt;This is the toolbox you use every single day. Have you ever typed &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cd&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, or &lt;code&gt;rm&lt;/code&gt;?&lt;br&gt;
These aren't just random words; they are individual, standalone programs bundled together in what we call the &lt;strong&gt;GNU Core Utilities&lt;/strong&gt; (or Coreutils). They run in the "user space" and allow you to interact with your system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Visual Layer: Desktop Environments (DE)
&lt;/h2&gt;

&lt;p&gt;Okay, so we have the kernel (the engine) and the GNU utilities (the steering wheel and pedals). But how do we actually see what we are doing?&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;Desktop Environments (DE)&lt;/strong&gt; come in. When you install an OS and see a taskbar, window frames, a file explorer, and icons, you are looking at the DE.&lt;/p&gt;

&lt;p&gt;Here are a few popular ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GNOME:&lt;/strong&gt; The default for Ubuntu, Fedora, and Debian. It's modern and beginner-friendly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KDE Plasma:&lt;/strong&gt; Popular on Arch and openSUSE. It's incredibly customizable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aqua:&lt;/strong&gt; The proprietary desktop environment used by Apple for macOS (which includes the Finder and the Dock).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Desktop Environment is also responsible for giving you a &lt;strong&gt;Terminal&lt;/strong&gt;. On Ubuntu (GNOME), it's called GNOME Terminal. On KDE, it's called Konsole. The terminal is just a graphical window an interface that lets you type things. But it doesn't process the commands itself. For that, it needs a Shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Brains of the Operation: The Shell
&lt;/h2&gt;

&lt;p&gt;If the Terminal is just a blank window, the &lt;strong&gt;Shell&lt;/strong&gt; is the smart program running inside it.&lt;/p&gt;

&lt;p&gt;The Shell takes the text you type, interprets it, figures out what program you want to run (like an &lt;code&gt;ls&lt;/code&gt; command from the Coreutils), and hands that request over to the kernel. When the kernel is done, the Shell takes the output and prints it on your Terminal screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Quick History of Shells:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;sh (Bourne Shell):&lt;/strong&gt; Created by Stephen Bourne at Bell Labs in 1977. The OG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ksh (KornShell):&lt;/strong&gt; Created by David Korn in 1983, adding more features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bash (Bourne Again Shell):&lt;/strong&gt; The GNU project's free answer to the original Bourne shell. It became the default for almost all Linux distributions for decades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;zsh (Z Shell):&lt;/strong&gt; A modern, highly customizable shell. If you use a modern Mac, &lt;code&gt;zsh&lt;/code&gt; is now the default&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>cli</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Stop Calling Docker a Tool: The Real Story Behind 'docker run hello-world'</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Mon, 06 Apr 2026 10:57:28 +0000</pubDate>
      <link>https://forem.com/tahsin000/docker-is-more-than-a-tool-understanding-the-docker-ecosystem-2ani</link>
      <guid>https://forem.com/tahsin000/docker-is-more-than-a-tool-understanding-the-docker-ecosystem-2ani</guid>
      <description>&lt;p&gt;Let’s get one thing straight right out of the gate: &lt;strong&gt;Docker is not just a tool.&lt;/strong&gt; It’s not just a simple application, and it’s certainly not just a piece of standalone software. &lt;/p&gt;

&lt;p&gt;If someone tells you Docker is just a software tool, you can confidently tell them they’ve been misled. &lt;/p&gt;

&lt;p&gt;So, what is it? &lt;strong&gt;Docker is a platform. It is an ecosystem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To truly master Docker, you have to stop looking at it as a black box that magically runs your code, and start looking at it as a living, breathing ecosystem. Today, we are going to dive deep into how this ecosystem actually works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm5elw8iopsn546ord13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm5elw8iopsn546ord13.png" alt=" " width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Ecosystem Analogy
&lt;/h2&gt;

&lt;p&gt;Think about a biological ecosystem a food chain. An earthworm is eaten by a duck, the duck is caught by a snake, the snake is hunted by a mongoose, and the mongoose is swooped up by an eagle. &lt;/p&gt;

&lt;p&gt;For the ecosystem to function, every single piece of that chain has to exist and interact. Docker works exactly the same way. It is a chain of distinct technologies working together to create what we call the "Docker Platform."&lt;/p&gt;

&lt;p&gt;Before we look at the chain in action, let’s meet the main characters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker Client (CLI):&lt;/strong&gt; The interface where you type your commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Engine (dockerd):&lt;/strong&gt; The background daemon (the brain) that listens for API requests and manages Docker objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Desktop:&lt;/strong&gt; The unsung hero for Mac and Windows users. It quietly creates a Linux Virtual Machine in the background so the Docker Engine has a Linux kernel to work with.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Images:&lt;/strong&gt; Think of an image as a "screenshot" or a frozen snapshot of a container. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Hub:&lt;/strong&gt; The massive, cloud-based database where all these images (like Ubuntu, Redis, Postgres, or Node) live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose:&lt;/strong&gt; (We’ll save this one for a future post, but just know it’s the orchestrator for multi-container setups!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Deep Dive: What actually happens when you hit Enter?
&lt;/h2&gt;

&lt;p&gt;Most developers know how to type &lt;code&gt;docker run hello-world&lt;/code&gt;. But what happens in the milliseconds after you hit enter? Let’s connect the dots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ftk2isam7evu66e0yxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ftk2isam7evu66e0yxr.png" alt=" " width="800" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The Request
&lt;/h3&gt;

&lt;p&gt;You type &lt;code&gt;docker run hello-world&lt;/code&gt; into your terminal. The &lt;strong&gt;Docker Client&lt;/strong&gt; catches this command and translates it into a REST API request. It sends this request to the &lt;strong&gt;Docker Engine&lt;/strong&gt; (specifically, the &lt;code&gt;dockerd&lt;/code&gt; daemon).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Passing the Baton
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dockerd&lt;/code&gt; is a busy manager. It receives your request and says, &lt;em&gt;"Hey, **containerd&lt;/em&gt;* (the high-level container runtime), handle this for me."*&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The Cache Check
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;containerd&lt;/code&gt; acts like a smart librarian. First, it checks its local cache. It asks: &lt;em&gt;"Do we already have the &lt;code&gt;hello-world&lt;/code&gt; image downloaded on this computer?"&lt;/em&gt; If this is your first time running it, the answer is no. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: The Download (Pulling)
&lt;/h3&gt;

&lt;p&gt;Because the image isn't stored locally, &lt;code&gt;containerd&lt;/code&gt; reaches out to &lt;strong&gt;Docker Hub&lt;/strong&gt;. It requests the &lt;code&gt;hello-world&lt;/code&gt; image, pulls it down, and caches it locally so it won't have to download it again next time. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: The Build
&lt;/h3&gt;

&lt;p&gt;Now that it has the image, &lt;code&gt;containerd&lt;/code&gt; hands it over to &lt;strong&gt;runc&lt;/strong&gt; (the low-level runtime) and says, &lt;em&gt;"Execute this."&lt;/em&gt; ### Step 6: The Kernel Magic&lt;br&gt;
Here is where the real magic happens. &lt;code&gt;runc&lt;/code&gt; talks directly to the &lt;strong&gt;Linux Kernel&lt;/strong&gt; (which, if you are on Mac/Windows, is provided by Docker Desktop). &lt;/p&gt;

&lt;p&gt;It asks the kernel for two very specific things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Namespaces:&lt;/strong&gt; To create an isolated "alternate reality" for the container so it can't see what else is running on your machine.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Control Groups (cgroups):&lt;/strong&gt; To set strict limits on how much RAM, CPU, and Hard Drive space this specific container is allowed to use.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The kernel agrees, builds this isolated little world, and the container is born!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: The Response
&lt;/h3&gt;

&lt;p&gt;A new process starts inside that container, executes the &lt;code&gt;hello-world&lt;/code&gt; script, and sends a success message all the way back up the chain from the daemon, to the CLI, and finally onto your screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens if you run it a second time?&lt;/strong&gt;&lt;br&gt;
Try running &lt;code&gt;docker run hello-world&lt;/code&gt; again. Notice how much faster it is? It completely skips Docker Hub. &lt;code&gt;containerd&lt;/code&gt; finds the image in the local cache, hands it straight to &lt;code&gt;runc&lt;/code&gt;, and the container spins up instantly. &lt;/p&gt;

&lt;h2&gt;
  
  
  The "Just Make it Work" Trap
&lt;/h2&gt;

&lt;p&gt;You might be wondering: &lt;em&gt;Why do I need to know all of this?&lt;/em&gt; Here is a hard truth: there are software engineers out there with 5 to 10 years of experience who couldn't explain what you just read. They never dive deep. They treat Docker as a magical black box because their only goal is to "just make it work." &lt;/p&gt;

&lt;p&gt;It’s easy to be lazy. It's easy to just copy-paste terminal commands. But taking the easy route puts a hard ceiling on your career.&lt;/p&gt;

&lt;p&gt;Think of your brain like a massive library. If you just throw random facts into it without organizing them, you'll never be able to find the information when a server crashes at 2 AM. But if you take the time to &lt;strong&gt;connect the dots&lt;/strong&gt; if you organize your knowledge logically, understanding &lt;em&gt;how&lt;/em&gt; &lt;code&gt;dockerd&lt;/code&gt; talks to &lt;code&gt;containerd&lt;/code&gt; you create a mental index. &lt;/p&gt;

&lt;p&gt;When you learn this way, you never forget. &lt;/p&gt;

</description>
      <category>docker</category>
      <category>containers</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The 3-Second Trap: Why Your HTML to Laravel Blade Conversions Are Loading So Slowly</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Sat, 04 Apr 2026 07:48:18 +0000</pubDate>
      <link>https://forem.com/tahsin000/the-3-second-trap-why-your-html-to-laravel-blade-conversions-are-loading-so-slowly-56fm</link>
      <guid>https://forem.com/tahsin000/the-3-second-trap-why-your-html-to-laravel-blade-conversions-are-loading-so-slowly-56fm</guid>
      <description>&lt;p&gt;You’re working on a shiny new admin dashboard. You found a gorgeous, lightning-fast static HTML template online. You download it, open the &lt;code&gt;index.html&lt;/code&gt; file in your browser, and it loads instantly. Perfect. &lt;/p&gt;

&lt;p&gt;You copy that HTML into your Laravel project, paste it into a fresh Blade view, fire up your local server, and hit refresh. &lt;/p&gt;

&lt;p&gt;...One second. &lt;br&gt;
...Two seconds. &lt;br&gt;
...Three seconds. &lt;/p&gt;

&lt;p&gt;Suddenly, the layout snaps into place, and the icons finally pop onto the screen. &lt;/p&gt;

&lt;p&gt;What just happened? How did a blazing-fast HTML file turn into a sluggish mess the moment it touched Laravel? &lt;/p&gt;

&lt;p&gt;If you’ve ever spent hours debugging this frustrating delay, you are not alone. As a software architect who has spent years building and scaling Laravel applications, I've seen countless developers fall into this exact trap. Today, we’re going to look at why this "delay dilemma" happens and exactly how to fix it.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Root Cause: The Asset Linking Trap
&lt;/h2&gt;

&lt;p&gt;When converting a static HTML template to a Laravel Blade file, the most common mistake is treating the Blade file exactly like a plain HTML file. &lt;/p&gt;

&lt;p&gt;Because Blade fully supports standard HTML syntax, it’s incredibly tempting to just drag and drop your CSS, JS, and image folders into your project and leave the &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags exactly as they were. &lt;/p&gt;

&lt;p&gt;It usually looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css/style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"vendors/fontawesome/all.min.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"js/main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a standard HTML environment, the browser looks for those files relative to where the HTML file sits in the folder structure. But in Laravel, your application is routed through the &lt;code&gt;public&lt;/code&gt; directory, and your URLs are dynamic. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Delay Dilemma Explained
&lt;/h3&gt;

&lt;p&gt;When you leave those relative links in your Blade file, the browser gets confused. It tries to load the CSS or the web fonts for your icons asynchronously. But because the file path doesn't align with Laravel's routing structure, the server can't easily find the assets.&lt;/p&gt;

&lt;p&gt;Behind the scenes, the browser is hanging. It is desperately searching for prerequisite files especially icon web fonts and core stylesheets. This creates a massive bottleneck. The browser essentially pauses the visual rendering for 2 to 3 seconds while it figures out what to do with the missing or misaligned assets. Finally, it gives up or falls back, and your page abruptly snaps into view. &lt;/p&gt;

&lt;p&gt;You might look at your code and think, &lt;em&gt;"My CSS is there, why is it slow?"&lt;/em&gt; The truth is, your CSS might be trying to load, but the broken asset links are holding the rest of the page hostage.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: Do It the Laravel Way
&lt;/h2&gt;

&lt;p&gt;To solve this, we need to stop relying on generic HTML relative paths and start using Laravel's built-in helper functions. Specifically, the &lt;code&gt;asset()&lt;/code&gt; helper.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;asset()&lt;/code&gt; function generates a full, absolute URL for your application based on your current request scheme (HTTP or HTTPS). It tells the browser &lt;em&gt;exactly&lt;/em&gt; where to look inside the &lt;code&gt;public&lt;/code&gt; directory, completely eliminating the guesswork and the load delay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Move your assets&lt;/strong&gt;&lt;br&gt;
First, ensure all your template's &lt;code&gt;css&lt;/code&gt;, &lt;code&gt;js&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, and &lt;code&gt;fonts&lt;/code&gt; folders are placed directly inside your Laravel project's &lt;code&gt;public&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Wrap your links&lt;/strong&gt;&lt;br&gt;
Next, go through your Blade file and update every single static asset link using the &lt;code&gt;{{ asset() }}&lt;/code&gt; syntax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('css/style.css') }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('vendors/fontawesome/all.min.css') }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Don't forget your scripts and images!&lt;/strong&gt;&lt;br&gt;
This rule applies to everything. If it's a static file, it needs the &lt;code&gt;asset()&lt;/code&gt; helper.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('js/main.js') }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('images/logo.png') }}"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Dashboard Logo"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  A Real-Life Game Changer
&lt;/h2&gt;

&lt;p&gt;I remember mentoring a junior developer a few years ago who was completely stuck on this. They were building a massive admin portal and had spent an entire afternoon profiling database queries, thinking their backend code was making the page slow. &lt;/p&gt;

&lt;p&gt;I took one look at their &lt;code&gt;app.blade.php&lt;/code&gt; layout file and saw dozens of hardcoded &lt;code&gt;&amp;lt;link href="assets/..."&amp;gt;&lt;/code&gt; tags. We spent five minutes wrapping them in the &lt;code&gt;asset()&lt;/code&gt; helper. When we hit refresh, that painful 3-second delay was completely gone. The icons loaded instantly, and the page felt native and snappy again. &lt;/p&gt;

&lt;p&gt;It was a total game-changer for them.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>performance</category>
    </item>
    <item>
      <title>Fixing Git 'Repository Not Found' &amp; Multiple SSH Key Issues</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Sun, 22 Mar 2026 16:16:50 +0000</pubDate>
      <link>https://forem.com/tahsin000/fixing-git-repository-not-found-multiple-ssh-key-issues-14de</link>
      <guid>https://forem.com/tahsin000/fixing-git-repository-not-found-multiple-ssh-key-issues-14de</guid>
      <description>&lt;p&gt;If you’ve ever worked with multiple GitHub accounts and suddenly hit errors like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Repository not found&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Can’t clone or push to a private repo&lt;/li&gt;
&lt;li&gt;Git showing a weird name like &lt;strong&gt;"Pagol98"&lt;/strong&gt; in commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…you’re not alone. This is one of those problems that looks confusing at first, but once you understand it, it becomes super easy to fix.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through the &lt;strong&gt;exact issues&lt;/strong&gt;, &lt;strong&gt;why they happen&lt;/strong&gt;, and a &lt;strong&gt;clean, real-world solution&lt;/strong&gt; you can reuse in any project.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Problem (What’s Going Wrong?)
&lt;/h2&gt;

&lt;p&gt;Let’s break it down into &lt;strong&gt;3 common issues&lt;/strong&gt; that often get mixed together:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Repository Not Found
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/username/tailadmin-blade-dashboard.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;remote: Repository not found.
fatal: repository not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This usually means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The repo name is wrong (typo)&lt;/li&gt;
&lt;li&gt;The repo is private and you don’t have access&lt;/li&gt;
&lt;li&gt;You’re using the wrong account&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Multiple SSH Keys Confusion
&lt;/h3&gt;

&lt;p&gt;You created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;id_ed25519&lt;/code&gt; (personal)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;id_work&lt;/code&gt; (work)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 But Git doesn’t know &lt;strong&gt;which key to use for which repo&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So sometimes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One repo works ✅&lt;/li&gt;
&lt;li&gt;Another repo fails ❌&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. 😅 Random Commit Name (like “Pagol98”)
&lt;/h3&gt;

&lt;p&gt;Git uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;user.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;user.email&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If not set correctly → it uses old/default values.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-Life Scenario (Why This Happens)
&lt;/h2&gt;

&lt;p&gt;Let’s say:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have &lt;strong&gt;2 GitHub accounts&lt;/strong&gt; → Personal + Work&lt;/li&gt;
&lt;li&gt;Both have &lt;strong&gt;different SSH keys&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You clone using HTTPS or default SSH&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Git gets confused:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Which identity should I use?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that’s where things break.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step-by-Step Fix (Clean &amp;amp; Professional Setup)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create SSH Config File
&lt;/h3&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Users\Asus\.ssh\config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not exists → create it.&lt;/p&gt;

&lt;p&gt;Now add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Personal GitHub&lt;/span&gt;
Host github-personal
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519

&lt;span class="c"&gt;# Work GitHub&lt;/span&gt;
Host github-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This is the &lt;strong&gt;magic step&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 2: Use SSH Instead of HTTPS
&lt;/h3&gt;

&lt;p&gt;❌ Don’t use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://github.com/username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Use SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git@github.com:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now modify it using your config:&lt;/p&gt;

&lt;h4&gt;
  
  
  👉 Personal repo:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github-personal:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  👉 Work repo:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github-work:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 3: Test SSH Connection
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github-personal
ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github-work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi username! You've successfully authenticated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 4: Fix Git Commit Name
&lt;/h3&gt;

&lt;p&gt;Check current config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set correct values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your-email@gmail.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Per-Repository Config (Best Practice)
&lt;/h3&gt;

&lt;p&gt;If you use multiple accounts, don’t rely only on global config.&lt;/p&gt;

&lt;p&gt;Inside a specific repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config user.name &lt;span class="s2"&gt;"Work Name"&lt;/span&gt;
git config user.email &lt;span class="s2"&gt;"work-email@gmail.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This avoids mixing identities.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 5: Verify Remote URL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure it shows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git@github-work:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git@github-personal:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This is one of those issues every developer faces at some point—especially when juggling &lt;strong&gt;personal and work GitHub accounts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The key takeaway is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Git doesn’t “understand accounts” — it only understands configuration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you properly configure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH keys&lt;/li&gt;
&lt;li&gt;SSH config&lt;/li&gt;
&lt;li&gt;Git user info&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Everything becomes predictable and smooth.&lt;/p&gt;

</description>
      <category>github</category>
      <category>gittips</category>
      <category>developerlife</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>How to Set Up Passwordless SSH Login with PuTTY.</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Sun, 22 Mar 2026 01:48:29 +0000</pubDate>
      <link>https://forem.com/tahsin000/how-to-set-up-passwordless-ssh-login-with-putty-16oj</link>
      <guid>https://forem.com/tahsin000/how-to-set-up-passwordless-ssh-login-with-putty-16oj</guid>
      <description>&lt;p&gt;If you’ve ever logged into your VPS again and again using a password, you already know how repetitive and risky it can be.&lt;/p&gt;

&lt;p&gt;There’s a better way.&lt;/p&gt;

&lt;p&gt;In professional server environments, developers almost always use &lt;strong&gt;SSH key-based authentication&lt;/strong&gt; instead of passwords. It’s faster, more secure, and honestly… once you set it up, you won’t want to go back.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll walk you through how to set up &lt;strong&gt;passwordless SSH login using PuTTY&lt;/strong&gt; in a simple, practical way.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Passwordless SSH Login?
&lt;/h2&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instead of typing a password every time&lt;/li&gt;
&lt;li&gt;You use a &lt;strong&gt;private key file&lt;/strong&gt; stored on your computer&lt;/li&gt;
&lt;li&gt;The server verifies it using a &lt;strong&gt;public key&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your server has a lock (public key), and your computer has the only matching key (private key)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No password needed. Just instant access.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Generate SSH Key Pair Using PuTTYgen
&lt;/h2&gt;

&lt;p&gt;First, we need to create two keys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Key (.ppk)&lt;/strong&gt; → stays on your PC&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Key&lt;/strong&gt; → goes to your server&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;strong&gt;PuTTYgen&lt;/strong&gt; (comes with PuTTY)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Under &lt;strong&gt;Parameters&lt;/strong&gt;, select:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ed25519&lt;/code&gt; (modern, faster, more secure than RSA)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Generate&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Move your mouse randomly (this generates randomness)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once done:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Save private key&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Save it somewhere &lt;strong&gt;safe&lt;/strong&gt; (very important ⚠️)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Copy the public key from:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Public key for pasting into OpenSSH authorized_keys file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 2: Add Public Key to Your VPS
&lt;/h2&gt;

&lt;p&gt;Now we tell the server: “This key is allowed to access you.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Login to your VPS (last time using password)
&lt;/h3&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.ssh
&lt;span class="nb"&gt;chmod &lt;/span&gt;700 ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Open authorized_keys file:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Paste your public key
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Right-click in PuTTY → it will paste automatically&lt;/li&gt;
&lt;li&gt;Then save:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + O → Enter → Ctrl + X
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Secure the file:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;600 ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 3: Configure PuTTY for One-Click Login
&lt;/h2&gt;

&lt;p&gt;Now comes the fun part no more typing anything 😄&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;strong&gt;PuTTY&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Connection → Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Set:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Auto-login username: your_username (e.g., root / ubuntu)
&lt;/code&gt;&lt;/pre&gt;

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

&lt;ol&gt;
&lt;li&gt;Go to:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Connection → SSH → Auth → Credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Select your &lt;code&gt;.ppk&lt;/code&gt; file&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Go back to:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   Session
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Enter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Host Name (IP)&lt;/li&gt;
&lt;li&gt;Saved Session name (e.g., &lt;code&gt;My Production VPS&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Result: One Click Login
&lt;/h2&gt;

&lt;p&gt;From now on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open PuTTY&lt;/li&gt;
&lt;li&gt;Double-click your saved session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’re instantly logged in. No password. No hassle.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-Life Scenario
&lt;/h2&gt;

&lt;p&gt;Let’s say you’re deploying a Laravel project from GitHub to your VPS.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login with password every time&lt;/li&gt;
&lt;li&gt;Risk of brute-force attacks&lt;/li&gt;
&lt;li&gt;Slower CI/CD setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instant login using SSH key&lt;/li&gt;
&lt;li&gt;Easy automation (GitHub Actions, scripts)&lt;/li&gt;
&lt;li&gt;Much more secure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is exactly how most production servers are managed in real-world teams.&lt;/p&gt;




&lt;p&gt;Setting up SSH key-based login might feel a bit technical at first but it’s one of those upgrades that pays off immediately.&lt;/p&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better security&lt;/li&gt;
&lt;li&gt;Faster access&lt;/li&gt;
&lt;li&gt;Easier automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly… once you start using it, typing passwords will feel outdated.&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>devops</category>
      <category>security</category>
      <category>linux</category>
    </item>
    <item>
      <title>Why Port 8000 Suddenly Stopped Working on My Local Machine (and How I Fixed It)</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Sat, 10 Jan 2026 09:23:29 +0000</pubDate>
      <link>https://forem.com/tahsin000/why-port-8000-suddenly-stopped-working-on-my-local-machine-and-how-i-fixed-it-4a12</link>
      <guid>https://forem.com/tahsin000/why-port-8000-suddenly-stopped-working-on-my-local-machine-and-how-i-fixed-it-4a12</guid>
      <description>&lt;p&gt;A few days ago, I faced one of those &lt;strong&gt;annoying local development issues&lt;/strong&gt; that waste hours and make you question your sanity.&lt;/p&gt;

&lt;p&gt;I started my local server like I always do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And suddenly… &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Failed to listen on 127.0.0.1:8000&lt;br&gt;
An attempt was made to access a socket in a way forbidden by its access permissions&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I tried ports &lt;strong&gt;8001, 8002, 8003… all the way to 8010&lt;/strong&gt;.&lt;br&gt;
Same error. Every. Single. Time.&lt;/p&gt;

&lt;p&gt;If this sounds familiar, this post is for you.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Confusing Part
&lt;/h2&gt;

&lt;p&gt;The first thing any developer does is check if the port is already in use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;netstat &lt;span class="nt"&gt;-ano&lt;/span&gt; | findstr :8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 &lt;strong&gt;Nothing. Empty.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So the port is free… right?&lt;/p&gt;

&lt;p&gt;Wrong.&lt;/p&gt;

&lt;p&gt;This is where Windows tricks you.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Problem (The Part No One Tells You)
&lt;/h2&gt;

&lt;p&gt;On &lt;strong&gt;Windows&lt;/strong&gt;, some ports are &lt;strong&gt;reserved by the OS itself&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This usually happens because of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hyper-V&lt;/li&gt;
&lt;li&gt;WSL2&lt;/li&gt;
&lt;li&gt;Docker Desktop&lt;/li&gt;
&lt;li&gt;Windows NAT (WinNAT)&lt;/li&gt;
&lt;li&gt;VPN software&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if &lt;strong&gt;no app is using the port&lt;/strong&gt;, Windows blocks it internally.&lt;/p&gt;

&lt;p&gt;That’s why:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;netstat&lt;/code&gt; shows nothing&lt;/li&gt;
&lt;li&gt;Your app still fails to start&lt;/li&gt;
&lt;li&gt;You lose time debugging the wrong thing&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Found the Truth
&lt;/h2&gt;

&lt;p&gt;Run this command &lt;strong&gt;as Administrator&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nb"&gt;netsh&lt;/span&gt; &lt;span class="kd"&gt;int&lt;/span&gt; &lt;span class="kd"&gt;ipv4&lt;/span&gt; &lt;span class="kd"&gt;show&lt;/span&gt; &lt;span class="kd"&gt;excludedportrange&lt;/span&gt; &lt;span class="kd"&gt;protocol&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kd"&gt;tcp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On my machine, I saw this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start Port    End Port
7943          8042
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Boom.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Port &lt;strong&gt;8000 is inside that range&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows owns the port&lt;/li&gt;
&lt;li&gt;Your app is not allowed to bind to it&lt;/li&gt;
&lt;li&gt;No process will show up in &lt;code&gt;netstat&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Error Is So Frustrating
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The error message is unclear&lt;/li&gt;
&lt;li&gt;Nothing shows in port checks&lt;/li&gt;
&lt;li&gt;Reinstalling frameworks won’t help&lt;/li&gt;
&lt;li&gt;Killing processes won’t help&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wasted time restarting apps when the problem was &lt;strong&gt;the OS itself&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fixes (Pick What Fits You)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Option 1: Use a Different Port (Fastest &amp;amp; Safest)
&lt;/h3&gt;

&lt;p&gt;If you just want to move on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;8080
3000
5000
9000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example (Django):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python manage.py runserver 127.0.0.1:8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works &lt;strong&gt;without admin access&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Option 2: Disable Hyper-V (Best for Dev Machines)
&lt;/h3&gt;

&lt;p&gt;If you don’t need Hyper-V:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nb"&gt;dism.exe&lt;/span&gt; &lt;span class="na"&gt;/Online /Disable-Feature&lt;/span&gt;&lt;span class="nl"&gt;:Microsoft&lt;/span&gt;&lt;span class="na"&gt;-Hyper-V
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart your PC&lt;/p&gt;

&lt;p&gt;This permanently frees ports like 8000.&lt;/p&gt;




&lt;h3&gt;
  
  
  Option 3: Shutdown WSL (Temporary)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="kd"&gt;wsl&lt;/span&gt; &lt;span class="na"&gt;--shutdown
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good if you only need a quick fix.&lt;/p&gt;




&lt;h3&gt;
  
  
  Option 4: Restart WinNAT
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nb"&gt;net&lt;/span&gt; &lt;span class="kd"&gt;stop&lt;/span&gt; &lt;span class="kd"&gt;winnat&lt;/span&gt;
&lt;span class="nb"&gt;net&lt;/span&gt; &lt;span class="nb"&gt;start&lt;/span&gt; &lt;span class="kd"&gt;winnat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Requires Administrator access&lt;br&gt;
⚠️ May be temporary&lt;/p&gt;




&lt;h2&gt;
  
  
  What NOT to Do
&lt;/h2&gt;

&lt;p&gt;❌ Don’t reinstall Python / Node / Django&lt;br&gt;
❌ Don’t keep killing random processes&lt;br&gt;
❌ Don’t fight the firewall first&lt;br&gt;
❌ Don’t assume &lt;code&gt;netstat&lt;/code&gt; tells the full story&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not your app’s fault&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;If this post saved you time, feel free to share it with another developer who’s stuck staring at port 8000 right now 😄&lt;br&gt;
Happy coding! 🚀&lt;/p&gt;

</description>
      <category>backend</category>
      <category>networking</category>
      <category>debugging</category>
      <category>windows</category>
    </item>
    <item>
      <title>A Small PHP Tip That Saves Time (and Lines of Code)</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Fri, 02 Jan 2026 20:09:59 +0000</pubDate>
      <link>https://forem.com/tahsin000/a-small-php-tip-that-saves-time-and-lines-of-code-10op</link>
      <guid>https://forem.com/tahsin000/a-small-php-tip-that-saves-time-and-lines-of-code-10op</guid>
      <description>&lt;p&gt;I was recently reviewing a PHP project. The code worked fine. Tests were passing. No bugs.&lt;/p&gt;

&lt;p&gt;But something caught my eye.&lt;/p&gt;

&lt;p&gt;The same pattern was repeated again and again in almost every class constructor. It’s not wrong, but since &lt;strong&gt;PHP 8.0&lt;/strong&gt;, we don’t need to write it this way anymore.&lt;/p&gt;

&lt;p&gt;This post is a &lt;strong&gt;quick, practical PHP tip&lt;/strong&gt; about classes and constructors that can make your code &lt;strong&gt;cleaner, shorter, and easier to read&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Old Habit We Still Write
&lt;/h2&gt;

&lt;p&gt;This is something I still see in many real projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing is technically wrong here.&lt;/p&gt;

&lt;p&gt;But when a project has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;50+ classes&lt;/li&gt;
&lt;li&gt;Each class has 5–10 properties&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You end up writing the same lines again and again.&lt;/p&gt;

&lt;p&gt;It’s &lt;strong&gt;boring&lt;/strong&gt;, &lt;strong&gt;repetitive&lt;/strong&gt;, and easy to mess up when refactoring.&lt;/p&gt;




&lt;h2&gt;
  
  
  PHP 8.0 Changed This Forever
&lt;/h2&gt;

&lt;p&gt;Since &lt;strong&gt;PHP 8.0&lt;/strong&gt;, we have a feature called:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Constructor Property Promotion&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It lets you declare and assign class properties &lt;strong&gt;directly inside the constructor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s rewrite the same class.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Modern Way (Cleaner &amp;amp; Shorter)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$age&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Just Happened?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No separate property declaration&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;$this-&amp;gt;name = $name;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Same behavior&lt;/li&gt;
&lt;li&gt;Less code&lt;/li&gt;
&lt;li&gt;Easier to read&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your brain now focuses on &lt;strong&gt;what the class needs&lt;/strong&gt;, not boilerplate code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Public, Protected, or Private? Your Choice
&lt;/h2&gt;

&lt;p&gt;You’re not limited to &lt;code&gt;private&lt;/code&gt;. You can use any visibility.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$authorId&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works exactly as expected.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real-Life Refactor Story
&lt;/h2&gt;

&lt;p&gt;While reviewing a Laravel project, I found a service class with &lt;strong&gt;12 properties&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The constructor alone was almost &lt;strong&gt;30 lines long&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I did this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Selected the constructor&lt;/li&gt;
&lt;li&gt;Used &lt;strong&gt;VS Code Quick Edit / Multi-cursor&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Converted all properties to constructor promotion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Constructor went from 30 lines to 6 lines&lt;/li&gt;
&lt;li&gt;No logic changed&lt;/li&gt;
&lt;li&gt;Code became easier to scan during reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This refactor took &lt;strong&gt;less than 2 minutes&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  When You Should Use This
&lt;/h2&gt;

&lt;p&gt;Constructor property promotion is perfect when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Properties are only set in the constructor&lt;/li&gt;
&lt;li&gt;You don’t need extra logic during assignment&lt;/li&gt;
&lt;li&gt;You want clean, modern PHP code&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  When You Should NOT Use It
&lt;/h2&gt;

&lt;p&gt;Avoid it if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need validation before assignment&lt;/li&gt;
&lt;li&gt;You modify values before storing them&lt;/li&gt;
&lt;li&gt;You want to keep constructor logic very explicit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example where the old way is still better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;strtolower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$email&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>codequality</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>php</category>
    </item>
    <item>
      <title>Stop Hacking Your .htaccess: A Better Way to Switch Laravel Versions</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Fri, 02 Jan 2026 15:04:02 +0000</pubDate>
      <link>https://forem.com/tahsin000/stop-hacking-your-htaccess-a-better-way-to-switch-laravel-versions-57p2</link>
      <guid>https://forem.com/tahsin000/stop-hacking-your-htaccess-a-better-way-to-switch-laravel-versions-57p2</guid>
      <description>&lt;p&gt;We’ve all been there. It’s 10:00 PM, you just finished a major update for your Laravel site, and it’s time to go live.&lt;/p&gt;

&lt;p&gt;In the past, I used to do what many of us try first: &lt;strong&gt;The .htaccess Trick.&lt;/strong&gt; I would upload the new version to a subfolder and try to "point" the website to it using some clever Apache rules.&lt;/p&gt;

&lt;p&gt;It felt smart at the time. But then came the bugs. Broken CSS paths, session errors, and the scariest part accidentally making my &lt;code&gt;.env&lt;/code&gt; file public.&lt;/p&gt;

&lt;p&gt;Today, I want to show you a much better, "pro" way to do this. It’s called a &lt;strong&gt;Symbolic Link (Symlink)&lt;/strong&gt;. It sounds technical, but it’s actually as simple as creating a shortcut on your desktop.&lt;/p&gt;

&lt;h3&gt;
  
  
  The "Bakery" Analogy
&lt;/h3&gt;

&lt;p&gt;Imagine you run a bakery. You have a display case (your website) where you show your cakes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The .htaccess way:&lt;/strong&gt; You try to move the entire display case every time you bake a new cake. It’s heavy, slow, and you might drop something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Symlink way:&lt;/strong&gt; You keep the display case where it is. You just swap the tray inside. The customers always look at the same spot, but the cake is fresh.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Why the .htaccess method is risky
&lt;/h3&gt;

&lt;p&gt;Before we dive into the "how," here is why you should avoid switching versions via &lt;code&gt;.htaccess&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; You risk exposing your sensitive files (like &lt;code&gt;.env&lt;/code&gt;) if the redirect isn't perfect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Path Issues:&lt;/strong&gt; Laravel functions like &lt;code&gt;public_path()&lt;/code&gt; can get confused when the project is buried in subfolders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Downtime:&lt;/strong&gt; If you make a typo in the &lt;code&gt;.htaccess&lt;/code&gt; file, your whole site goes down with a "500 Internal Server Error."&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  The Better Way: The "Current" Folder Strategy
&lt;/h3&gt;

&lt;p&gt;Instead of moving files around, we are going to create a structure like this on your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/my-project/
├── releases/
│   ├── v1_old/   (Your old code)
│   └── v2_new/   (Your new code)
└── current/      (The "Magic" Shortcut)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your web server (Apache or Nginx) will always look at the &lt;code&gt;current/public&lt;/code&gt; folder. To switch versions, we just tell the &lt;code&gt;current&lt;/code&gt; shortcut to point to a different folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Prepare your folders
&lt;/h4&gt;

&lt;p&gt;Upload your new version into a folder inside &lt;code&gt;releases/&lt;/code&gt;. Let's call it &lt;code&gt;v2_new&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. The Magic Command
&lt;/h4&gt;

&lt;p&gt;Open your terminal (SSH). Instead of copying files, run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-sfn&lt;/span&gt; /home/username/releases/v2_new/public /home/username/public_html

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What does this do?&lt;/strong&gt; It tells the server: &lt;em&gt;"Hey, whenever someone visits public_html, actually show them the files inside v2_new/public."&lt;/em&gt; It happens &lt;strong&gt;instantly&lt;/strong&gt;. No loading bars, no waiting.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. The "Oops" Button (Rollback)
&lt;/h4&gt;

&lt;p&gt;This is my favorite part. If you realize &lt;code&gt;v2_new&lt;/code&gt; has a massive bug, you don't need to panic. You can switch back to the old version in one second:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-sfn&lt;/span&gt; /home/username/releases/v1_old/public /home/username/public_html

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Empty Box Problem in Laravel Migrations (And why I stopped using default strings)</title>
      <dc:creator>Tahsin Abrar</dc:creator>
      <pubDate>Thu, 18 Dec 2025 19:38:09 +0000</pubDate>
      <link>https://forem.com/tahsin000/the-empty-box-problem-in-laravel-migrations-and-why-i-stopped-using-default-strings-4hc6</link>
      <guid>https://forem.com/tahsin000/the-empty-box-problem-in-laravel-migrations-and-why-i-stopped-using-default-strings-4hc6</guid>
      <description>&lt;p&gt;🛑 Stop me if you’ve faced this decision before.&lt;/p&gt;

&lt;p&gt;You are writing a Laravel migration.&lt;br&gt;
You need to add an optional column, like &lt;code&gt;unit_type&lt;/code&gt;.&lt;br&gt;
Not every product needs a unit.&lt;/p&gt;

&lt;p&gt;So, you have two choices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;$table-&amp;gt;string('unit_type')-&amp;gt;default('');&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$table-&amp;gt;string('unit_type')-&amp;gt;nullable();&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I almost always chose Option 1.&lt;/p&gt;

&lt;p&gt;Why? &lt;strong&gt;Fear.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2a1akfaxurs09bvhe8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2a1akfaxurs09bvhe8d.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was afraid of the dreaded &lt;code&gt;Trying to access property on null&lt;/code&gt; error in my frontend.&lt;br&gt;
I just wanted to output the value without writing &lt;code&gt;if&lt;/code&gt; statements everywhere.&lt;br&gt;
Using &lt;code&gt;default('')&lt;/code&gt; felt "safe."&lt;/p&gt;

&lt;p&gt;But after 10 years of database design, I realized I was doing it wrong.&lt;/p&gt;

&lt;p&gt;Here is a simple way to look at it:&lt;/p&gt;

&lt;p&gt;Imagine a warehouse shelf. 📦&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using `nullable()&lt;/strong&gt;` is like having &lt;strong&gt;no box&lt;/strong&gt; on the shelf.&lt;br&gt;
It means: "This item does not apply here." (e.g., A digital download has no weight).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using `default('')&lt;/strong&gt;` is like putting an &lt;strong&gt;empty box&lt;/strong&gt; on the shelf.&lt;br&gt;
It means: "There is a box here, but we forgot to put something inside."&lt;/p&gt;

&lt;p&gt;When you use empty strings, you are technically "lying" to your database. You are saying there is a value (text of length 0), even when there isn’t.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does this matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;❌ &lt;strong&gt;Queries get messy:&lt;/strong&gt; searching for &lt;code&gt;WHERE column IS NULL&lt;/code&gt; is standard. Searching for &lt;code&gt;WHERE column = ''&lt;/code&gt; feels amateur.&lt;br&gt;
❌ &lt;strong&gt;Foreign Keys:&lt;/strong&gt; You can’t make an empty string a foreign key later.&lt;br&gt;
❌ &lt;strong&gt;Analytics:&lt;/strong&gt; Reports get confused between "missing data" and "empty text."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Best Practice Solution?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep the database clean, and handle the "safety" in your Model.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In your migration, use &lt;code&gt;nullable()&lt;/code&gt;. Let the database be accurate.&lt;/li&gt;
&lt;li&gt;In your Laravel Model, use an &lt;strong&gt;Accessor&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getUnitTypeAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$value&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you the best of both worlds.&lt;br&gt;
Your database stores clean &lt;code&gt;NULL&lt;/code&gt; values.&lt;br&gt;
Your frontend gets a safe empty string.&lt;/p&gt;

&lt;p&gt;👇 &lt;strong&gt;What’s your preference? Do you strictly enforce NULLs, or do you sneak in defaults to save time? Let’s argue in the comments.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>architecture</category>
      <category>laravel</category>
      <category>php</category>
    </item>
  </channel>
</rss>
