<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayush Dutta</title>
    <description>The latest articles on DEV Community by Ayush Dutta (@spirizeon).</description>
    <link>https://dev.to/spirizeon</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%2F2171713%2F3a77166f-64a8-44f4-b9ed-34af7ff07c61.jpeg</url>
      <title>DEV Community: Ayush Dutta</title>
      <link>https://dev.to/spirizeon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spirizeon"/>
    <language>en</language>
    <item>
      <title>Web-Apps: Networks-based deep dive</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Fri, 18 Oct 2024 06:25:49 +0000</pubDate>
      <link>https://dev.to/spirizeon/web-apps-networks-based-deep-dive-p8b</link>
      <guid>https://dev.to/spirizeon/web-apps-networks-based-deep-dive-p8b</guid>
      <description>&lt;h2&gt;
  
  
  What's HTTP?
&lt;/h2&gt;

&lt;p&gt;HTTP (Hypertext Transfer Protocol) is designed to interconnect nodes containing hypertext, which are documents that can embed text and multimedia. The global interconnection of these nodes forms the internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building an Alternative to HTTP
&lt;/h2&gt;

&lt;p&gt;HTTP has been the backbone of web communication for decades. However, evolving web technologies demand innovation. Let's explore the key components of HTTP and consider possible alternatives.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding HTTP and Hypertext
&lt;/h3&gt;

&lt;p&gt;Hypertext is the foundation of the World Wide Web. Browsers interpret it using HTML (Hypertext Markup Language). When a browser requests a webpage, it sends an HTTP request to a web server, which responds with an HTML document and other resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client-Server Architecture
&lt;/h3&gt;

&lt;p&gt;HTTP uses a client-server model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;client&lt;/strong&gt; (typically a browser) sends requests for resources.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;server&lt;/strong&gt; processes requests and sends back responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rethinking Client-Server Architecture
&lt;/h3&gt;

&lt;p&gt;Alternatives to HTTP could focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Persistent Connections&lt;/strong&gt;: Keeping connections open for faster communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming Data&lt;/strong&gt;: Supporting continuous, real-time data streaming.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bidirectional Communication&lt;/strong&gt;: Allowing real-time, two-way messaging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security in Web Protocols
&lt;/h3&gt;

&lt;p&gt;HTTPS (Hypertext Transfer Protocol Secure) encrypts data transfers between client and server. It uses TLS (Transport Layer Security) to ensure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Integrity&lt;/strong&gt;: Preventing data alteration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidentiality&lt;/strong&gt;: Encrypting data for intended recipients only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt;: Verifying identities to prevent impersonation attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're absolutely right, and I apologize for that oversight. Let me add a section on APIs and the request-response model:&lt;/p&gt;

&lt;h2&gt;
  
  
  APIs and the Request-Response Model
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Are APIs?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Application Programming Interfaces (APIs)&lt;/strong&gt; are crucial in modern web applications. They define rules for how different software systems communicate, enabling seamless integration between various applications and services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Aspects of APIs:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Standardization&lt;/strong&gt;: APIs standardize communication between different applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Functionality&lt;/strong&gt;: They allow retrieval of data, execution of operations, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versatility&lt;/strong&gt;: APIs power web applications, mobile apps, IoT devices, and more.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Request-Response Model
&lt;/h3&gt;

&lt;p&gt;Most APIs, including those based on HTTP, use the client-server request-response model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Request&lt;/strong&gt;: The client sends a request to the server for a specific resource or action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing&lt;/strong&gt;: The server processes the request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response&lt;/strong&gt;: The server sends back a response, which may include data, status information, or both.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example of API Request-Response:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request:
GET /api/users/123 HTTP/1.1
Host: api.example.com

Response:
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  HTTP Methods Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  GET
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/api/users/123&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used to retrieve resources&lt;/li&gt;
&lt;li&gt;Should not modify server state&lt;/li&gt;
&lt;li&gt;Data is sent in query parameters&lt;/li&gt;
&lt;li&gt;Idempotent and cacheable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  POST
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;POST&lt;/span&gt; &lt;span class="nn"&gt;/api/users&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/json&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used to create new resources&lt;/li&gt;
&lt;li&gt;Can modify server state&lt;/li&gt;
&lt;li&gt;Data is sent in the request body&lt;/li&gt;
&lt;li&gt;Not idempotent, but can be made cacheable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PUT
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;PUT&lt;/span&gt; &lt;span class="nn"&gt;/api/users/123&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/json&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John Smith"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john.smith@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used to update existing resources&lt;/li&gt;
&lt;li&gt;Replaces the entire resource&lt;/li&gt;
&lt;li&gt;Idempotent but not cacheable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PATCH
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;PATCH&lt;/span&gt; &lt;span class="nn"&gt;/api/users/123&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/json&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john.smith@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used for partial updates to resources&lt;/li&gt;
&lt;li&gt;Only specified fields are updated&lt;/li&gt;
&lt;li&gt;Not guaranteed to be idempotent&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DELETE
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;DELETE&lt;/span&gt; &lt;span class="nn"&gt;/api/users/123&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Used to delete resources&lt;/li&gt;
&lt;li&gt;Idempotent but not cacheable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These methods form the core of RESTful API design, each serving a specific purpose in resource manipulation. The choice of method depends on the operation you want to perform on the resource.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common API Architectures:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;RESTful APIs&lt;/strong&gt;: Use HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GraphQL&lt;/strong&gt;: Allows clients to request specific data structures, reducing over-fetching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebSocket APIs&lt;/strong&gt;: Enable real-time, bidirectional communication.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Understanding DNS and Domain Names
&lt;/h2&gt;

