<?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: Devashish Roy</title>
    <description>The latest articles on Forem by Devashish Roy (@roydevashish).</description>
    <link>https://forem.com/roydevashish</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%2F3517792%2F9d3ef852-ee2e-4bd0-b0b0-bd029a2c9067.jpeg</url>
      <title>Forem: Devashish Roy</title>
      <link>https://forem.com/roydevashish</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/roydevashish"/>
    <language>en</language>
    <item>
      <title>Understanding SOLID Principles — The Foundation of Better Software Design</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Wed, 19 Nov 2025 19:26:47 +0000</pubDate>
      <link>https://forem.com/roydevashish/understanding-solid-principles-the-foundation-of-better-software-design-456k</link>
      <guid>https://forem.com/roydevashish/understanding-solid-principles-the-foundation-of-better-software-design-456k</guid>
      <description>&lt;p&gt;I am currently working on the project &lt;strong&gt;&lt;a href="//youtubelayer.in"&gt;YouTubeLayer&lt;/a&gt;&lt;/strong&gt;. The prototype worked fine initially, but when I tried to &lt;strong&gt;move it to a working production system and scale it&lt;/strong&gt;, everything started breaking. It felt like playing Jenga — touch one block, and the whole tower comes crashing down.&lt;/p&gt;

&lt;p&gt;That’s when I stumbled upon something that completely changed the way I thought about software design — the &lt;strong&gt;SOLID principles&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These five principles aren’t just fancy theory; they’re a way of writing code that’s &lt;strong&gt;easy to understand, extend, and maintain&lt;/strong&gt;. And trust me — once you start applying them, your code (and your sanity) will thank you.&lt;/p&gt;

