<?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: B Mithilesh</title>
    <description>The latest articles on DEV Community by B Mithilesh (@kingsmen732).</description>
    <link>https://dev.to/kingsmen732</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%2F1631667%2Fa005e303-c3df-45d1-9056-91ede7abcda7.png</url>
      <title>DEV Community: B Mithilesh</title>
      <link>https://dev.to/kingsmen732</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kingsmen732"/>
    <language>en</language>
    <item>
      <title>OverTheWire: Bandit - Level 0</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Tue, 22 Jul 2025 16:53:10 +0000</pubDate>
      <link>https://dev.to/kingsmen732/overthewire-bandit-level-0-23kd</link>
      <guid>https://dev.to/kingsmen732/overthewire-bandit-level-0-23kd</guid>
      <description>&lt;h2&gt;
  
  
  OverTheWire: Bandit - Level 0
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Level Goal
&lt;/h2&gt;

&lt;p&gt;The goal of this level is to log into the game using SSH. Once logged in, go to the &lt;a href="https://overthewire.org/wargames/bandit/bandit1.html" rel="noopener noreferrer"&gt;Level 1&lt;/a&gt; page to find out how to beat Level 1.&lt;/p&gt;




&lt;h2&gt;
  
  
  Connection Details
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Username&lt;/strong&gt;: &lt;code&gt;bandit0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password&lt;/strong&gt;: &lt;code&gt;bandit0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hostname&lt;/strong&gt;: &lt;code&gt;bandit.labs.overthewire.org&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port&lt;/strong&gt;: &lt;code&gt;2220&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Commands You May Need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ssh&lt;/code&gt; – OpenSSH remote login client&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What is SSH?
&lt;/h2&gt;