&lt;p&gt;The Domain Name System (DNS) translates human-readable domain names into IP addresses. This process involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Browser cache check&lt;/li&gt;
&lt;li&gt;Query to DNS resolver&lt;/li&gt;
&lt;li&gt;Resolver queries DNS servers&lt;/li&gt;
&lt;li&gt;Resolution returns the response&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Domain Name Hierarchy
&lt;/h3&gt;

&lt;p&gt;Domain names have a hierarchical structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Top-Level Domain (TLD): e.g., .com, .org&lt;/li&gt;
&lt;li&gt;Second-Level Domain (2LD): e.g., example in example.com&lt;/li&gt;
&lt;li&gt;Third-Level Domain (3LD) or Subdomain: e.g., www in &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DNS Resolution Process
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;User enters URL&lt;/li&gt;
&lt;li&gt;Local cache lookup&lt;/li&gt;
&lt;li&gt;Query sent to DNS resolver&lt;/li&gt;
&lt;li&gt;Root DNS server queried&lt;/li&gt;
&lt;li&gt;TLD DNS server queried&lt;/li&gt;
&lt;li&gt;Authoritative DNS server queried&lt;/li&gt;
&lt;li&gt;IP address returned to browser&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Ports in System Processes
&lt;/h2&gt;

&lt;p&gt;Ports are logical constructs that identify specific processes or services in network communication. They allow computers to direct network traffic to the correct applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Ports
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Well-Known Ports (0-1023)&lt;/strong&gt;: Used by system processes and main network services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registered Ports (1024-49151)&lt;/strong&gt;: Used by applications not part of core services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic or Private Ports (49152-65535)&lt;/strong&gt;: Used for temporary connections.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Security Concerns for Ports
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Close unused ports&lt;/li&gt;
&lt;li&gt;Use firewalls to control port access&lt;/li&gt;
&lt;li&gt;Conduct regular port scans&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cloud Machines
&lt;/h2&gt;

&lt;p&gt;Cloud machines are virtual computing instances provided by cloud service providers like AWS, Google Cloud, or Azure. They offer scalability, on-demand availability, and remote access.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Cloud Machines
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Pay-as-you-go pricing&lt;/li&gt;
&lt;li&gt;OS flexibility&lt;/li&gt;
&lt;li&gt;Managed infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Containers
&lt;/h2&gt;