&lt;p&gt;Let’s go through them one by one, in the simplest way possible 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 S — Single Responsibility Principle (SRP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br&gt;
A class should have &lt;strong&gt;only one reason to change&lt;/strong&gt; — in other words, it should do &lt;strong&gt;only one thing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In plain English:&lt;/strong&gt;&lt;br&gt;
Don’t make a “God class” that does everything — logging, sending emails, calculating bills, and making coffee.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
I once worked on a &lt;code&gt;UserManager&lt;/code&gt; class that handled both &lt;strong&gt;user authentication&lt;/strong&gt; and &lt;strong&gt;sending email notifications&lt;/strong&gt;. Every time we updated the notification logic — like changing email templates or adding a new notification type — the authentication system mysteriously broke. 😅  &lt;/p&gt;

&lt;p&gt;We eventually split it into two separate classes — &lt;code&gt;AuthManager&lt;/code&gt; for authentication and &lt;code&gt;NotificationManager&lt;/code&gt; for sending emails. After that, changes became smooth and predictable. It was such a relief!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
It makes debugging, testing, and updating code simpler and safer.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚪 O — Open/Closed Principle (OCP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br&gt;
Classes should be &lt;strong&gt;open for extension but closed for modification&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In plain English:&lt;/strong&gt;&lt;br&gt;
You should be able to add new features without touching existing code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
This reminds me of a time when I had to add &lt;strong&gt;subscription payments&lt;/strong&gt; to my platform. Initially, all the payment logic lived inside one giant &lt;code&gt;if-else&lt;/code&gt; block — handling credit cards, UPI, and wallets all in one place. When I tried adding a new option like PayPal, I had to dive back into that messy code and risk breaking existing functionality.&lt;/p&gt;

&lt;p&gt;Later, I refactored the system by introducing a base &lt;code&gt;Payment&lt;/code&gt; interface and creating separate classes like &lt;code&gt;CreditCardPayment&lt;/code&gt;, &lt;code&gt;UPIPayment&lt;/code&gt;, and &lt;code&gt;PayPalPayment&lt;/code&gt;. After that, adding a new payment mode was as simple as creating a new class — no need to touch the old code. It felt like magic ✨&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
It keeps old features safe while allowing new features to be added easily.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔄 L — Liskov Substitution Principle (LSP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br&gt;
Subclasses should be replaceable with their parent classes &lt;strong&gt;without breaking the application&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In plain English:&lt;/strong&gt;&lt;br&gt;
If a subclass can’t perform the same role as its parent, it shouldn’t be a subclass.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
This happened when I designed a &lt;code&gt;Payment&lt;/code&gt; interface for my subscription system with a &lt;code&gt;processSubscription()&lt;/code&gt; method. I had different payment classes like &lt;code&gt;CreditCardPayment&lt;/code&gt;, &lt;code&gt;UPIPayment&lt;/code&gt;, and &lt;code&gt;CashOnDelivery&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At first, I thought they could all just extend &lt;code&gt;Payment&lt;/code&gt;, but then I realized — &lt;strong&gt;Cash on Delivery&lt;/strong&gt; couldn’t actually process a &lt;em&gt;subscription renewal&lt;/em&gt; automatically. When I passed a &lt;code&gt;CashOnDelivery&lt;/code&gt; object where a regular &lt;code&gt;Payment&lt;/code&gt; object was expected, the system broke because it couldn’t handle renewals properly.&lt;/p&gt;

&lt;p&gt;Lesson learned — not every subclass should substitute its parent. Inheritance (or implementation) should make logical sense for the behavior it represents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
It ensures consistency and prevents unexpected behavior when using inheritance or interfaces.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧱 I — Interface Segregation Principle (ISP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br&gt;
Clients shouldn’t be forced to depend on interfaces they &lt;strong&gt;don’t use&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In plain English:&lt;/strong&gt;&lt;br&gt;
Don’t create one huge interface — break it down into smaller, more specific ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
This reminds me of a project where we had a &lt;code&gt;Notifier&lt;/code&gt; interface with methods like &lt;code&gt;sendEmail()&lt;/code&gt;, &lt;code&gt;sendSMS()&lt;/code&gt;, and &lt;code&gt;sendPushNotification()&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;But not every notification service supported all of these. For example, &lt;strong&gt;EmailNotifier&lt;/strong&gt; didn’t need &lt;code&gt;sendSMS()&lt;/code&gt; or &lt;code&gt;sendPushNotification&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;So I refactored it into smaller interfaces — &lt;code&gt;EmailNotifier&lt;/code&gt;, &lt;code&gt;SMSNotifier&lt;/code&gt;, and &lt;code&gt;PushNotifier&lt;/code&gt;. That way, each service only implemented what it actually used.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
It keeps code modular and prevents classes from carrying unnecessary baggage.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ D — Dependency Inversion Principle (DIP)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;br&gt;
Depend on &lt;strong&gt;abstractions&lt;/strong&gt;, not on &lt;strong&gt;concrete implementations&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In plain English:&lt;/strong&gt;&lt;br&gt;
High-level modules (like your business logic) shouldn’t depend on low-level modules (like database classes). Both should depend on an interface or abstraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
When I built a logging feature, I initially called a &lt;code&gt;FileLogger&lt;/code&gt; class directly. Later, when we switched to &lt;code&gt;DatabaseLogger&lt;/code&gt;, I had to change everything. The fix? Use a &lt;code&gt;Logger&lt;/code&gt; interface, and just swap implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
It makes your code flexible and easy to maintain when changing technologies or components.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Wrapping It All Up
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;SOLID principles&lt;/strong&gt; are like a set of guardrails — they don’t restrict your creativity; they just keep you from falling off the cliff.&lt;/p&gt;

&lt;p&gt;Here’s a quick recap:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Principle&lt;/th&gt;
&lt;th&gt;Stands For&lt;/th&gt;
&lt;th&gt;Key Idea&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;S&lt;/td&gt;
&lt;td&gt;Single Responsibility&lt;/td&gt;
&lt;td&gt;One class = one job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O&lt;/td&gt;
&lt;td&gt;Open/Closed&lt;/td&gt;
&lt;td&gt;Extend without modifying&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L&lt;/td&gt;
&lt;td&gt;Liskov Substitution&lt;/td&gt;
&lt;td&gt;Subclasses should behave like their parents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I&lt;/td&gt;
&lt;td&gt;Interface Segregation&lt;/td&gt;
&lt;td&gt;No unnecessary interface methods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;Dependency Inversion&lt;/td&gt;
&lt;td&gt;Depend on abstractions, not concretes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When I look back, I realize the biggest jump in my programming maturity came when I stopped focusing on &lt;em&gt;just writing code&lt;/em&gt; and started focusing on &lt;em&gt;designing it well&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So next time you’re building something — pause for a moment and ask,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Am I being SOLID about this?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📚 References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898" rel="noopener noreferrer"&gt;The S.O.L.I.D Principles in Pictures — &lt;em&gt;Medium (Backticks &amp;amp; Tildes)&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design#open-closed-principle" rel="noopener noreferrer"&gt;S.O.L.I.D: The First Five Principles of Object-Oriented Design — &lt;em&gt;DigitalOcean&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blog.ashutoshkrris.in/solid-principles-for-better-software-design" rel="noopener noreferrer"&gt;SOLID Principles for Better Software Design — &lt;em&gt;Ashutosh Krishna Blog&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://amirmustafaofficial.medium.com/understanding-solid-principles-in-javascript-2024-b91fd20eb96d" rel="noopener noreferrer"&gt;Understanding SOLID Principles in JavaScript (2024) — &lt;em&gt;Amir Mustafa&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=jlnhHxzC9-w" rel="noopener noreferrer"&gt;SOLID Principles in One Video 🔥 | Clean Code &amp;amp; OOP Design Simplified for Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=UsNl8kcU4UA" rel="noopener noreferrer"&gt;SOLID Design Principles | Complete Guide with Code Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=hU9koy6A2I0" rel="noopener noreferrer"&gt;SOLID Design Principles | part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>solidprinciples</category>
      <category>softwareengineering</category>
      <category>cleancode</category>
      <category>programming</category>
    </item>
    <item>
      <title>Higher Order Functions — Powering Modern JavaScript Magic</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sun, 19 Oct 2025 11:46:50 +0000</pubDate>
      <link>https://forem.com/roydevashish/higher-order-functions-powering-modern-javascript-magic-26hi</link>
      <guid>https://forem.com/roydevashish/higher-order-functions-powering-modern-javascript-magic-26hi</guid>
      <description>&lt;p&gt;When I first started working with JavaScript, I used to think functions were just blocks of code — something you call, they do their job, and that’s it. But as my projects grew — from simple scripts to complex API-driven dashboards — I discovered something that completely changed how I write code: &lt;strong&gt;Higher-Order Functions (HOFs)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Higher-Order Functions?
&lt;/h2&gt;

&lt;p&gt;In simple terms, a &lt;strong&gt;higher-order function&lt;/strong&gt; is a function that does one or both of these things:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Takes another function as an argument&lt;/strong&gt;,
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returns a new function&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it. But this simple idea gives us immense flexibility — allowing us to write cleaner, reusable, and more powerful code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-Life Example — API Calls and Async Workflows
&lt;/h2&gt;

&lt;p&gt;Imagine you’re building a dashboard that fetches data from multiple APIs — user profiles, posts, analytics, etc.&lt;/p&gt;

&lt;p&gt;Normally, you’d call an API, handle its response, and move on. But what if you need to:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retry failed API calls automatically
&lt;/li&gt;
&lt;li&gt;Log how long each request takes
&lt;/li&gt;
&lt;li&gt;Or show a loading spinner until &lt;em&gt;all&lt;/em&gt; requests finish
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of writing repetitive code for each API call, you can use a &lt;strong&gt;higher-order function&lt;/strong&gt; to handle this behavior.&lt;/p&gt;

&lt;p&gt;Here’s an example 👇&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="c1"&gt;// A higher-order function that wraps any async function with logging and retry logic&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;withRetryAndLogging&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;asyncFunc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&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="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Attempt &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;...`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;asyncFunc&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`✅ Success in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;ms`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`⚠️ Failed attempt &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;retries&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;error&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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Original function – just fetches data&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://api.example.com/users/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Wrapped function with extra behavior&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;safeFetchUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;withRetryAndLogging&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Use it like a normal function&lt;/span&gt;
&lt;span class="nf"&gt;safeFetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;withRetryAndLogging&lt;/code&gt; is a &lt;strong&gt;higher-order function&lt;/strong&gt; — it &lt;em&gt;takes a function&lt;/em&gt; (&lt;code&gt;fetchUserData&lt;/code&gt;) and &lt;em&gt;returns a new one&lt;/em&gt; with extra capabilities.&lt;/p&gt;

&lt;p&gt;This makes your code &lt;strong&gt;modular&lt;/strong&gt;, &lt;strong&gt;reusable&lt;/strong&gt;, and &lt;strong&gt;easier to maintain&lt;/strong&gt; — a big win when working with asynchronous systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Other Real-World Examples
&lt;/h2&gt;

&lt;p&gt;You’re already using HOFs — even if you don’t realize it:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;setTimeout(() =&amp;gt; {...}, 1000)&lt;/code&gt; — takes a callback function.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Array.map()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt;, &lt;code&gt;reduce()&lt;/code&gt; — take functions to process arrays.
&lt;/li&gt;
&lt;li&gt;Express.js middleware — functions that take another function (the next handler).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these uses the same principle — passing functions as data to build flexible, composable systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why It Matters
&lt;/h2&gt;

&lt;p&gt;When working with &lt;strong&gt;asynchronous code&lt;/strong&gt; like API calls, event listeners, or promises, higher-order functions give you:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Better abstraction&lt;/strong&gt; – you can separate logic (like retry or logging) from the main task.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code reuse&lt;/strong&gt; – one wrapper can handle multiple API functions.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cleaner structure&lt;/strong&gt; – no repeated boilerplate or nested callbacks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They’re the reason modern frameworks like &lt;strong&gt;React, Node.js, and Express&lt;/strong&gt; feel so elegant — all powered by functions working with other functions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;Think of higher-order functions as the “middleware of logic.” Just as routers pass requests through layers of middleware before reaching the final handler, your code can pass data through layers of behavior — retry, logging, validation, or error handling — all made possible because functions in JavaScript are &lt;strong&gt;first-class citizens&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once you start thinking in terms of higher-order functions, your code stops being just instructions — it becomes a system of composable, reusable logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=E7WIis2NjZU" rel="noopener noreferrer"&gt;Higher Order Function | javascript interview series&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=03lLCa3KbuI" rel="noopener noreferrer"&gt;High Order Functions and Callbacks in Javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/First-class_Function" rel="noopener noreferrer"&gt;First-class function - Glossary | MDN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>function</category>
      <category>coding</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Functions are First-Class Citizens — What Does It Mean?</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Wed, 15 Oct 2025 18:00:22 +0000</pubDate>
      <link>https://forem.com/roydevashish/functions-are-first-class-citizens-what-does-it-mean-4787</link>
      <guid>https://forem.com/roydevashish/functions-are-first-class-citizens-what-does-it-mean-4787</guid>
      <description>&lt;p&gt;Before understanding why functions are called first-class citizens in some programming languages and not in others, we need to understand what a &lt;strong&gt;first-class citizen&lt;/strong&gt; means in a programming language.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a First-Class Citizen?
&lt;/h2&gt;

&lt;p&gt;In programming, a first-class citizen (or first-class object) is an entity that can be treated like any other value in the language.&lt;/p&gt;

&lt;p&gt;This means it can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Be assigned to a variable.&lt;/li&gt;
&lt;li&gt;Be passed as an argument to a function.&lt;/li&gt;
&lt;li&gt;Be returned from a function.&lt;/li&gt;
&lt;li&gt;Be stored in data structures (like lists, maps, etc.).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example — Functions as First-Class Citizens (Python)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def greet():
    return "Hello"

# 1. Assigned to a variable
say_hello = greet

# 2. Passed as an argument
def call_func(func):
    print(func())

call_func(say_hello)

# 3. Returned from a function
def outer():
    return greet

inner = outer()
print(inner())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, functions are first-class citizens because they can be assigned, passed, and returned.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Are the First-Class Citizens in Popular Languages?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  C
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Primitive types (int, float, char)&lt;/li&gt;
&lt;li&gt;✅ Pointers (including function pointers)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;⚠️ Functions are not fully first-class — you can use function pointers, but no closures or nested functions.&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Variables, pointers, primitive types&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  C++
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Objects (instances of classes)&lt;/li&gt;
&lt;li&gt;✅ Primitive types&lt;/li&gt;
&lt;li&gt;✅ Lambdas / function objects (std::function) since C++11&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;⚠️ Regular functions are not first-class by themselves&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Objects, primitive types, lambdas, std::function&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Java
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Objects (instances of classes)&lt;/li&gt;
&lt;li&gt;✅ Lambdas and method references since Java 8&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;⚠️ Regular methods are not first-class&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Objects, lambdas (Java 8+)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  JavaScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Functions (assignable, passable, returnable)&lt;/li&gt;
&lt;li&gt;✅ Objects, arrays, primitives&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;✅ Closures supported&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Functions, objects, primitives&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  TypeScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Superset of JavaScript, same rules&lt;/li&gt;
&lt;li&gt;✅ Functions, objects, primitives, classes&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;✅ Type annotations make function-as-value more explicit&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Functions, objects, primitives, classes&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Everything is an object&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;✅ Functions, classes, modules, numbers, strings — all first-class&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Everything (especially functions and classes)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Go (Golang)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Functions (assignable, passable, returnable)&lt;/li&gt;
&lt;li&gt;✅ Interfaces, structs, primitives&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;✅ Closures supported&lt;/p&gt;

&lt;p&gt;→ First-class citizens: Functions, structs, interfaces, primitives&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  First-Class Entities Matrix with Examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Entity&lt;/th&gt;
&lt;th&gt;Assigned&lt;/th&gt;
&lt;th&gt;Passed&lt;/th&gt;
&lt;th&gt;Returned&lt;/th&gt;
&lt;th&gt;Stored&lt;/th&gt;
&lt;th&gt;Created&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Primitive (&lt;code&gt;int&lt;/code&gt;,&lt;code&gt;char&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Pointer&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Struct&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Function&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;⚠️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C++&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Primitive&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Object&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Pointer / Reference&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Lambda / std::function&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Primitive&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Object&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Lambda / Functional Interface&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Class&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Function&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Object&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Array&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Class&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Primitive&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Function&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Object&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Class&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Module&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Primitive&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Go&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Function&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Struct&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Interface&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Primitive&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Summary Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;First-Class Citizens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;Variables, pointers, primitive types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C++&lt;/td&gt;
&lt;td&gt;Objects, primitive types, lambdas (std::function)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Java&lt;/td&gt;
&lt;td&gt;Objects, lambdas (Java 8+)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;Functions, objects, primitives&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TypeScript&lt;/td&gt;
&lt;td&gt;Functions, objects, primitives, classes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Everything (functions, classes, modules, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Functions, structs, interfaces, primitives&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Why Functions Are First-Class Citizens in Some Languages
&lt;/h2&gt;

&lt;p&gt;Functions are first-class citizens in languages like Python, JavaScript, Go, and TypeScript because they satisfy all the properties of first-class entities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They can be assigned to variables&lt;/li&gt;
&lt;li&gt;They can be passed as arguments&lt;/li&gt;
&lt;li&gt;They can be returned from other functions&lt;/li&gt;
&lt;li&gt;They can be stored in data structures&lt;/li&gt;
&lt;li&gt;They can be created dynamically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In languages like C or Java (pre-Java 8), functions are not fully first-class because they cannot satisfy all these properties — e.g., you cannot create functions dynamically or return raw functions as easily.&lt;/p&gt;




&lt;p&gt;In short: A first-class function is a function that can be treated just like any other value.&lt;/p&gt;

&lt;p&gt;Languages differ in their support, and that’s why understanding first-class citizens helps you write more flexible, functional, and expressive code.&lt;/p&gt;

</description>
      <category>function</category>
      <category>javascript</category>
      <category>python</category>
      <category>go</category>
    </item>
    <item>
      <title>Docker Command Sheet - My Go-To Dev Environment</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sun, 21 Sep 2025 13:51:22 +0000</pubDate>
      <link>https://forem.com/roydevashish/docker-command-sheet-my-go-to-dev-environment-2kpg</link>
      <guid>https://forem.com/roydevashish/docker-command-sheet-my-go-to-dev-environment-2kpg</guid>
      <description>&lt;p&gt;A quick reference for commonly used Docker commands.&lt;/p&gt;

&lt;p&gt;Designed for everyday development, it shows how to build, run, manage, and push Docker images. Fully generalized with placeholders for paths, image names, container names, and ports. Minimal, non-redundant, and easy to follow for beginners and intermediate users alike.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Basic Docker Commands&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check installed Docker version&lt;/span&gt;
docker version

&lt;span class="c"&gt;# Pull an image from Docker Hub&lt;/span&gt;
docker pull &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# Build an image from a Dockerfile (path = directory containing Dockerfile)&lt;/span&gt;
docker build &lt;span class="nt"&gt;-t&lt;/span&gt; &amp;lt;image_name&amp;gt; &amp;lt;path_to_dockerfile&amp;gt;

&lt;span class="c"&gt;# Run a container interactively&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# Run a container with port mapping (host → container)&lt;/span&gt;
docker run &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;host_port&amp;gt;:&amp;lt;container_port&amp;gt; &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# Run a container with a custom name&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; &amp;lt;container_name&amp;gt; &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# List running containers&lt;/span&gt;
docker container &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# List all containers (including stopped ones)&lt;/span&gt;
docker container &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;

&lt;span class="c"&gt;# Stop a container&lt;/span&gt;
docker stop &amp;lt;container_id&amp;gt;

&lt;span class="c"&gt;# Remove a container&lt;/span&gt;
docker container &lt;span class="nb"&gt;rm&lt;/span&gt; &amp;lt;container_id&amp;gt;

&lt;span class="c"&gt;# List all images&lt;/span&gt;
docker image &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Remove an image&lt;/span&gt;
docker image &lt;span class="nb"&gt;rm&lt;/span&gt; &amp;lt;image_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Docker Volumes&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a named volume&lt;/span&gt;
docker volume create &amp;lt;volume_name&amp;gt;

&lt;span class="c"&gt;# List all volumes&lt;/span&gt;
docker volume &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Run a container with a mounted host directory&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &amp;lt;host_path&amp;gt;:&amp;lt;container_path&amp;gt; &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# Run a container with a named volume&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &amp;lt;volume_name&amp;gt;:&amp;lt;container_path&amp;gt; &amp;lt;image_name&amp;gt; bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Docker Networking&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List all networks&lt;/span&gt;
docker network &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Inspect the default bridge network&lt;/span&gt;
docker inspect bridge

&lt;span class="c"&gt;# Create a new network&lt;/span&gt;
docker network create &amp;lt;network_name&amp;gt;

&lt;span class="c"&gt;# Run a container inside a specific network&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--network&lt;/span&gt; &amp;lt;network_name&amp;gt; &lt;span class="nt"&gt;--name&lt;/span&gt; &amp;lt;container_name&amp;gt; &amp;lt;image_name&amp;gt;

&lt;span class="c"&gt;# Connect an existing container to a network&lt;/span&gt;
docker network connect &amp;lt;network_name&amp;gt; &amp;lt;container_name&amp;gt;

&lt;span class="c"&gt;# Execute a command inside a running container&lt;/span&gt;
docker &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;container_name&amp;gt; bash

&lt;span class="c"&gt;# Run a container with port mapping&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;host_port&amp;gt;:&amp;lt;container_port&amp;gt; &amp;lt;image_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Working with Docker Hub&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Build an image and tag it for Docker Hub&lt;/span&gt;
docker build &lt;span class="nt"&gt;-t&lt;/span&gt; &amp;lt;dockerhub_username&amp;gt;/&amp;lt;repo_name&amp;gt; &amp;lt;path_to_dockerfile&amp;gt;

&lt;span class="c"&gt;# Push image to Docker Hub&lt;/span&gt;
docker push &amp;lt;dockerhub_username&amp;gt;/&amp;lt;repo_name&amp;gt;

&lt;span class="c"&gt;# Pull image from Docker Hub&lt;/span&gt;
docker pull &amp;lt;dockerhub_username&amp;gt;/&amp;lt;repo_name&amp;gt;

&lt;span class="c"&gt;# Run container from Docker Hub image&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;dockerhub_username&amp;gt;/&amp;lt;repo_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This cheatsheet provides a minimal, non-redundant, and fully generalized set of Docker commands for everyday development.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;References&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=zCsbp_iBTq8" rel="noopener noreferrer"&gt;Docker Tutorial For Beginners in Hindi by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=6t2NhkRsmuA" rel="noopener noreferrer"&gt;Docker Networking | Networking Tutorial in Hindi by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=VbuNIZIog2w" rel="noopener noreferrer"&gt;What is Docker Volume | Docker Volumes Explained by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=31k6AtW-b3Y&amp;amp;t=1506s" rel="noopener noreferrer"&gt;Docker In One Shot - Part 1 by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=xPT8mXa-sJg" rel="noopener noreferrer"&gt;Docker For Open Source Contributors - Part 2 by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Run Oracle19c Database in Mac M1/M2 using Docker</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sat, 20 Sep 2025 13:40:28 +0000</pubDate>
      <link>https://forem.com/roydevashish/run-oracle19c-database-in-mac-m1m2-using-docker-2gnk</link>
      <guid>https://forem.com/roydevashish/run-oracle19c-database-in-mac-m1m2-using-docker-2gnk</guid>
      <description>&lt;p&gt;Running Oracle 19c on Mac (M1/M2) isn’t straightforward. Unlike Windows or Linux, Oracle doesn’t provide a native installer, which can be a huge blocker for students and developers.&lt;/p&gt;

&lt;p&gt;During my MTech 2nd semester Database Security Lab, I had to use Oracle 19c for practicals—but on my Mac, there was no direct installer available. Initially, I wasted a lot of time trying different hacks and workarounds just to get it running.&lt;/p&gt;

&lt;p&gt;The breakthrough came when I used Docker. By containerizing Oracle 19c, I could run it seamlessly on macOS without hitting compatibility issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository Link:&lt;/strong&gt; &lt;a href="https://github.com/roydevashish/path-to-software-engineer" rel="noopener noreferrer"&gt;https://github.com/roydevashish/path-to-software-engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation Link:&lt;/strong&gt; &lt;a href="https://github.com/roydevashish/path-to-software-engineer/blob/main/oracle19c-in-mac-m1-m2-using-docker.md" rel="noopener noreferrer"&gt;https://github.com/roydevashish/path-to-software-engineer/blob/main/oracle19c-in-mac-m1-m2-using-docker.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re on macOS and struggling to run Oracle databases, this setup can save you hours of frustration.&lt;/p&gt;

&lt;p&gt;Curious to know — have you ever used Docker as a workaround to bypass OS compatibility issues?&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Prerequisite&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.docker.com/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Steps to follow&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Download the Oracle Database 19c for LINUX ARM (aarch64) file&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Go to the page -&amp;gt; &lt;a href="https://www.oracle.com/in/database/technologies/oracle-database-software-downloads.html" rel="noopener noreferrer"&gt;Database Software Downloads | Oracle India&lt;/a&gt; and download &lt;strong&gt;Oracle Database 19c for LINUX ARM (aarch64)&lt;/strong&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;2. Clone Repository oracle/docker-images&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone github.com/oracle/docker-images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;3. Copy or Move the file&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Copy or Move the download file &lt;code&gt;LINUX.ARM64_1919000_db_home.zip&lt;/code&gt; to &lt;code&gt;docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;4. Build the Image&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Use terminal and navigate to &lt;code&gt;docker-images/OracleDatabase/SingleInstance/dockerfiles&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Build the docker image by running the shell script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./buildContainerImage.sh &lt;span class="nt"&gt;-v&lt;/span&gt; 19.3.0 &lt;span class="nt"&gt;-e&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;v: for version&lt;/li&gt;
&lt;li&gt;e: for enterprise edition&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. List to check the images&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The list must have an image &lt;code&gt;docker/database&lt;/code&gt; with tag &lt;code&gt;19.3.0-ee&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6. Run the Docker Container&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Run a docker container using the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; oracle19 &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;ORACLE_PWD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;mypassword1 &lt;span class="nt"&gt;-p&lt;/span&gt; 1521:1521 oracle/database:19.3.0-ee
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;-name: Name of the container&lt;/li&gt;
&lt;li&gt;ORACLE_PWD: Password of your oracle database&lt;/li&gt;
&lt;li&gt;p: Port mapping&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;7. Check the status of the container&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Check the status of the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The status should be &lt;code&gt;healthy&lt;/code&gt; that means the container is up and running.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;8. Download the VS Code Extension&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Download the &lt;a href="https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer" rel="noopener noreferrer"&gt;Oracle SQL Developer Extension&lt;/a&gt; for VSCode.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a New Connection with the following properties&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name: SYS
(You can give anything, but I like to keep the connection name as the username, so that I know which user is using this connection.)

Role: SYSDBA
Username: SYS
Password: mypassword1

Hostname: localhost
Port: 1521
Type: Service Name
Service Name: ORCLCDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;code&gt;Test&lt;/code&gt; to check the connection&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;code&gt;Save&lt;/code&gt; to save the connection&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the connection name to connect, it will ask for the password&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a worksheet and run the SQL commands&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  &lt;strong&gt;References&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=uxvoMhkKUPE" rel="noopener noreferrer"&gt;How to Install Oracle on an M1/M2 Mac (Finally)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.oracle.com/in/database/technologies/oracle-database-software-downloads.html" rel="noopener noreferrer"&gt;Database Software Downloads | Oracle India&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/oracle/docker-images" rel="noopener noreferrer"&gt;oracle/docker-images: Official source of container configurations, images, and examples for Oracle products and projects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer" rel="noopener noreferrer"&gt;Oracle SQL Developer Extension for VSCode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>database</category>
      <category>docker</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Git Command Cheetsheet Sheet</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sat, 20 Sep 2025 13:39:57 +0000</pubDate>
      <link>https://forem.com/roydevashish/git-command-cheetsheet-sheet-57ia</link>
      <guid>https://forem.com/roydevashish/git-command-cheetsheet-sheet-57ia</guid>
      <description>&lt;p&gt;A concise reference for &lt;strong&gt;Git&lt;/strong&gt; commands.&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;strong&gt;⚙️ Configure Git&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🌍 Global (applies to all repositories)&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Set global name&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;

&lt;span class="c"&gt;# Set global email&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your@email.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;📂 Local (specific to a repository)&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Set local name (for this repo only)&lt;/span&gt;
git config &lt;span class="nt"&gt;--local&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;

&lt;span class="c"&gt;# Set local email (for this repo only)&lt;/span&gt;
git config &lt;span class="nt"&gt;--local&lt;/span&gt; user.email &lt;span class="s2"&gt;"your@email.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;🏗️ Initialize &amp;amp; Clone&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🆕 Initialize a Git repository&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;📥 Clone a repository&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone into a new directory&lt;/span&gt;
git clone &lt;span class="o"&gt;[&lt;/span&gt;url]

&lt;span class="c"&gt;# Clone into the current directory&lt;/span&gt;
git clone &lt;span class="o"&gt;[&lt;/span&gt;url] &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# Clone into a specific directory&lt;/span&gt;
git clone &lt;span class="o"&gt;[&lt;/span&gt;url] &lt;span class="o"&gt;[&lt;/span&gt;path-to-clone]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;📌 Stage &amp;amp; Snapshot&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🔎 Check file status&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;➕ Add files to the staging area&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Stage a specific file&lt;/span&gt;
git add &lt;span class="o"&gt;[&lt;/span&gt;file]

&lt;span class="c"&gt;# Stage all files&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;➖ Remove files from the staging area&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Unstage a specific file&lt;/span&gt;
git reset &lt;span class="o"&gt;[&lt;/span&gt;file]

&lt;span class="c"&gt;# Unstage all files&lt;/span&gt;
git reset &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;📝 Check file changes&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Show unstaged changes&lt;/span&gt;
git diff

&lt;span class="c"&gt;# Show staged changes&lt;/span&gt;
git diff &lt;span class="nt"&gt;--staged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;💾 Commit changes&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Commit with a message&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Commit message"&lt;/span&gt;

&lt;span class="c"&gt;# Commit with title and description&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Commit title"&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Commit description"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;🌿 Branching&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;📋 List branches&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;🌱 Create a new branch&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;🔀 Switch to another branch&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;✏️ Rename the current branch&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-M&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;new-branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;🕒 View commit history&lt;/strong&gt;
&lt;/h2&gt;



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

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;🔄 Share &amp;amp; Update&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🌐 Remote repositories&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add a remote&lt;/span&gt;
git remote add &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;url]

&lt;span class="c"&gt;# List remotes&lt;/span&gt;
git remote &lt;span class="nt"&gt;-v&lt;/span&gt;

&lt;span class="c"&gt;# Show details of a remote&lt;/span&gt;
git remote show &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

&lt;span class="c"&gt;# Get the URL of a remote&lt;/span&gt;
git remote get-url &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

&lt;span class="c"&gt;# Remove a remote&lt;/span&gt;
git remote remove &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;📤 Fetching &amp;amp; pushing&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Fetch and merge changes from remote&lt;/span&gt;
git pull

&lt;span class="c"&gt;# Push and set upstream for the first time&lt;/span&gt;
git push &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;branch]

&lt;span class="c"&gt;# Push to a specific remote and branch&lt;/span&gt;
git push &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;branch]

&lt;span class="c"&gt;# Push to the default remote/branch&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;🚫 Ignoring Files&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Create a &lt;code&gt;.gitignore&lt;/code&gt; file to exclude files/folders from being tracked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;logs/
*.notes
pattern*/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  &lt;strong&gt;📖 References&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=TsSjgkfAeJ0" rel="noopener noreferrer"&gt;Complete Git &amp;amp; GitHub Tutorial - by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=RDxQEzXN8AU" rel="noopener noreferrer"&gt;Complete Git and GitHub Tutorial for Beginners - by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=LF-rK5yPzVM" rel="noopener noreferrer"&gt;Complete Git &amp;amp; GitHub Tutorial | Branching And Merging - by Piyush Garg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>China Cracks Small RSA Key with Quantum Computer – What It Means for Our Digital Future</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sat, 20 Sep 2025 13:37:53 +0000</pubDate>
      <link>https://forem.com/roydevashish/china-cracks-small-rsa-key-with-quantum-computer-what-it-means-for-our-digital-future-52l5</link>
      <guid>https://forem.com/roydevashish/china-cracks-small-rsa-key-with-quantum-computer-what-it-means-for-our-digital-future-52l5</guid>
      <description>&lt;p&gt;Imagine waking up one morning to find out the math behind the encryption protecting your bank account is slowly beginning to break. That’s exactly the kind of shift a recent breakthrough in China is hinting at — and while we’re not in immediate danger, it’s a wake-up call the world can't ignore.&lt;/p&gt;




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

&lt;p&gt;A team of researchers from &lt;strong&gt;Shanghai University&lt;/strong&gt; used a &lt;strong&gt;quantum annealing computer&lt;/strong&gt; by &lt;strong&gt;D-Wave Systems&lt;/strong&gt; to crack a &lt;strong&gt;22-bit RSA key&lt;/strong&gt; — a small feat in terms of practical encryption but a &lt;strong&gt;huge leap in terms of quantum capabilities&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They avoided the traditional Shor’s algorithm and instead reframed the problem as a combinatorial optimization task, ideal for D-Wave’s quantum annealers.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Why Should You Care About Just 22 Bits?
&lt;/h3&gt;

&lt;p&gt;While a 22-bit key is not used in practice, this successful demonstration shows significant &lt;strong&gt;progress in real-world quantum cryptanalysis&lt;/strong&gt;. It scaled beyond past limits and demonstrated strategies that could extend to larger key sizes.&lt;/p&gt;




&lt;h3&gt;
  
  
  📅 Visual Timeline: Quantum Threats to RSA and the Global Response
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text
CopyEdit
1977 ─────► RSA encryption is introduced.
1994 ─────► Shor’s algorithm (theoretical RSA breaker) is proposed.
2019 ─────► Google achieves "quantum supremacy" in a limited task.
2022 ─────► NIST announces 4 finalists for post-quantum cryptographic standards.
2023 ─────► IBM &amp;amp; others build 400–1000+ qubit gate-based quantum processors.
2024 ─────► China factors a 22-bit RSA key using D-Wave quantum annealer.
2024 ─────► NIST releases FIPS 203–205: Official PQC standards.
2025 ─────► HQC selected as additional PQC candidate by NIST.
20XX ─────► Full-scale quantum computers pose real threat to 2048-bit RSA.

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ We're here 👆 — and we’re already past the planning phase.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🛡 What’s the Risk?
&lt;/h3&gt;

&lt;p&gt;RSA, ECC, and other traditional algorithms protect nearly everything online. Quantum computers, once powerful enough, could &lt;strong&gt;break these systems in minutes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Governments and standards organizations are already preparing. The &lt;strong&gt;U.S. National Institute of Standards and Technology (NIST)&lt;/strong&gt; is leading the global shift to &lt;strong&gt;post-quantum cryptography (PQC)&lt;/strong&gt;, using &lt;strong&gt;lattice-based&lt;/strong&gt; algorithms like CRYSTALS-Kyber.&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 What Should You Do?
&lt;/h3&gt;

&lt;p&gt;Whether you’re a developer, architect, or IT leader, now is the time to:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Audit&lt;/strong&gt; where your systems use RSA, ECC, SHA, or other vulnerable algorithms&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Start testing&lt;/strong&gt; quantum-safe libraries like &lt;a href="https://openquantumsafe.org/" rel="noopener noreferrer"&gt;Open Quantum Safe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Use hybrid schemes&lt;/strong&gt; (classical + PQC) during the transition&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Design for crypto-agility&lt;/strong&gt;, so you can update encryption without rewriting everything&lt;/p&gt;




&lt;h3&gt;
  
  
  🧩 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;RSA isn’t dead — yet. But history tells us that &lt;strong&gt;proof-of-concept attacks scale fast&lt;/strong&gt;. Just like &lt;strong&gt;DES was declared broken four years after the first partial cracks&lt;/strong&gt;, this 22-bit demonstration could be a preview of what’s coming.&lt;/p&gt;

&lt;p&gt;If your systems handle &lt;strong&gt;sensitive, long-lived data&lt;/strong&gt; like health records, personal identities, or financial data — you can't afford to wait.&lt;/p&gt;




&lt;p&gt;🔐 The future of encryption is quantum-safe.&lt;/p&gt;

&lt;p&gt;Start your transition before the quantum threat becomes a quantum disaster.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>news</category>
      <category>science</category>
    </item>
    <item>
      <title>Networking and Digital Communication Fundamentals</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sat, 20 Sep 2025 13:36:35 +0000</pubDate>
      <link>https://forem.com/roydevashish/networking-and-digital-communication-fundamentals-1b4d</link>
      <guid>https://forem.com/roydevashish/networking-and-digital-communication-fundamentals-1b4d</guid>
      <description>&lt;h1&gt;
  
  
  1. Introduction
&lt;/h1&gt;

&lt;p&gt;The basic of networking and digital communication and essential elements required to understand how computer network operates in the context of security of information system for out net-centric organisation.&lt;/p&gt;

&lt;h2&gt;
  
  
  1.1 Topics to be covered
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Types of network&lt;/li&gt;
&lt;li&gt;How network works&lt;/li&gt;
&lt;li&gt;Routers&lt;/li&gt;
&lt;li&gt;Gateways&lt;/li&gt;
&lt;li&gt;Bridges&lt;/li&gt;
&lt;li&gt;OSI Model&lt;/li&gt;
&lt;li&gt;Network Topologies&lt;/li&gt;
&lt;li&gt;Protocols&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Network:&lt;/strong&gt; Two or more devices connected together in such way as to allow them to exchange information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Protocol:&lt;/strong&gt; Set of standards that defines all operations within a network, basically it is an agreed upon formate for transmitting data between two devices. It determines a number of things in the network: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;type of error check&lt;/li&gt;
&lt;li&gt;data compression method, if any&lt;/li&gt;
&lt;li&gt;indicate finished sending a message, or received a message&lt;/li&gt;
&lt;li&gt;how devices outside the network can interact with the network&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Protocol defines everything from basic networking data structure to upper level application programs.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Network Types
&lt;/h1&gt;

&lt;p&gt;A network is a logical grouping of computers that share information and resources.&lt;/p&gt;

&lt;p&gt;Common Categorisation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;LAN (Local Area Network)&lt;/li&gt;
&lt;li&gt;WAN (Wide Area Network)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  2.1 LAN (Local Area Network)
&lt;/h2&gt;

&lt;p&gt;A LAN is a single network of computers, which are physically located in the same area and rarely spans over more than one location. It usually comprise small number of computers and printers with up to five servers. &lt;/p&gt;

&lt;p&gt;Example - Network in a small office or home office. &lt;/p&gt;

&lt;h2&gt;
  
  
  2.2      WAN (Wide Area Network)
&lt;/h2&gt;

&lt;p&gt;A WAN is a network of LANs. WANs span more than one geographic area and are used to connect remote offices to each other. Basically, a WAN comprises two or more LANs joined together by &lt;em&gt;routers&lt;/em&gt;. It can be found in medium - to - large-sized businesses with more then one office location. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Routers&lt;/em&gt; are hardware devices that direct traffic from one LAN to another.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example - A software company might have its headquarters in Delhi, but also have remote office locations, say in Aurangabad and Faridabad. The LAN in the Delhi office would be connected to the LAN in the remote offices forming a WAN.&lt;/p&gt;

&lt;p&gt;ℹ️&lt;/p&gt;

&lt;p&gt;LANs and WANs comes in many different varient. The most popular network type is &lt;em&gt;Ethernet&lt;/em&gt;. &lt;em&gt;Ethernet network&lt;/em&gt; have speeds of 10 Mbps, 100 Mbps or 1 Gbps. The majority of networks today operates at 100 Mbps. An alternative to Ethernet network is &lt;em&gt;token-ring networks&lt;/em&gt;. Token-ring networks operates at 4 or 16 Mbps and are usually found in legacy system/networks. &lt;em&gt;Token-ring networks&lt;/em&gt; are rarely found in companies today because of their lack of speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.3 Key Terms
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;LAN:&lt;/strong&gt; It is a system of network computers and other hardware, such as printers, that are in relatively close proximity to one another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backbone:&lt;/strong&gt; It is a high-speed network that connects several LANs in a location, to provide services. Such as in a university campus several LANs are connected to provide electronic mail (e-mail) and Internet access service beyond the LAN environment.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MAN:&lt;/strong&gt; MANs are larger than LANs, but smaller than WANs. MANs are usually characterised by very high speed connections using fiber optical cables or other digital media. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;IEEE 802-2001 standard definition:&lt;/strong&gt;&lt;br&gt;
A MAN (metropolitan area network) &lt;em&gt;is optimized for a larger geographical area than is a LAN, ranging from several blocks of building to entire cities. MANs can also depend on communications channels of moderate-to-high data rates. A MAN might be owned and operated by a single organization, but it is usually used by many individuals and organizations. MANs might also be owned and operated as public utilities. They will often provide means for internetworking for local network. Metropolitan area networks can span up to 50 km, devices used ate modem and wire/cable.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WAN:&lt;/strong&gt; It is a geographically dispersed communications network, with many owners, linking computers for the purpose of communication with each other, such as a national network for airline reservations or railway reservation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Value-added Network (VAN):&lt;/strong&gt; It is a communication channel leased from a telephone company to offer customers with modern access to network services through a local or toll-free number. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wireless Network:&lt;/strong&gt; It is most commonly used to refer to a telecommunication network whose interconnections between nodes is implemented without the use of wires. Wireless telecommunications networks are generally implemented with some type of remote information transmission system that uses electromagnetic waves, such as radio waves.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  3. Network Architecture
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Network architecture&lt;/em&gt; can be described in two ways: &lt;em&gt;peer-to-peer&lt;/em&gt; and &lt;em&gt;client/server&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;3.1 peer-to-peer&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;A &lt;em&gt;peer-to-peer&lt;/em&gt; network is a grouping of personal computers such that all share information among each other. It usually comprise less than 10 computers. This type of network is for the users that requires very little computer service and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Issues&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;em&gt;peer-to-peer&lt;/em&gt; network, file storage is scattered among the computers and security is extremely low.&lt;/li&gt;
&lt;li&gt;Susceptible to hackers and other malicious users because there is no solid security policy enforced.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;3.2 client/server&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;A &lt;em&gt;client/server&lt;/em&gt; network is a network comprising several workstation and one or more servers. Client (user) log in the server and gain access to their files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage over &lt;em&gt;peer-to-peer&lt;/em&gt; network&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An administrator can control the privileges of each user.&lt;/li&gt;
&lt;li&gt;Files are stored centrally, simplifying data backup.&lt;/li&gt;
&lt;li&gt;Security policies are implemented that protects the users’ information.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  4. Network Topologies
&lt;/h1&gt;

&lt;p&gt;Topology refers to the shape of a network or the network’s layout. How different nodes in a network are connected to each other and how they communicate. Each topology is suited to specific tasks and has its own advantages and disadvantages. The choice of topology is dependent on:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;type and number of equipments being used.&lt;/li&gt;
&lt;li&gt;planned application and rate of data transfer.&lt;/li&gt;
&lt;li&gt;required response time.&lt;/li&gt;
&lt;li&gt;cost.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  4.1 Physical Topology Vs. Logical Topology
&lt;/h2&gt;

&lt;p&gt;Physical topology is the physical layout of devices on a network. The way that the workstations are connected to the network through the actucal cables that transmit data, that is , the physical structure fo the network, is called the physical topology. Every LAN has a topology, that is, the way that the devices on a network are arranged and how they communicate with each other.&lt;/p&gt;

&lt;p&gt;The logical topology, in contrast, is the way that the signals act on the network media, or the way that the data pass through the network from one device to the next without regard to the physical interconnection to the device. Logical topology is also called signal topology.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A network’s logical topology is not necessarily the same as its physical topology.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Logical topologies are bound to the network protocols that direct how the data move across a network. The ethernet protocol is a common logical bus topology protocol.&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4.2 Mesh Topology
&lt;/h2&gt;

&lt;p&gt;In this topology, the devices are connected with many redundant interconnections between the network nodes. In a true mesh topology, every node has a connection to every other node in the network.&lt;/p&gt;

&lt;p&gt;One of the problems with mesh topology is that its cabling expenses are high and it takes extra efforts to track down cable faults.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.3 Star Topology
&lt;/h2&gt;

&lt;p&gt;In this topology, all devices are connected to a central hub. Nodes communicate across the network by passing data through the hub.&lt;/p&gt;

&lt;p&gt;Advantages of star topology are: it becomes easy to add new workstations (nodes), it allows centralised control over the network and it allows centralised monitoring of the hub/network.&lt;/p&gt;

&lt;p&gt;Disadvantage: if the hub fails, it cripples all the workstations connected to that hub, bringing the network performance to zero, and hub are expensive network components. in terms of cost.&lt;/p&gt;

&lt;p&gt;In the connection with the start topology, the following important terms are used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hub: A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it it copied to the other ports so that all segments of the LAN can see all the packets.

&lt;ol&gt;
&lt;li&gt;Passive Hub: A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another.&lt;/li&gt;
&lt;li&gt;Intelligent Hub: Intelligent hubs includes additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Also called manageable hubs.&lt;/li&gt;
&lt;li&gt;Switching Hub: Switching hubs reads the destination address of each packet and the forwards the packet to the correct port.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;Port: An interface of the computer to which a device can be connected.&lt;/li&gt;

&lt;li&gt;Packet: A piece of message transmitted over a packet-switching network. One if the key features of a packet is that it contains the destination address in addition to the data.&lt;/li&gt;

&lt;li&gt;Packet Switching: Protocol in which message are divided into packets before they are sent. Each packet is then transmitted individually and can even follow different routes to its destination. Once all the packets forming a message arrive at the destination, they are recompiled into the original message.&lt;/li&gt;

&lt;li&gt;Switching Hub: A special type of hub that forwards packets to the appropriate port based on the packet’s address. &lt;/li&gt;

&lt;li&gt;Segment: A segment, in a LAN or other types of networks, is a section of a network that is bounded by bridges, routers or switches. Hubs and switches are used to connect each segment to the rest of the LAN.&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  4.4 Bus Topology
&lt;/h2&gt;

&lt;p&gt;In this topology, all devices are connected to a central cable, called the bus or backbone.&lt;/p&gt;

&lt;p&gt;In connection with the bus topology, the following important terms are used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bus: A collection of wires through which data are transmitted from one part of a computer to another.&lt;/li&gt;
&lt;li&gt;Backbone: Another term for bus, the main wire that connects nodes. The term is often used to describe the main network connection composing the Internet.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;In networking, a bus is a central cable that connects all devices on a LAN. It is also called the backbone.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4.5 Ring Topology
&lt;/h2&gt;

&lt;p&gt;In this topology, all devices are connected to one another in the shape of a closed loop, so that each device is connected directly to two other devices, one on either side of it.&lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cable failures affect limited users.&lt;/li&gt;
&lt;li&gt;Equal access is provided for all users.&lt;/li&gt;
&lt;li&gt;Each workstation has full access speed to the ring.&lt;/li&gt;
&lt;li&gt;Even when workstation numbers increase, performance diminishes only slightly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Wiring cost.&lt;/li&gt;
&lt;li&gt;Difficult connections.&lt;/li&gt;
&lt;li&gt;expensive adaptors cards need to be used.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  4.6 Tree Topology
&lt;/h2&gt;

&lt;p&gt;This is a hybrid topology. Groups of star-configured networks are connected to a linear bus backbone.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. The OSI Seven Layer Model
&lt;/h1&gt;

&lt;p&gt;The OSI is an International Organisation for Standardisation (ISO) standard for worldwide communications that defines a networking framework for implementing protocols in seven layers.&lt;/p&gt;

&lt;p&gt;The OSI reference model is a set of seven layers that defines the different stages that data must go through to travel from one device to another over a network. It is also referred as the OSI reference model or just the OSI model.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.1 Application Set
&lt;/h2&gt;

&lt;h3&gt;
  
  
  5.1.1 Layer 7 - Application
&lt;/h3&gt;

&lt;p&gt;This is the layer that actually interacts with the operating system (OS) or application whenever the user transfers files, reads messages or perform other network related activities. The application layer supports application and end-user processes. Everything at this layer is application specific. This layer provides application services for file transfers, e-mail and other network software services.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1.2 Layer 6 - Presentation
&lt;/h3&gt;

&lt;p&gt;It takes the data provided by the application layer and converts it into a standard formate that the other layers can understand. The presentation layer provides independence from differences in data presentation by translating from application to network formate and vice versa. &lt;/p&gt;

&lt;p&gt;The presentation layer works to transform data into the form that the application layer can accept. This layer formates and encrypt data to be sent across a network, providing freedom from compatibility problems. &lt;/p&gt;

&lt;p&gt;The presentation layer is sometimes called the syntax layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1.3 Layer 5 - Session
&lt;/h3&gt;

&lt;p&gt;This layer establishes, maintains and ends communication with the receiving device. It establishes, manages and terminates conversations, exchanges and dialogues between the applications at each end. It deals with session and connection coordination.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2 Transport Set
&lt;/h2&gt;

&lt;h3&gt;
  
  
  5.2.1 Layer 4 - Transport
&lt;/h3&gt;

&lt;p&gt;This layer maintains flow control of data and provides for error checking and recovery of data between the devices.&lt;/p&gt;

&lt;p&gt;Transport layer looks to see if data are coming from more then one application and integrates each application’s data into a single stream for the physical network. This layer provides transparent transfer of data between end systems, or hosts, and is responsible for end-to-end error recovery. It ensures complete data transfer.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2.2 Layer 3 - Network
&lt;/h3&gt;

&lt;p&gt;The format, in which the transmitted data will be sent to the recipient device, is determined in this layer. Logical protocols, routing and addressing are handled here. &lt;/p&gt;

&lt;p&gt;Network layer provides switching and routing technologies, creating logical paths, known as virtual circuits, for transmitting data from node to node. Routing and forwarding are functions of this layer, as well as addressing, inter-networking, error handling, congestion control and packet sequencing.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2.3 Layer 2 - Data
&lt;/h3&gt;

&lt;p&gt;In this layer, the appropriate physical protocol is assigned to the data. Also, the type of network and packet sequencing are defined. At this layer, data packets are encoded and decoded into bits. It furnishes transmission protocol knowledge and management and handles errors in the physical layer, flow control and frame synchronisation. &lt;/p&gt;

&lt;p&gt;In Institute of Electrical and Electronics Engineer (IEEE) 802 networks, the data link control (DLC) layer is divided into two sublayers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The media access control (MAC) layer&lt;/li&gt;
&lt;li&gt;logical link control (LLC) layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MAC is a hardware address that uniquely identifies each node of a network. The MAC layer interface directly with the network medium. Consequently, each different type of a network medium requires a different MAC layer. The MAC sublayer controls how a computer on the network gains access to the data and permission to transmit it.&lt;/p&gt;

&lt;p&gt;The LLC layer controls frame synchronisation, flow control and error checking.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2.4 Layer 1 - Physical
&lt;/h3&gt;

&lt;p&gt;This is the level of the actual hardware. It defines the physical characteristics of the network such as connections, voltage levels and timing. This layer conveys the bit stream electric impluse, light and radio signal through the network at the electric and mechanical levels. It provides the hardware means of sending and receiving data on a carrier, including defining cables, cards and physical aspects.&lt;/p&gt;

&lt;h1&gt;
  
  
  6. Network Components
&lt;/h1&gt;

&lt;p&gt;The network components can be both software and hardware elements. Some of the key hardware components of computer networks are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cables

&lt;ol&gt;
&lt;li&gt;Coaxial Cable

&lt;ol&gt;
&lt;li&gt;Thin Ethernet&lt;/li&gt;
&lt;li&gt;Thick Ethernet&lt;/li&gt;
&lt;li&gt;Twisted Pair&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;/li&gt;

&lt;li&gt;network adapter cards&lt;/li&gt;

&lt;li&gt;hubs and switching hubs&lt;/li&gt;

&lt;li&gt;routers&lt;/li&gt;

&lt;li&gt;gateways and bridges&lt;/li&gt;

&lt;li&gt;firewalls.&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  6.1 Network Cables
&lt;/h2&gt;

&lt;p&gt;There are two most popular types of network cabling:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;twisted pair (also known as 10BaseT)&lt;/li&gt;
&lt;li&gt;thin coax (also known as 10Base2)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;10BaseT was used with 10Mbps. 10BaseT cabling looks like an ordinary telephone wire, except that is has eight wires inside instead of four.&lt;/p&gt;

&lt;p&gt;Thin coax looks like the copper coaxial cabling that is often used to connect a videocassette recorder to a television set.&lt;/p&gt;

&lt;p&gt;10baseT or Cat5 cables are used for most home and small business networks. They are thin, easy to manipulate are easy to purchase as they come in custome lengths. The 10baseT/Cat5 cables have connectors that resemble a phone cord connector, only larger. These are called RJ-45 connectors. &lt;/p&gt;

&lt;h2&gt;
  
  
  6.2 Network Adapter Cards
&lt;/h2&gt;

&lt;p&gt;Network adapter cards (NIC: Network Interface Card) plays an important role in computer networks on which modern IS reside. A network computer is connected to the network cabling with an NIC.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.3 Hub and Switching Hub or the Switch
&lt;/h2&gt;

&lt;p&gt;A hub is the central connecting device in a network. It is a box that is used to gather groups of PCs together at a central location with 10BaseT cabling.&lt;/p&gt;

&lt;p&gt;For small networks (such as peer-to-peer network), it is possible to get by with a hub, some 10BaseT cables and a handful of network adapters. &lt;/p&gt;

&lt;p&gt;Larger network often use a thin coax ‘backbone’ that connects a row of 10BaseT hubs together. Each hub, in turn, may connect a handful of computers together using 10BaseT cabling, which allows you to build networks of tens, hundreds or thousands of computers.&lt;/p&gt;

&lt;p&gt;The switching hub, sometimes called a ‘switch’, is a more advanced unit over the basic hub. In a basic hub, all the computers connect to it and the speed of the Internet is defined by the slowest computer network card connected. &lt;/p&gt;

&lt;p&gt;Switching hub treats each network card independently. The switching hub allows all the faster connections to remain at a higher speed and still interacts with the slow system.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.4 Routers
&lt;/h2&gt;

&lt;p&gt;Network is a heterogeneous environments. In such environments, there is a need of connection device that would interconnect two different technologies. &lt;/p&gt;

&lt;p&gt;The router serves as a routing switchboard. It is a special computer that is dedicated to the task of interconnecting networks. It moves the information from its source to its destination regardless of the middleware.&lt;/p&gt;

&lt;p&gt;Routers connect two or more networks and forward data packets between them. When data arrive from one of the segments, the router decides, according to its routing table, to which segment to forward the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.5 Gateways and Bridges
&lt;/h2&gt;

&lt;p&gt;A gateway is a legacy term, that is, it is a term that was used in the earlier days of computer networking. It once used to refer to a routing device. Today, in the TCP/IP world, the term gateway now refers to special-purpose devices that performs protocol conversions. Gateways implement application layer conversions of information received from various protocols.&lt;/p&gt;

&lt;p&gt;A bridge is an electric device that connects and passes packets between two network segments. In general, a bridge will forward or discard an incoming frame based on the MAC address of that frame.&lt;/p&gt;

&lt;h2&gt;
  
  
  6.6 Firewalls
&lt;/h2&gt;

&lt;p&gt;A firewall is a system designed to prevent unauthorised access to or from a private network. Firewall can be implemented in both hardware or software, or a combination of both. They are frequently used to prevent unauthorised Internet users from accessing private networks connected to the Internet, especially intranets. All messages entering or leaving the intranet pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria.&lt;/p&gt;

&lt;p&gt;Types of firewall techniques:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Packet filter: This involves looking at each packet entering or leaving the network and accepts or rejects it on the basis of user defined rules.&lt;/li&gt;
&lt;li&gt;Application gateway: This applies security mechanisms to specific applications, such as file transfer protocol (FTP) and Telnet severs.&lt;/li&gt;
&lt;li&gt;Circuit-level gateway: In this, security mechanism are applied when a TCP or UDP connection is established. Once the connection has been made, packets can flow between the hosts without further checking.&lt;/li&gt;
&lt;li&gt;Proxy server: This is used to intercept all messages entering and leaving the network. The proxy server effectively hides the true network addresses.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  7. Network Protocols
&lt;/h1&gt;

&lt;p&gt;A network protocol is basically an agreed-upon format for transmitting data between two devices. It is a standard set of rules that determines how systems will communicate across network. Two different systems can communicate and understand each other only if they use the same protocol in spite of their differences.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.1 TCP/IP
&lt;/h2&gt;

&lt;p&gt;TCP is one of the main protocols in TCP/IP networks. Whereas the IP deals only with the packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent. IP specifies the format of packets, also called datagrams, and the addressing scheme. Most networks combines IP with a higher level protocol called TCP, which establishes a virtual connection between a destination and source.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.2 Link Protocol
&lt;/h2&gt;

&lt;p&gt;Link protocol plays a role at layer 2 of the OSI model (the data link layer). In communication, there is transmission of a unit of data from one node to another. It is responsible for ensuring that the bits received are the same as the bits sent. There are two categories of data transmission:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;synchronous&lt;/li&gt;
&lt;li&gt;asynchronous&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Asynchronous means not synchronised, that is, not occourring at perdetermined or regular intervals. The term ‘asynchronous’ is usually used to describe communication in which data can be transmitted intermittently rather than in a steady steam.&lt;/p&gt;

&lt;p&gt;The difficulty with asynchronous communication is that the receiver must have a way to distinguish between valid data and noise. In computer communications, this is usually accomplished through a special start bit and a stop bit at the beginning and end of each piece of data. For this reason, asynchronous communication is sometimes called start-stop communication.&lt;/p&gt;

&lt;p&gt;Synchronous communication occurs at regular intervals.&lt;/p&gt;

&lt;h2&gt;
  
  
  7.3 OSI Protocol
&lt;/h2&gt;

&lt;p&gt;OSI is an information exchange standard developed by the ISO in the early 1980s. The structure of the OSI in terms of its underlying protocols is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;physical layer&lt;/li&gt;
&lt;li&gt;datalink layer&lt;/li&gt;
&lt;li&gt;network layer&lt;/li&gt;
&lt;li&gt;transport layer&lt;/li&gt;
&lt;li&gt;session layer&lt;/li&gt;
&lt;li&gt;presentation layer&lt;/li&gt;
&lt;li&gt;application layer&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7.4 Routing Protocol
&lt;/h2&gt;

&lt;p&gt;Routing protocols allow different computer networks to communicate. Some commonly used routing protocols are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;router information protocol (RIP)&lt;/li&gt;
&lt;li&gt;open shortest path first (OSPF)&lt;/li&gt;
&lt;li&gt;interior gateway routing protocol (IGRP)&lt;/li&gt;
&lt;li&gt;enhanced IGRP (EIGRP)&lt;/li&gt;
&lt;li&gt;border gateway protocol (BGP)&lt;/li&gt;
&lt;li&gt;intermediate system to intermediate system (IS - IS)&lt;/li&gt;
&lt;li&gt; constrained shortest path first (CSPF)&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;IGRP and EIGRP are proprietary Cisco protocols, and are supported on Cisco routers or other vendors’ routers to which Cisco has licensed the technology.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7.5 Tunneling Protocol
&lt;/h2&gt;

&lt;p&gt;Tunneling is to do with VPN (Virtual Private Network). A tunneling protocol is a network protocol that encapsulates open protocol or session inside another. Protocol A is encapsulated within protocol B, such that A treats B as though it were a data link layer. Tunneling may be used to transport a network protocol through a network that would not otherwise support. &lt;/p&gt;

&lt;p&gt;Examples of Tunneling Protocols:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Datagram - based

&lt;ol&gt;
&lt;li&gt;layer 2 tunneling protocol (L2TP)&lt;/li&gt;
&lt;li&gt;multi-protocol label switching (MPLS)&lt;/li&gt;
&lt;li&gt;generic routing encapsulation (GRE)&lt;/li&gt;
&lt;li&gt;general packet radio service (GPRS) tunneling protocol (GTP)&lt;/li&gt;
&lt;li&gt;point-to-point tunneling protocol (PPTP)&lt;/li&gt;
&lt;li&gt;point-to-point protocol over Ethernet (PPPoE)&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;Stream-based

&lt;ol&gt;
&lt;li&gt;transport layer security (TLS)&lt;/li&gt;
&lt;li&gt;secure shell (SSH)&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h1&gt;
  
  
  8. Working of Network and the Internet
&lt;/h1&gt;

&lt;p&gt;No one really ‘owns’ the Internet! It is a global collection of networks, both big and small. Under the Internet scheme, networks all over the world connect together in many different ways to form the single entity that is known as the ‘Internet’.&lt;/p&gt;

&lt;p&gt;Typically, people connect to the Internet in two ways: while at work and while using the LAN connection through the ISP contract. The ISP may then connect to a larger network and become part of it. While at home or a remote location, most people typically connect to the Internet using the combination of modem and dial-up service. Either ways, when anyone connects to the Internet, his/her computer becomes a part of a network whose span is global.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POP (Point of Presence)&lt;/strong&gt;&lt;br&gt;
Most large corporations have their own dedicated backbones connecting various regions. In each region, the company has a point of presence (POP). The POP is a place for local users to access the company’s network, often through a local phone number or dedicated line.&lt;/p&gt;

&lt;h1&gt;
  
  
  9. Telecommunication Links and Other Important Related Topics
&lt;/h1&gt;

&lt;h2&gt;
  
  
  9.1 Circuit Switching and Packet Switching
&lt;/h2&gt;

&lt;p&gt;Circuit Switching is a type of communication in which a dedicated channel (or circuit) is established for the duration of a transmission. The most ubiquitous circuit-switching network is the telephone system, which links together wire segments to create a single unbroken line for each telephone call. This system is ideal for communications that requires data to be transmitted in real time. These networks are sometimes called connection oriented networks.&lt;/p&gt;

&lt;p&gt;Packet switching is a method in which messages are divided into packets and sends each packet individually. The Internet is based on a packet-switching protocol - the TCP/IP. Packet switching networks are more efficient if some amount of delay is acceptable. These networks are connectionless networks, a packet switching network can be made connection oriented by using a higher level protocol. Example: TCP, makes IP networks connection oriented.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.2 Host
&lt;/h2&gt;

&lt;p&gt;A host is a computer system that is accessed by a user working at a remote location. Typically, the term is used when there are two computer systems connected by modems and telephone lines.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.3 Dedicated Server
&lt;/h2&gt;

&lt;p&gt;Dedicated means being reserved for a specific use. A dedicated server is a single computer in a network reserved for serving the needs of the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.4 Workstation
&lt;/h2&gt;

&lt;p&gt;A ‘workstation’ is a type of computer used for engineering applications, desktop publishing, software development and other type of applications that require a moderate amount of computing power and relatively high-quality graphic capabilities. In the context of networking, workstation refers to any computer connected to a LAN. It could be workstation or a PC.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.5 Channel and Node
&lt;/h2&gt;

&lt;p&gt;A channel is a transmission path. A transmission channel is the path between two nodes of a network that a data communication follows. The term can refer to the physical cabling that connects the nodes on a network, the signal that is communicated over the pathway or a subchannel in a carrier frequency.&lt;/p&gt;

&lt;p&gt;A node is a processing location in a network. A node can be a computer or some other device, such as printer. Every node has a unique network address, called as MAC address.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.6 Contention
&lt;/h2&gt;

&lt;p&gt;In the context of computer networks, contention means competition for resources. The term is used especially in network to describe the situation where two or more nodes attempt to transmit a message across the same wire at the same time. A contention is also a type of network protocol that allows nodes to contend for network access. That is, two or more nodes may try to send message across the network simunltaneously. The contention protocol defines what happens when this occurs.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.7 CSMS/CD
&lt;/h2&gt;

&lt;p&gt;CSMA/CD is a set of rules determining how network devices respond when two devices attempts to use a data channel simultaneously (called a ‘collision’).&lt;/p&gt;

&lt;h2&gt;
  
  
  9.8 Twisted-Pair Cable
&lt;/h2&gt;

&lt;p&gt;This is a type of cable that consists of two independently insulated wires twisted around one another.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.9 Coaxial Cable
&lt;/h2&gt;

&lt;p&gt;A coaxial cable is a type of wire that consists of a centre wire surrounded by insulation and the a grounded shield of braided wire.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.10 Fiber Optics
&lt;/h2&gt;

&lt;p&gt;Fibre optics is a technology that uses glass (or plastic) threads (fibers) to transmit data. A fiber optic cable consists of a bundle of glass threads, each or which is capable of transmitting messages modulated onto light waves.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.11 Token, Token Passing and Token-Ring Network
&lt;/h2&gt;

&lt;p&gt;In the networking context, a token is a special series of bits that travels around a token ring network. As the token circulates, computers attached to the network can capture it. The token acts like a ticket, enabling its owner to send a message across the network. There is only one token for each network, so there is no possibility that two computers will attempt to transmit message at the same time.&lt;/p&gt;

&lt;p&gt;Token passing uses a token, or series of bits, to grant a device permission to transmit over the network. Whichever device has the token, can put data into the network. When its transmission is complete, the device passes the token along to the next device in the topology.&lt;/p&gt;

&lt;p&gt;A token ring network is a type of computer network in which all the computers are arranged in a circle. A token, which is a special bit pattern, travels around the circle. To send a message, a computer catches the token, attaches a message to it and then lets it continue to travel around the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.12 IEEE 802.5 Token Ring
&lt;/h2&gt;

&lt;p&gt;A short message (called a token) is circulated around the ring, passed from station to station. A station that wants to transmit waits for the token to arrive.&lt;/p&gt;

&lt;p&gt;When the token arrives, the station change it from a token to a connector message and appends its message. This new message is then placed on the outgoing side of the ring. Each station passes on received tokens if they have nothing to transmit.&lt;/p&gt;

&lt;p&gt;The workstations monitor connector messages to see if the message is addressed to them. If connector message are addressed to them, they copy the message, modify it to signify its receipt and then send it on around the ring. Connector messages that are not addressed to them are passed directly on to the next station in the ring. When the connector message travels full circle and arrives at the original sending station, it checks the message to see if it has been received. It then discards the message and replace it with a token.&lt;/p&gt;

&lt;h2&gt;
  
  
  9.13 CAM and Polling Mechanisms
&lt;/h2&gt;

&lt;p&gt;CAM is short for channel access method, a protocol for how data are transmitted in the bottom two layers of the OSI mode (the physical and the data link layer). Polling, contention and token passing are three examples of CAMs.&lt;/p&gt;

&lt;p&gt;Polling is CAM. In a master-slave scenario, the master queries each slave device in turns as to whether it has any data to transmit. If the slave answers yes, then the device is permitted to transmit its data. If the slave answers no, then the master moves on and polls the next slave device. This process is repeated continuously.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Django deployment on AWS</title>
      <dc:creator>Devashish Roy</dc:creator>
      <pubDate>Sat, 20 Sep 2025 13:31:25 +0000</pubDate>
      <link>https://forem.com/roydevashish/django-deployment-on-aws-1o2b</link>
      <guid>https://forem.com/roydevashish/django-deployment-on-aws-1o2b</guid>
      <description>&lt;p&gt;Today we are going to deploy our Django project in AWS. Our Django project’s code are stored in the GitHub repository, and we have an EC2 instance created and running with ubuntu 18.04 LTS operating system in AWS. We are going to see the steps to deploy our Django project from GitHub to AWS EC2 instance.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Prerequisite&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Before going to the steps and setting up our server, we have a checklist, go through it and make sure it’s done before going through the steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Django Project&lt;/p&gt;

&lt;p&gt;You must have a Django project which is completed or it runs without any error, and the Django project must stored inside the django_deployment directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;GitHub repository&lt;/p&gt;

&lt;p&gt;After having the Django project you must push all the codes into the GitHub repository.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;AWS (Amazon Web Services) &lt;/p&gt;

&lt;p&gt;You will need a free or paid AWS account with an EC2 instance created and running with ubuntu 18.04 LTS and also it should accept all the public request from http and https method.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Setup our EC2 instance
&lt;/h1&gt;

&lt;p&gt;⚠️ Note: For my convenience I am renaming EC2 instance to cloud computer. From now on whenever their is cloud computer it means EC2 instance.&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%2Fimages.unsplash.com%2Fphoto-1496181133206-80ce9b88a853%3Fixlib%3Drb-1.2.1%26q%3D80%26cs%3Dtinysrgb%26fm%3Djpg%26crop%3Dentropy" 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%2Fimages.unsplash.com%2Fphoto-1496181133206-80ce9b88a853%3Fixlib%3Drb-1.2.1%26q%3D80%26cs%3Dtinysrgb%26fm%3Djpg%26crop%3Dentropy" width="760" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Till now we have created our cloud computer and it’s running ubuntu 18.04 LST operating system. Now our task is to download and configure the software package to run our Django project. To run our Django application we need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;python3-dev&lt;/li&gt;
&lt;li&gt;python3-venv&lt;/li&gt;
&lt;li&gt;python-pip&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;git&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let’s install all the required software dependencies for our project. Before doing so we are going to update our system for the latest software packages.&lt;/p&gt;

&lt;p&gt;Run these two commands to update and upgrade all the software packages installed in the system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get update
apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using these two commands we have completed our system update.&lt;/p&gt;

&lt;p&gt;Now we are going to install all the software packages we need for our Django project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; python3-dev python3-venv sqlite python-pip git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using the above command we have installed the required software packages.&lt;/p&gt;

&lt;p&gt;At this point we have done our cloud computer setup.&lt;/p&gt;

&lt;p&gt;Next we are going to setup our Django project in the cloud computer.&lt;/p&gt;

&lt;h1&gt;
  
  
  Django project setup
&lt;/h1&gt;

&lt;p&gt;We are going to save all of our work in the /usr/local/workspace directory. So from now on whenever I use WORKSPACE directory it means /usr/local/workspace directory.&lt;/p&gt;

&lt;p&gt;First we are going to create an apps directory inside our WORKSPACE directory. In this directory we are going to store our all projects.&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; /usr/local/workspace/apps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are going to clone our Django project from GitHub.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/&amp;lt;username&amp;gt;/github_repo.git /usr/local/workspace/apps/django_deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the above git command we have cloned our Django project from GitHub to our cloud computer and it is stored inside the WORKSPACE/apps/django_deployment directory.&lt;/p&gt;

&lt;p&gt;Now we going to create and env directory inside our WORKSPACE directory. Inside this directory we are going to store virtual environments for our projects.&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; /usr/local/workspace/env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let’s create a virtual environment for our Django project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv /usr/local/workspace/env/django_deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the virtual environment we need to install the requirements of our Django project, all the requirements of our Django project are stored in the requirements.txt file inside the project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/usr/local/workspace/env/django_deployment/bin/pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; /usr/local/workspace/apps/django_deployment/requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will install all the requirements of our Django project inside the virtual environment.&lt;/p&gt;

&lt;p&gt;Now we are going to run migrations and create static files for our Django project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py makemigrations
/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py migrate
/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py collectstatic &lt;span class="nt"&gt;--noinput&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point we are done with the Django project setup.&lt;/p&gt;

&lt;p&gt;Next is to install and configure our supervisor and nginx server so that we can accept and process requests and give them responses.&lt;/p&gt;

&lt;h1&gt;
  
  
  Server setup
&lt;/h1&gt;

&lt;p&gt;We need supervisor and nginx, two software packages, supervisor to run our Django project’s python files and nginx to serve Django project’s static files.&lt;/p&gt;

&lt;p&gt;Let’s first install both the software packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; supervisor nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure supervisor
&lt;/h2&gt;

&lt;p&gt;supervisor uses configuration files to manage processes. All the configuration files of supervisor is stored inside /etc/supervisor/conf.d&lt;/p&gt;

&lt;p&gt;Create a configuration file for supervisor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano /etc/supervisor/conf.d/django_deployment.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will open a code editor inside the terminal. We need to write our configuration inside this. The configuration file includes 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="o"&gt;[&lt;/span&gt;program:django_deployment]
environment &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nv"&gt;DEBUG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
&lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; /usr/local/workspace/env/django_deployment/bin/uwsgi &lt;span class="nt"&gt;--http-socket&lt;/span&gt; :9000 &lt;span class="nt"&gt;--wsgi-file&lt;/span&gt; /usr/local/workspace/apps/django_deployment/django_server/wsgi.py
directory &lt;span class="o"&gt;=&lt;/span&gt; /usr/local/workspace/apps/django_deployment
user &lt;span class="o"&gt;=&lt;/span&gt; root
autostart &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true
&lt;/span&gt;autorestart &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true
&lt;/span&gt;stdout_logfile &lt;span class="o"&gt;=&lt;/span&gt; /var/log/supervisor/django_deployment.log
stderr_logfile &lt;span class="o"&gt;=&lt;/span&gt; /var/log/supervisor/django_deployment_err.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press CTRL + X, it will prompt yes or no to save it, press y and then enter to confirm and after that it will ask for the file name which we have already provided at the time of nano command as django_deployment.conf, so press enter. It will save and exit the code editor.&lt;/p&gt;

&lt;p&gt;This will create  a program / process named django_deployment and it will run our Django project using &lt;a href="http://wsgi.py" rel="noopener noreferrer"&gt;wsgi.py&lt;/a&gt; file.&lt;/p&gt;

&lt;p&gt;Now need to update our process list and restart the processes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;supervisorctl reread
supervisorctl update
supervisorctl restart django_deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This three commands will update the process list and restart our django_deployment process. To check the status of the processes you can use status option with supervisorctl command, this will list all the processes with their current status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;supervisorctl status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are done with the supervisor configuration.&lt;/p&gt;

&lt;p&gt;Next we are going to configure nginx so that we can serve the static files of our Django project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure nginx
&lt;/h2&gt;

&lt;p&gt;nginx also uses configuration files to manage the server configurations. All the configuration files of nginx is stored inside /etc/nginx directory and the sites available to serve, their configurations are stored inside the /etc/nginx/sites-available directory.&lt;/p&gt;

&lt;p&gt;For our Django project we are going to create a configuration file for nginx to serve the static files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano /etc/nginx/sites-available/django_deployment.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will open a code editor inside the terminal. We need to write our configuration inside this. The configuration file includes this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server &lt;span class="o"&gt;{&lt;/span&gt;
    listen 80 default_server&lt;span class="p"&gt;;&lt;/span&gt;

    location /static &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;alias&lt;/span&gt; /usr/local/workspace/apps/django_deployment/static&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    location / &lt;span class="o"&gt;{&lt;/span&gt;
        proxy_pass        http://127.0.0.1:9000/&lt;span class="p"&gt;;&lt;/span&gt;
        proxy_set_header  Host                &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        proxy_set_header  X-Real-IP           &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        proxy_set_header  X-Forwarded-For     &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        proxy_set_header  X-Forwarded-Proto   &lt;span class="nv"&gt;$scheme&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        proxy_redirect    off&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press CTRL + X, it will prompt yes or no to save it, press y and then enter to confirm and after that it will ask for the file name which we have already provided at the time of nano command as django_deployment.conf, so press enter. It will save and exit the code editor.&lt;/p&gt;

&lt;p&gt;This will create the configuration file for nginx to server our static files which will create and stored inside the /usr/local/workspace/apps/django_deployment/static directory&lt;/p&gt;

&lt;p&gt;Now we need to remove a file /etc/nginx/sites-enabled/default and in place of this file we need to create a link from a file to the configuration file /etc/nginx/sites-available/django_deployment.conf&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;rm&lt;/span&gt; /etc/nginx/sites-enabled/default
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/django_deployment.conf /etc/nginx/sites-enabled/django_deployment.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need to restart the server so that the updated configuration comes in action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl restart nginx.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are done with the nginx configuration.&lt;/p&gt;

&lt;p&gt;So, till at this point we can see our Django project running and live on internet, and we can check it in the web browser.&lt;/p&gt;

&lt;h1&gt;
  
  
  Update changes
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Update local computer and push to GitHub
&lt;/h2&gt;

&lt;p&gt;First we are going to change and update our files inside the local machine, and then we will commit these changes and push it to the GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pull the updated file from GitHub to cloud computer
&lt;/h2&gt;

&lt;p&gt;Now we will pull the updated files from GitHub.&lt;/p&gt;

&lt;p&gt;To pull the file change directory to the project directory&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;cd&lt;/span&gt; /usr/local/workspace/apps/django_deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run the pull request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now git will pull all the updated files for you and update your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Effect the changes
&lt;/h2&gt;

&lt;p&gt;Now we are going to run migrations and create static files for our Django project.&lt;/p&gt;

&lt;p&gt;Note: Go through these steps if you have done changes in the database and static files. And if you are in doubt just go through these, if their will be any changes they will take care of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py makemigrations
/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py migrate
/usr/local/workspace/env/django_deployment/bin/python /usr/local/workspace/apps/django_deployment/manage.py collectstatic &lt;span class="nt"&gt;--noinput&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Restart the supervisor process
&lt;/h2&gt;

&lt;p&gt;Now restart the supervisor process to effect the changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;supervisorctl restart django_deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Time to check our live site
&lt;/h1&gt;

&lt;p&gt;Now it’s time to hit the web browser with the URL. After going to the URL you can see your live Django project direct from your cloud computer.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>django</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
