<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arash Arora on Medium]]></title>
        <description><![CDATA[Stories by Arash Arora on Medium]]></description>
        <link>https://medium.com/@arasharora2001?source=rss-d19d0346f89f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2NQi-RLhuSbHQvwS</url>
            <title>Stories by Arash Arora on Medium</title>
            <link>https://medium.com/@arasharora2001?source=rss-d19d0346f89f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:16:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arasharora2001/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Beginner’s Guide to NGINX and NGINX Proxy Manager]]></title>
            <link>https://arasharora2001.medium.com/a-beginners-guide-to-nginx-and-nginx-proxy-manager-3ed07fdad9a8?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ed07fdad9a8</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[reverse-proxy]]></category>
            <category><![CDATA[hosting]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 15:55:30 GMT</pubDate>
            <atom:updated>2025-06-22T11:56:20.347Z</atom:updated>
            <content:encoded><![CDATA[<p>Whether you’re self-hosting applications or deploying websites in production, <strong>reverse proxies</strong> are one of the most powerful tools in your DevOps toolbox. At the heart of it all is <strong>NGINX</strong> — a versatile, open-source server that can function as a web server, reverse proxy, load balancer, and even a mail proxy.</p><p>However, writing manual NGINX configurations — especially for multiple services, subdomains, and SSL certificates — can quickly become tedious, redundant and error-prone.</p><p>That’s where <strong>NGINX Proxy Manager (NPM)</strong> steps in to simplify everything with a clean and user-friendly interface.</p><p>In this blog, we’ll begin with the basics of NGINX, and then walk you through how to deploy NGINX Proxy Manager in just a few steps.</p><h3>🧠 What is NGINX?</h3><p><strong>NGINX</strong> (pronounced <em>engine-x</em>) is a high-performance, open-source web server that’s designed for scalability and efficiency. It can be used for:</p><ul><li>Serving static files (HTML, CSS, JavaScript)</li><li>Acting as a <strong>reverse proxy</strong> (routing external traffic to internal services)</li><li>Load balancing between servers</li><li>Caching for faster delivery</li><li>SSL termination (handling HTTPS connections)</li></ul><p>Originally built to solve the <strong>C10K problem</strong> — handling 10,000+ concurrent connections — NGINX has become one of the most popular servers in the world.</p><h3>🔄 What is a Reverse Proxy?</h3><p>A <strong>reverse proxy</strong> acts as a gateway: it receives client requests, forwards them to the appropriate backend service, and returns the response to the client. This allows you to:</p><ul><li>Host multiple apps on a single server (e.g., <a href="http://app1.example.com/">app1.example.com</a>, <a href="http://app2.example.com/">app2.example.com</a>)</li><li>Serve all apps over HTTPS using <strong>Let’s Encrypt</strong></li><li>Hide internal infrastructure from the public</li><li>Apply rate limiting, access control, or logging policies</li></ul><h3>⚙️ Installing NGINX the Traditional Way</h3><p>On most Linux distributions, you can install NGINX with:</p><pre>sudo apt update -y<br>sudo apt install nginx -y</pre><p>To verify NGINX is running:</p><pre>systemctl status nginx</pre><p>You should be able to visit http://&lt;your-server-ip&gt; and see the NGINX welcome page.</p><p>To configure new sites manually, you’ll edit files under /etc/nginx/sites-available/ and link them to /etc/nginx/sites-enabled/</p><h3>😵‍💫 The Problem: Manual NGINX Config is a Pain</h3><p>For each new service or domain, you have to:</p><ul><li>Add a new subdomain</li><li>Set up SSL with Let’s Encrypt</li><li>Configure proxying rules</li><li>Handle authentication and security settings</li><li>Test your NGINX config and reload the service</li></ul><p>This process is powerful but <strong>not beginner-friendly</strong> and quickly becomes a burden when managing many services.</p><h3>🎉 The Solution: NGINX Proxy Manager (NPM)</h3><p><strong>NGINX Proxy Manager</strong> is a Docker-based application that wraps the power of NGINX in an easy-to-use <strong>web interface</strong>.</p><h3>🔑 Key Features</h3><ul><li>Intuitive web UI to manage proxy hosts</li><li>Automatic SSL certificates via Let’s Encrypt</li><li>Redirection and 404 host handling</li><li>Access control via IP or basic auth</li><li>Custom NGINX config snippets</li><li>Lightweight and easy to deploy via Docker</li></ul><h3>🧱 How to Install NGINX Proxy Manager on Ubuntu/Debian</h3><h3>Prerequisites</h3><ul><li>A Linux server or cloud VPS</li><li>Docker and Docker Compose installed</li><li>A registered domain (optional but recommended)</li></ul><h3>Step 1: Install Docker &amp; Docker Compose</h3><pre>sudo apt update<br>sudo apt install docker.io docker-compose -y</pre><p>Verify Docker is running:</p><pre>sudo systemctl status docker</pre><p>If inactive, enable and start it:</p><pre>sudo systemctl enable docker<br>sudo systemctl start docker</pre><h3>Step 2: Create the Docker Compose File</h3><ul><li>Create a working directory:</li></ul><pre>mkdir npm &amp;&amp; cd npm</pre><ul><li>Now create the docker-compose.yml file:</li></ul><pre>version: &#39;3.8&#39;<br>services:<br>  app:<br>    image: &#39;jc21/nginx-proxy-manager:latest&#39;<br>    restart: unless-stopped<br>    ports:<br>      # These ports are in format &lt;host-port&gt;:&lt;container-port&gt;<br>      - &#39;80:80&#39; # Public HTTP Port<br>      - &#39;443:443&#39; # Public HTTPS Port<br>      - &#39;81:81&#39; # Admin Web Port<br><br>    environment:<br>      # Mysql/Maria connection parameters:<br>      DB_MYSQL_HOST: &quot;db&quot;<br>      DB_MYSQL_PORT: 3306<br>      DB_MYSQL_USER: &quot;npm&quot;<br>      DB_MYSQL_PASSWORD: &quot;npm&quot;<br>      DB_MYSQL_NAME: &quot;npm&quot;<br>    volumes:<br>      - ./data:/data<br>      - ./letsencrypt:/etc/letsencrypt<br>    depends_on:<br>      - db<br><br>  db:<br>    image: &#39;jc21/mariadb-aria:latest&#39;<br>    restart: unless-stopped<br>    environment:<br>      MYSQL_ROOT_PASSWORD: &#39;npm&#39;<br>      MYSQL_DATABASE: &#39;npm&#39;<br>      MYSQL_USER: &#39;npm&#39;<br>      MYSQL_PASSWORD: &#39;npm&#39;<br>      MARIADB_AUTO_UPGRADE: &#39;1&#39;<br>    volumes:<br>      - ./mysql:/var/lib/mysql</pre><blockquote>💡 <strong>Why a database?</strong><br>The database stores all your proxy host settings, SSL metadata, users, and configuration changes persistently</blockquote><h3>Step 3: Launch the Container</h3><p>Run the containers:</p><pre>docker-compose up -d</pre><h3>Step 4: Access the Web Interface</h3><p>Open your browser and visit:<br>http://your-server-ip:81</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g4AnW7mv47lR5W8q.png" /></figure><p>Login with default credentials:</p><ul><li><strong>Email:</strong> admin@example.com</li><li><strong>Password:</strong> changeme</li></ul><blockquote><em>You’ll be prompted to change your login details after the first login.</em></blockquote><p>Once you login, you’ll be redirected to your dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d-Dwoip1cRhZFVPR.png" /></figure><h3>🔧 Setting Up Your First Proxy Host</h3><ol><li>Go to <strong>“Proxy Hosts” &gt; “Add Proxy Host”</strong></li><li>Enter your <strong>domain name</strong> (e.g., <a href="http://myapp.example.com/">npm.domain.com</a>)</li><li>Enter the <strong>internal IP address and port</strong> of your service (e.g., 192.168.1.100:8080)</li><li>Enable <strong>“Block Common Exploits”</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*NC-LbTkYep7s2g-8.png" /></figure><p>5. Switch to the <strong>SSL</strong> tab:</p><ul><li>Enable <strong>SSL</strong></li><li>Request a <strong>Let’s Encrypt certificate</strong></li><li>Enable <strong>Force SSL</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/0*wWHqY5RLtW1bFJm3.png" /></figure><p>6. Click <strong>Save</strong></p><blockquote><em>🎉 Done! Your service is now live, secure, and reachable via your custom domain. (</em><strong><em>npm.domain.com</em></strong><em> in this case)</em></blockquote><h3>🔐 Advanced Features</h3><ul><li><strong>Access Lists</strong> — Restrict access using IP whitelisting or basic auth</li><li><strong>Custom NGINX Directives</strong> — Add your own caching rules, headers, or security policies</li><li><strong>Rate Limiting</strong> — Throttle excessive traffic and protect against DoS attacks</li><li><strong>Redirection Hosts</strong> — Easily forward old URLs to new destinations</li><li><strong>404 Hosts</strong> — Define catch-all behavior for unknown or misrouted domains</li></ul><h3>💡 Common Use Cases</h3><ul><li>Host self-hosted apps like <strong>Nextcloud</strong>, <strong>Jellyfin</strong>, <strong>Bitwarden</strong>, or <strong>Portainer</strong></li><li>Expose internal microservices on custom subdomains</li><li>Make local development tools publicly accessible with HTTPS</li><li>Replace complex manual NGINX or Traefik setups with a user-friendly dashboard</li></ul><h3>🧠 Final Thoughts</h3><p>NGINX is incredibly powerful, but configuring it manually can be time-consuming and error-prone.<br><strong>NGINX Proxy Manager</strong> simplifies this process without sacrificing flexibility.</p><p>It’s perfect for:</p><p>✅ Self-hosters<br>✅ Developers managing multiple projects<br>✅ Small teams hosting internal tools<br>✅ Anyone who wants <strong>easy SSL</strong> and <strong>quick proxy setup</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ed07fdad9a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with NodeJS]]></title>
            <link>https://faun.pub/nodejs-e5ed40a184cd?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5ed40a184cd</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Sat, 18 Jun 2022 19:20:40 GMT</pubDate>
            <atom:updated>2022-06-23T02:33:58.403Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with Node.js</h3><p>It is a JavaScript runtime that extends its capability to the server-side. It is built on Chrome’s V8 JavaScript Engine. It is an event-driven, non-blocking IO model. That basically means it is asynchronous, it does not block itself for one request but rather immediately moves to the next request. This makes Node.js extraordinarily fast and efficient. By event-driven, it means that as soon as Node.js starts it initiates all the variables, and functions and waits for an event to occur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IoMGNQRGKpOVD95O.png" /></figure><p>NPM — Node Package Manager for Nodejs<br>NPX — Node Package Execute, it can execute any npm package without even installing it</p><p>To download NPM head to <a href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a></p><h3>First NodeJS Program (Hello World)</h3><ol><li>Create a file hello_world.js in your project folder</li><li>Open the file in your code editor like vscode</li><li>Code<br>console.log(“Hello World”);</li><li>Open the terminal, navigate to the file location</li><li>Now type node hello_world.js</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*5SBqU4AAD7p3J_4oOgtbZg.png" /></figure><h3>Importing NodeJS core modules</h3><p>So let’s start with the very basic package that is fs (file system) — it is used to create, read, and modify files</p><ol><li>To import the fs module, <br>const fs = require(“fs”);</li><li>Now to use any function of this module, you can refer to the <a href="https://nodejs.org/docs/latest-v17.x/api/fs.html#file-system">doc</a></li><li>To create a file, we can use fs.writeFileSync(filename, content);</li></ol><pre>const fs = require(“fs”);<br>fs.writeFileSync(“file.txt”, “Hi there..”);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*KzqmGo9SE7R3XPYOS-3LXg.png" /></figure><p>To append anything in the same file we can use fs.appendFileSync(filename, content);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*dOqUqcuJ5a5vl_BQ_E0dSg.png" /></figure><h3>Install NPM Packages</h3><p>Now we will use a very basic NPM package (<strong>superheroes</strong> — list of random superheroes) to understand this topic</p><ol><li>To install any NPM package we can use this command in the cmd<br>npm install superheroes</li><li>Now to import the installed package<br>const sh = require(“superheroes”);</li><li>To display the name of the random superhero<br>console.log(sh.random());</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*WfHNl2GDgyXBEwfV6oV0GQ.png" /></figure><p>Let’s try another package? Okay then, now we’ll install one of the most used NPM packages <strong>“chalk” — </strong>it styles the text string in the terminal</p><ol><li>To install the chalk package (we will install the 2.4.2 version as it allows us to import the package using the <strong>require</strong> method)<br>npm install chalk@2.4.2</li><li>Now to style the text string, to color the string the syntax is chalk.color(text)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*AQ5TX0vxzPn5N0lzrSBbJw.png" /></figure><p>To read more about the chalk package visit this <a href="https://www.npmjs.com/package/chalk">link</a></p><h3>Initiate the NPM in our program</h3><p>To initiate the NPM in our program we can use the following command <br>npm init<br>and press enter or answer the questions accordingly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*G_SVRqNdjuuWssQANvZgbw.png" /></figure><p>Or you can directly, use the command npm init -y (same as pressing enter to all the questions)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*CafNbhzEhvGAayNHnpb29A.png" /></figure><p>This will result in the creation of the <strong>package.json</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*hYaMdTgcLdABQ1qqjQdpRQ.png" /></figure><h4>So, what is package.json?</h4><p>package.json is the heart of any Nodejs project, it maintains the record of all the dependencies (NPM packages). It contains the metadata of every project. If someone else downloads the project, this file would help him to install all the dependencies required to run the program.</p><h4>Moment.js — NPM package to parse, validate date</h4><ol><li>To install the package<br>npm i moment</li><li>Import the package<br>const moment = require(“moment”);</li><li>To create a Date object to fetch the current date and time (javascript method)<br>const time = new Date();</li><li>Now, to parse or format the date we will use the <strong>moment</strong> package<br>const parsedTime = moment(time).format(“h:mm:ss”);</li><li>Print the parsed time <br>console.log(parsedTime);</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*V3hJ24cmTASx9k6Rv83gXg.png" /></figure><p>This is the package.json for this project which includes all the dependency packages — moment in this case</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*kKFpiaEOtsRbxN67do4HDw.png" /></figure><p>We also have <strong>node_modules</strong> in the project folder, this folder contains all the dependencies our project depends on including moment and other packages that moment depends on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*-mxxdXnGzLxG98LE2ebMDQ.png" /></figure><p><strong>package-lock.json</strong> is another file in our project folder that contains all the information regarding the name, dependencies, version of dependencies, and locked version of the project. <br>It describes the exact tree that was generated to allow subsequent installs to have the identical tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1VMBTQ3HtQtnaHUWGY8iQ.png" /></figure><h3>ExpressJS — NodeJS framework</h3><p>Express is a Node.js web application framework that offers a comprehensive range of functionality for both web and mobile apps.</p><h4>How to install express</h4><p>npm install express</p><h4>Import express</h4><p>const express = require(“express”);</p><h4>To create an express application</h4><p>const app = express()</p><h4>To start a server on port 3000</h4><pre>app.listen(3000, () =&gt; {<br>  console.log(&quot;Server running on port 3000&quot;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*jD3FvRLcd_j2MuZ0U6_bXw.png" /></figure><p>Now you can open <a href="http://localhost:3000/"><strong>http://localhost:3000</strong></a><strong> </strong>to reach your created server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*IMLmUArtV_ctmiAG18TnJg.png" /></figure><p>Okay, so “cannot get /” means that there is no defined route “/” yet.</p><p>So to define the “/” route we use app.get() the function</p><ul><li><strong>app.get(route, callback function)</strong> function is used to handle all GET requests</li><li>the callback function has 2 arguments <strong>req, res</strong> which refers to HTTP requests and desired response respectively. The argument names (req, res) are not fixed and can be named anything you want.</li></ul><pre>app.get(&quot;/&quot;, (req,res) =&gt; { <br>// app.get to handle GET requests<br>// req - http request, res - desired response<br>  res.send(&quot;Hello World&quot;); // send Hello World to this route<br>}</pre><h4>Hello World in express</h4><pre>const express = require(&quot;express&quot;);</pre><pre>const app = express();</pre><pre>app.get(&quot;/&quot;, (req, res) =&gt; {</pre><pre>  res.send(&quot;hello world&quot;);</pre><pre>});</pre><pre>app.listen(3000, () =&gt; {</pre><pre>  console.log(&quot;Server running on 3000&quot;);</pre><pre>});</pre><blockquote>Output</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*uRqmENgESv8cdq-0oSaX8A.png" /></figure><h3>Render static files in express</h3><ul><li>Create a new project folder</li><li>Initialize npm using npm init -y</li><li>Install express package npm i express</li><li>Create a file app.js</li><li>Create an app, and listen or start the server on port 3000</li></ul><pre>const express = require(&quot;express);<br>const app = express();</pre><pre>app.listen(3000, () =&gt; {<br>  console.log(&quot;Server running on 3000&quot;);<br>}</pre><ul><li>To render static web pages such as HTML, CSS, and JS create a folder named public in the root directory.</li><li>As we’re focussing on only the backend, thus we will not waste much time on the frontend and will create only an HTML file in the public folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*-OiGmKZaz7GKc3NdNVjZdg.png" /></figure><ul><li>We will now import the <strong>path </strong>module — join specified paths into one<br>const path = require(“path”);</li><li>Now to render these files, we have to use the following command <br>app.use(express.static(path.join(__dirname, “/public”)));</li></ul><p><strong>__dirname → </strong>returns the current directory</p><pre>const express = require(&quot;express&quot;);</pre><pre>const path = require(&quot;path&quot;);</pre><pre>const app = new express();</pre><pre>app.use(express.static(path.join(__dirname, &quot;/public&quot;)));</pre><pre>app.listen(3000, () =&gt; {</pre><pre>  console.log(&quot;Server running on 3000&quot;);</pre><pre>});</pre><blockquote>Output</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*2U5Qi3XKOaNF0MjXSTo0tg.png" /></figure><h3>Render dynamic files in express</h3><p>To render dynamic web pages there are many templates such as pug, handlebars, ejs, etc. These templates allow us to inject dynamic data, if conditions, loops at runtime.</p><p>But here we will focus on handlebars.</p><ul><li>Install the packages (express and hbs)<br>npm i hbs express</li><li>Create a file named app.js and import the packages</li></ul><pre>const express = require(“express”);</pre><pre>const hbs = require(“hbs”);</pre><pre>const path = require(“path”);</pre><ul><li>Create an express app and listen on port 3000</li></ul><pre>const app = express();<br>app.listen(3000, (req,res) =&gt; {<br>  console.log(&quot;Server running on 3000&quot;);<br>}</pre><ul><li>For handlebars to work we need to set the view engine as hbs <br>app.set(“view engine”, “hbs”);<br>view engine enables us to render dynamic webpages using the specified template</li><li>View engine generally looks for the “views” folder in the root folder but to avoid errors we’ll mention the path of “views” using the following command <br>app.set(“views”, path.join(__dirname,“/views”);</li><li>Now create a <strong>views</strong> folder in the root directory and under that create a file index.hbs (.hbs is the extension of handlebars) and insert the following HTML code</li></ul><blockquote>index.hbs</blockquote><pre>&lt;html&gt;</pre><pre>  &lt;head&gt;</pre><pre>    &lt;title&gt;Dynamic Rendering&lt;/title&gt;</pre><pre>  &lt;/head&gt;</pre><pre>  &lt;body&gt;</pre><pre>    &lt;h1&gt;Dynamic Rendering&lt;/h1&gt;</pre><pre>    &lt;p&gt;{{author}}&lt;/p&gt;</pre><pre>  &lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p><strong>{{author}} </strong>— it is the syntax to insert dynamic data</p><ul><li>Now to render the index.hbs file we’ll create an app.get function to handle the GET request on the route “/” and send the dynamic data <strong>author</strong></li></ul><pre>app.get(&quot;/&quot;, (req, res) =&gt; {</pre><pre>  res.render(&quot;index&quot;, {</pre><pre>    author: &quot;Arash Arora&quot;,</pre><pre>  });</pre><pre>});</pre><p><strong>res.render</strong> is the function to render the view; here we’ve to pass 2 arguments. The first is the name of the file without the extension and the second is the object of local variables example <strong>author</strong></p><blockquote><strong>app.js file</strong></blockquote><pre>const express = require(&quot;express&quot;);</pre><pre>const hbs = require(&quot;hbs&quot;);</pre><pre>const path = require(&quot;path&quot;);</pre><pre>const app = express();</pre><pre>app.set(&quot;view engine&quot;, &quot;hbs&quot;);</pre><pre>app.set(&quot;views&quot;, path.join(__dirname, &quot;/views&quot;));</pre><pre>app.get(&quot;/&quot;, (req, res) =&gt; {</pre><pre>  res.render(&quot;index&quot;, {</pre><pre>    author: &quot;Arash Arora&quot;,</pre><pre>  });</pre><pre>});<br>app.listen(3000, (req, res) =&gt; {</pre><pre>  console.log(&quot;Server listening on 3000&quot;);</pre><pre>});</pre><blockquote>folder structure</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*7xz9Fj17mTS5pZhxzf2dvw.png" /></figure><blockquote>Output</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*JQt1mgjLTU-LJJ0XS7UH3A.png" /></figure><h3>Advanced Templating</h3><p>So, this is where we’ll learn about reusable components. Previously, we had to construct the identical component for each and every page when it came to headers and footers. Because there are so many repetitive tasks, ADVANCED TEMPLATING is the savior. This concept states that we will just make one component that will be used everywhere it is needed.</p><h4>Handlebars introduced the concept of Partials</h4><p>Partials are the normal handlebar files that other templates can call.</p><p>Steps to create partials</p><ul><li>Initiate npm → npm init -y</li><li>Install the required packages, express, and hbs → npm i express hbs</li><li>Create a folder templates</li><li>Create 2 additional folders within the folder templates: <strong>partials and views</strong></li><li>Now create a file <strong>app.js</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*98jLDll1IWq-vd8H0ieNCg.png" /><figcaption>The folder Structure should be similar</figcaption></figure><ul><li>Let’s create 2 partial files → header.hbs and footer.hbs</li><li>And 2 views → index.hbs and about.hbs</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/211/1*E32yq-EHCLFfUFzbgIbJJg.png" /></figure><blockquote>index.hbs</blockquote><pre>&lt;html lang=&quot;en&quot;&gt;</pre><pre>  &lt;head&gt;</pre><pre>    &lt;title&gt;Advanced Templating&lt;/title&gt;</pre><pre>  &lt;/head&gt;</pre><pre>  &lt;body&gt;</pre><pre>    {{&gt;header}} // include the header component</pre><pre>    &lt;p&gt;I&#39;m a savior&lt;/p&gt;</pre><pre>    {{&gt;footer}} // include the footer component</pre><pre>  &lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><blockquote>about.hbs</blockquote><pre>&lt;html lang=&quot;en&quot;&gt;</pre><pre>  &lt;head&gt;</pre><pre>    &lt;title&gt;Advanced Templating -- About&lt;/title&gt;</pre><pre>  &lt;/head&gt;</pre><pre>  &lt;body&gt;</pre><pre>    {{&gt;header}}</pre><pre>    &lt;p&gt;Handlebars&lt;/p&gt;</pre><pre>    {{&gt;footer}}</pre><pre>  &lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><blockquote>header.hbs</blockquote><pre>&lt;header&gt;</pre><pre>  &lt;h1&gt;Advanced Templating&lt;/h1&gt;</pre><pre>  &lt;h3&gt;{{title}}&lt;/h3&gt;//title is the dynamic data received from server</pre><pre>  &lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;</pre><pre>  &lt;a href=&quot;/about&quot;&gt;About&lt;/a&gt;</pre><pre>&lt;/header&gt;</pre><blockquote>footer.hbs</blockquote><pre>&lt;footer&gt;</pre><pre>  &lt;p&gt;Created by {{name}}&lt;/p&gt; //name -&gt; dynamic data </pre><pre>&lt;/footer&gt;</pre><blockquote>app.js</blockquote><pre>const express = require(&quot;express&quot;);</pre><pre>const hbs = require(&quot;hbs&quot;);</pre><pre>const path = require(&quot;path&quot;);</pre><pre>const app = express();</pre><pre>app.set(&quot;view engine&quot;, &quot;hbs&quot;);</pre><pre>app.set(&quot;views&quot;, path.join(__dirname, &quot;/templates/views&quot;));</pre><pre>hbs.registerPartials(path.join(__dirname, &quot;/templates/partials&quot;));</pre><pre>app.get(&quot;/&quot;, (req, res) =&gt; {</pre><pre>  res.render(&quot;index&quot;, {</pre><pre>    title: &quot;Home&quot;,</pre><pre>    name: &quot;Arash Arora&quot;,</pre><pre>  });</pre><pre>});</pre><pre>app.get(&quot;/about&quot;, (req, res) =&gt; {</pre><pre>  res.render(&quot;about&quot;, {</pre><pre>    title: &quot;About&quot;,</pre><pre>    name: &quot;Arash Arora&quot;,</pre><pre>  });</pre><pre>});</pre><pre>app.listen(3000, () =&gt; {</pre><pre>  console.log(&quot;Listening on port 3000&quot;);</pre><pre>});</pre><p>Everything is the same as explained in the Render dynamic files in express concept except here we have to <strong>register the partials</strong> to use partials</p><p><strong>How to register partials?</strong></p><p>hbs.registerPartials(path_to_partials)</p><p>As we’ve created the partials directory in the templates folder so here is the path of partials</p><p>hbs.registerPartials(path.join(__dirname, “/templates/partials”));</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ICkLjsG4F1df8cTq.png" /></figure><p><em>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</em></p><p><em>🚀Developers: Learn and grow by keeping up with what matters, </em><a href="https://faun.to/8zxxd"><em>JOIN FAUN.</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jUwM0Ghi-796Sdly.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5ed40a184cd" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/nodejs-e5ed40a184cd">Getting Started with NodeJS</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DSA — Flowcharts & Algorithms]]></title>
            <link>https://faun.pub/dsa-lecture-1-f9bbafebf1d0?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9bbafebf1d0</guid>
            <category><![CDATA[pseudocode]]></category>
            <category><![CDATA[flowchart]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Thu, 03 Feb 2022 06:15:41 GMT</pubDate>
            <atom:updated>2022-02-07T16:03:52.182Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Here we’re gonna learn C++|DSA| PROBLEM-SOLVING TECHNIQUES TO ACE THE PLACEMENTS.</blockquote><h3>Goals</h3><ol><li>Provide optimal solution</li><li>Problem-solving skill | Thought process<br>- Understand the problem<br>- Check the Given values<br>- What approach should be taken<br>- Create a program</li><li>Get an understanding of what a flowchart and pseudocode is</li></ol><blockquote>Computer Understands 0/1, thus we need to convert the program into machine understandable language, then it is considered as executable. So instead of doing it manually we can use High Level Languages.</blockquote><h3><strong>Flowchart</strong> —</h3><p>Graphical representation of steps to implement an approach</p><ol><li>Terminator — start &amp; stop</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/138/1*28MP4q-Om4rPo3Vm_WvOhQ.png" /></figure><p>2. Input / Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*70doR_SOAkyNC9GDv5b0aQ.png" /></figure><p>3. Process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*_1_qUxFWY6her5kxgAa1Nw.png" /></figure><p>4. Decision Making</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/121/1*nYXF9knqp845a568RrJhSQ.png" /></figure><p>5. Arrows — determine the flow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*87B2g_CD2T9fuXw4Bo3MzA.png" /></figure><p>6. Connector</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/131/1*o3Gck0BSGH69Fkfe6U5SKA.png" /></figure><h3>Pseudo Code</h3><p>Way of representing logic in a generalized manner. The pseudocode is not specific to single language, rather can be applied to all languages</p><h3>Sum Of Two Numbers — Pseudocode</h3><pre>1. Read 2 numbers a &amp; b<br>2. sum = a + b<br>3. Print sum</pre><h3>Sum Of Two Numbers — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/0*fuyBjDCiIHOamSkI" /></figure><h3>Simple Interest — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*lj0a5ax7ajQsVqTe" /></figure><h3>Average of 3 Numbers — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*JcPwHn8e2Lz8jXyM" /></figure><h3>Compare 2 Numbers — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/0*uanwpMwG5Smwp15D" /></figure><h3>Compare 2 Numbers — Pseudocode</h3><pre>1. Read a &amp; b<br>2. if a&gt;b then print a is larger and go to step 4 else goto step 3<br>3. print b is larger</pre><h3>Check if the number is even or odd — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/0*rcdol-TUTelB-U27" /></figure><h3>Check if the number is even or odd — Pseudocode</h3><pre>1. Read a <br>2. if a%2==0 print &quot;Even&quot;<br>3. else print &quot;odd&quot;<br>4. stop</pre><h3>Check if the number is positive or negative — Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*9nYuHZB1LVZHrWwO" /></figure><h3>Check if the number is positive or negative — pseudocode</h3><pre>1. Read a <br>2. if a&gt;0 then print positive else print negative<br>3. end</pre><h3>Check if the triangle is valid or not — flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/0*3x9wvBILs-jC_Mya" /></figure><h3>Loops — where we continuously perform some action</h3><h3>Print natural numbers — flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/0*L5b1PzwYke3HXbSu" /></figure><h3>Print all even numbers from 1 to n</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/0*J9dUgPrq_BYwT5dk" /></figure><h3>Print all odd numbers from 1 to n</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/0*8d88A4b6natBNH7p" /></figure><h3>Find sum of n numbers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*MFvvU3k8S0P5e6Ki" /></figure><h3>Find sum of n numbers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*jKwmfecFr-qWLHPX" /></figure><h3>Find sum of n numbers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*4IT4UVxRGZZJiIW4" /></figure><h3>Programming language?</h3><ul><li>It is a way to communicate with a computer</li><li>It is a language which we use to make our computer do a certain task</li><li>Every programming language has some <strong>semantics</strong> and <strong>syntax</strong></li><li>Programming languages are first converted into the language which our computers can understand, the phenomena which converts our program is known as translator, interpreter, compiler</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*vGuZBTYVlolFAjPq" /></figure><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9bbafebf1d0" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/dsa-lecture-1-f9bbafebf1d0">DSA — Flowcharts &amp; Algorithms</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java — A Quick Tour]]></title>
            <link>https://medium.com/geekculture/java-a-quick-tour-1c70d64230fe?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c70d64230fe</guid>
            <category><![CDATA[basics-of-programming]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[arrays]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Fri, 07 Jan 2022 20:26:43 GMT</pubDate>
            <atom:updated>2022-01-10T07:15:42.911Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java — A Quick Tour</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NY4_kN6r5Eov32cO" /><figcaption>Photo by <a href="https://unsplash.com/@ffstop?utm_source=medium&amp;utm_medium=referral">Fotis Fotopoulos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Java is a popular programming language, which is primarily used for</p><ul><li>Web Applications</li><li>Mobile Applications</li><li>Desktop Applications</li><li>Games and much more..</li></ul><p>Java was developed by Sun Microsystems in 1995. <strong>James Gosling </strong>is known as the father of Java. It was earlier known as Oak.</p><h4>Why Java?</h4><p>Java is platform independent thus works on various platforms be it Windows, Mac, Linux etc. It is secure, open source, and supports OOPS concepts.</p><blockquote>Java is both compiled and interpreted</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*c6bSJIOFtFbADHXPXXN9Xg.png" /></figure><p><strong>Bytecode</strong> — machine language intended for the JVM</p><p><strong>JVM</strong> — Java Virtual Machine, which is a software based interpreter. It basically converts compiled binary bytecode to specific machine language regardless of hardware &amp; software components &amp; configurations of the machine. Thus Java is a platform independent language</p><blockquote>Hello World in Java</blockquote><pre>class Main {<br>  public static void main(String[] args) {<br>    System.out.println(&quot;Hello World!&quot;);<br>  }<br>}</pre><p>In java, every piece of code that runs must be inside of a class. Class name should always start with a capital letter according <strong>pascal case</strong>.</p><p><strong>public</strong> — it is an access specifier. Public means that it is globally available. The main method needs to be public so as to be executed by java runtime</p><p><strong>static</strong> — it basically means that it does not require an instance to call the main function</p><p><strong>void </strong>— return type, doesn’t return anything.</p><p><strong>main </strong>— entry point of every java program.</p><p><strong>String[] args </strong>— also known as java command line arguments, java main method accepts a single argument of type String array. We can change the name args.</p><p><strong>System — </strong>it is a final class</p><p><strong>out — </strong>it is an instance of printstream type</p><p><strong>println — </strong>print the statements and then move the cursor to the next line</p><h4>How to compile java programs</h4><p>javac a.java</p><p>a.java → a.class (.class file would be made for every class present in the a.java)</p><h4>Command used for the output</h4><p>java a</p><h3>Comments in Java</h3><p>Comments — any text or notes written between the double slashes will be ignored by Java thus wouldn’t be executed</p><p>Single line comments with //</p><p>Multi line comments with /* ... */</p><h3>Variables</h3><p>They are defined as the containers which contains data</p><p>Variables can be of various datatypes that is it would hold data specific to a datatype say integer</p><p>eg. int a = 5; //a would only hold integer values</p><h3>Datatypes</h3><p>It is of two types</p><h4>1. Primitives — those which are predefined in java</h4><ul><li>byte → takes 1 byte (-128 to 127), default = 0</li><li>short → takes 2 bytes ((-2¹⁶)/2 to 2¹⁶/2–1)), default = 0</li><li>int → takes 4 bytes ((-2³²)/2 to 2³²/2–1)), default = 0</li><li>long → takes 8 bytes, default = 0</li><li>float → takes 4 bytes, default = 0.0f</li><li>double → takes 8 bytes, default = 0.0d</li><li>char → takes 2 bytes, default = ‘\u0000’</li><li>boolean → takes 1 bit (true or false), default = false</li></ul><h4>2. Non Primitives — those which are user defined</h4><ul><li>String</li><li>Array</li><li>Class</li><li>Interface</li></ul><blockquote>Declaring a variable</blockquote><pre>class Main {<br>  public static void main(String[] args) {<br>    <strong>int a = 5;<br>    float b = 3.23f;<br>    char c = &#39;A&#39;;<br>    boolean d = true;<br>    double e = 93.232;<br>    byte f = 12;<br>    short g = 23;<br>    long h = 27398l;</strong></pre><pre>    <strong>String name = &quot;Arash Arora&quot;;</strong><br>  }<br>}</pre><h3>Type Casting — conversion of one primitive datatype to another</h3><ul><li><strong>Widening Casting </strong>— which is done automatically (smaller type to larger type size)</li></ul><p>byte →short → char → int → long → float → double</p><ul><li><strong>Narrowing Casting</strong> — done manually (large datatype to smaller)</li></ul><p>double →float → long → int → char → short → byte</p><h4>Widening Casting Example</h4><pre>int a = 9;</pre><pre>double b = a;</pre><h4>Narrowing Casting Example</h4><pre>double a = 9.423;</pre><pre>int b = (int) a;</pre><h3>Operators — which are used to perform operations on operands</h3><p>x = 100 + 50;</p><p>100, 50 → operand</p><p>+ → operator</p><blockquote>Types of operators</blockquote><ul><li><strong>Arithmetic Operators</strong></li></ul><ol><li>+</li><li>-</li><li>*</li><li>/</li><li>%</li><li>++</li><li>- -</li></ol><ul><li><strong>Assignment Operators</strong></li></ul><ol><li>=</li><li>+=</li><li>-=</li><li>*=</li><li>/=</li></ol><ul><li><strong>Comparison Operators</strong></li></ul><ol><li>==</li><li>!=</li><li>&gt;</li><li>&lt;</li><li>≥</li><li>≤</li></ol><ul><li><strong>Logical Operators</strong></li></ul><ol><li>&amp;&amp;</li><li>||</li><li>!</li></ol><ul><li><strong>Bitwise Operators</strong></li></ul><ol><li>Left Shift → &lt;&lt; → 10&lt;&lt;2 → 10*2² = 40</li><li>Right Shift → &gt;&gt; → 10&gt;&gt;2 → 10/2² = 2</li><li>&gt;&gt;&gt; → for negative number, it changes the parity bit (MSB) to 0</li><li>&amp;, | → checks both the conditions no matter if first is false</li></ol><ul><li><strong>Ternary Operators</strong></li></ul><p>a&gt;b ? a : b; //it basically means if a&gt;b then return a else return b</p><h3>Keywords — those words which are reserved (predefined)</h3><p>ex. boolean, int, break, byte etc.</p><h3>Objects — instance of a class</h3><p>Through objects we can access class variables and methods. It consists of a state (stored in fields)&amp; behavior (methods) of a class.</p><blockquote>Creating an object</blockquote><pre>class Student {<br>  ...<br>}<br>class Main {<br>  public static void main(String[] args) {<br>    Student s = new Student(); //object for class Student<br>  }<br>}</pre><h3>References —</h3><p>It points out to the object created, holds the location of the object in the memory. It is created alongside with the creation of object.</p><h3>Read Inputs from users</h3><p>We’ll use Scanner module of java.util package to take inputs from the users</p><pre>import java.util.Scanner;<br>class Main {<br>  public static void main(String[] args) {<br>    Scanner sc = new Scanner(System.in); /*System.in refers to readm    <br>                                        what we type from keyboard*/<br>    int a = sc.nextInt(); //take input from user of type integer<br>    float b = sc.nextFloat();<br>    double c = sc.nextDouble();<br>//  as nextDouble() won&#39;t read new line characters thus if use <br>//  nextLine() to read a string, it would result into an empty <br>//  string  as it will read that new line character, so we would use  //  nextLine() first and then read the string</pre><pre>    nextLine();<br>    String s = nextLine();<br>    boolean d = hasNextInt(); //returns true if the input is integer</pre><h3>Control Statements</h3><h4>if-else</h4><pre>if(condition) {<br>  statements<br>} else if(condition2) {<br>  statements<br>} else {<br> statements<br>}</pre><h4>switch-case</h4><pre>switch(expression) {<br>  case value1 : ... <br>  break;<br>  case value2 : ...<br>  break;<br>  case value3 : ...<br>  break;<br>  default : ...<br>}</pre><h4>for loop</h4><pre>for (initialization;condition;increment/decrement) {<br> ... <br>}</pre><h4>while loop</h4><pre>while(condition) {<br>  ...<br>}</pre><h4>do while loop — executes for atleast 1 time</h4><pre>do {<br>  ... <br>} while(condition);</pre><h4>for each — direct access to the elements of the array</h4><pre>for(type var: array) {<br>  ... <br>}</pre><h3>Array</h3><p>It is a collection of homogeneous elements that has contiguous memory location. It is a data structure where we store same data of similar datatype.</p><p>It has a fixed size defined by the user.</p><p>We can store any primitive values or objects in an array.</p><p><strong>Types of Arrays</strong></p><ol><li>Single Dimensional</li><li>Multidimensional</li></ol><blockquote>Declaration of array (single dimensional)</blockquote><pre>int[] arr; // declaration<br>arr = new int[5]; //instantiation <br>int[] arr = new int[5]; // declaration and instantiation <br>int a[] = {33,3,4,5} // intialization</pre><blockquote>Declaration of array (multi dimensional)</blockquote><pre>int[][] arr = new int[3][3]; //3 rows &amp; 3 columns<br>arr[0][0]=1;<br>arr[0][1]=2;<br>...</pre><h4>Jagged Array — array of arrays with different number of columns</h4><pre>int values[][] = new int[3][];</pre><pre>values[0] = new int[1];</pre><pre>values[1] = new int[3];</pre><pre>values[2] = new int[2];<br></pre><pre>for(int i=0;i&lt;values.length;i++) {</pre><pre>  for(int j=0; j&lt;values[i].length;j++) {</pre><pre>    values[i][j]=sc.nextInt();</pre><pre>  }</pre><pre>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c70d64230fe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/java-a-quick-tour-1c70d64230fe">Java — A Quick Tour</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remove Duplicates from Sorted Array — LeetCode]]></title>
            <link>https://arasharora2001.medium.com/remove-duplicates-from-sorted-array-leetcode-3b96b15c3f44?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b96b15c3f44</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Fri, 26 Nov 2021 14:16:00 GMT</pubDate>
            <atom:updated>2021-11-29T00:09:04.694Z</atom:updated>
            <content:encoded><![CDATA[<h3>Remove Duplicates from Sorted Array — LeetCode</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQDabMVcpqbe8MhM" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Given an integer array nums sorted in <strong>non-decreasing order</strong>, remove the duplicates <a href="https://en.wikipedia.org/wiki/In-place_algorithm"><strong>in-place</strong></a> such that each unique element appears only <strong>once</strong>. The <strong>relative order</strong> of the elements should be kept the <strong>same</strong>.</p><p>Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the <strong>first part</strong> of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.</p><p>Return k<em> after placing the final result in the first </em>k<em> slots of </em>nums.</p><p>Do <strong>not</strong> allocate extra space for another array. You must do this by <strong>modifying the input array </strong><a href="https://en.wikipedia.org/wiki/In-place_algorithm"><strong>in-place</strong></a> with O(1) extra memory.</p><p><strong>Constraints:</strong></p><ul><li>0 &lt;= nums.length &lt;= 3 * 104</li><li>-100 &lt;= nums[i] &lt;= 100</li><li>nums is sorted in <strong>non-decreasing</strong> order</li></ul><p><strong>Custom Judge:</strong></p><p>The judge will test your solution with the following code:</p><pre>int[] nums = [...]; // Input array<br>int[] expectedNums = [...]; // The expected answer with correct length</pre><pre>int k = removeDuplicates(nums); // Calls your implementation</pre><pre>assert k == expectedNums.length;<br>for (int i = 0; i &lt; k; i++) {<br>    assert nums[i] == expectedNums[i];<br>}</pre><p>If all assertions pass, then your solution will be <strong>accepted</strong>.</p><h4>My Solution —</h4><pre><strong>class solution</strong> {<br>  <strong>public: </strong><br>   <strong>int removeDuplicates</strong>(vector&lt;<strong>int</strong>&gt;&amp; nums)//given parameter&#39;s vector<br>   {<br><strong>      unordered_set</strong>&lt;<strong>int</strong>&gt; s; // taken a set as a variable<br>      <strong>for</strong>(<strong>int </strong>i:nums) // mapped through all the elements of nums<br>        s.<strong>insert</strong>(i); //inserted the non duplicate elements in s<br>      nums.<strong>clear</strong>() // emptied the vector nums<br>      <strong>for</strong>(<strong>int </strong>i:s)<br>        nums.<strong>push_back</strong>(i) //appended the elements from s to nums<br>      <strong>sort</strong>(nums.<strong>begin</strong>(), nums.<strong>end</strong>()) //sorted nums<br>      <strong>return </strong>s.<strong>size</strong>()<br>   }<br>}</pre><blockquote>Runtime: <strong>20 ms</strong></blockquote><blockquote>Memory Usage: <strong>18.9 MB</strong></blockquote><h4>Other Solution —</h4><pre><strong>class</strong> <strong>Solution</strong> { <br>  <strong>public</strong>: <br>  <strong>int</strong> <strong>removeDuplicates</strong>(vector&lt;<strong>int</strong>&gt;&amp; nums) <br>  { <br>    <strong>int</strong> j = 0; <br>    <strong>int</strong> n = nums.size(); <br>    <strong>if</strong>(n &lt;= 1) <strong>return</strong> n; //return the size of nums if n&lt;=1<br>    <strong>for</strong>(<strong>int</strong> i = 1; i&lt;n; i++)<br>    { <br>      <strong>if</strong>(nums[i] != nums[j]) <br>      { <br>         j++; <br>         nums[j] = nums[i]; //<br>      } <br>    } <br>    <strong>return</strong> j+1; <br>  } <br>};</pre><blockquote>Runtime: <strong>16 ms</strong></blockquote><blockquote>Memory Usage: <strong>18.2 MB</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b96b15c3f44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linked List]]></title>
            <link>https://faun.pub/linked-list-3b134084cdda?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b134084cdda</guid>
            <category><![CDATA[linked-lists]]></category>
            <category><![CDATA[placement]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[dynamic-memory-allocation]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Sat, 30 Oct 2021 15:01:56 GMT</pubDate>
            <atom:updated>2021-11-01T13:38:03.320Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>It is defined as the collection of nodes that are randomly stored in the main memory.</li><li>Nodes are stored in non contiguous memory</li><li>We’ve to traverse linearly through a linked list thus it is a <strong>linear data structure</strong> in terms of <strong>traversal</strong></li><li>Else it acts as a <strong>non linear data structure</strong> in terms of <strong>storage</strong></li></ul><h4>Node</h4><p>It contains 2 fields</p><ol><li><strong>Data </strong>— number, string and anything which could be an asset to a company</li><li><strong>Pointer </strong>—which holds the address to the next node</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*saLy_7o1gsm77WlC.jpeg" /></figure><h4>Types</h4><ol><li>Singly Linked List</li><li>Doubly Linked List</li><li>Circular Linked List</li></ol><h3>SINGLY LINKED LIST —</h3><h4>Declaration of a Linked List</h4><pre>struct node {</pre><pre>  int data; //data in the node</pre><pre>  struct node *next; /*pointer which holds the address of next node</pre><pre>};<br>  /*Mandatory declaration of pointers which we&#39;re gonna use in   future code*/<br>  struct node *start=NULL, *last=NULL, *newnode, *temp=NULL, *del;</pre><h4>Creation of nodes</h4><pre>//Creating a node</pre><pre>void create()</pre><pre>{</pre><pre>  newnode = (struct node*)malloc(sizeof(struct node));</pre><pre>  /*</pre><pre>  (struct node*) - type casting to type struct node</pre><pre>  malloc - allocate memory, returns the void pointer (that&#39;s why type casted)</pre><pre>  sizeof(struct node) - defines the size of memory to be allocated to the pointer</pre><pre>  */</pre><pre>  printf(&quot;ELEMENT : &quot;);</pre><pre>  scanf(&quot;%d&quot;,&amp;newnode-&gt;data);</pre><pre>}</pre><h4>Insertion of a node at beginning</h4><pre>//Insert a node in front</pre><pre>void ins_front()</pre><pre>{</pre><pre>  create();</pre><pre>  if(newnode == NULL)</pre><pre>  {</pre><pre>    printf(&quot;OVERFLOW \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else if(start==NULL)</pre><pre>  {</pre><pre>    newnode-&gt;next = NULL;</pre><pre>    start=last=newnode;</pre><pre>  }</pre><pre>  else {</pre><pre>    newnode-&gt;next=start-&gt;next;</pre><pre>    start=newnode;</pre><pre>  }<br>}</pre><h4>Insertion of a node at end</h4><pre>//Insert a node in end</pre><pre>void ins_end()</pre><pre>{</pre><pre>  create();</pre><pre>  if(newnode==NULL)</pre><pre>  {</pre><pre>    printf(&quot;OVERFLOW! \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else if(start==NULL)</pre><pre>  {</pre><pre>    newnode-&gt;next = NULL;</pre><pre>    start=last=newnode;</pre><pre>  }</pre><pre>  else {</pre><pre>    newnode-&gt;next=NULL;</pre><pre>    last-&gt;next=newnode;</pre><pre>    last=newnode;</pre><pre>  }</pre><pre>}</pre><h4>Insertion of a node at specific position</h4><pre>//Insert a node at specific position</pre><pre>void ins_sp(){</pre><pre>  int i=1,pos;</pre><pre>  create();</pre><pre>  printf(&quot;POSITION : &quot;);</pre><pre>  scanf(&quot;%d&quot;,&amp;pos);</pre><pre>  temp=start;</pre><pre>  while(i&lt;pos-1 &amp;&amp; temp!=NULL)</pre><pre>  {</pre><pre>    temp=temp-&gt;next;</pre><pre>    i++;</pre><pre>  }</pre><pre>  newnode-&gt;next = temp-&gt;next;</pre><pre>  temp-&gt;next=newnode;</pre><pre>}</pre><h4>Deletion of a node from beginning</h4><pre>//Delete a node from beginning</pre><pre>void del_beg()</pre><pre>{</pre><pre>  if(start==NULL)</pre><pre>  {</pre><pre>    printf(&quot;UNDERFLOW! \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    del=start;</pre><pre>    start=start-&gt;next;</pre><pre>    free(del);</pre><pre>   }</pre><pre>}</pre><h4>Deletion of a node from end</h4><pre>//Delete a node from end</pre><pre>void del_end()</pre><pre>{</pre><pre>  if(start==NULL)</pre><pre>  {</pre><pre>    printf(&quot;UNDERFLOW!\n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    del=last;</pre><pre>    temp=start;</pre><pre>    while(temp-&gt;next!=last)</pre><pre>    {</pre><pre>       temp=temp-&gt;next;</pre><pre>    }</pre><pre>    temp-&gt;next=NULL;</pre><pre>    free(del);</pre><pre>  }</pre><pre>}</pre><h4>Deletion of a node from a specific position</h4><pre>//Delete a node from a specific position</pre><pre>void del_sp()</pre><pre>{</pre><pre>  int i=1,pos;</pre><pre>  if(start==NULL)</pre><pre>  {</pre><pre>    printf(&quot;UNDERFLOW!\n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    printf(&quot;POSITION : &quot;);</pre><pre>    scanf(&quot;%d&quot;,&amp;pos);</pre><pre>    temp=start;</pre><pre>    while(i&lt;pos-1 &amp;&amp; temp!=NULL)</pre><pre>    {</pre><pre>      temp=temp-&gt;next;</pre><pre>      i++;</pre><pre>    }</pre><pre>   del=temp-&gt;next;</pre><pre>   temp-&gt;next=del-&gt;next;</pre><pre>   free(del);</pre><pre>  }</pre><pre>}</pre><h4>Traversal of nodes</h4><pre>//Traversal</pre><pre>void trav()</pre><pre>{</pre><pre>  temp=start;</pre><pre>  while(temp!=NULL)</pre><pre>  {</pre><pre>    printf(&quot;%d\t&quot;,temp-&gt;data);</pre><pre>    temp=temp-&gt;next;</pre><pre>  }</pre><pre>  printf(&quot;\n&quot;);</pre><pre>}</pre><h4>Main Function</h4><pre>int main(void) {</pre><pre>  int ch;</pre><pre>  char ch1;</pre><pre>  do {</pre><pre>    printf(&quot;1. Insertion at beg\n2. Insertion at end\n3.    Traversing\n4. Insertion at specific pos\n5. Deletion from beg\n6. Deletion from end\n7. Deletion from specific pos &quot;);</pre><pre>    scanf(&quot;%d&quot;,&amp;ch);</pre><pre>    if(ch==1)</pre><pre>      ins_front();</pre><pre>    else if(ch==2)</pre><pre>      ins_end();</pre><pre>    else if(ch==3)</pre><pre>      trav();</pre><pre>    else if(ch==4)</pre><pre>      ins_sp();</pre><pre>    else if(ch==5)</pre><pre>      del_beg();</pre><pre>    else if(ch==6)</pre><pre>      del_end();</pre><pre>    else if(ch==7)</pre><pre>      del_sp();</pre><pre>    printf(&quot;Press y to continue &quot;);</pre><pre>    scanf(&quot;%s&quot;,&amp;ch1);</pre><pre>  }while(ch1==&#39;y&#39; || ch1==&#39;1&#39;);</pre><pre>  return 0;</pre><pre>}</pre><h4>Full Code —</h4><pre>#include &lt;stdio.h&gt;</pre><pre>#include &lt;stdlib.h&gt;</pre><pre>struct node {</pre><pre>  int data; //data in the node</pre><pre>  struct node *next; //pointer which holds the address of next node</pre><pre>};</pre><pre>struct node *newnode,*del,*temp,*start=NULL,*last=NULL;</pre><pre><br>//Creating a node</pre><pre>void create()</pre><pre>{</pre><pre>  newnode = (struct node*)malloc(sizeof(struct node));</pre><pre>  /*</pre><pre>  (struct node*) - type casting to type struct node</pre><pre>  malloc - allocate memory, returns the void pointer (that&#39;s why  type casted)</pre><pre>  sizeof(struct node) - defines the size of memory to be allocated to the pointer</pre><pre>  */</pre><pre>  printf(&quot;ELEMENT : &quot;);</pre><pre>  scanf(&quot;%d&quot;,&amp;newnode-&gt;data);</pre><pre>}</pre><pre>//Insert a node in front</pre><pre>void ins_front()</pre><pre>{</pre><pre>  create();</pre><pre>  if(newnode == NULL)</pre><pre>  {</pre><pre>    printf(&quot;OVERFLOW \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else if(start==NULL)</pre><pre>  {</pre><pre>    newnode-&gt;next = NULL;</pre><pre>    start=last=newnode;</pre><pre>  }</pre><pre>  else {</pre><pre>    newnode-&gt;next=start-&gt;next;</pre><pre>    start=newnode;</pre><pre>  }</pre><pre>}</pre><pre><br>//Insert a node in end</pre><pre>void ins_end()</pre><pre>{</pre><pre>  create();</pre><pre>  if(newnode==NULL)</pre><pre>  {</pre><pre>    printf(&quot;OVERFLOW! \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else if(start==NULL)</pre><pre>  {</pre><pre>    newnode-&gt;next = NULL;</pre><pre>    start=last=newnode;</pre><pre>  }</pre><pre>  else {</pre><pre>    newnode-&gt;next=NULL;</pre><pre>    last-&gt;next=newnode;</pre><pre>    last=newnode;</pre><pre>  }</pre><pre>}</pre><pre>//Insert a node at specific position</pre><pre>void ins_sp(){</pre><pre>  int i=1,pos;</pre><pre>  create();</pre><pre>  printf(&quot;POSITION : &quot;);</pre><pre>  scanf(&quot;%d&quot;,&amp;pos);</pre><pre>  temp=start;</pre><pre>  while(i&lt;pos-1 &amp;&amp; temp!=NULL)</pre><pre>  {</pre><pre>    temp=temp-&gt;next;</pre><pre>    i++;</pre><pre>  }</pre><pre>  newnode-&gt;next = temp-&gt;next;</pre><pre>  temp-&gt;next=newnode;<br>}</pre><pre>//Delete a node from beginning</pre><pre>void del_beg()</pre><pre>{</pre><pre>  if(start==NULL)</pre><pre>  { </pre><pre>    printf(&quot;UNDERFLOW! \n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    del=start;</pre><pre>    start=start-&gt;next;</pre><pre>    free(del);</pre><pre>  }</pre><pre>}</pre><pre>//Delete a node from end</pre><pre>void del_end()</pre><pre>{</pre><pre>  if(start==NULL)</pre><pre>  {</pre><pre>    printf(&quot;UNDERFLOW!\n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    del=last;</pre><pre>    temp=start;</pre><pre>    while(temp-&gt;next!=last)</pre><pre>    {</pre><pre>      temp=temp-&gt;next;</pre><pre>    }</pre><pre>    temp-&gt;next=NULL;</pre><pre>    free(del);</pre><pre>  }</pre><pre>}</pre><pre>//Delete a node from a specific position</pre><pre>void del_sp()</pre><pre>{</pre><pre>  int i=1,pos;</pre><pre>  if(start==NULL)</pre><pre>  {</pre><pre>    printf(&quot;UNDERFLOW!\n&quot;);</pre><pre>    exit(0);</pre><pre>  }</pre><pre>  else {</pre><pre>    printf(&quot;POSITION : &quot;);</pre><pre>    scanf(&quot;%d&quot;,&amp;pos);</pre><pre>    temp=start;</pre><pre>    while(i&lt;pos-1 &amp;&amp; temp!=NULL)</pre><pre>    {</pre><pre>      temp=temp-&gt;next;</pre><pre>      i++;<br>    }</pre><pre>    del=temp-&gt;next;</pre><pre>    temp-&gt;next=del-&gt;next;</pre><pre>    free(del);</pre><pre>  }<br>}</pre><pre>//Traversal</pre><pre>void trav()</pre><pre>{</pre><pre>  temp=start;</pre><pre>  while(temp!=NULL)</pre><pre>  {</pre><pre>     printf(&quot;%d\t&quot;,temp-&gt;data);</pre><pre>     temp=temp-&gt;next;</pre><pre>  }</pre><pre>  printf(&quot;\n&quot;);</pre><pre>}</pre><pre><br>//Main function</pre><pre>int main(void) {</pre><pre>  int ch;</pre><pre>  char ch1;</pre><pre>  do {</pre><pre>   printf(&quot;1. Insertion at beg\n2. Insertion at end\n3.  Traversing\n4. Insertion at specific pos\n5. Deletion from beg\n6. Deletion from end\n7. Deletion from specific pos &quot;);</pre><pre>  scanf(&quot;%d&quot;,&amp;ch);</pre><pre>  if(ch==1)</pre><pre>    ins_front();</pre><pre>  else if(ch==2)</pre><pre>    ins_end();</pre><pre>  else if(ch==3)</pre><pre>    trav();</pre><pre>  else if(ch==4)</pre><pre>    ins_sp();</pre><pre>  else if(ch==5)</pre><pre>    del_beg();</pre><pre>  else if(ch==6)</pre><pre>    del_end();</pre><pre>  else if(ch==7)</pre><pre>    del_sp();</pre><pre>  printf(&quot;Press y to continue &quot;);</pre><pre>  scanf(&quot;%s&quot;,&amp;ch1);</pre><pre>  }while(ch1==&#39;y&#39; || ch1==&#39;1&#39;);</pre><pre>  return 0;</pre><pre>}</pre><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b134084cdda" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/linked-list-3b134084cdda">Linked List</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Burp Suite Set Up]]></title>
            <link>https://arasharora2001.medium.com/burp-suite-set-up-e70526e0a4fb?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e70526e0a4fb</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[proxy]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Tue, 12 Oct 2021 17:11:27 GMT</pubDate>
            <atom:updated>2021-10-12T17:11:27.697Z</atom:updated>
            <content:encoded><![CDATA[<p>It is a <strong>proxy tool</strong> which can intercept requests and is often used for evaluating security of web-based applications and doing hands-on testing</p><p>It comes with 3 editions out of which community edition is free — <a href="https://portswigger.net/burp/communitydownload">Download Burp Suite Community Edition — PortSwigger</a></p><h4>It is recommended to use burpsuite on port 8081 rather than 8080, so in order to change it we can</h4><ul><li>Go to Proxy tab</li><li>Click on options</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ch4xtvSoBtdrvQFA1II_7Q.png" /></figure><ul><li>Click and edit the proxy listeners and change the port to 8081</li><li>Click OK</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*caUqeBIubI7HDtp2_rxSLg.png" /></figure><ul><li>Open firefox</li><li>Swipe all the way down to Network Settings, click settings</li><li>Select Manual proxy Configuration</li><li>Change the HTTP Proxy to 127.0.0.1 and Port to 8081</li><li>Select also use this proxy for FTP and HTTPS</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLyzQSo1kb2At7NpNHPxMw.png" /></figure><ul><li>Click OK</li></ul><h4>To download the certificate</h4><ul><li>Go to <a href="http://burp/">http://burp</a> and on the top right corner click CA Certificate</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZAcFq8ENUAYO1V_SMBdsw.png" /></figure><ul><li>Save it</li><li>Open your firefox’s preferences</li><li>Search for “certificates”</li><li>Import the newly downloaded certificate</li><li>Tick the checkboxes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EqpB5R_uVIJXuhi0Ksqxw.png" /></figure><ul><li>Click OK</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e70526e0a4fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase]]></title>
            <link>https://faun.pub/firebase-881a1d4b549?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/881a1d4b549</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Sun, 03 Oct 2021 10:46:28 GMT</pubDate>
            <atom:updated>2021-10-04T07:51:48.355Z</atom:updated>
            <content:encoded><![CDATA[<p>It is a platform developed by Google for creating web and mobile apps. It is a Backend-as-a-Service (Baas) that provides developers with a variety of tools and assistance to help them develop quality apps, grow their user base, and earn profit. The Firebase Realtime Database lets you build rich, collaborative applications by allowing secure access to the database directly from client-side code. Firebase is categorized as a NoSql database program, which stores data in JSON-like documents.</p><h4>Key Features</h4><ol><li><strong>Authentication</strong></li></ol><p>It supports authentication using passwords, phone numbers, Google, Facebook, Twitter, and more.</p><p>2.<strong> Realtime database</strong></p><p>Data is synced across all clients in real-time and remains available even when an app goes offline.</p><p>3. <strong>Hosting</strong></p><p>Firebase Hosting provides fast hosting for a web app; content is cached into content delivery networks worldwide.</p><p>4. <strong>Test lab</strong></p><p>The application is tested on virtual and physical devices located in Google’s data centers.</p><p>5. <strong>Notifications</strong></p><p>Notifications are sent with firebase with no additional coding.</p><h4>Set Up a Firebase App</h4><ol><li>Go to <a href="https://console.firebase.google.com/">Firebase</a></li><li>Login to your google account</li><li>Click <strong>Get Started</strong></li><li>Then add a project</li><li>Name your project</li><li>Enable Google Analytics (totally upto you)</li><li>Choose an account for google analytics</li><li>Create project</li><li><strong>Then register the app → </strong>heading over to settings icon in the sidebar and then to project settings</li><li>Select as per your project (mine is web app so I’ll choose 3rd icon from the left in figure 1)</li><li>Give a suitable nickname and copy the firebase SDK into your code</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WEk1JN4RpUC4SnckhgCHXg.png" /><figcaption>Figure 1 — Platform</figcaption></figure><h4>Set Up a Firestore Database</h4><ol><li>From the list of your registered firebase apps, select an app for which you want to create a database. Check your apps <a href="https://console.firebase.google.com/">here</a></li><li>Head to Firestore Database</li><li>Create database</li><li>Start in test mode</li><li>Click next</li><li>Cloud Firestore location is totally fine being nam5 (us-central) but you can change as per your preference</li><li>Enable</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*OM7Q76VFgwF68mKUuQTDmw.png" /></figure><p>Firebase Database is a NoSql structure.</p><p>It structure is somewhat like (suppose I’m building a chat room)</p><p># Collection of rooms → several documents, each document represent a different room→ Each room has it’s own collection of messages in the form o documents</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*NwhesLzCY1ZXWBTZtm_IJg.png" /></figure><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=881a1d4b549" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/firebase-881a1d4b549">Firebase</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DHCP Starvation]]></title>
            <link>https://arasharora2001.medium.com/dhcp-starvation-4aebca98b884?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aebca98b884</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[dhcp-starvation-attack]]></category>
            <category><![CDATA[dhcp]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitm]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Sat, 25 Sep 2021 10:31:49 GMT</pubDate>
            <atom:updated>2021-11-09T03:20:55.221Z</atom:updated>
            <content:encoded><![CDATA[<p>When a PC or any sort of device boots up on a network, it is a DHCP client. It’s gonna issue a DHCP Discover packet that means it is looking for a DHCP server which can issue it an IP address.</p><p>The server which hears the request would send over an offer — the IP address the client is allowed to use.</p><p>DHCP server has the pool of addresses on a /24 network, maximum number of addresses in the pool could be 254, out of which 1 or 2 are saved for static router addresses.</p><p>After this the client sends the message back saying I’d like to request the IP address you just offered. And finally the server sends the ACK packet.</p><h4>4 basic Packets involved —</h4><ol><li>Discover</li><li>Offer</li><li>Request</li><li>ACK</li></ol><h4>Attack</h4><p>when an attacker sends 100s of DHCP discover malicious packets using a bogus made up mac addresses as the source mac address for each of the request, and when the server offers IP addresses to all of them. And once this server has no more IP address to offer, then the attacker will bring his own DHCP server known as rogue DHCP server. The clients who are offered the IP addresses would use the attacker’s default gateway and thus the client’s information would be routed through the attacker’s machine so as Man In The Middle Attack.</p><blockquote>We can use <strong>yersinia </strong>tool to launch DHCP Starvation Attack</blockquote><p>Steps</p><ol><li>Start yersinia gui</li></ol><pre>yersinia -G</pre><p>2. Launch attack</p><p>3. Select DHCP and then sending DISCOVERY packet</p><p>4. Press okay and the attack would start</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKDRxgpwbFjesw8RqXYcTA.png" /></figure><h4>Prevention</h4><p>Port Security</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aebca98b884" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MAC Flooding Attack]]></title>
            <link>https://arasharora2001.medium.com/mac-flooding-attack-8a9ada4f94e5?source=rss-d19d0346f89f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a9ada4f94e5</guid>
            <category><![CDATA[mac-address]]></category>
            <category><![CDATA[mac-flooding]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[switch]]></category>
            <dc:creator><![CDATA[Arash Arora]]></dc:creator>
            <pubDate>Sat, 25 Sep 2021 07:47:29 GMT</pubDate>
            <atom:updated>2021-09-25T14:15:29.247Z</atom:updated>
            <content:encoded><![CDATA[<h4>MAC Address—</h4><p>Media Access Control — unique address assigned to a NIC (Network Interface Card) of your machine.</p><h4>MAC Flooding —</h4><p>It is a type of attack in which we overload the switch by sending the large amount of ARP responses leading to the switching of the switch to a hub. Which further means it will forward traffic to each and every device on the network. Thus a hacker can easily intrude the data using network sniffing tools like <strong>Wireshark</strong>.</p><h4>MACOF —</h4><p>It is a part of DSNIFF tool suit. It is mainly used to flood the switch on a local network with MAC addresses</p><blockquote><strong>Command —</strong></blockquote><pre>macof -i eth1 -n 10 -d 192.168.0.1</pre><ul><li>-i → interface</li><li>eth0 → ethernet interface</li><li>-n → number of packets to send</li><li>-d → target IP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZF839u3maQVeiYJjqMVUA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a9ada4f94e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>