&lt;p&gt;Containers are lightweight, portable units that package an application and its dependencies. They share the host OS kernel, making them more resource-efficient than VMs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of Containers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lightweight&lt;/li&gt;
&lt;li&gt;Portable&lt;/li&gt;
&lt;li&gt;Fast deployment&lt;/li&gt;
&lt;li&gt;Consistent environments&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Containers vs. Virtual Machines (VMs)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Containers&lt;/th&gt;
&lt;th&gt;Virtual Machines&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Architecture&lt;/td&gt;
&lt;td&gt;Share host OS kernel&lt;/td&gt;
&lt;td&gt;Each has its own OS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Startup Time&lt;/td&gt;
&lt;td&gt;Fast (seconds)&lt;/td&gt;
&lt;td&gt;Slow (minutes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resource Usage&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Isolation&lt;/td&gt;
&lt;td&gt;Process-level&lt;/td&gt;
&lt;td&gt;Full OS-level&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Portability&lt;/td&gt;
&lt;td&gt;Highly portable&lt;/td&gt;
&lt;td&gt;Less portable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Deploying a Web App to AWS EC2 and Mapping a Domain
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create an AWS EC2 Instance
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Log in to AWS Management Console&lt;/li&gt;
&lt;li&gt;Launch a new EC2 instance:

&lt;ul&gt;
&lt;li&gt;Choose an AMI and instance type&lt;/li&gt;
&lt;li&gt;Configure security group (allow HTTP, SSH, and your app's port)&lt;/li&gt;
&lt;li&gt;Launch and download SSH key&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 2: Deploy the Web Application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;SSH into your EC2 instance&lt;/li&gt;
&lt;li&gt;Install required software&lt;/li&gt;
&lt;li&gt;Upload your web app&lt;/li&gt;
&lt;li&gt;Run your application&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Set Up a Domain Name and Map it to EC2 IP
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Buy a domain name&lt;/li&gt;
&lt;li&gt;Create an A record pointing to your EC2 instance's public IP&lt;/li&gt;
&lt;li&gt;Set TTL to a low value (e.g., 300 seconds)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Access the Web App via the Domain
&lt;/h3&gt;

&lt;p&gt;Wait for DNS propagation, then access your app using the domain name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Share the Website Link
&lt;/h3&gt;

&lt;p&gt;Once everything is set up, share your website link (e.g., &lt;code&gt;https://www.example.com&lt;/code&gt;).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🤖 Virtual Machines and Containers</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Sun, 13 Oct 2024 19:50:24 +0000</pubDate>
      <link>https://dev.to/spirizeon/virtual-machines-and-containers-3h47</link>
      <guid>https://dev.to/spirizeon/virtual-machines-and-containers-3h47</guid>
      <description>&lt;p&gt;One of the most essential and important concerning isolated environments and modern cloud architecture in data centers. Virtual Machines and Containers provide a replication development/deployment environment for software. Despite both existing as an abstraction layer above the host system, they differ conceptually when concerning factors like their architecture, speed and resource footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual Machines
&lt;/h3&gt;

&lt;p&gt;Virtual Machines are specialized environments that emulate a computer operating system. They can be further specialized to deploy particular software. Let's think of running an OS like Linux, but over the host system running Windows. Here, Linux will be treated as a "Guest OS" and will be running atop Windows as an Application.&lt;/p&gt;

&lt;p&gt;Virtual machines are governed by a type of software called a "Hypervisor", these can control their deployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.data-storage.uk%2Fwp-content%2Fuploads%2F2022%2F03%2Fhypervisor.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.data-storage.uk%2Fwp-content%2Fuploads%2F2022%2F03%2Fhypervisor.jpg" alt="Understanding a hypervisor the simple way - Data Storage Solutions" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hypervisors also enable us to distribute hardware resources among virtual machines according to preference. If we have a 128GB RAM server and a lot of clients that want to access it, we would split the hardware resource among several virtual machines, so that each client gets their own isolated space and OS to run with a particular quantity of machine resources (like CPU and memory) allotted to them.&lt;/p&gt;

&lt;h3&gt;
  
  
  What can be improved
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxra846tx0fes47l3ti3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxra846tx0fes47l3ti3p.png" alt="What Is an OS Kernel? | Baeldung on Computer Science" width="480" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An Operating system in general consists of two stacked layers over the hardware.&lt;/p&gt;

&lt;p&gt;Going from top to bottom, we first encounter the OS Applications layer, which consists of all the software run on the machine.&lt;/p&gt;

&lt;p&gt;Secondly, we get the OS kernel, the layer that deals with communication with hardware resources, and acts as a bridge between the hardware and the OS Applications layer.&lt;/p&gt;

&lt;p&gt;A virtual machine emulates both the OS kernel and the applications layer stacked in the mentioned order. This results in excessive use of resources, however there is a solution to this. We can use the host's kernel instead of having multiple kernels run altogether.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enter: Containers
&lt;/h3&gt;

&lt;p&gt;With the added advantage of using the host's kernel, Containers save on resources and boost up speed. Docker is used specifically because it's one of the most popular tools and also the one that revolutionized this category, also its registry, Docker-Hub is one of the largest repositories for pulling dependencies for your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.contentstack.io%2Fv3%2Fassets%2Fblt300387d93dabf50e%2Fbltb6200bc085503718%2F5e1f209a63d1b6503160c6d5%2Fcontainers-vs-virtual-machines.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.contentstack.io%2Fv3%2Fassets%2Fblt300387d93dabf50e%2Fbltb6200bc085503718%2F5e1f209a63d1b6503160c6d5%2Fcontainers-vs-virtual-machines.jpg" alt="Docker vs Virtual Machines (VMs) : A Practical Guide to Docker Containers  and VMs" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have a container engine that manages these containers or isolated environments, Just like a hypervisor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spinning up a new container
&lt;/h2&gt;

&lt;p&gt;Docker can be installed through the official set of instructions on their &lt;a href="https://docs.docker.com/engine/install/" rel="noopener noreferrer"&gt;site&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It uses the Docker engine which the docker daemon responsible for all processes concerning it.&lt;/p&gt;

&lt;p&gt;There are two options, one is to either pull an existing container through Docker's registry called &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;. Secondly is to build custom images to suit our project's needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using existing images
&lt;/h3&gt;

&lt;p&gt;To clone a docker container off Docker Hub,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker pull &amp;lt;image_name&amp;gt;:&amp;lt;version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can then start this container by getting the image ID through the &lt;code&gt;docker images&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker start &amp;lt;image_ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Building a custom image
&lt;/h3&gt;

&lt;p&gt;In order to build a custom image, a blueprint file called a &lt;code&gt;Dockerfile&lt;/code&gt; needs to be added to the project directory. This will contain all the configuration code, regarding what dependency versions and base image (which is the OS image that will be emulated) will be included in the container.&lt;/p&gt;

&lt;p&gt;A typical &lt;code&gt;Dockerfile&lt;/code&gt; would look somewhat similar to the one below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; &amp;lt;primary_service&amp;gt;:&amp;lt;base_image&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; &amp;lt;source code directory&amp;gt; /app/&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; &amp;lt;the working directory&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&amp;lt;any terminal commands&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that the blueprint is made, time to build and deploy a docker container with the following configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker build &amp;lt;location_to_save_container&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This builds the docker container following the blueprint, now this can be uploaded to Docker Hub or any repository to ship it to other environments and servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 2 Extra: Docker Vs. Podman
&lt;/h3&gt;

&lt;p&gt;Podman is a popular alternative to Docker and possibly is aiming to succeed it. It has now been adopted to be used in container orchestration tools like Kubernetes.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Advantage
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Podman optionally requires root/admin privileges to build/run containers. Which makes it safer for the deployment system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unlike Docker which uses a daemon (background service) that constantly listens for new requests using the client-server architecture. Podman's philosophy has a daemon-less architecture and hence saves up on system resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mostly all docker commands work with Podman with the replacement of the word "docker" with "podman" (at least as far as the CLI is concerned).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Podman isn't a monolithic piece of software unlike Docker. It depends on software like systemd. Hence it is more lightweight.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, Podman is overall a safer alternative than Docker.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some Extra Reads:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.imaginarycloud.com/blog/podman-vs-docker/" rel="noopener noreferrer"&gt;https://www.imaginarycloud.com/blog/podman-vs-docker/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://berzi.hashnode.dev/containers-and-virtualization-with-docker" rel="noopener noreferrer"&gt;https://berzi.hashnode.dev/containers-and-virtualization-with-docke&lt;/a&gt;r&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.podman.io/en/latest/" rel="noopener noreferrer"&gt;https://docs.podman.io/en/latest/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.vmware.com/in/topics/glossary/content/virtual-machine.html" rel="noopener noreferrer"&gt;https://www.vmware.com/in/topics/glossary/content/virtual-machine.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>❄️ NixOS: OS as Code</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Sun, 13 Oct 2024 19:49:46 +0000</pubDate>
      <link>https://dev.to/spirizeon/nixos-os-as-code-2h6d</link>
      <guid>https://dev.to/spirizeon/nixos-os-as-code-2h6d</guid>
      <description>&lt;p&gt;There are many Linux-based distributions out there, some are flashy, some are minimal, some are bloated (i guess we all hate those ones, lol). Then we have NixOS, a very fundamentally different Linux distro from all its other relatives. It can be summarized in three words: declarative, reproducible, and immutable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Declarative
&lt;/h2&gt;

&lt;p&gt;Let's start with the first attribute, NixOS's declarative configuration makes it easy to write configurations for the various components in our operating system in an easy-to-understand language called "Nix". Nix is very similar to JSON syntax wise.&lt;br&gt;
For declaring NixOS config, we write a file called configuration.nix which is stored in /etc/nixos/&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix

    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "endernix"; # Define your hostname...
  # Enable networking
  networking.networkmanager.enable = true;

  # Enable docker
  virtualisation.docker.enable = true;

  # Enable bluetooth
  hardware.bluetooth.enable = true;
  hardware.bluetooth.powerOnBoot = true;
...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The comments above each line or chunk of code describe their functionality. For example, the Bluetooth chunk describes that when re-building the system again, it needs to enable and start the bluetooth service on boot. We'll get into rebuilds later on, but how do we install packages? Easy. we declare it in the same file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ ...
users.users.ifkash = {
    isNormalUser = true;
    description = "Kashif";
    extraGroups = [ "networkmanager" "wheel" "docker" ];
    packages = with pkgs; [
      # Browsers
      brave
      firefox
      google-chrome
      # Fetch tools
      neofetch
      sysfetch
      nitch
    ];
};

...
}

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

&lt;/div&gt;



&lt;p&gt;Now these blocks can be placed anywhere in the file, because Nix is a purely functional programming language, which in layman's terms mean that positions of definitions does not matter sequentially.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducibility
&lt;/h2&gt;

&lt;p&gt;Once our system's file has been configured, it's time to build/modify our system. Running sudo nixos-rebuild switch will read the entire configuration file and build a new Nix system accordingly. Now comes the question, would it take nearly double the size of the previous version if i simply include small packages in the new rebuild? The answer is No.&lt;br&gt;
/nix/store&lt;/p&gt;

&lt;p&gt;Nix store is a location where Nix system stores all the names of the packages in the form of files with their dependency list hashed and attached to the file name. This way, whenever the system is rebuilt, if it is available in nix store, it is simply ignored. If not, a new file is created in nix store and added with appropriate rules.&lt;/p&gt;

&lt;p&gt;We can also go back to our previous build with `nixos-rebuild --rollback switch&lt;br&gt;
Rollbacks - Never break your system again&lt;/p&gt;

&lt;p&gt;Hence, incase our new system breaks for some reason, we can always switch back to the previous version and get our work done. This feature gives it the deadly advantage against distros like Arch Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Immutability
&lt;/h2&gt;

&lt;p&gt;Since the system is defined declaratively, it's not possible to modify the system's existing state (like updating/upgrading packages, etc) This is not a bug, but a feature. It enables further safety against breaking our systems. This also means we cannot install additional things into the system in the current rebuild. It also makes the system more secure against attacks that intend to change ownership permissions or corrupt the boot files of the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Nix package manager
&lt;/h3&gt;

&lt;p&gt;The Nix package manager fetches from the Nix package repository, one of the largest repos among all operating systems, it even beats Arch's user repository well known for its enormous package support. Hence, Nix boasts better software support than most operating systems on the planet.&lt;/p&gt;

&lt;p&gt;You can search your favorite packages here: &lt;a href="https://search.nixos.org/packages" rel="noopener noreferrer"&gt;https://search.nixos.org/packages&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why use NixOS as a daily driver?
&lt;/h3&gt;

&lt;p&gt;Apart from excellent software support, and all its other features. NixOS doesn't feel different from other Linux distros at all on the surface level. There's that feel-at-home and works-out-of-the-box feeling. Now that NixOS's installation ISO comes with the graphical calamares installer, it makes installing it even easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acknowledgements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nixos.org/" rel="noopener noreferrer"&gt;https://nixos.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kashifulhaque/nixos-config" rel="noopener noreferrer"&gt;https://github.com/kashifulhaque/nixos-config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ianthehenry.com/posts/how-to-learn-nix/" rel="noopener noreferrer"&gt;https://ianthehenry.com/posts/how-to-learn-nix/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@vimjoyer" rel="noopener noreferrer"&gt;https://www.youtube.com/@vimjoyer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>🛠️ Setting up Arch</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Sun, 13 Oct 2024 19:48:19 +0000</pubDate>
      <link>https://dev.to/spirizeon/setting-up-arch-5cbf</link>
      <guid>https://dev.to/spirizeon/setting-up-arch-5cbf</guid>
      <description>&lt;h2&gt;
  
  
  Downloading the ISO
&lt;/h2&gt;

&lt;p&gt;An ISO is an image of the operating system. It acts as the installer for the operating system.&lt;/p&gt;

&lt;p&gt;The ISO can be downloaded from one of ArchLinux's global mirrors, and flashed to create a bootable USB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up Ventoy: Flashing multiple ISOs to one USB
&lt;/h3&gt;

&lt;p&gt;Just to be safe, we will use Ventoy to flash at least two different ISOs to our USB stick to make sure that if installing Arch is not possible for some case, we can always install some other linux distribution. However this is a very rare case because people don't usually sole-install Arch on their devices.&lt;/p&gt;

&lt;p&gt;Link to installing: &lt;a href="https://github.com/ventoy/Ventoy" rel="noopener noreferrer"&gt;Ventoy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's assume that we are already on a Linux distribution (If you are on Windows, please follow &lt;a href="https://www.ventoy.net/en/doc_start.html" rel="noopener noreferrer"&gt;this guide&lt;/a&gt; ). After we install the Ventoy binary, we will run it with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sh Ventoy2Disk.sh &lt;span class="nt"&gt;-i&lt;/span&gt; /dev/sdX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;/dev/sdX&lt;/code&gt; is the device file name for our USB, we can know what that is through the &lt;code&gt;fdisk -l&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;After Ventoy is installed, we can simply drag and drop our ArchLinux ISO into our flash drive's directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diving into Arch: First boot
&lt;/h2&gt;

&lt;p&gt;We will be greeted with a command line after we select the first option from the boot loader.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting wi-fi
&lt;/h3&gt;

&lt;p&gt;In most cases of a home computer, we may not have an ethernet cable laying around, so, we will connect our computer to wi-fi with &lt;code&gt;iwctl&lt;/code&gt; utility.&lt;/p&gt;

&lt;p&gt;Simply typing &lt;code&gt;iwctl&lt;/code&gt; will open the &lt;code&gt;iwd&lt;/code&gt; shell prompt. From here we must type the following command to view all our network devices:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;iwd]: device list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we grab our device. We will make it scan for active wi-fi networks and display them:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;iwd]: station &amp;lt;device_name&amp;gt; scan
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;iwd]: station &amp;lt;device_name&amp;gt; get-networks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then select and connect to the network:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;iwd]: station &amp;lt;device_name&amp;gt; connect &amp;lt;wifi_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be asked to pitch in the password for that &lt;code&gt;SSID&lt;/code&gt;. After we connect, we can test our connection with the &lt;code&gt;ping&lt;/code&gt; command. And press &lt;code&gt;CTRL-C&lt;/code&gt; to stop pinging. This is optional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Partitioning drives
&lt;/h2&gt;

&lt;p&gt;We will use the &lt;code&gt;cfdisk&lt;/code&gt; utility to edit our drive partitions.&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="nv"&gt;$ &lt;/span&gt;cfdisk /dev/sdY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here &lt;code&gt;/dev/sdY&lt;/code&gt; is the device file name for the drive whose partitions we want to edit. We will assume that we are clean installing Arch on the entire drive.&lt;/p&gt;

&lt;p&gt;In order to delete existing partitions, we will simple hover over the partition section with arrow keys and press delete.&lt;/p&gt;

&lt;p&gt;After we select and enter &lt;code&gt;write&lt;/code&gt;, our formatting is done. Let's create our new partitions now.&lt;/p&gt;

&lt;p&gt;We will click on &lt;code&gt;new&lt;/code&gt; then give the first partition a size of &lt;code&gt;100M&lt;/code&gt; meaning 100 megabytes, this will house the boot loader for our distribution.&lt;/p&gt;

&lt;p&gt;After pressing enter, we will hover back to &lt;code&gt;free space&lt;/code&gt; and repeat the process. This time we will give it a size of &lt;code&gt;4G&lt;/code&gt;. This will be house the &lt;code&gt;swap&lt;/code&gt; memory for our distribution. It is that part of the drive which can be used as extra memory incase our RAM fills up.&lt;/p&gt;

&lt;p&gt;Lastly, we will select free-space and not edit the default size suggested. Which will be all of the remaining part. This will house our files.&lt;/p&gt;

&lt;p&gt;After everything's done. We will click &lt;code&gt;write&lt;/code&gt; then &lt;code&gt;primary&lt;/code&gt; then enter. Then quit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building and mounting file systems
&lt;/h2&gt;

&lt;p&gt;We can know our partition names and size from the &lt;code&gt;lsblk&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;mkfs.fat &lt;span class="nt"&gt;-F&lt;/span&gt; 32 &amp;lt;boot_partition&amp;gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;mkswap &amp;lt;swap_partition&amp;gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;mkfs.btrfs &amp;lt;storage_partition&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are using &lt;code&gt;FAT32&lt;/code&gt;, &lt;code&gt;SWAP&lt;/code&gt;, and &lt;code&gt;btrfs&lt;/code&gt; file systems for our partitions. They are, almost the most optimal choices for file systems for these partitions.&lt;/p&gt;

&lt;p&gt;After that, we will mount or make the file systems accessible from Arch.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /mnt/boot/efi
&lt;span class="nv"&gt;$ &lt;/span&gt;mount &amp;lt;boot_partition&amp;gt; /mnt/boot/efi
&lt;span class="nv"&gt;$ &lt;/span&gt;swapon &amp;lt;swap_partition&amp;gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;mount &amp;lt;storage_partition&amp;gt; /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are creating the &lt;code&gt;boot&lt;/code&gt; and then nesting that with the &lt;code&gt;efi&lt;/code&gt; directory to store the boot partition.&lt;/p&gt;

&lt;p&gt;We are mounting the rest of the partitions to their required position.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing essential packages
&lt;/h2&gt;

&lt;p&gt;Now, we are ready to install the core packages of our system.&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="nv"&gt;$ &lt;/span&gt;pacstrap &lt;span class="nt"&gt;-K&lt;/span&gt; /mnt base linux linux-firmware sof-firmware base-devel nano networkmanager grub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are installing the Linux kernel, sound-card firmware (for newer) systems, build-tools, network manager, the GRUB boot-loader and a text editor for editing system config files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generating the fstab file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;genfstab &lt;span class="nt"&gt;-U&lt;/span&gt; /mnt &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /mnt/etc/fstab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fstab&lt;/code&gt; is our Linux system's filesystem table, aka fstab , which is a configuration table designed &lt;strong&gt;to ease the burden of mounting and unmounting file systems to a machine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Time to enter our newly installed arch system:&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="nv"&gt;$ &lt;/span&gt;arch-chroot /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  System configurations
&lt;/h2&gt;

&lt;p&gt;We can set the time zone with the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-sf&lt;/span&gt; /usr/share/zoneinfo/Region/City /etc/localtime
&lt;span class="nv"&gt;$ &lt;/span&gt;hwclock &lt;span class="nt"&gt;--systohc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;Region/City&lt;/code&gt; is your region (Just click TAB to set it as you go). The second command syncs the system clock with the set timezone.&lt;/p&gt;

&lt;p&gt;Generating 'locale's or general configurations that are to be used by all or most programs can be done with 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="nv"&gt;$ &lt;/span&gt;locale-gen
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'LANG=en_US.UTF-8'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/locale.conf
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'KEYMAP=us'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/vconsole.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating the hostname file for our system&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;hostname&amp;gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/hostname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Root and User configuration
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;passwd
&lt;span class="nv"&gt;$ &lt;/span&gt;useradd &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="nt"&gt;-G&lt;/span&gt; wheel ‘USERNAME’
&lt;span class="nv"&gt;$ &lt;/span&gt;passwd ‘USERNAME’
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will prompt us for the root password. Then create a user and add it to the group &lt;code&gt;wheel&lt;/code&gt;. Lastly we will set the password for this user.&lt;/p&gt;

&lt;p&gt;It's time to add root privileges to this user.&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="nv"&gt;$ EDITOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nano visudo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Over here, we will head over to the first statement and look for the line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#%wheel%   ALL=(ALL:ALL) ALL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we will uncomment this line to enable all users underneath this group to have root privileges. Exit nano with &lt;code&gt;CTRL+S&lt;/code&gt; and &lt;code&gt;CTRL+X&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Update the packages:&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-Syu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing GRUB boot-loader
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;grub-install &amp;lt;drive_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can replace &lt;code&gt;&amp;lt;drive_name&amp;gt;&lt;/code&gt; with the device file name for our drive (Not partition).&lt;/p&gt;

&lt;h2&gt;
  
  
  Finishing steps
&lt;/h2&gt;

&lt;p&gt;we will unmount the &lt;code&gt;/mnt&lt;/code&gt; directory and reboot into our new system!&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="nv"&gt;$ &lt;/span&gt;umount &lt;span class="nt"&gt;-R&lt;/span&gt; /mnt
&lt;span class="nv"&gt;$ &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please remove the USB after the screen goes blank after the &lt;code&gt;reboot&lt;/code&gt; command. We now boot into a fresh install of ArchLinux!&lt;/p&gt;

&lt;p&gt;It is advisable to install a desktop environment like &lt;code&gt;GNOME&lt;/code&gt; if you are using it as a daily driver. Just login now. Welcome!&lt;/p&gt;

&lt;h2&gt;
  
  
  Some extra reads:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://wiki.archlinux.org/title/installation_guide" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/title/installation_guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.ventoy.net/en/doc_start.html" rel="noopener noreferrer"&gt;https://www.ventoy.net/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://guese-justin.medium.com/installing-arch-linux-the-easy-way-with-encrypted-drives-for-deep-learning-83fd55035ff7" rel="noopener noreferrer"&gt;https://guese-justin.medium.com/installing-arch-linux-the-easy-way-with-encrypted-drives-for-deep-learning-83fd55035ff7&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.sciencedirect.com/topics/computer-science/boot-partition" rel="noopener noreferrer"&gt;https://www.sciencedirect.com/topics/computer-science/boot-partition&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.oracle.com/cd/E19253-01/817-2521/overview-39/index.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/cd/E19253-01/817-2521/overview-39/index.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Zed's Linux port needs more punch</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Thu, 10 Oct 2024 15:18:47 +0000</pubDate>
      <link>https://dev.to/spirizeon/zeds-linux-port-needs-more-punch-1e4g</link>
      <guid>https://dev.to/spirizeon/zeds-linux-port-needs-more-punch-1e4g</guid>
      <description>&lt;p&gt;I've been waiting for the Zed editor to release their Linux port for a long time now, ever since it was released. But as soon as it did, I wasn't impressed, but neither was i disappointed. Here are my thoughts...&lt;/p&gt;

&lt;p&gt;Rather than being written in Javascript like VSCode, Zed offers better speeds, along with other benefits provided by the Rust language. Being a recent Rust fanatic myself, I appreciate it very much. &lt;/p&gt;

&lt;p&gt;Whenever I open Zed project on my computer, it lags by a few seconds. Sure, but once it's open, it's as smooth as butter. However that is not the case with Neovim since it uses the terminal emulator as a base.&lt;/p&gt;

&lt;p&gt;Sure, there are plenty of extensions out there, but the extensions marketplace doesn't really have as many extensions as something like Jetbrains or Neovim, given that they took ages to release the Linux port, I expected more. If this is the case, they should eliminate the marketplace feature fully and adopt a similar config system like neovim's for installing plugins.&lt;/p&gt;

&lt;p&gt;Zed supports many languages out of the box, including syntax highlighting and auto complete. This is however, a trade-off because the user needs to tinker a lot to remove support for languages that are not needed. This is also NOT the case with VSCode, where you install the extension (LSP, Formatters,Linters, etc) of the language only when you need it. &lt;/p&gt;

&lt;p&gt;Currently Zed editor supports native packages for only a few Linux distros like NixOS. Even for Arch, i believe it's only through the Arch wiki. Otherwise you may need to depend on curling an install script.&lt;/p&gt;

&lt;p&gt;I personally tend to stay away from these AI coding assistants because they collect usage data, need API keys, or just ruin your ability to code overtime with the habit of reliance.&lt;/p&gt;

&lt;p&gt;I feel that I might stay on the Neovim side longer as my config offers more than the Zed editor provides to my workflow. I know it is all about personal choices. I acknowledge that these were all purely my opinions on the topic (feel free to roast me if you're a Zed fanboy). There's just nothing on Zed currently that might attract me to make the switch, even with Ai code completion (which can be easily implemented in any mainstream editor nowadays). Zed needs to pack more of a punch.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hacking the LinkedIN algorithm for developers</title>
      <dc:creator>Ayush Dutta</dc:creator>
      <pubDate>Sat, 05 Oct 2024 20:09:33 +0000</pubDate>
      <link>https://dev.to/spirizeon/hacking-the-linkedin-algorithm-for-developers-33j9</link>
      <guid>https://dev.to/spirizeon/hacking-the-linkedin-algorithm-for-developers-33j9</guid>
      <description>&lt;p&gt;First thing's first, this is not a post about penetration testing any systems. We're gonna talk about how to boost your Linkedin from zero to hero in a matter of months. We're also gonna talk about being real and raw in this post, not the shenanigans of how to get down to "influencing", we're here to do actual business. Let's kick the tires.&lt;/p&gt;

&lt;p&gt;Diving into the essentials first, we'll need a profile that's cool and yet not to casual, It's okay to wear something casual (but not too fancy). Try to make the background as subtle or peaceful as possible or just replace it. Also try to make sure you have a banner following the same color-scheme. It can be a single color shade, have your logo or be a photo of you with your community.&lt;/p&gt;

&lt;p&gt;Tagline: The most important part of one's profile. Here's the priority list you should sequence your tagline on: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What's your skill? (frontend,backend,fullstack,ML, etc)&lt;/li&gt;
&lt;li&gt;What're you doing in your career life? (interns, jobs, etc)&lt;/li&gt;
&lt;li&gt;Anything you're interested in (in terms of tech)&lt;/li&gt;
&lt;li&gt;Anything you like doing (can be non-tech) &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's a sample:&lt;br&gt;
Backend | DevOps | DevRel | SDE intern &lt;a class="mentioned-user" href="https://dev.to/stealth"&gt;@stealth&lt;/a&gt; | Linux enthuse | Volunteering @stealth-charity&lt;/p&gt;

&lt;p&gt;Now, we've got a lot of things done. Time to construct your bio, make sure it is short,crisp and upto 50 words. Distill your resume down to those 50 words. Yes, you are free to prompt ChatGPT or some other LLM.&lt;/p&gt;

&lt;p&gt;Experiences (optional if you don't have any): Roles and companies don't matter on the profile unless you're some founder or revolutionary guy or you got a nice company. If you're not in this group, then make sure to bullet doing your job description clearly in the description section under the role.&lt;/p&gt;

&lt;p&gt;Accordingly add your education, and add your volunteering experiences with any communities. Be sure to add pictures in all of these including experience sections. &lt;/p&gt;

&lt;p&gt;Since we are just beginning, we can skip the featured section for now. And as for the certifications section, keep certificates that actually matter, like AWS ones, not those from coursera or udemy.&lt;/p&gt;

&lt;p&gt;Time to connect with people, search people in your interested domain through #keyword on the search bar, keep connecting with people through search, networks section and DMing existing connections. Your Linkedin feed's content will determine the content you consume and that will be determined by the people you follow and connect with. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