&lt;p&gt;SSH (Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network. It’s commonly used to remotely log into machines, transfer files, and execute commands securely.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Secure_Shell" rel="noopener noreferrer"&gt;Wikipedia: SSH (Secure Shell)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wikihow.com/Use-SSH" rel="noopener noreferrer"&gt;How to Use SSH – WikiHow Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Solution Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open Terminal&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On &lt;strong&gt;Windows&lt;/strong&gt;, use &lt;strong&gt;PowerShell&lt;/strong&gt; or &lt;strong&gt;Command Prompt&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;On &lt;strong&gt;Linux/macOS&lt;/strong&gt;, use the built-in terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Execute SSH Command&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ssh bandit0@bandit.labs.overthewire.org &lt;span class="nt"&gt;-p&lt;/span&gt; 2220
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fingerprint Prompt&lt;/strong&gt;:
If prompted to accept the server's fingerprint, type:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Password Prompt&lt;/strong&gt;:
Enter the password:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Successful Login&lt;/strong&gt;:
You should see a banner like:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   This is an OverTheWire game server. More information on http://www.overthewire.org/wargames
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;To Exit SSH&lt;/strong&gt;:
Type &lt;code&gt;exit&lt;/code&gt; or use &lt;code&gt;Ctrl + D&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Helpful Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ensure your internet connection is stable before connecting.&lt;/li&gt;
&lt;li&gt;If the connection hangs, try re-running the SSH command.&lt;/li&gt;
&lt;li&gt;Double-check the port number &lt;code&gt;-p 2220&lt;/code&gt; — it's not the default SSH port.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Next Step
&lt;/h2&gt;

&lt;p&gt;Once you’ve successfully logged in, proceed to &lt;a href="https://overthewire.org/wargames/bandit/bandit1.html" rel="noopener noreferrer"&gt;Bandit Level 1&lt;/a&gt; to continue.&lt;/p&gt;

</description>
      <category>overthewire</category>
      <category>cybersecurity</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Bypass Netflix’s Same Household Block — With a Fullscreen Playbar That Just Works</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Mon, 16 Jun 2025 14:02:08 +0000</pubDate>
      <link>https://dev.to/kingsmen732/bypass-netflixs-same-household-block-with-a-fullscreen-playbar-that-just-works-4lpb</link>
      <guid>https://dev.to/kingsmen732/bypass-netflixs-same-household-block-with-a-fullscreen-playbar-that-just-works-4lpb</guid>
      <description>&lt;p&gt;Built out of frustration as a broke student, this extension adds a fullscreen playbar to Netflix and blocks those annoying “same home network” modals. No fancy UI — just works. Makes Netflix load faster, look better, and stop nagging.&lt;/p&gt;

&lt;p&gt;No data collected, no bloat, no BS. Just pure DOM hacking.&lt;/p&gt;

&lt;p&gt;Because I just wanted to watch in peace 😤&lt;/p&gt;

</description>
      <category>netflix</category>
      <category>extensions</category>
      <category>bypass</category>
      <category>localhackday</category>
    </item>
    <item>
      <title>Ambient lighting - DIY</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Sun, 15 Jun 2025 13:53:26 +0000</pubDate>
      <link>https://dev.to/kingsmen732/ambient-lighting-diy-2p90</link>
      <guid>https://dev.to/kingsmen732/ambient-lighting-diy-2p90</guid>
      <description>&lt;h2&gt;
  
  
  ✨ Bring Your Screen to Life with Ambient LED Lighting
&lt;/h2&gt;

&lt;p&gt;Ever seen TVs or gaming setups that glow with colors matching what's happening on the screen? That's ambient lighting — and now you can bring that magic to your own setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎥 What Is It?
&lt;/h2&gt;

&lt;p&gt;Imagine watching a sunset in a movie, and your room softly glows orange and red to match. Or playing a game, and as explosions light up your screen, your walls reflect the same fiery burst. That's what ambient LED lighting does — it extends your screen beyond the frame, creating an immersive atmosphere.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌈 How Does It Work?
&lt;/h2&gt;

&lt;p&gt;Without getting too technical: Tiny LED lights are placed around your screen — usually behind it. These lights "watch" what's happening on the edges of your screen in real-time, and then glow in matching colors. The result? Your entire room reacts to your screen, creating a dynamic, living light show that follows the action.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛋 Where Can You Use It?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🎮 &lt;strong&gt;Gaming setups&lt;/strong&gt; – Feel like you're &lt;em&gt;inside&lt;/em&gt; the game&lt;/li&gt;
&lt;li&gt;📺 &lt;strong&gt;Home theaters&lt;/strong&gt; – Add drama, warmth, and immersion&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Desktops&lt;/strong&gt; – Ambient vibes for work or late-night browsing&lt;/li&gt;
&lt;li&gt;🎶 &lt;strong&gt;Music visualizers&lt;/strong&gt; – Sync lights with beats and moods&lt;/li&gt;
&lt;li&gt;🧘‍♂️ &lt;strong&gt;Relaxation spaces&lt;/strong&gt; – Create calming light environments that shift slowly over time&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💡 Why It's Awesome
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Makes screens feel larger and more cinematic&lt;/li&gt;
&lt;li&gt;Reduces eye strain by softening the contrast between screen and room&lt;/li&gt;
&lt;li&gt;Transforms any space into something futuristic and alive&lt;/li&gt;
&lt;li&gt;Highly customizable: brightness, colors, patterns, and more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're a movie lover, gamer, or just someone who loves a cool vibe — ambient LED lighting adds a whole new dimension to your experience.&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>programming</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Simple Sieve - DSA</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Sun, 15 Jun 2025 13:19:31 +0000</pubDate>
      <link>https://dev.to/kingsmen732/simple-sieve-dsa-14mh</link>
      <guid>https://dev.to/kingsmen732/simple-sieve-dsa-14mh</guid>
      <description>&lt;h2&gt;
  
  
  🧮 A Simple Sieve of Eratosthenes in Java: Find All Primes Up to N
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"The prime numbers are the building blocks of all natural numbers."&lt;/em&gt;&lt;br&gt;&lt;br&gt;
— Carl Friedrich Gauss&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Prime numbers play a fundamental role in number theory and cryptography. In this post, we'll walk through the &lt;strong&gt;Sieve of Eratosthenes&lt;/strong&gt; — a simple and efficient algorithm to generate all prime numbers up to a given number &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We'll cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ What the sieve is
&lt;/li&gt;
&lt;li&gt;🧠 How it works
&lt;/li&gt;
&lt;li&gt;🔧 Java implementation (with fixed code)
&lt;/li&gt;
&lt;li&gt;🌍 Real-life applications of primes
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📌 What Is the Sieve of Eratosthenes?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Sieve of Eratosthenes&lt;/strong&gt; is a classic algorithm used to find all prime numbers less than a given integer &lt;code&gt;n&lt;/code&gt;. It does so by iteratively marking the multiples of each prime starting from 2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time Complexity:&lt;/strong&gt; &lt;code&gt;O(n log log n)&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Space Complexity:&lt;/strong&gt; &lt;code&gt;O(n)&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  💡 How Does It Work?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a boolean array of size &lt;code&gt;n + 1&lt;/code&gt;, initialized to &lt;code&gt;true&lt;/code&gt;. Each index represents a number.&lt;/li&gt;
&lt;li&gt;Starting from &lt;code&gt;2&lt;/code&gt;, for each number, if it is marked &lt;code&gt;true&lt;/code&gt;, mark all its multiples as &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;At the end, all indices with &lt;code&gt;true&lt;/code&gt; are prime.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  🧪 Java Implementation
&lt;/h2&gt;

&lt;p&gt;Here's a clean and corrected version of the sieve algorithm in Java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Scanner&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Arrays&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Main&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Scanner&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Input the upper limit&lt;/span&gt;

        &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;isPrime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
        &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Prime numbers up to "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" are:"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isPrime&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;print&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔍 Fixes Made to the Original Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Replaced undeclared variable &lt;code&gt;num&lt;/code&gt; with &lt;code&gt;n&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Fixed syntax error: &lt;code&gt;===&lt;/code&gt; → &lt;code&gt;==&lt;/code&gt; (Java uses &lt;code&gt;==&lt;/code&gt; for comparison)&lt;/li&gt;
&lt;li&gt;Included primes up to &lt;code&gt;n&lt;/code&gt; (inclusive)&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;isPrime[0]&lt;/code&gt; and &lt;code&gt;isPrime[1]&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; explicitly&lt;/li&gt;
&lt;li&gt;Used &lt;code&gt;Arrays.fill()&lt;/code&gt; for simplicity and clarity&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌍 Real-Life Applications of Prime Numbers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔐 Cryptography &amp;amp; Cybersecurity
&lt;/h3&gt;

&lt;p&gt;Public-key encryption algorithms like RSA use large primes for secure key generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎲 Random Number Generation
&lt;/h3&gt;

&lt;p&gt;Primes are used in linear congruential generators and hash functions to produce uniform randomness.&lt;/p&gt;

&lt;h3&gt;
  
  
  💽 Hashing Algorithms
&lt;/h3&gt;

&lt;p&gt;Prime table sizes reduce hash collisions, improving performance in hash tables and bloom filters.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎮 Procedural Generation in Graphics
&lt;/h3&gt;

&lt;p&gt;Games use prime intervals to generate less predictable world seeds and layouts.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 Mathematical Research &amp;amp; Theories
&lt;/h3&gt;

&lt;p&gt;The study of primes leads to groundbreaking theorems and conjectures (e.g., Goldbach's, Riemann Hypothesis).&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Try It Out Yourself
&lt;/h2&gt;

&lt;p&gt;You can run the above code on any online Java compiler:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔗 &lt;a href="https://replit.com" rel="noopener noreferrer"&gt;Replit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 &lt;a href="https://www.jdoodle.com" rel="noopener noreferrer"&gt;JDoodle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🔗 &lt;a href="https://www.onlinegdb.com" rel="noopener noreferrer"&gt;OnlineGDB&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just copy-paste the code, input a number like 100, and watch the primes roll out!&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>programming</category>
      <category>beginners</category>
      <category>java</category>
    </item>
    <item>
      <title>How to Share Internet Connection on Linux (Server to Client via Ethernet)</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Thu, 16 Jan 2025 16:43:13 +0000</pubDate>
      <link>https://dev.to/kingsmen732/how-to-share-internet-connection-on-linux-server-to-client-via-ethernet-52m4</link>
      <guid>https://dev.to/kingsmen732/how-to-share-internet-connection-on-linux-server-to-client-via-ethernet-52m4</guid>
      <description>&lt;p&gt;Sharing an Internet connection on Linux between two computers using an Ethernet cable might seem tricky at first, but it’s straightforward once you know the steps. Whether you’re troubleshooting, setting up a local network, or just exploring Linux networking, this guide has you covered.&lt;/p&gt;




&lt;h2&gt;
  
  
  📡 Steps to Configure Internet Sharing on the Server
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Open Network Connections
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;network icon&lt;/strong&gt; in the system tray or panel.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;"Edit Connections..."&lt;/strong&gt; from the dropdown menu.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Edit the Wired Connection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Network Connections&lt;/strong&gt; dialog, locate and double-click your &lt;strong&gt;Wired Connection&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;This is the connection that will be used to share Internet access. 
&lt;em&gt;👉 Leave the wireless connection untouched if it’s the one connected to the Internet.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Modify IPv4 Settings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;"IPv4 Settings" tab&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set the &lt;strong&gt;Method&lt;/strong&gt; to &lt;strong&gt;"Shared to other computers"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Save and close the settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Reconnect the Wired Network
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Disconnect and reconnect the Wired Network so it gets a new IP address.&lt;/li&gt;
&lt;li&gt;Make sure the server and client are physically connected via an Ethernet cable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Retrieve Connection Information
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Click on &lt;strong&gt;"Connection Information"&lt;/strong&gt; in the network menu.&lt;/li&gt;
&lt;li&gt;Note down the &lt;strong&gt;IP address&lt;/strong&gt; and &lt;strong&gt;network mask&lt;/strong&gt; assigned to the wired connection.
&lt;em&gt;(Example: &lt;code&gt;10.42.0.1/255.255.255.0&lt;/code&gt;).&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🖧 Steps to Configure the Client Computer
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Open Network Connections
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;On the client computer, click the &lt;strong&gt;network icon&lt;/strong&gt; and select &lt;strong&gt;"Edit Connections..."&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Edit the Wired Connection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Locate and double-click your &lt;strong&gt;Wired Connection&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Modify IPv4 Settings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;"IPv4 Settings" tab&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set the &lt;strong&gt;Method&lt;/strong&gt; to &lt;strong&gt;"Manual"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Assign an IP address on the same subnetwork as the server.
&lt;em&gt;👉 Example: &lt;code&gt;10.42.0.69&lt;/code&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Use the IP and network mask from the server for:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Netmask&lt;/strong&gt;: &lt;code&gt;255.255.255.0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway&lt;/strong&gt;: &lt;code&gt;10.42.0.1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS Servers&lt;/strong&gt;: &lt;code&gt;10.42.0.1&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Reconnect the Wired Network
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Disconnect and reconnect the Wired Network to apply the new settings.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Final Step
&lt;/h2&gt;

&lt;p&gt;Pat yourself on the back and surf away! 🎉&lt;/p&gt;




&lt;h2&gt;
  
  
  📢 Additional Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make sure the Ethernet cable is connected before reconnecting the networks on both computers.&lt;/li&gt;
&lt;li&gt;If Internet sharing doesn’t work as expected, verify the server’s firewall settings to ensure proper traffic routing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know if you have any questions or if this guide worked for you in the comments! 👇&lt;/p&gt;

</description>
      <category>linux</category>
      <category>networking</category>
      <category>ubuntu</category>
      <category>internet</category>
    </item>
    <item>
      <title>Regression</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Mon, 26 Aug 2024 16:20:49 +0000</pubDate>
      <link>https://dev.to/kingsmen732/regression-4g8i</link>
      <guid>https://dev.to/kingsmen732/regression-4g8i</guid>
      <description>&lt;h1&gt;
  
  
  Regression Evaluation Metrics
&lt;/h1&gt;

&lt;p&gt;When working with regression models, it's crucial to evaluate their performance by comparing the predicted and actual values. Here are some common metrics used for this purpose:&lt;/p&gt;

&lt;h3&gt;
  
  
  Mean Absolute Error (MAE)
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;Mean Absolute Error (MAE)&lt;/em&gt; indicates by how much each prediction was wrong on average, without considering whether the prediction was over or under the actual value. This metric is the mean of the absolute errors for the entire validation set.&lt;/p&gt;

&lt;p&gt;For example, consider predicting the number of ice creams sold. If the absolute errors are 2, 3, 3, 1, 2, and 3, the MAE is calculated as:&lt;/p&gt;

&lt;p&gt;MAE = (2 + 3 + 3 + 1 + 2 + 3) / 6 = 2.33&lt;/p&gt;

&lt;h3&gt;
  
  
  Mean Squared Error (MSE)
&lt;/h3&gt;

&lt;p&gt;While &lt;em&gt;MAE&lt;/em&gt; treats all discrepancies equally, sometimes it's desirable to amplify larger errors. The &lt;strong&gt;Mean Squared Error (MSE)&lt;/strong&gt; does this by squaring the errors before averaging them, which emphasizes larger errors more.&lt;/p&gt;

&lt;p&gt;Using the same ice cream example, the squared errors are 4, 9, 9, 1, 4, and 9, so the MSE is:&lt;/p&gt;

&lt;p&gt;MSE = (4 + 9 + 9 + 1 + 4 + 9) / 6 = 6&lt;/p&gt;

&lt;h3&gt;
  
  
  Root Mean Squared Error (RMSE)
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;MSE&lt;/strong&gt; metric is useful, but it doesn't represent the quantity measured by the label due to the squaring process. To bring it back to the original scale, we calculate the &lt;strong&gt;Root Mean Squared Error (RMSE)&lt;/strong&gt;, which is the square root of MSE.&lt;/p&gt;

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

&lt;p&gt;RMSE = √6 ≈ 2.45 (ice creams)&lt;/p&gt;

&lt;h3&gt;
  
  
  Coefficient of Determination (R²)
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Coefficient of Determination&lt;/strong&gt;, or &lt;strong&gt;R²&lt;/strong&gt;, measures the proportion of variance in the actual values explained by the model. An &lt;em&gt;R²&lt;/em&gt; value closer to 1 indicates a better fit.&lt;/p&gt;

&lt;p&gt;The formula for &lt;em&gt;R²&lt;/em&gt; is:&lt;/p&gt;

&lt;p&gt;R² = 1 - ∑(y - ŷ)² / ∑(y - ȳ)²&lt;/p&gt;

&lt;p&gt;In simple terms, if our ice cream regression model has an &lt;strong&gt;R²&lt;/strong&gt; of 0.95, it means that 95% of the variance in ice cream sales can be explained by the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Iterative Training
&lt;/h3&gt;

&lt;p&gt;In practice, developing a regression model involves &lt;em&gt;iterative training&lt;/em&gt;. This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feature selection and preparation:&lt;/strong&gt; Choosing the right features and applying transformations to ensure a better model fit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm selection:&lt;/strong&gt; While linear regression is one option, many other regression algorithms could be explored.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm parameters:&lt;/strong&gt; Adjusting hyperparameters to control the algorithm's behaviour and improve performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Through multiple iterations, a data scientist refines the model to achieve the best evaluation metrics suitable for the scenario.&lt;/p&gt;

</description>
      <category>regression</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Tree structure of Machine Learning</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Sun, 04 Aug 2024 13:36:24 +0000</pubDate>
      <link>https://dev.to/kingsmen732/tree-structure-of-machine-learning-4ioj</link>
      <guid>https://dev.to/kingsmen732/tree-structure-of-machine-learning-4ioj</guid>
      <description>&lt;p&gt;&lt;strong&gt;Supervised machine learning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Supervised machine learning is a general term for machine learning algorithms in which the training data includes both feature values and known label values. Supervised machine learning is used to train models by determining a relationship between the features and labels in past observations, so that unknown labels can be predicted for features in future cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regression&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Regression is a form of supervised machine learning in which the label predicted by the model is a numeric value. For example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- The number of ice creams sold on a given day, based on the temperature, rainfall, and windspeed.
- The selling price of a property based on its size in square feet, the number of bedrooms it contains, and socio-economic metrics for its location.
- The fuel efficiency (in miles-per-gallon) of a car based on its engine size, weight, width, height, and length.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Classification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Classification is a form of supervised machine learning in which the label represents a categorization, or class. There are two common classification scenarios.&lt;br&gt;
Binary classification&lt;/p&gt;

&lt;p&gt;In binary classification, the label determines whether the observed item is (or isn't) an instance of a specific class. Or put another way, binary classification models predict one of two mutually exclusive outcomes. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether a patient is at risk for diabetes based on clinical metrics like weight, age, blood glucose level, and so on.&lt;/li&gt;
&lt;li&gt;Whether a bank customer will default on a loan based on income, credit history, age, and other factors.&lt;/li&gt;
&lt;li&gt;Whether a mailing list customer will respond positively to a marketing offer based on demographic attributes and past purchases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all of these examples, the model predicts a binary true/false or positive/negative prediction for a single possible class.&lt;br&gt;
Multiclass classification&lt;/p&gt;

&lt;p&gt;Multiclass classification extends binary classification to predict a label that represents one of multiple possible classes. For example,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The species of a penguin (Adelie, Gentoo, or Chinstrap) based on its physical measurements.&lt;/li&gt;
&lt;li&gt;The genre of a movie (comedy, horror, romance, adventure, or science fiction) based on its cast, director, and budget.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In most scenarios that involve a known set of multiple classes, multiclass classification is used to predict mutually exclusive labels. For example, a penguin can't be both a Gentoo and an Adelie. However, there are also some algorithms that you can use to train multilabel classification models, in which there may be more than one valid label for a single observation. For example, a movie could potentially be categorized as both science fiction and comedy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unsupervised machine learning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unsupervised machine learning involves training models using data that consists only of feature values without any known labels. Unsupervised machine learning algorithms determine relationships between the features of the observations in the training data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clustering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most common form of unsupervised machine learning is clustering. A clustering algorithm identifies similarities between observations based on their features, and groups them into discrete clusters. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Group similar flowers based on their size, number of leaves, and number of petals.&lt;/li&gt;
&lt;li&gt;Identify groups of similar customers based on demographic attributes and purchasing behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In some ways, clustering is similar to multiclass classification; in that it categorizes observations into discrete groups. The difference is that when using classification, you already know the classes to which the observations in the training data belong; so the algorithm works by determining the relationship between the features and the known classification label. In clustering, there's no previously known cluster label and the algorithm groups the data observations based purely on similarity of features.&lt;/p&gt;

&lt;p&gt;In some cases, clustering is used to determine the set of classes that exist before training a classification model. For example, you might use clustering to segment your customers into groups, and then analyze those groups to identify and categorize different classes of customer (high value - low volume, frequent small purchaser, and so on). You could then use your categorizations to label the observations in your clustering results and use the labeled data to train a classification model that predicts to which customer category a new customer might belong.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>architecture</category>
      <category>classification</category>
    </item>
    <item>
      <title>IpLookup website - know your device IP in the network and device specifications</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Fri, 05 Jul 2024 12:48:54 +0000</pubDate>
      <link>https://dev.to/kingsmen732/ip-lookup-website-1pl9</link>
      <guid>https://dev.to/kingsmen732/ip-lookup-website-1pl9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://dev.tourl"&gt;https://ip.mithileshdev.co/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Dev Blog: Building a Web App to Display IP Address, Geolocation, and Device Specs
&lt;/h2&gt;

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

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this blog, I'll walk you through the process of building a web application that displays your IP address, geolocation, and detailed device specifications. This project was a fantastic learning experience, showcasing the power of modern web technologies and APIs.&lt;br&gt;
Project Overview&lt;/p&gt;

&lt;p&gt;Our web app provides the following features:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    IP Address and Geolocation&lt;/li&gt;
&lt;li&gt;    Device Specifications&lt;/li&gt;
&lt;li&gt;    Network Information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's dive into the implementation, breaking it down into small, digestible snippets.&lt;br&gt;
Setting Up the Project&lt;/p&gt;

&lt;p&gt;We started with a basic HTML structure to create the foundation of our web app.&lt;/p&gt;

&lt;p&gt;This simple setup includes placeholders for the different pieces of information we plan to display.&lt;br&gt;
Fetching IP Address and Geolocation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To get the user's IP address and geolocation, we used the IP Geolocation API. Here's the snippet for fetching and displaying this data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

async function fetchIPAndLocation() {
    const response = await fetch('https://api.ipgeolocation.io/ipgeo?apiKey=YOUR_API_KEY');
    const data = await response.json();
    document.getElementById('ip-address').innerText = `IP Address: ${data.ip}`;
    document.getElementById('location').innerText = `Location: ${data.city}, ${data.country_name} (Lat: ${data.latitude}, Lon: ${data.longitude})`;
}

fetchIPAndLocation();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using fetch, we make an API call to get the IP address and geolocation data, then update the HTML with this information.&lt;br&gt;
Gathering Device Specifications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To collect various device specs, we used multiple browser APIs. This snippet illustrates how to get screen size, device memory, CPU cores, and GPU info:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

function getDeviceSpecs() {
    const specs = {};
    specs.screenWidth = window.screen.width;
    specs.screenHeight = window.screen.height;
    specs.deviceMemory = navigator.deviceMemory || 'N/A';
    specs.hardwareConcurrency = navigator.hardwareConcurrency || 'N/A';

    const gl = document.createElement('canvas').getContext('webgl');
    specs.gpu = gl.getParameter(gl.UNMASKED_RENDERER_WEBGL);

    document.getElementById('device-specs').innerHTML = `
        &amp;lt;h2&amp;gt;Device Specs:&amp;lt;/h2&amp;gt;
        &amp;lt;p&amp;gt;Screen Size: ${specs.screenWidth} x ${specs.screenHeight}&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;Device Memory: ${specs.deviceMemory} GB&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;CPU Cores: ${specs.hardwareConcurrency}&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;GPU: ${specs.gpu}&amp;lt;/p&amp;gt;
    `;
}

getDeviceSpecs();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We accessed properties like window.screen.width and navigator.deviceMemory, and used WebGL to get GPU information.&lt;br&gt;
Displaying Battery Information&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Battery Status API provides battery level details:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

async function getBatteryInfo() {
    const battery = await navigator.getBattery();
    document.getElementById('device-specs').innerHTML += `
        &amp;lt;p&amp;gt;Battery Level: ${battery.level * 100}%&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;Battery Temperature: Not directly available, simulated value: 30°C&amp;lt;/p&amp;gt;
    `;
}

getBatteryInfo();

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

&lt;/div&gt;



&lt;p&gt;Although direct battery temperature isn't available, we simulated it for demonstration purposes.&lt;br&gt;
Fetching Network Information&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We used the Network Information API to display network details:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

function getNetworkInfo() {
    const connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
    const type = connection.effectiveType;
    const downlink = connection.downlink;
    const rtt = connection.rtt;

    document.getElementById('network-info').innerHTML = `
        &amp;lt;h2&amp;gt;Network Info:&amp;lt;/h2&amp;gt;
        &amp;lt;p&amp;gt;Connection Type: ${type}&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;Downlink: ${downlink} Mbps&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;RTT: ${rtt} ms&amp;lt;/p&amp;gt;
    `;
}

getNetworkInfo();

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

&lt;/div&gt;



&lt;p&gt;This snippet accesses connection properties to show the type, downlink speed, and round-trip time.&lt;br&gt;
Calculating FPS&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For calculating FPS, we used the Performance API:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

function calculateFPS() {
    let lastFrame = performance.now();
    let frameCount = 0;
    let fps = 0;

    function loop() {
        const now = performance.now();
        frameCount++;
        if (now - lastFrame &amp;gt;= 1000) {
            fps = frameCount;
            frameCount = 0;
            lastFrame = now;
            document.getElementById('device-specs').innerHTML += `&amp;lt;p&amp;gt;FPS: ${fps}&amp;lt;/p&amp;gt;`;
        }
        requestAnimationFrame(loop);
    }

    loop();
}

calculateFPS();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By measuring the time between frames, we calculated and displayed the FPS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building this web application was a fantastic experience, allowing us to explore various web APIs and enhance our understanding of client-side scripting. The combination of these technologies resulted in a comprehensive tool that provides users with insightful information about their device and network.&lt;/p&gt;

&lt;p&gt;Feel free to explore and extend this project. The full code is available on our GitHub repository. Happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>networking</category>
    </item>
    <item>
      <title>HEIMDALL - Open Source PYscript for bypassing and login captive portals in private networks</title>
      <dc:creator>B Mithilesh</dc:creator>
      <pubDate>Sat, 15 Jun 2024 17:42:35 +0000</pubDate>
      <link>https://dev.to/kingsmen732/open-source-bash-script-for-bypassing-and-login-captive-portals-in-private-networks-3ef9</link>
      <guid>https://dev.to/kingsmen732/open-source-bash-script-for-bypassing-and-login-captive-portals-in-private-networks-3ef9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnd9n98gpzqzrqy5b4h30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnd9n98gpzqzrqy5b4h30.png" alt=" " width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  This Python script automates the process of connecting to a captive portal, often encountered in public Wi-Fi networks. Here’s a summary of how the code works and its usefulness:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Setup and Configuration:     &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script imports various libraries, including requests for HTTP requests and JSON for handling JSON data.&lt;/li&gt;
&lt;li&gt;It defines several enums (Client_type, Request_type, Portal_action, Server_response) to manage different client types, request methods, portal actions, and server responses.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Global Variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Global class holds key variables like username, password, client type, portal URL, and timestamps of login and acknowledgement.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Utility Functions:&lt;/p&gt;

&lt;p&gt;-Credential Management: get_creds_from_json(path_to_json) reads the username and password from a JSON file.&lt;/p&gt;

&lt;p&gt;-Connectivity Tests: gstatic_connect_test() and msft_connect_test() check if the internet is accessible.&lt;/p&gt;

&lt;p&gt;-Captive Portal Detection: find_captive_portal() attempts to find and return the captive portal URL.&lt;/p&gt;

&lt;p&gt;-Header and Payload Generation: header_generator() and payload_generator() generate HTTP headers and payloads for requests.&lt;/p&gt;

&lt;p&gt;-WAN State Monitoring: is_wan_up() checks and logs changes in the WAN state.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Request Functions:&lt;/p&gt;

&lt;p&gt;-GET and POST Requests: get_req(uni_host) and post_req(uni_host, portal_action) handle GET and POST requests to the portal.&lt;/p&gt;

&lt;p&gt;-Server Response Parsing: parse_server_response(response) interprets the server’s response and updates global state variables accordingly.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Main Logic:&lt;/p&gt;

&lt;p&gt;-Program Loop: program_loop() continuously checks the WAN state and attempts to login to the portal if the internet is down. It also sends acknowledgement requests periodically if the client is a desktop.&lt;br&gt;
-Pause Menu: pause_menu() provides a user interface for actions like logging out, exiting, and changing the client type.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Usefulness Compared to Software:
&lt;/h2&gt;

&lt;p&gt;1.Automation: &lt;br&gt;
The script automatically handles login and maintains connectivity, unlike manual software methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def program_loop():
    while not exit_flag:
        if not Utility.is_wan_up():
            post_req(uni_host=portal_url, portal_action=Portal_action.LOGIN)

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

&lt;/div&gt;



&lt;p&gt;2.Customizability: &lt;br&gt;
Easily adjustable for different portals by modifying headers, payloads, and URLs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def header_generator(uni_host: str, payload_length: int, request_type: Request_type):
    headers = { 'Host': url_parse.hostname, 'User-Agent': Global.user_agent, ... }

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

&lt;/div&gt;



&lt;p&gt;3.Lightweight: Minimal dependencies and resources compared to GUI-based applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests, json, logging

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

&lt;/div&gt;



&lt;p&gt;4.Logging and Monitoring: Provides detailed logs and real-time status updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;logging.basicConfig(level=logging.INFO, filename='app.log', ...)

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

&lt;/div&gt;



&lt;p&gt;5.Cross-Platform Compatibility: Runs on various operating systems using Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.system('cls' if os.name == 'nt' else 'clear')

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

&lt;/div&gt;



</description>
      <category>networking</category>
      <category>captiveportals</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
