<?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"><channel><title><![CDATA[Md Moinuddin]]></title><description><![CDATA[Hi! I’m into Linux, electronics, low-level programming, and full-stack web development. I enjoy working across the stack—from hardware to web apps—and love lear]]></description><link>https://blog.noobyco.site</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 04:45:23 GMT</lastBuildDate><atom:link href="https://blog.noobyco.site/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Linux init system]]></title><description><![CDATA[Who should read this?
I would like you to ask a couple of questions and provide a yes or no answer before proceeding with the article.

Have I used a Linux Distro before?

Do I like spending time in the terminal?

Am I interested in a deep dive into ...]]></description><link>https://blog.noobyco.site/linux-init-system</link><guid isPermaLink="true">https://blog.noobyco.site/linux-init-system</guid><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Sun, 27 Jul 2025 15:31:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1753632668492/beb0d007-6b4e-412a-a90b-a1f4046faf34.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-who-should-read-this">Who should read this?</h2>
<p>I would like you to ask a couple of questions and provide a yes or no answer before proceeding with the article.</p>
<ol>
<li><p>Have I used a Linux Distro before?</p>
</li>
<li><p>Do I like spending time in the terminal?</p>
</li>
<li><p>Am I interested in a deep dive into Linux systems?</p>
</li>
</ol>
<p>In case your answer is yes to more than one question, then you are in. Knowing a bit about the Linux ecosystem gives an edge to quickly grasp further concepts of Linux. Now, let’s quickly understand what the heck is <strong>init sys</strong>.</p>
<h2 id="heading-what-is-init-sys">What is init sys</h2>
<p>In short, the init system is the very first process that starts after the kernel finishes loading. It has a process ID (PID) of 1. Alright, that was a mouthful of information. Let’s try to break it down piece by piece. For that, we need to understand what happens when we press the start button of the computer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1753625364774/05c8011c-d0a3-4aaf-bde3-723fd639daea.png" alt class="image--center mx-auto" /></p>
<p>This flowchart illustrates the sequential stages of a Linux system startup process, showing how control passes from hardware initialization to a fully operational user environment. It begins with <strong>Power On</strong> (represented by a green hatched circle) and flows through six main stages, each depicted as rounded rectangles with pink diagonal hatching:</p>
<h3 id="heading-biosuefi-the-hardware-detective">BIOS/UEFI: The Hardware Detective</h3>
<p>When you press that power button, BIOS or UEFI firmware springs into action like a hardware detective. This low-level software performs the Power-On Self-Test (POST), checking if your RAM, CPU, and storage devices are ready for action.</p>
<p>Modern systems use UEFI, which offers faster boot times and support for drives larger than 2TB. You've probably seen this stage if you've ever entered the "BIOS setup" by pressing F2 or Delete during startup.</p>
<p>The firmware then scans your boot devices—whether it's your SSD, USB drive, or network—to find something bootable.</p>
<h3 id="heading-bootloader-the-systems-traffic-controller">Bootloader: The System's Traffic Controller</h3>
<p>Think of the bootloader as a sophisticated traffic controller that decides which operating system gets to run. GRUB (Grand Unified Bootloader) is the most common choice on Linux systems, presenting you with that familiar menu when you dual-boot Windows and Linux.</p>
<p>This tiny program, usually just a few megabytes, has the critical job of loading the Linux kernel from your hard drive into RAM. It also passes important boot parameters like which root filesystem to use and whether to boot in quiet mode or show detailed startup messages.</p>
<h3 id="heading-kernel-the-digital-brain-awakens">Kernel: The Digital Brain Awakens</h3>
<p>The Linux kernel is where the real magic happens—it's the core that transforms your collection of hardware into a functioning computer. Once loaded, the kernel decompresses itself and immediately takes control of your CPU, memory, and hardware devices.</p>
<p>You'll see this stage if you remove the "quiet" parameter from your boot options—watch as it detects your network card, graphics driver, and storage controllers in rapid succession.</p>
<p>The kernel then mounts your root filesystem (usually from /dev/sda1 or similar) and prepares to hand control over to user space by starting the very first process with PID 1.</p>
<h3 id="heading-init-system-the-process-orchestrator">Init System: The Process Orchestrator</h3>
<p>The init system is the first user-space process that takes control after the kernel loads, and there are several options available. Traditional systems used SysVinit with its simple but slow sequential startup, while alternatives like OpenRC (used by Gentoo) and runit (found in Void Linux) offer different approaches to service management.</p>
<p>However, systemd has become the dominant choice across major distributions like Ubuntu, Fedora, and Red Hat. As process number 1, systemd acts like a conductor orchestrating a complex symphony of services, revolutionizing how modern Linux systems start up.</p>
<p>Unlike older systems that started services one by one, systemd launches multiple services simultaneously, dramatically reducing boot times. You can see systemd in action by running "systemctl status" on most modern distributions. It manages everything from your network connection (NetworkManager.service) to your display server, ensuring dependencies are respected—for instance, making sure the network is up before starting web servers.</p>
<h3 id="heading-system-services-the-background-workforce">System Services: The Background Workforce</h3>
<p>While you're browsing the web or editing documents, dozens of background services work tirelessly behind the scenes. These daemons handle everything from managing your WiFi connection (wpa_supplicant) to logging system events (rsyslog) and keeping your system time synchronized (chrony or ntpd).</p>
<p>On a typical Ubuntu desktop, you'll find services like cups-browsed for printer discovery, bluetooth for wireless device management, and systemd-resolved for DNS resolution.</p>
<p>These services communicate through various mechanisms like D-Bus, creating an interconnected ecosystem that keeps your system running smoothly.</p>
<h3 id="heading-login-manager-the-digital-gatekeeper">Login Manager: The Digital Gatekeeper</h3>
<p>The login manager is your system's friendly gatekeeper, presenting either a graphical login screen or a simple text prompt depending on your setup. Desktop environments like Ubuntu use GDM (GNOME Display Manager), while others might use LightDM or SDDM.</p>
<p>This component doesn't just verify your password—it also sets up your user session, loads your desktop environment preferences, and manages multiple user sessions if needed.</p>
<p>Once you successfully authenticate, the login manager launches your chosen desktop environment, whether that's GNOME, KDE Plasma, or a lightweight window manager, finally bringing you to the familiar desktop you interact with daily.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">The flow concludes with the <strong>user environment loading</strong> (Gnome, KDE, etc.), indicating the system is ready for user interaction.</div>
</div>

<h2 id="heading-build-our-system-service-for-the-minecraft-server">Build our System Service for the Minecraft server</h2>
<p>Why do we need a service for a Minecraft server that needs to be managed by an init system? That’s a great question btw. It's because we need our server to run 24/7, running the Minecraft server on a terminal session remains in running mode till the terminal session remains active.</p>
<p>Let’s get our feet wet by quickly installing the Minecraft server from here <a target="_blank" href="https://www.minecraft.net/en-us/download/server">https://www.minecraft.net/en-us/download/server</a>. After downloading it we will get a <strong>server.jar</strong> file and our next step is to make it into a service so that run it everytime from the terminal.</p>
<p>The following connand spins the minecraft server, this will come handy while creating the service.</p>
<pre><code class="lang-bash">java -Xmx1024M -Xms1024M -jar minecraft_server.1.21.8.jar nogui
</code></pre>
<ol>
<li>Create a directory called as <strong>minecraft</strong> under <strong>/opt</strong> path and put the server jar file inside that directory.</li>
</ol>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /opt &amp;&amp; mkdir -p minecraft/server
</code></pre>
<ol start="2">
<li>Goto this path, <strong>/etc/systemd/system/</strong></li>
</ol>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /etc/systemd/system/
</code></pre>
<ol start="3">
<li>create a minecraft.service file under /etc/systemd/system path</li>
</ol>
<pre><code class="lang-bash">nano minecraft.service
</code></pre>
<ol start="4">
<li>Once the nano text editor opens, paste this piece of service configuration.</li>
</ol>
<pre><code class="lang-bash">[Unit]
Description=Minecraft Server
After=network.target
StartLimitIntervalSec=0

[Service]
Type=forking
Restart=always
RestartSec=5
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft/server

<span class="hljs-comment"># Adjust memory settings as needed (-Xmx4G = 4GB RAM, -Xms1G = 1GB initial)</span>
ExecStart=/usr/bin/screen -dmS minecraft /usr/bin/java -Xmx4G -Xms1G -jar server.jar nogui

<span class="hljs-comment"># Graceful shutdown sequence</span>
ExecStop=/usr/bin/screen -p 0 -S minecraft -X <span class="hljs-built_in">eval</span> <span class="hljs-string">'stuff "say Server shutting down in 10 seconds..."\015'</span>
ExecStop=/bin/sleep 10
ExecStop=/usr/bin/screen -p 0 -S minecraft -X <span class="hljs-built_in">eval</span> <span class="hljs-string">'stuff "stop"\015'</span>
ExecStop=/bin/sleep 5

[Install]
WantedBy=multi-user.target
</code></pre>
<ol start="5">
<li><p>After pasting the config, save the file using <strong>ctrl+o</strong> and then exit out using <strong>ctrl+x.</strong></p>
</li>
<li><p>Create a minecraft user</p>
</li>
</ol>
<pre><code class="lang-bash">sudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft
</code></pre>
<ol start="7">
<li>Set the required permision</li>
</ol>
<pre><code class="lang-bash">sudo chown -R minecraft:minecraft /opt/minecraft
</code></pre>
<ol start="8">
<li>Enable the minecraft service</li>
</ol>
<pre><code class="lang-bash">sudo systemctl <span class="hljs-built_in">enable</span> minecraft.service
</code></pre>
<p>Congratulations we have sucessfully created the minecraft service and its now running in background as a <strong>background process</strong>🚀</p>
]]></content:encoded></item><item><title><![CDATA[Under-the-hood: Java]]></title><description><![CDATA[Before we go onto each component of the above diagram we must know the basics. So, first thing first -
tl;dr
Zoom out a bit from complex compiler designs termonologies and whatever scratches the part of your mind at night. We have tons of programming...]]></description><link>https://blog.noobyco.site/under-the-hood-java</link><guid isPermaLink="true">https://blog.noobyco.site/under-the-hood-java</guid><category><![CDATA[Java]]></category><category><![CDATA[#CompilerDesign]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Sat, 29 Jun 2024 20:24:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1753634401489/1b1c54d3-e4a1-4159-84c6-2763a00470a8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720000144733/1e6246a1-ea4a-4257-8bab-7a3fa5be5ded.png" alt class="image--center mx-auto" /></p>
<p>Before we go onto each component of the above diagram we must know the basics. So, first thing first -</p>
<h3 id="heading-tldr">tl;dr</h3>
<p>Zoom out a bit from complex compiler designs termonologies and whatever scratches the part of your mind at night. We have tons of programming languages, they all are in some form of <strong><em>textual format</em></strong> that is readable by us humans. At the end of the day, all we want is to execute that piece of code inside a processor. Thus all we need to worry about is converting that sugar-coated code into machine code cause our cute little processor only understands that.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719689126904/082d472e-46a3-480a-aa84-99fe99771b7c.png" alt class="image--center mx-auto" /></p>
<p>The computation in the middle is the real work here. Whatever components a programming language includes all work towards one goal, the goal to spit machine code at the end. Let's bring in some colors. Interpreters, compilers, assemblers, loaders, linkers, and parsers are a few of them that can fit into computation land. Programming languages can utilize the compilation of computation tools like in here <strong><em>Java.</em></strong> It is both compiled and Interpreted. Now let's learn the components involved in executing your Java code, end-to-end.</p>
<h2 id="heading-components">Components:</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719690932393/f6419e41-bca6-44b9-83da-6434f9bf0af6.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719690181895/052da19b-5354-4024-b8b5-164c0866bde5.png" alt class="image--center mx-auto" /></p>
<p>Source code is what we refer to as pure language code. It is nothing far from just a text which always gets converted into another text format. It could be compiled, interpreted, or transpiled.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719691130172/cb1daf11-6ce0-41ad-847d-c04e70e8f9a0.png" alt /></p>
<p>Java uses <strong><em>Javac</em></strong> to compile source code into Bytecode (.class) files.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719691243552/27f5ec7d-189d-4acf-9c0c-d5650340c2bb.png" alt /></p>
<p>It is an intermediate representation code with a <strong><em>.class</em></strong> file extension.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719692131485/0952ff1d-e03e-448d-8322-07b2959ba548.png" alt /></p>
<p>It reads Bytecode and converts it into machine code line by line cause it's an interpreter.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719692176768/50d11ff6-c74a-4cd9-a9d7-d44b774393c4.png" alt /></p>
<p>Machine code is the most basic form of instruction that a computer's central processing unit (CPU) can execute directly.</p>
<hr />
<h2 id="heading-faqs">FAQs</h2>
<details><summary>Is Java an interpreted or compiled language?</summary><div data-type="detailsContent">It's both.</div></details><details><summary>Where can I learn more about JVM?</summary><div data-type="detailsContent">Here - <a target="_blank" href="https://www.ibm.com/think/topics/jvm-vs-jre-vs-jdk#:~:text=Java%20virtual%20machine%2C%20or%20JVM,because%20it%20runs%20Java%20programming">https://www.ibm.com/think/topics/jvm-vs-jre-vs-jdk#:~:text=Java%20virtual%20machine%2C%20or%20JVM,because%20it%20runs%20Java%20programming</a>.</div></details><details><summary>Are machine code and object files different?</summary><div data-type="detailsContent">Yes.</div></details><details><summary>Where can I reach out if my question is unanswered in this blog?</summary><div data-type="detailsContent">This blog is not the final version thus it keeps evolving. I seek feedback and update my blog on demand to keep it updated. Just comment down below and I'll be checking them periodically.</div></details>]]></content:encoded></item><item><title><![CDATA[WASM Landscape 2023]]></title><description><![CDATA[What the Hell is WASM --> WebAssembly?
MDN says...
Let's go the usual way first, I'm going to yoink the definition of wasm from MDN 🫣
WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language...]]></description><link>https://blog.noobyco.site/wasm-landscape-2023</link><guid isPermaLink="true">https://blog.noobyco.site/wasm-landscape-2023</guid><category><![CDATA[wasm]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Mon, 11 Sep 2023 17:29:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1691072879297/f0bed3c6-737c-47a6-ab5f-748bd2782c1a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-the-hell-is-wasm-gt-webassembly">What the Hell is WASM --&gt; WebAssembly?</h2>
<h3 id="heading-mdn-says">MDN says...</h3>
<p>Let's go the usual way first, I'm going to yoink the definition of <code>wasm</code> from MDN 🫣</p>
<p>WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C#, and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://developer.mozilla.org/en-US/docs/WebAssembly">https://developer.mozilla.org/en-US/docs/WebAssembly</a></div>
<p> </p>
<h3 id="heading-webassembly-says">WebAssembly says...</h3>
<p>WebAssembly (abbreviated <em>Wasm</em>) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.</p>
<p><a target="_blank" href="https://webassembly.org/">https://webassembly.org/</a></p>
<h3 id="heading-i-say">I say...</h3>
<p>Now let's see what I gotta offer you from my perspective. In short, WASM is a language-neutral compilation target. I'm extremely sorry if I scared you there 🥹 Don't worry I'm gonna break it down. WebAssembly is still a piece of code that is similar to a low-level format. Lemme show you instead of me ranting 😁.</p>
<p><strong>$noobyco@nixos:~/Desktop/wasm]$</strong> cat hello.wasm</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691070828199/85a9f284-8079-43fc-a4aa-c49fb9c8e7dd.png" alt /></p>
<p>Now lemme show you what the real binary of <code>hello.wasm</code> looks like, Here we go...</p>
<p><strong>$noobyco@nixos:~/Desktop/wasm]$</strong> hexdump -C hello.wasm</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691070699345/8eba83fd-4d15-48fe-84a2-3334b3169f37.png" alt /></p>
<p>I have been doing a ton of research and hands-on on programming language internals, thus it was Lil easy for me to grasp the internals of wasm quickly. Here is my blog post that you might wanna got through to clear out the mud.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://noobyco.codes/programming-language-under-the-hood-stuff-documentary">https://noobyco.codes/programming-language-under-the-hood-stuff-documentary</a></div>
<p> </p>
<h2 id="heading-but-why">But why?</h2>
<p>Lemme give a scenario where we wanna use intensive applications like 3D games, Virtual and Augmented Reality, computer vision, and image/video editing, but on the web. It's possible to implement in the traditional way but we have to trade its performance. software needs to be written in near-native speed programming languages like C/C++, Rust, etc. For the web, it was challenging until the birth of WebAssembly, Now we can use Premier Pro and even hardcore games on the web with WASM.</p>
<p>Lemme summarise the benefits we get with WASM -</p>
<ul>
<li><p>Be fast, efficient, and portable — WebAssembly code can be executed at near-native speed across different platforms by taking advantage of <a target="_blank" href="https://webassembly.org/docs/portability/#assumptions-for-efficient-execution">common hardware capabilities</a></p>
</li>
<li><p>Be readable and debuggable — WebAssembly is a low-level assembly language, but it does have a human-readable text format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. One of them is WAT.</p>
</li>
<li><p>Keep secure — WebAssembly is specified to be run in a safe, sandboxed execution environment. Like other web codes, it will enforce the browser's same-origin and permissions policies.</p>
</li>
<li><p>Don't break the web — WebAssembly is designed so that it plays nicely with other web technologies and maintains backward compatibility.</p>
</li>
</ul>
<h2 id="heading-wasm-key-concepts">WASM key concepts</h2>
<p>It is important to skim through basic concepts to fully understand the bigger picture. Let's start with Modules.</p>
<ol>
<li><p>Modules: It represents the WebAssembly binary that has been compiled by the WASM compiler.</p>
</li>
<li><p><strong>Memory</strong>: A resizable ArrayBuffer that contains the linear array of bytes read and written by WebAssembly's low-level memory access instructions.</p>
</li>
<li><p><strong>Table</strong>: A resizable typed array of references (e.g. to functions) that could not otherwise be stored as raw bytes in Memory (for safety and portability reasons).</p>
</li>
<li><p><strong>Instance</strong>: A Module paired with all the states it uses at runtime including a Memory, Table, and set of imported values. An Instance is like an ES module that has been loaded into a particular global with a particular set of imports.</p>
</li>
</ol>
<h2 id="heading-webassembly-core-mechanics">WebAssembly core mechanics</h2>
<p>This particular section Is fully dedicated to the internals of WebAssembly. Throughout this, we'll explore its working in the browser as well as outside the browser platform like the server.</p>
<h3 id="heading-where-is-it-used-for">Where is it used for</h3>
<p>Before going into the rabbit hole for each use case of WASM, we must look at the broad view of its use cases. Go through the official WebAssembly page for the use case.</p>
<p><a target="_blank" href="https://webassembly.org/docs/use-cases/">https://webassembly.org/docs/use-cases/</a></p>
<h3 id="heading-on-browser">On browser</h3>
<p>WebAssembly in the browser works lil differently than on the server side. Okie let's do it...🚀 Let's be clear that browsers need to load <code>.wasm</code> modules that can be fetched and invoked from the Javascript using WASM web API. The browser has a Stack-based VM ( virtual machine ) that is responsible for executing <code>.wasm</code> files.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691068956114/90598341-5d0f-41b3-a1b8-4cd60d45aff6.png" alt class="image--center mx-auto" /></p>
<p>If we try to zoom in on the browser section of my scrappy drawing, we will find out that it's more than the compilation of WASM with HTML, CSS, and JS. So what is actually going on inside here? Well, that's a great question there😎...</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1691176865767/bc64e2d0-4ab2-48c9-9645-a53a331e145c.png" alt class="image--center mx-auto" /></p>
<p>Dw doesn't directly run .wasm files on the browser, as I earlier it needs to be fetched into Javascript using the WebAssembly web API. After successfully writing wasm code in js we need to load the code into the browser, This process happens when we spin some sort of server-like <code>live-server</code> in VS code. Do open up the dev tool in your browser and navigate to the network tag, If you can't see any files then you definitely need to refresh once. Finally, you will be able to see those files loaded in the browser successfully👏🏻👏🏻</p>
<h3 id="heading-on-server-outside-browser">On Server { outside browser }</h3>
<p>The WebAssembly technology was Intentionally made to charge up web apps in terms of performance. Web Applications like Figma and Adobe Premier Pro are Intense applications that need to be written in low-level languages like C and C++.</p>
<p>We can also use the same technology outside the browser thanks to WASI { web Assembly system interface } Let's see how the pieces come together here!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1694453240141/b73642b6-c1fd-4b6d-8451-5acb8ea9fe9c.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[🚡Programming language, under-the-hood stuff :Documentary.]]></title><description><![CDATA[How I ended up writing this blog
It was a time when I could not handle a neverending list of unanswered questions saved in my brain. It was clear that they were taking up a lot of space, so I wrote them on a piece of paper to free my brain storage. �...]]></description><link>https://blog.noobyco.site/programming-language-under-the-hood-stuff-documentary</link><guid isPermaLink="true">https://blog.noobyco.site/programming-language-under-the-hood-stuff-documentary</guid><category><![CDATA[architecture]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[compiler]]></category><category><![CDATA[interpreter]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Sun, 25 Jun 2023 18:28:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/ioEjMWHn2nY/upload/3ba46390ba08a6d0a6f42bd530133bc9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-how-i-ended-up-writing-this-blog">How I ended up writing this blog</h2>
<p>It was a time when I could not handle a neverending list of unanswered questions saved in my brain. It was clear that they were taking up a lot of space, so I wrote them on a piece of paper to free my brain storage. 🧠🧟</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687283135853/bb3ce25a-80e4-4225-adc1-0b0cc70ca106.png" alt class="image--center mx-auto" /></p>
<p>After week-long sleepless nights, it was the moment when every dot suddenly started to connect. I didn't go through compiler design books but still managed to understand fundamentals which is enough to code up my first programming language haha. BTW I'm not kidding! 🐸</p>
<h2 id="heading-the-modern-way-to-explore-and-learn">The modern way to explore and learn</h2>
<p>Before going into the path that I took to understand the concepts, I want to clarify one thing. Apart from the theories, it was my curious mind being in an unstable state and strong hunger to understand how languages work from the inside.</p>
<p>Traditionally things have been taught like it's detached from reality. Hell, seriously. Lemme give you an example here, for learning an operating system concept the only thing you need do is to `<strong>build your operating system`</strong>. Yup, it's damm simple. Why do people complicate them with generalized learning approaches where you get multiple random tosses of never used terms?</p>
<p>I'm not opposing the traditional idea, instead, it's not the better initial approach to take when you don't have your fundamentals clear to build more advanced stuff upon.</p>
<p>Considering my magical way to explore stuff that works as fast as <strong>NURALINK</strong> 🥹. I decided to learn concepts by putting my list of favorite languages on the inspection table😉</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Language</td><td>Compiled</td><td>Interpreted</td></tr>
</thead>
<tbody>
<tr>
<td>C/C++ --&gt; Carbon</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Golang</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Rust</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Python</td><td>❌</td><td>✅</td></tr>
<tr>
<td>Java/C#</td><td>❌</td><td>✅</td></tr>
<tr>
<td>Javascript</td><td>❌</td><td>✅</td></tr>
<tr>
<td>Ruby</td><td>❌</td><td>✅</td></tr>
<tr>
<td>Zig</td><td>✅</td><td>❌</td></tr>
<tr>
<td>OCaml</td><td>✅</td><td>✅</td></tr>
<tr>
<td>Mojo</td><td>✅</td><td>✅</td></tr>
</tbody>
</table>
</div><h2 id="heading-the-first-question-in-mind">The first question in mind</h2>
<p>To date, I'm using multiple programming languages combining compiled and interpreted. I wondered how a piece of software can convert highly human-readable language with symbols into the processor's native language or code.</p>
<p>Thus I began my exploration research in a top-down fashion. The languages I'm familiar with gave me enough motivation to start with them cause I use them. Being already informative about compiled language saved me a ton of time. While going through them, I took real-life examples of them like :</p>
<ol>
<li><p>C/C++</p>
</li>
<li><p>Golang</p>
</li>
<li><p>Rust</p>
</li>
<li><p>Zig</p>
</li>
</ol>
<p>...</p>
<p>Along the way explored multiple terms including <code>Ahead of time</code>, <code>Natively compiled</code>. Things got pretty serious when it was tough to wrap my head around unanswered questions like :</p>
<ul>
<li><p>Can an executable code ( <strong>code.exe</strong> ) run on the same operating system ( <strong>Mac</strong> ) but different <strong><em>Instruction set architecture?</em></strong></p>
</li>
<li><p>If the operating systems have a binary for multiple processor architectures ( <strong>ISA</strong> ) why do we need to compile for specific architecture then?</p>
</li>
</ul>
<p>These questions led me to a term called <strong>CROSS-COMPILATION</strong>, it had all the answers I needed. WoW, problem solved then, Yeah kinda 🥹</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687358678465/d63c5c3f-2db2-4038-9883-a9354101f396.png" alt class="image--center mx-auto" /></p>
<p>Cross-compilation enables us to compile programs for different processor architectures ( ISA ) from being in a single processor architecture. The above diagram illustrates this incredibly ✨</p>
<p>Lemme give you a real-life example of cross-compilation in Golang. Execute the below command in the terminal to compile <a target="_blank" href="https://github.com/caddyserver/caddy">Caddy</a> for <strong>Windows</strong> running on <strong>amd64</strong> Instruction set architecture.</p>
<p><img src="https://cdn.dribbble.com/userupload/2624050/file/original-59266f4dea1c2aa43f2064cc0f3b165a.png?resize=400x0" alt="Golang designs, themes, templates and downloadable graphic ..." class="image--center mx-auto" /></p>
<pre><code class="lang-bash">env GOOS=windows GOARCH=amd64 go build github.com/mholt/caddy/
</code></pre>
<p>The executable will be created in the current directory, using the package name as its name. However, since we built this executable for Windows, the name ends with the suffix <code>.exe</code>. Run the below command to verify the created file.</p>
<pre><code class="lang-bash">ls | grep caddy
</code></pre>
<pre><code class="lang-bash">output
caddy.exe
</code></pre>
<p>The <code>env</code> the command runs a program in a modified environment. This lets you use environment variables for the current command execution only. The variables are unset or reset after the command executes.</p>
<p>The following table shows some of the possible combinations of <code>GOOS</code> and <code>GOARCH</code> you can use:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>GOOS - Target operating system</td><td>GOARCH - Target Instruction set architecture</td></tr>
</thead>
<tbody>
<tr>
<td>Android</td><td>arm</td></tr>
<tr>
<td>Dragonfly</td><td>amd64</td></tr>
<tr>
<td>Linux</td><td>ppc64</td></tr>
<tr>
<td>NetBSD</td><td>386</td></tr>
<tr>
<td>Windows</td><td>amd64</td></tr>
</tbody>
</table>
</div><h2 id="heading-whats-the-matter-with-java">What's the matter with JAVA?</h2>
<p>I have written Java code before. Initially, I used to run my code in IDE ( Integrated development environment ) - <code>Eclipse</code>, which gave me a sweet abstraction layer to prevail me from looking into the internal execution processes. This was long before in my high school days, but 🍑 things have changed now 🥲</p>
<p>This time I played with SDK instead and did my terminal magic to understand under-the-hood stuff. The very next moment I got myself confused between <code>Javac</code> and <code>Java</code> inside command line env. why do we require a two-step process to execute Java code? why did the <code>.class</code> file gets generated after the first process? My curious mind needs answers now 🤥</p>
<p>// Doing Javac thing first...</p>
<pre><code class="lang-bash">javac demo.java
</code></pre>
<p>// Doing Java thing second...</p>
<pre><code class="lang-bash">java demo
</code></pre>
<p>Did some digging and finally got to a question that says, 'Is Java compiled or interpreted?' 🤔 found out that <strong>Java</strong> is both compiled as well as Interpreted but how? Okie things get pretty juicy here cuz the <strong>Java</strong> architecture is entirely different than natively compiled languages like <code>zig</code> or <code>rust</code> . Let's look at the bigger picture together.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687623876733/6463279d-67c5-42bf-9f9f-a6d4933ea9b2.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-phase-1-compilation">Phase 1 - Compilation</h3>
<p>If we look at things closely, the compiler <code>javac</code> in Java is functionally very similar to natively compiled language, the only dissimilarity is the output of the compiler which is the <strong>Bytecode</strong> instead of <strong>machine code</strong>. The Bytecode is also called Intermediate code which is closer to the machine but not as much as the binary stuff.</p>
<p>The question arises here is that why we even need to compile into Bytecode to execute it further by the Interpreter. we can just do direct Interpretation like <code>LISP</code> In the old days. BTW <code>LISP</code> was the first Interpreted programming language.</p>
<ol>
<li><p><strong><em>Performance:</em></strong> Bytecode is a lower-level representation of the code compared to the original source code. This allows the JVM to perform various optimizations during the interpretation or Just-In-Time (JIT) compilation process. These optimizations can result in improved performance and execution speed compared to directly interpreting the source code.</p>
</li>
<li><p><strong><em>Portability:</em></strong> Java aims to be platform-independent, allowing Java programs to run on any system that has a compatible JVM. By compiling Java code into bytecode, which is a standardized intermediate representation, it can be executed on different operating systems and architectures without the need for recompilation.</p>
</li>
<li><p><strong><em>Interoperability:</em></strong> By using bytecode as an intermediate representation, Java programs can seamlessly interact with other languages that target the JVM, such as Kotlin, Scala, and Groovy. These languages can also be compiled into bytecode, allowing them to utilize Java libraries and frameworks.</p>
</li>
</ol>
<h3 id="heading-phase-2-interpretation">Phase 2 - Interpretation</h3>
<p>We now have bytecode in hand, we just need to pass it on to Interpreter. The Interpreter then analyses the Bytecode line by line and produces direct output instead of an executable file { specific to the operating system }.</p>
<h3 id="heading-variations-in-interpreters">Variations in Interpreters</h3>
<p>Like Native compilers, Interpreters are rapidly evolving over time. Earlier we used to directly Interpret source code, for example, <code>LISP</code> but now things have gotten advanced. Let's introduce you to <code>JIT</code> what stands for <strong>just in time.</strong></p>
<p>Here is a thing, Interpreters are slow than running what's produced by native compilers, and because it's executing bytecode line by line in most of the cases which in result takes a lot of time doing stuff while being in runtime mode. That's why we have JIT with us which optimizes out dynamically typed code on the fly in runtime. Code optimization in Interpreters is not possible because it scans each line and executes it.</p>
<p>Code optimization let us execute the same code much faster than before. we won't go deeper into optimization for now, that's a topic for another blog but you get the point.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=d7KHAVaX_Rs">https://www.youtube.com/watch?v=d7KHAVaX_Rs</a></div>
<p> </p>
<p>Okie here are the Interpreter's variations in terms of architecture that you will see in most cases:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Variations</td><td>Example language</td></tr>
</thead>
<tbody>
<tr>
<td>Direct Interpreter without JIT</td><td>LISP</td></tr>
<tr>
<td>Direct Interpreter with JIT</td><td></td></tr>
<tr>
<td>Bytecode Interpreter without JIT</td><td>Python</td></tr>
<tr>
<td>Bytecode Interpreter with JIT</td><td>JAVA, MOJO</td></tr>
</tbody>
</table>
</div><blockquote>
<p><strong>In the background, even the compiled programs( C, C++ etc) are interpreted.</strong> There is an interpreter running the binary file which is implemented by the underlying processor. But its not commonly said.</p>
</blockquote>
<ul>
<li><p><strong>A CPU can be viewed as a hardware-based interpreter for its machine code.</strong></p>
</li>
<li><p><strong>A VM can be viewed as a software-based interpreter.</strong></p>
</li>
</ul>
<h3 id="heading-architectures">Architectures</h3>
<p>Now that I have a broad understanding of a couple of programming language architectures, I began to dig more into language architectures and I found:</p>
<ol>
<li><p>Natively compiled ✅</p>
</li>
<li><p>Direct Interpreter ( with or without JIT ) ✅</p>
</li>
<li><p>Bytecode Interpreter ( with or without JIT ) ✅</p>
</li>
<li><p>Transpiler</p>
</li>
</ol>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=5rn_MAspYFM">https://www.youtube.com/watch?v=5rn_MAspYFM</a></div>
<p> </p>
<h2 id="heading-multiple-implementations-of-the-same-language">Multiple Implementations of the same language</h2>
<p>Let's take it back to 90tees. We all know <strong>C</strong> language which is epic for system programming but don't have an official implementation like <a target="_blank" href="https://www.python.org/">python.org</a> or <a target="_blank" href="https://www.ruby-lang.org/en/">ruby-lang.org</a>. If you type <strong>C</strong> programming language in Google you won't get a website dedicated to <strong>C</strong> language instead you are forced to download its compiler according to the operating system.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Platform</td><td>Implementation</td></tr>
</thead>
<tbody>
<tr>
<td>Windows</td><td>MinGW, Cygwin</td></tr>
<tr>
<td>Mac/Linux</td><td>clang, GCC</td></tr>
</tbody>
</table>
</div><blockquote>
<p>List of C compiler Implementations ... <a target="_blank" href="https://en.wikipedia.org/wiki/List_of_compilers#C_compilers">https://en.wikipedia.org/wiki/List_of_compilers#C_compilers</a></p>
</blockquote>
<p>Let's roll towards Interpreted language like Python. Earlier, I said Python has an official implementation so why am I talking about it in this section? In addition to official implementation, it has some unofficial implementations like <code>pypy</code>.</p>
<blockquote>
<p>List of Python Implementations ...</p>
<p><a target="_blank" href="https://wiki.python.org/moin/PythonImplementations?action=show&amp;redirect=implementation">https://wiki.python.org/moin/PythonImplementations?action=show&amp;redirect=implementation</a></p>
</blockquote>
<h3 id="heading-list-of-implementations">List of implementations</h3>
<p>For learning Implementations of other languages refer to this Link:</p>
<p><a target="_blank" href="https://en.wikipedia.org/wiki/List_of_compilers">https://en.wikipedia.org/wiki/List_of_compilers</a></p>
]]></content:encoded></item><item><title><![CDATA[🦊 Javascript ecosystem is driving me crazy.]]></title><description><![CDATA[Every other developer, who blindly stepped into the land of javascript, still figuring out their { escape } 🥲
Haha just kidding 🫣 😅
Lemme take you on a flashback
The story begins with my desperate desire to be called a developer. It didn't matter ...]]></description><link>https://blog.noobyco.site/javascript-ecosystem-is-driving-me-crazy</link><guid isPermaLink="true">https://blog.noobyco.site/javascript-ecosystem-is-driving-me-crazy</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[TypeScript]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Sat, 06 May 2023 16:59:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682954992051/3e7c4c5e-cf6b-49c6-8e84-b5ead5898a41.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every other developer, who blindly stepped into the land of javascript, still figuring out their { escape } 🥲</p>
<p>Haha just kidding 🫣 😅</p>
<h2 id="heading-lemme-take-you-on-a-flashback">Lemme take you on a flashback</h2>
<p>The story begins with my desperate desire to be called a developer. It didn't matter what kind of developer I become, as long as I could build something with code. I was limited to programming syntax and found it difficult to break through the barrier :/ So, I decided to call for HELP. I randomly came across Angela Yu's Web Development course and without a second thought, I enrolled in it.</p>
<p>Before I kicked off the course, I didn't know much about HTML and CSS. The backend stuff was also not my strong suit, so I just went with the flow of the course and let it take me wherever it went.</p>
<p>Whoa! Can you believe it's been over a year developing web apps now? My skill set has gone from zero to hero, and it's blowing my mind! When you invest enough time in something, it's like putting on a pair of magic glasses - suddenly, everything looks different!</p>
<h2 id="heading-lets-look-at-a-bigger-picture">Let's look at a bigger picture</h2>
<p>Before diving into the specifics of the ecosystem lemme show your brain a quick look, at how the javascript world looks like from my experience till now.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682958527944/9bf5c95b-9681-4a5d-8722-242c6f3d6283.png" alt class="image--center mx-auto" /></p>
<p>Starting out in whatever field in tech is like exploring the never-ending map of Minecraft. There is so much to learn and to keep yourself updated. it might turn out to be overwhelming and annoying after hitting the threshold of brain power to suck up every ounce of information present there. Instead, I would recommend enjoying the process which, I didn't do, haha how paradoxical I'm being here.</p>
<h3 id="heading-enjoy-the-process">Enjoy the process</h3>
<p>What do I exactly mean by "<strong>enjoying the process</strong>"? You don't necessarily need to force yourself to enjoy rather you should focus on tweaking the <strong>learning mindset</strong>. grasping concepts little by little via project building. This could go in a cycle, you learned something new, just make a project on that or, You made a project which made you learn something new.</p>
<h3 id="heading-lets-dive-into-the-javascript-map">Let's dive into the Javascript map</h3>
<blockquote>
<p>Lemme make it clear that I'm totally focused on the web side of things but also will brief about everything else present on the map, just to give a broad understanding.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1683392174036/95d258e3-b88a-4009-bc3f-f93776e91480.jpeg" alt class="image--center mx-auto" /></p>
<p>Javascript is a land of experiments, where every other day new framework or library pops up. Imagine boxes in the JS map as Bubbles in the JS world. are we good? alright, let's dive now.</p>
<h3 id="heading-backend">Backend</h3>
<p>For doing the backend in javascript there is an option to write your code at the runtime level or you could utilize the infinite power of <strong>frameworks</strong> out there at <a target="_blank" href="https://www.npmjs.com/">https://www.npmjs.com/</a> till eternity. we call them "<strong>Backend Frameworks</strong>" or if it's specific to runtime like Node.js then it's called "<strong>Node.js framework</strong>". These frameworks add up sugar on top of the runtime environments and create a sweet spot for the developers to work.</p>
<p>Here is an example of what an HTTP server looks like without a framework in Node.js --&gt; <a target="_blank" href="https://github.com/Blaize15/raw-node">https://github.com/Blaize15/raw-node</a></p>
<p>There is a list of never-ending backend frameworks you might look into. Btw I learned Express.js.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.simform.com/blog/best-nodejs-frameworks/">https://www.simform.com/blog/best-nodejs-frameworks/</a></div>
<p> </p>
<p>Each framework provides its own functionality, some functionality makes it stand out from other frameworks. therefore we need to choose frameworks wisely. For instance, Express.js provides Routing, templating, middleware, etc.</p>
<p>You might be wondering about Node.js being the single most Runtime available for javascript at the backend, then you are wrong🥲 Javascript is the language with a billion choices🥹 What are the other Runtimes then :</p>
<ol>
<li><p><a target="_blank" href="https://deno.com/">https://deno.com/</a></p>
</li>
<li><p><a target="_blank" href="https://bun.sh/">https://bun.sh/</a></p>
</li>
</ol>
<h3 id="heading-frontend">Frontend</h3>
<p>Frontend has interesting evolution right from <a target="_blank" href="https://jquery.com/">Jquery.js</a>. Why do we need a framework here, even if everything is possible with Vanilla Javascript? I guess you know it already, those who have used juicy frameworks like <a target="_blank" href="https://react.dev/">React.js</a>, <a target="_blank" href="https://angular.io/">Angular.js</a>, <a target="_blank" href="https://vuejs.org/">Vue.js</a>, and many more popping up every other second. Obviously, they make application development a breeze.</p>
<p>You might know browsers live in noisy and chaotic environments where we cannot guarantee cross-browser compatibility. To have maximum utilization across multiple leading browsers frameworks need to make sure of it.</p>
<ol>
<li><p><strong>Module bundler:</strong> A module bundler is a web development tool that bundles different kinds of modules with dependencies into static assets.</p>
<p> <img src="https://webpack.github.io/assets/what-is-webpack.png" alt="webpack module bundler" /></p>
</li>
<li><p><strong>Babel</strong>: A javascript compiler that compiles your javascript code to a specific version that you want.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1683394297789/ab587311-c41e-4390-b780-f49a1ad5db04.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-javascript-transpilers">Javascript transpilers</h3>
<p>A transpiler, also known as a source-to-source compiler, is a tool that translates source code written in one programming language (the source language) into equivalent code in another language (the target language). Transpilers are commonly used to convert modern or alternative language features into a more widely supported language, allowing developers to leverage new language capabilities while maintaining compatibility with existing platforms.</p>
<p>Some of the cool-sounding transpilers are :</p>
<ol>
<li><p><a target="_blank" href="https://www.typescriptlang.org/">Typescript</a> - The Grandaddy</p>
</li>
<li><p><a target="_blank" href="https://elm-lang.org/">Elm</a> - purely functional in case you are wondering.</p>
</li>
<li><p><a target="_blank" href="https://clojurescript.org/">ClojureScript</a></p>
</li>
<li><p><a target="_blank" href="https://www.purescript.org/">pureScript</a></p>
</li>
</ol>
<h3 id="heading-native-capabilities">Native capabilities</h3>
<p>Javascript is also used to build native applications supporting <strong>Desktop and Mobile</strong>. Surely you can take advantage of <code>npm</code> ecosystem to build your native apps.</p>
<ol>
<li><p><strong>React Native for Mobile -</strong> <a target="_blank" href="https://reactnative.dev/">https://reactnative.dev/</a></p>
</li>
<li><p><strong>Electron for Desktop -</strong> <a target="_blank" href="https://www.electronjs.org/">https://www.electronjs.org/</a></p>
</li>
</ol>
<h3 id="heading-iot">IoT</h3>
<p>This could be fairly new stuff in front of web developers, but there is a great saying <code>Dig deeper into whatever scares you the most</code> haha.</p>
<p>Do :</p>
<pre><code class="lang-apache">$ <span class="hljs-attribute">npm</span> i mqtt
</code></pre>
<p>&amp; You are good to create your next IoT product 💥 ( Smile in pain ) 🥲</p>
<h2 id="heading-a-mess-how">A mess, How?</h2>
<p>I'll point out some of my personal experiences with the javascript ecosystem in general just to be safe from <code>Js wizards</code> 🪄🥲</p>
<h3 id="heading-it-aint-consistent">It ain't consistent</h3>
<p>I mean there is a billion other way of doing the exact same thing. it has a multitude of frameworks, libraries, and tools for various purposes, such as frontend development, backend development, testing, and build processes. The rapid pace of innovation has led to fragmentation in the ecosystem, with new tools and frameworks emerging frequently. This can create decision paralysis for developers and a steep learning curve when trying to navigate the ecosystem.</p>
<h3 id="heading-lack-of-standardization">Lack of standardization</h3>
<p>JavaScript lacks strict standardization compared to some other programming languages. This flexibility allows for creativity and experimentation but can also lead to inconsistencies in coding styles, patterns, and best practices across projects and libraries. It can make it challenging for developers to adopt new libraries or collaborate on projects.</p>
<h3 id="heading-compatibility-issues">Compatibility issues</h3>
<p>Compatibility Issues: JavaScript runs in different environments such as browsers, server-side with Node.js, and mobile applications with frameworks like React Native. Each environment has its own set of APIs, behaviors, and limitations. Ensuring cross-platform compatibility and dealing with browser inconsistencies can be time-consuming and challenging.</p>
<p>Despite these challenges, it's important to note that the JavaScript ecosystem is also vibrant and filled with innovation. The large community, extensive package availability, and flexibility of the language have contributed to its popularity and power. The ecosystem is constantly evolving, and efforts are being made to address the challenges and improve the developer experience. With time, experience, and familiarity, developers can effectively navigate and leverage the rich JavaScript ecosystem to build robust and scalable applications.</p>
]]></content:encoded></item><item><title><![CDATA[🦄Microcontrollers support modern languages]]></title><description><![CDATA[Points to be covered

Lil History.

Modern language support in microcontrollers.

Will my development board support these languages?

Let's blink Leds with a couple of these modern languages.


What has changed in the microcontroller ecosystem?
Befor...]]></description><link>https://blog.noobyco.site/microcontrollers-support-modern-languages</link><guid isPermaLink="true">https://blog.noobyco.site/microcontrollers-support-modern-languages</guid><category><![CDATA[raspberry-pi-pico]]></category><category><![CDATA[Go Language]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Python]]></category><category><![CDATA[microcontroller]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Tue, 25 Apr 2023 18:20:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/zs4gtT8thO0/upload/f9a845c4918d0463f6dc558b8350fbb8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-points-to-be-covered">Points to be covered</h2>
<ol>
<li><p>Lil History.</p>
</li>
<li><p>Modern language support in microcontrollers.</p>
</li>
<li><p>Will my development board support these languages?</p>
</li>
<li><p>Let's blink Leds with a couple of these modern languages.</p>
</li>
</ol>
<h2 id="heading-what-has-changed-in-the-microcontroller-ecosystem">What has changed in the microcontroller ecosystem?</h2>
<p>Before grasping modern advancements in the ecosystem, we should know a little bit about the history around it.</p>
<h3 id="heading-phase-1-worlds-first-microcontroller">Phase 1: World's first microcontroller</h3>
<p>Gary Boone along with Michael Cochran created the first Microcontroller at <a target="_blank" href="https://www.ti.com/">Texas Instruments</a> around 1970 - 1971. It was given a name similar to some weird codename equals '<strong>TMS1802NC</strong>'</p>
<p><img src="https://ethw.org/w/images/4/4a/Microcon1.jpg" alt="File:Microcon1.jpg" class="image--center mx-auto" /></p>
<h3 id="heading-phase-2-assembly-andamp-c">Phase 2: Assembly &amp; C</h3>
<p>These tiny legacy microcontrollers used to be coded in assembly code. One of the great disadvantages of writing in assembly is that you can't run the same code on different microcontroller architectures like { <strong>arm64, arm32, PowerPC, etc</strong> } also it's equivalent to writing binary still🥹</p>
<p>Then the <strong>'C'</strong> miracle was adopted by the ecosystem and every other vendor was shipping their microcontroller with their own <strong>SDK.</strong> That made it difficult for developers to quickly hop from one board to another.</p>
<h3 id="heading-phase-3-arduino-breakthrough">Phase 3: Arduino breakthrough</h3>
<p>Arduino developed an <strong>IDE</strong> that supports a wide range of microcontrollers. It's <strong>'C/C++'</strong> like syntax with a '<strong>.ino'</strong> Extention with tons of libraries and built-in support. developers loved the idea of <strong>'write once run anywhere'</strong> at least Arduino products for a moment. Later non-Arduino boards start to become Arduino compatible like <a target="_blank" href="https://www.espressif.com/en/products/socs/esp32">ESP32</a>.</p>
<h3 id="heading-phase-4-modern-language-integration">Phase 4: Modern language integration</h3>
<p>How awesome it would be on integrating your most loved programming languages like <a target="_blank" href="https://micropython.org/">Python</a> or <a target="_blank" href="https://tinygo.org/">Golang</a> into your favorite microcontroller board. Guess what it's happening now, &amp; you are a couple of steps away to run blink LED code in your favorite language of choice. Skip to the <strong>"Hands-on"</strong> section to try it yourself.</p>
<p>For each language brief skip to the <strong>"Modern language support"</strong> section.</p>
<h2 id="heading-important-dates-to-compare">Important dates to compare</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Date</td><td>Event</td></tr>
</thead>
<tbody>
<tr>
<td>1947</td><td>Invention Of <strong>Transistor</strong></td></tr>
<tr>
<td>1959</td><td>Invention Of <strong>Integrated Circuit</strong></td></tr>
<tr>
<td>1965</td><td>Birth Of <strong>Moore’s Law</strong></td></tr>
<tr>
<td>1971</td><td>First Microprocessor came to Market-<strong>4004</strong></td></tr>
<tr>
<td>1971</td><td>Development of First Microcontroller-<strong>TMS1802NC</strong></td></tr>
<tr>
<td>2011</td><td>Intel announced its first 22 nm microprocessor, codenamed <strong>Ivy Bridge</strong>, using a technology called 3-D Tri-Gate</td></tr>
</tbody>
</table>
</div><h2 id="heading-modern-language-support">Modern language support</h2>
<p>Well, there are multiple modern languages with multiple solutions to bring them into the micro-ecosystem. What exactly do I mean by solution here? lemme give you a real example before taking you into a rabbit hole😅</p>
<p>If you wish to write Python on your development board, then you may need <a target="_blank" href="https://micropython.org/">https://micropython.org/</a> or <a target="_blank" href="https://circuitpython.org/">https://circuitpython.org/</a> as a solution.</p>
<p>Now lemme give you a list of solutions for a couple of languages.</p>
<ol>
<li><p><strong>Python</strong></p>
<ol>
<li><p><a target="_blank" href="http://micropython.org/">http://micropython.org/</a></p>
</li>
<li><p><a target="_blank" href="https://circuitpython.org/">https://circuitpython.org/</a></p>
</li>
</ol>
</li>
<li><p><strong>Javascript</strong></p>
<ol>
<li><p><a target="_blank" href="https://jerryscript.net/">https://jerryscript.net/</a></p>
</li>
<li><p><a target="_blank" href="https://www.espruino.com/">https://www.espruino.com/</a></p>
</li>
<li><p><a target="_blank" href="https://kalumajs.org/">https://kalumajs.org/</a> { <strong>Only for Pi Peco</strong> }</p>
</li>
</ol>
</li>
<li><p>Go</p>
<ol>
<li><a target="_blank" href="https://tinygo.org/">https://tinygo.org/</a></li>
</ol>
</li>
<li><p>Rust</p>
<ul>
<li><p>Writing code in Rust is a little more complex than above languages 🥲</p>
<p>  The Rust language can be compiled specifically for development boards whose ISA { Instruction set architecture } can be found at <a target="_blank" href="https://doc.rust-lang.org/nightly/rustc/platform-support.html">https://doc.rust-lang.org/nightly/rustc/platform-support.html</a>.</p>
</li>
<li><p>The Embedded Rust can be written in two ways :</p>
<ol>
<li><p>Rust::Unsafe mode - which means direct access to memory for low-level hardware access like timers, interrupts, etc.</p>
</li>
<li><p>HAL { Hardware abstraction layer } - which means, you no longer have to directly communicate bare metal. Now you can get specific <strong>'HAL crates'</strong> for your board. Crates can be found at <a target="_blank" href="https://crates.io/">https://crates.io/</a>. These crates are like APIs to access low-level stuff.</p>
</li>
</ol>
</li>
<li><p>Embedded repo resource for Rust - <a target="_blank" href="https://github.com/rust-embedded">https://github.com/rust-embedded</a></p>
</li>
</ul>
</li>
</ol>
<h2 id="heading-will-my-board-run-modern-languages">Will my board run modern languages?</h2>
<p>Most language Runtime firmware is open-sourced with diverse communities constantly contributing to the project. As a new dev board pops into the market, the community is there to add support for it.</p>
<p>lemme give you a list of boards for specific languages.</p>
<p><strong>MicroPython</strong> - <a target="_blank" href="https://github.com/micropython/micropython/tree/master/ports">https://github.com/micropython/micropython/tree/master/ports</a></p>
<p><strong>CircuitPython</strong> - <a target="_blank" href="https://github.com/adafruit/circuitpython/tree/main/ports">https://github.com/adafruit/circuitpython/tree/main/ports</a></p>
<p><strong>TinyGo</strong> - <a target="_blank" href="https://github.com/tinygo-org/tinygo/tree/release/targets">https://github.com/tinygo-org/tinygo/tree/release/targets</a></p>
<p><strong>JerryScript</strong> - <a target="_blank" href="https://github.com/jerryscript-project/jerryscript/tree/master/jerry-port">https://github.com/jerryscript-project/jerryscript/tree/master/jerry-port</a></p>
<p><strong>Rust</strong> - <a target="_blank" href="https://doc.rust-lang.org/nightly/rustc/platform-support.html">https://doc.rust-lang.org/nightly/rustc/platform-support.html</a></p>
<blockquote>
<p>NOTE: You can find any other language runtime or language-specific board support in the project repository.</p>
</blockquote>
<h2 id="heading-hands-on">Hands-on</h2>
<p>Here I'm demonstrating LED blink fin <strong>MicroPython</strong>, you can test it out for others, or lemme know if you want a dedicated blog for that.</p>
<p>I'm using Raspberry Pi Pico for the demonstration, you can either go for the same board or use another with maybe a slightly different installation of MicroPython firmware.</p>
<p>Follow the below docs to install MicroPython firmware.UF2 file on it.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.raspberrypi.com/documentation/microcontrollers/micropython.html">https://www.raspberrypi.com/documentation/microcontrollers/micropython.html</a></div>
<p> </p>
<p>After successfully getting your REPL up and running, try running the below code to blink the built-in LED on Pi Pico.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> machine <span class="hljs-keyword">import</span> Pin, Timer
led = Pin(<span class="hljs-number">25</span>, Pin.OUT)
timer = Timer()

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">blink</span>(<span class="hljs-params">timer</span>):</span>
    led.toggle()

timer.init(freq=<span class="hljs-number">2.5</span>, mode=Timer.PERIODIC, callback=blink)
</code></pre>
<p>Here is a list of reference articles referred to write this blog :</p>
<p><a target="_blank" href="https://www.raspberrypi.com/news/multilingual-blink-for-raspberry-pi-pico/">https://www.raspberrypi.com/news/multilingual-blink-for-raspberry-pi-pico/</a></p>
]]></content:encoded></item><item><title><![CDATA[Break into the Linux ecosystem]]></title><description><![CDATA[Why Linux?
While there are numerous reasons to learn Linux, my personal motivation was to explore cybersecurity. I started with the basic command line and gradually expanded my knowledge. Here are some facts that highlight the importance of learning ...]]></description><link>https://blog.noobyco.site/break-into-the-linux-ecosystem</link><guid isPermaLink="true">https://blog.noobyco.site/break-into-the-linux-ecosystem</guid><category><![CDATA[WeMakeDevs]]></category><category><![CDATA[@wemakedev]]></category><category><![CDATA[Linux]]></category><category><![CDATA[Learning Journey]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Thu, 23 Mar 2023 06:48:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/9XngoIpxcEo/upload/b6934549d4079435b1c4d60caccff35c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-linux">Why Linux?</h2>
<p>While there are numerous reasons to learn Linux, my personal motivation was to explore cybersecurity. I started with the basic command line and gradually expanded my knowledge. Here are some facts that highlight the importance of learning Linux.</p>
<ol>
<li><h3 id="heading-its-free">It's free</h3>
</li>
<li><h3 id="heading-its-robust">It's robust</h3>
</li>
<li><h3 id="heading-runs-on-millions-of-servers">Runs on millions of servers</h3>
</li>
</ol>
<div class="hn-table">
<table>
<thead>
<tr>
<td>ROLES</td><td>WHY DO THEY USE LINUX</td></tr>
</thead>
<tbody>
<tr>
<td>Developer</td><td>{ Command line, open source tools }</td></tr>
<tr>
<td>System Administrators</td><td>{ Server management, networking }</td></tr>
<tr>
<td>Researchers</td><td>{ Open Source software/tools }</td></tr>
</tbody>
</table>
</div><h2 id="heading-linux-and-distro">Linux and Distro</h2>
<p><img src="https://imageio.forbes.com/specials-images/imageserve/5dc1a7ccca425400079c78c4/0x0.jpg?format=jpg&amp;width=1200" alt class="image--center mx-auto" /></p>
<p>Technically Linux is a kernel used in distribution. The kernel is very essential for an operating system to function. People usually call Linux an operating system, it's fine to say it so unless you ain't talking technical.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679420478103/6007c071-bcdc-413c-bb51-5b3ac3df27c9.png" alt class="image--center mx-auto" /></p>
<p>You might have seen Linux mentioned as one of the platforms when you download software. The vs code has "Linux x64" mentioned as the Operating system option to download along with { Windows, Macos }. It's understandable in this situation, although technically it sounds weird.</p>
<h2 id="heading-choosing-a-right-linux-distribution">Choosing a right Linux distribution</h2>
<p>It might be overwhelming for beginners to choose their first Linux distribution. You have to start somewhere to kick off your Linux journey. It doesn't matter initially as long as you focus on learning Linux concepts.</p>
<blockquote>
<p><strong>Take a look at the Linux distro map :</strong> <a target="_blank" href="https://distrowatch.com/images/other/distro-family-tree.png">Distrowatch</a></p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=dL05DoJ0qsQ">https://www.youtube.com/watch?v=dL05DoJ0qsQ</a></div>
<p> </p>
<h2 id="heading-burning-linux-onto-hardware">Burning Linux onto hardware</h2>
<p>This is the part where you start hands-on with the Linux box. How to install a Linux distro of your choice to a particular hardware? how to even choose the right hardware for your Linux box. Time to get your hands dirty 💩</p>
<h3 id="heading-choosing-hardware">Choosing hardware</h3>
<p>The Linux kernel is capable of running on multiple "Instruction set architectures" like <strong>x86, mips, arm, riscv.</strong> Refer to this <a target="_blank" href="https://github.com/torvalds/linux/tree/master/arch"><mark>Link</mark></a> to know about the supported ISA ( Instruction set architectures ) by the Linux kernel. Theories aside let's talk about the hardware available for common ISA.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Hardware</td><td>Example</td><td>Instruction set architecture</td></tr>
</thead>
<tbody>
<tr>
<td>Personal computers</td><td>Macbook, windows computers</td><td>x86, arm</td></tr>
<tr>
<td>Single board computers</td><td>Raspberry pi</td><td>arm</td></tr>
</tbody>
</table>
</div><h3 id="heading-ways-to-run-your-linux-distribution">Ways to run your Linux distribution</h3>
<p>Now that you have your choice of hardware with you, next you need to install/burn the Linux distribution on it. There are a couple of ways to install the distro. I'll go with beginner-friendly installation from the top to all the way till the end.</p>
<ol>
<li><p>Google Cloud console</p>
</li>
<li><p>Live boot</p>
</li>
<li><p>Using hypervisors</p>
</li>
<li><p>cloud vms</p>
</li>
<li><p>WSL2</p>
</li>
<li><p>Wipe up and install fresh</p>
</li>
<li><p>Dual boot</p>
</li>
</ol>
<p>Refer to my other <mark>blog</mark> on Linux to learn deep about each installation method 👇</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://noobyco.codes/linux-for-dummies#heading-lets-get-our-hands-dirty-with-linux">https://noobyco.codes/linux-for-dummies#heading-lets-get-our-hands-dirty-with-linux</a></div>
<p> </p>
<h3 id="heading-why-you-shouldnt-dual-boot">Why you shouldn't dual boot</h3>
<p>Check this amazing content by "HackerSploit". Shoutout to him✨</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=IFBmNLym76I">https://www.youtube.com/watch?v=IFBmNLym76I</a></div>
<p> </p>
<h2 id="heading-how-to-find-good-linux-resources">How to find good Linux resources</h2>
<p>I remember endless research for resources to learn Linux. Research is the key to resources on any topic but what really helped me to reach some of the juicy content on Linux is by finding people who have already done some good work around the Linux ecosystem. If they make content in form of videos, blogs, or whatever, do follow them only if they have proof of their work. Further, connect with them and learn along 🙂</p>
<p>My favorite resources for Linux till now are :</p>
<ol>
<li><p><a target="_blank" href="https://linuxjourney.com/">Linux Journey</a></p>
</li>
<li><p><a target="_blank" href="https://overthewire.org/wargames/">Over The Wire</a></p>
</li>
</ol>
<h2 id="heading-personal-tip">Personal tip</h2>
<p>I you are one of those who are struggling to maintain consistency but still wanna learn it, then you should definitely consider making Linux distro your primary Operating System and use it as your daily driver.</p>
]]></content:encoded></item><item><title><![CDATA[Linux for dummies]]></title><description><![CDATA[Most people out there who are just starting development may find Linux as something driving them insane. lemme show you the bright ✨ side of Linux for team developers, team operations, and coding Hobbyists.
Entering into the world of Linux can be ove...]]></description><link>https://blog.noobyco.site/linux-for-dummies</link><guid isPermaLink="true">https://blog.noobyco.site/linux-for-dummies</guid><category><![CDATA[Linux]]></category><category><![CDATA[linux for beginners]]></category><category><![CDATA[linux-commands]]></category><category><![CDATA[command line]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Tue, 03 Jan 2023 13:18:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/ecc27748d0a78eba4bb6bb5b596a6579.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most people out there who are just starting development may find <strong><em>Linux</em></strong> as something driving them insane. lemme show you the <strong><em>bright ✨</em></strong> side of <strong><em>Linux</em></strong> for <strong><em>team developers</em></strong>, <strong><em>team operations,</em></strong> and <strong><em>coding Hobbyists</em></strong>.</p>
<h2 id="heading-entering-into-the-world-of-linux-can-be-overwhelming">Entering into the world of Linux can be overwhelming 🤯</h2>
<p>You might indeed have heard, Linux is used by cool punk hackers showing their <strong><em>terminals</em></strong> with constant texts popping up after banging some commands. If you flip the coin you will encounter the deepest darkest secret hidden from people like you who are getting started, just kidding 🤣. well, I'm not scaring you exactly rather trying to demystify.</p>
<h3 id="heading-in-what-sense-it-can-be-overwhelming">In what sense it can be overwhelming</h3>
<ol>
<li><p><strong>There is too much distribution out there</strong> 😣</p>
</li>
<li><p><strong>I can't install my favourite code editor "vs code"</strong> 😣</p>
</li>
<li><p><strong>Lot more</strong> 😣</p>
</li>
</ol>
<h3 id="heading-1-there-is-too-much-distribution-out-there">1. There is too much distribution out there 😣</h3>
<p>You may have heard some of the most popular <strong><em>distributions</em></strong> like <code>Kali Linux</code> <code>Ubuntu</code> and may have assumed <code>Ubuntu == Linux</code> or <code>Kali Linux == Linux</code>, I was in your place once believe me 😁</p>
<p>There's brand new distribution popping up now and then. but windows is just one freaking thing, is there any problem with Linux being prone to mutation? 😥well Linux is just a major part of the entire operating system called ' <strong><em>kernel</em></strong> '. it's also called, the <strong><em>heart of the operating system</em></strong>. we won't trouble ourselves going deep into the kernel for now.</p>
<p>So if Linux is the kernel, then what distribution is? 🧐Linux is an <strong><em>open-source</em></strong> kernel, so developers out there grab it and smash it right into their codes to bake an operating system also called a distribution or Distro for short. but why do people commonly say distro rather than operating system? cause there are a lot of operating systems/Distro sharing the same kernel which is Linux, made by <a target="_blank" href="https://twitter.com/linus__torvalds">Linus Torvalds</a>.</p>
<p><strong><em>You can explore Distros here</em></strong> 👉 <a target="_blank" href="https://distrowatch.com/images/other/distro-family-tree.png"><mark>Distro tree</mark></a></p>
<h3 id="heading-2-i-cant-install-my-favourite-code-editor-vs-code">2. I can't install my favourite code editor "vs code" 😣</h3>
<p>Typically, users in windows would download the installer for particular software and the installer would guide and does most of the part itself. below is one example of a <strong><em>software installer</em></strong> for windows.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672687488096/7a43eef8-6c9c-416c-9ddc-e920399378be.png" alt class="image--center mx-auto" /></p>
<p>what about the case of <strong><em>Linux distros</em></strong>? well, they are very much different from windows kinda installing software. they use something called a <strong><em>package manager</em></strong> to manage software/packages. what does managing mean in Linux distro?</p>
<p>📩 Installing software</p>
<p>⚙ Updating software</p>
<p>❌ Deleting software</p>
<p>🥤 Much more juicy stuff</p>
<p>Some package managers used by different distributions are :</p>
<blockquote>
<p><strong><em>apt</em></strong> or <strong><em>apt-get</em> --&gt;</strong> Debian-based distributions</p>
<p><strong><em>rpm</em></strong> or <strong><em>yum --&gt;</em></strong> Redhat-based distributions</p>
</blockquote>
<p>If you can relate to the package managers inside programming languages like <strong><em>python</em></strong> = <strong><em>pip,</em></strong> <strong><em>javascript</em></strong> = <strong><em>npm,</em></strong> and so on. Explore most of the package managers for programming languages - <a target="_blank" href="https://libraries.io/"><mark>Libraries.io</mark></a></p>
<h3 id="heading-3-lot-more">3. Lot more 😣</h3>
<p>Once you start using Linux distros as your daily driver then you gradually start to pick up the whole ecosystem a lot faster. It also prioritized more on the <strong><em>command-line interface</em></strong> <code>CLI</code> over the <strong><em>graphical user interface</em></strong> or <code>GUI</code> . This command line has a steep learning curve than graphical once such as the one and only freakin Windows.</p>
<p>You might be thinking "Hey Noobyco why ain't you mentioned mac anywhere?", well well, mac is based on Unix so it is an all-rounder when it comes to both GUI and CLI. you can think of it as, visually friendly like windows and extremely robust as well as juicy like Linux distros.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672690881982/d299f405-4bfe-485a-a3a9-dacbcfb6f9aa.png" alt class="image--right mx-auto mr-0" /></p>
<h3 id="heading-note">NOTE</h3>
<p>You may have heard developers saying Linux to describe an operating system rather than ' <strong><em>kernel</em></strong> ', it's totally fine as long as you understand the difference. another term ' <strong><em>terminal</em></strong> ' is thrown a lot in this field which Is the software providing <strong><em>CLI</em></strong> in Linux distros and mac ecosystem, there are a variety of terminals out there to use. but in the case of windows, currently, we have only two, <strong><em>PowerShell</em></strong> and <strong><em>CMD</em></strong>.</p>
<h2 id="heading-our-target-reader">Our target reader</h2>
<ol>
<li><p><strong>Transitioning to backend development</strong> 👩‍💻</p>
</li>
<li><p><strong>Transitioning to an administration job</strong> ⌨</p>
</li>
<li><p><strong>Hobbyist</strong> 🐧</p>
</li>
</ol>
<h3 id="heading-1-transitioning-to-backend-development">1. Transitioning to backend development 👩‍💻</h3>
<p>Most people transitioning into the backend are <strong><em>front-end</em></strong> guys, there are also some people directly hopping into the <strong><em>backend</em></strong>, so we'll consider both situations. In the case of front-end dudes, they tend to use <strong><em>CLI</em></strong> far less than <strong><em>server</em></strong> guys. when I say CLI it does not refer to a <strong><em>Linux terminal</em></strong> rather it's the interface used by operating systems for various reasons.</p>
<p>there are no specific <strong><em>prerequisites</em></strong> for people falling into this category, except basic <strong><em>IT knowledge</em></strong> includes knowing how to use an operating system for daily use.</p>
<h3 id="heading-2-transitioning-to-an-administration-job">2. Transitioning to an administration job ⌨</h3>
<p>majorly there are two teams in a software producing company, one which writes software AKA software developer ( Includes all sub-categories like <strong><em>web development</em></strong>, <strong><em>mobile</em></strong> ... ) another maintains <strong><em>production servers</em></strong> in which the software runs. administrative jobs fall under server Maintainance also called operations in IT. <strong><em>Network admin</em></strong>, <strong><em>System admin and help desk</em></strong> are some of the roles that come under this. these guys can't live without a <strong><em>terminal</em></strong>.</p>
<h3 id="heading-3-hobbyist">3. Hobbyist 🐧</h3>
<p>they are my favourite set of <strong><em>tech-savvy</em></strong>, always prone to explore new stuff and open to learning out of their <strong><em>curiosity</em></strong>.</p>
<h2 id="heading-lets-get-our-hands-dirty-with-linux">Let's get our hands dirty with Linux</h2>
<p>Enough talking, it's time to <strong><em>execute</em></strong> some stuff. let's proceed according to standard <strong><em>OS</em></strong> users.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672748366928/2ed373c0-bbe5-41b5-8581-edeab6cc9431.jpeg" alt class="image--center mx-auto" /></p>
<h3 id="heading-1-windows-savvy">1. Windows savvy</h3>
<p>Users coming from a Windows background has some of the following ways to spin up a <strong><em>Linux</em></strong> <strong><em>distro</em></strong> for them</p>
<ul>
<li><p><strong>WSL2</strong></p>
</li>
<li><p><strong>Live boot</strong></p>
</li>
<li><p><strong>Dual boot</strong></p>
</li>
<li><p><strong>Using hypervisors</strong></p>
</li>
<li><p><strong>Google Cloud console</strong></p>
</li>
<li><p><strong>Wipe up and install fresh</strong></p>
</li>
<li><p><strong>Virtual machines on Cloud</strong></p>
</li>
</ul>
<p>There are many ways to get your Distro rolling, but ill recommend doing <strong>Live boot, Using hypervisor</strong> and <strong>Google Cloud console</strong> initially, later on, you can try left-out things on your own or comment me down if you want a detailed blog on a specific topic.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672741474306/0940b1ba-48c7-4aa3-b0d9-9c615b9321d0.jpeg" alt class="image--center mx-auto" /></p>
<ol>
<li><strong>Hypervisors</strong> are the most common way of spinning a distro, it uses the virtualization technique. refer to this tutorial kinda video to set up your hypervisor.</li>
</ol>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=wX75Z-4MEoM">https://www.youtube.com/watch?v=wX75Z-4MEoM</a></div>
<p> </p>
<ol>
<li><strong>Live boot</strong> is a way of booting up the distro without installing it into your secondary storage i.e hard disk. well, now it's something getting interesting haa 🧐.</li>
</ol>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=_PGJ980upPQ">https://www.youtube.com/watch?v=_PGJ980upPQ</a></div>
<p> </p>
<ol>
<li><p><strong>Google Cloud console</strong> is one of the easiest options to opt for among the three, cause there the distro spins on Google servers. they have exposed a console to use it, all you need is a google account, that's it.</p>
<p> <strong><mark>Hit </mark></strong> <a target="_blank" href="https://console.cloud.google.com/"><strong><mark>HERE</mark></strong></a></p>
</li>
</ol>
<h3 id="heading-2-mac-savvy">2. Mac savvy</h3>
<p>Do not need to worry about any of the installation process cause mac is <strong><em>Unix based</em></strong>, thus it already has a terminal pre-baked from the factory.</p>
<h3 id="heading-juicy-platform-to-learn-linux">juicy platform to learn Linux</h3>
<p>Of course, I can explain every basic concept along with examples here, but that would be pointless for this blog, there is already a platform to <strong><em>practice and reference</em></strong>. you can do <a target="_blank" href="https://chat.openai.com">ChatGPT</a> and fetch a lot of valuable resources and references for you, but <code>AI != Human</code> so I'm sharing my favourite platforms with you</p>
<ul>
<li>Use <a target="_blank" href="https://overthewire.org/wargames/">Over The Wire</a> to practice your <strong><em>Linux skills</em></strong> by playing <strong><em>games</em></strong>.</li>
</ul>
<p>I would recommend beginners start with <strong><em>video content</em></strong> rather than <strong><em>textual content</em></strong>, cause when you are starting with something, it requires more <strong><em>focus</em></strong> during those <strong><em>initial days</em></strong>. Visual content grabs your focus and makes it a lot more interesting than textual content. I agree visual contents <strong><em>consume a lot of time</em></strong> but it pays off in the beginning.</p>
<blockquote>
<p><strong>In the end, the only method that works the best is to force yourself to learn Linux by wiping up your hard disk and freshly installing Linux distro and using it as your daily driver. before doing that make sure you back up every bit of data.</strong></p>
</blockquote>
<h2 id="heading-why-should-we-learn-linux">Why should we learn Linux?</h2>
<p>well, it depends on what kind of person you are. In the tech field, developers use it, the <strong><em>server maintainers</em></strong>, <strong><em>cybersecurity</em></strong> <strong><em>professionals</em></strong>, and <strong><em>DevOps</em></strong> guys. I can go on listing roles on and on but I wanna make a point about the factors causing these roles to adapt. of course, we can run web servers on the windows operating system ( <strong><em>windows server</em></strong> ) or do <strong><em>bug bounty</em></strong> on windows or any other operating system. The fact we all should notice Linux being run on the majority of servers and used in various roles because of the following <strong><em>factors</em></strong> :</p>
<h3 id="heading-command-line"><strong>Command line</strong></h3>
<p>Both Linux and mac have a <strong><em>robust command line interface</em></strong>, which is often preferred by developers because it allows them to <strong><em>automate tasks</em></strong> and work more <strong><em>efficiently</em></strong>. Windows on the other side is not fully featured as the one on Linux and mac.</p>
<h3 id="heading-compatibility-with-open-source"><strong>Compatibility with open source</strong></h3>
<p>Many open-source <strong><em>tools and frameworks</em></strong> are developed on and for Linux and mac systems.</p>
<h3 id="heading-customizability"><strong>Customizability</strong></h3>
<p>Linux and mac systems offer more customization options than Windows, which can be attractive to developers who want to tailor their <strong><em>development environment</em></strong> to their specific needs.</p>
<h2 id="heading-my-journey-into-linux">My journey into Linux</h2>
<p>I remember completely wiping up my disk and installing <strong><em>Debian based Distro</em></strong> <code>Kali Linux</code> as my first Linux exposure. I was curious to explore the very concepts Linux is different from Windows. I heard the term <strong>Linux</strong> during high school but used to wonder about it being run on the system. my school computer labs had windows installed on them so I used to play crazy on the <strong><em>CMD</em></strong> command line. create a batch script and do all sorts of harmful executions to destroy systems completely, although I enjoyed those days 😅.</p>
<p>Back in 2k22, I was exploring cybersecurity, and this was the main reason to start learning Linux in the first place. I discovered my favourite platforms to learn it. one of my all-time favourite is <a target="_blank" href="https://linuxjourney.com/">Linuxjourney</a>, unfortunately, it's down currently 😢.</p>
<p>The one strategy I always used is to `<strong>learn something if you know its why`</strong> in my case I was learning to learn cybersecurity concepts. I call it <code>reverse engineering</code> .</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Some of you might be wondering, where are commands in this blog 😅. Intentionally I designed this blog the way it is cause it's for <strong><em>dummies</em></strong>. Let's assume you heard about Linux from your friend circle and you come back home spin your Linux distro and start banging commands onto the terminal. sixty-nine minutes passed and you have no idea what's going on 😂. This situation matches perfectly to <code>script kiddies</code> in the world of hacking.</p>
<p>Now after reading this one can be comfortable in the ecosystem and keep learning on top of that. Let me know if you guys want more blogs around Linux or if you wanna explore ChatGPT to learn the same.</p>
]]></content:encoded></item><item><title><![CDATA[My journey into the world of IoT]]></title><description><![CDATA[WHOAMI?

Let me introduce myself. I'm a student who is interested in electronics, I know that I threw a pretty vague term there but lemme explain. When I was very young, maybe in 6th std (excuse me I don't know the exact year) my sister gave me a lig...]]></description><link>https://blog.noobyco.site/my-journey-into-the-world-of-iot</link><guid isPermaLink="true">https://blog.noobyco.site/my-journey-into-the-world-of-iot</guid><category><![CDATA[iot]]></category><category><![CDATA[Electronics]]></category><category><![CDATA[iot project]]></category><dc:creator><![CDATA[Md Moinuddin]]></dc:creator><pubDate>Wed, 10 Aug 2022 18:40:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1660139528370/gnT2J9G9r.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-whoami">WHOAMI?</h2>
<hr />
<p>Let me introduce myself. I'm a student who is interested in <strong>electronics</strong>, I know that I threw a pretty vague term there but lemme explain. When I was very young, maybe in 6th std (excuse me I don't know the exact year) my sister gave me a light bulb, one with a filament on it. From there my interest in electronics started and later aligned with the field of computers... cause</p>
<pre><code class="lang-plaintext">COMPUTERS == APPLICATION_OF_ELECTRONICS
</code></pre>
<hr />
<p>Back in the year 2k21, this was the year after I started college. I used to watch build videos of electronic projects like LED cube matrix or POV displays but in the end, something I wanted to do out of my **curiosity **, of knowing how those devices would work, and that stuff really fascinated me.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660142501799/JoGKyUfMQ.webp" alt="LEDCubeFinalOperational.webp" /></p>
<p>After getting loaded with a bunch of electronic project ideas, there was one project which stuck on my mind for a very long time. In that project, I wanted to control my home light bulbs and fans via my smartphone. Then my research journey began...</p>
<h2 id="heading-let-the-journey-begin">Let the journey begin</h2>
<hr />
<p>I was not sure how to achieve that result, thus I started <strong>Dorking Google</strong>. I saw the most common method to achieve my result, and that was using services like <strong>Arduino IoT cloud</strong> or <strong>Blynk</strong>, etc. At that time I had only one board which was <strong>Raspberry pi 3</strong>. Because of the following factors, i could not use those appealing services :</p>
<ul>
<li><p>I wasn't aware of the platform which supports Raspberry pi and</p>
</li>
<li><p>I had no dev board other than raspberry pi cause</p>
</li>
<li><p>I was poor</p>
</li>
</ul>
<blockquote>
<h3 id="heading-communication-between-things">Communication between things</h3>
</blockquote>
<hr />
<p>In this particular project, the things were two, and they were :</p>
<ul>
<li><p>Raspberry pi + LED connected to it</p>
</li>
<li><p>web app to fire commands</p>
</li>
</ul>
<p>I was looking for some kinda glue to stick them both together so that they could start communicating via messages. That was the very basic plan but before hitting google I thought to myself, what if we could use the HTTP protocol to enable the communication? I was familiar with some of the networking stuff, so I picked up my raspberry pi and installed an apache server, and coded a Lil <code>.py</code> script to control the led on the pi connected via GPIO.</p>
<p>The idea was to deploy my web app onto the raspberry pi, on doing so I could write a script onto the backend of the web app to directly control the LED via commands coming from the frontend.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660151662142/L-zytCohL.webp" alt="server-browser-relationship.webp" /></p>
<p>I ended up not applying the HTTP protocol and began research. Then I found the MQTT protocol and this time I'm using it.</p>
<blockquote>
<h3 id="heading-mqtt-test">MQTT test</h3>
</blockquote>
<hr />
<p>So I wrote the <code>.py</code> script on two different files. One for the <code>publish.py</code> and the other<code>subscribe.py</code>. I ran both scripts using two separate terminals. the <code>publish.py</code> file was responsible to publish a msg into the broker and <code>subscribe.py</code> was to subscribe. The broker is the central MQTT server which is stateless.</p>
<p>As I published a msg from one terminal, immediately i could see the msg appearing on the other terminal. I was so happy that I took that laptop that day and showed it to my whole family.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660153584066/TeKeDNpzY.jpg" alt="annebell-dogger-iX16iOAQ_lw-unsplash.jpg" /></p>
<blockquote>
<h3 id="heading-way-to-fire-commands">Way to fire commands</h3>
</blockquote>
<hr />
<p>Here comes the juicy stuff. MQTT demo was working flawlessly, now there was the challenge to code <code>UI</code> and get command from there and <code>POST</code> to backend. I chose <code>Express+Node</code> setup at the backend with no database involved. The plan was to make it less complicated. On the frontend side, i used simple <code>HTML+CSS</code>.</p>
<p>The web app is ready, time was to add MQTT flavor to the backend to communicate via a broker. Thus i used the npm package called also <code>mqtt</code>. Glued everything together and landed with this beast...</p>
<p><a target="_blank" href="https://led-iot.herokuapp.com/">Web-App</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660155418861/qzzTH67R1.png" alt="Web-App" class="image--center mx-auto" /></p>
<blockquote>
<h3 id="heading-pi-setup">Pi setup</h3>
</blockquote>
<hr />
<p>On the PI I modified the <code>subscribe.py</code> file and interfaced it with a GPIO pin for controlling the LED attached to it.</p>
<pre><code class="lang-plaintext">
import paho.mqtt.client as mqtt
import time
import RPi.GPIO as GPIO

#setmode
GPIO.setmode(GPIO.BCM)

#pin_setup for led.

GPIO.setup(4,GPIO.OUT)

def on_message(client, userdata, message):
    msg = str(message.payload.decode("utf-8"))
    if(msg == "on" or msg=="ON" or msg=="On"):
        GPIO.output(4, GPIO.HIGH)
    elif(msg == "off" or msg=="OFF" or msg=="Off"):
        GPIO.output(4, GPIO.LOW)
    print("received message: " ,str(message.payload.decode("utf-8")))

mqttBroker ="broker.hivemq.com"

client = mqtt.Client("internet")
client.connect(mqttBroker) 
#Loop_Start
client.loop_start()

client.subscribe("internet")
client.on_message=on_message 

time.sleep(90000)
#Loop_End
client.loop_stop()
</code></pre>
<blockquote>
<h3 id="heading-zoom-out-a-lil-bit">Zoom out a Lil bit</h3>
</blockquote>
<hr />
<p>I just finished the three major parts of the project :</p>
<ul>
<li><p>Web-App</p>
</li>
<li><p>MQTT broker</p>
</li>
<li><p>Pi script</p>
</li>
</ul>
<p>If we tryna understand what's really going on under the hood then we need to step back zoom out a Lil bit and see the bigger picture. I won't explain you in the text but on looking at the below image you'll get what i wanna explain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660156679467/CdscTzmZY.png" alt="MQTT Broker.png" /></p>
<blockquote>
<blockquote>
<p>Get the <code>GitHub</code> repo : <a target="_blank" href="https://github.com/Blaize15/iot-led/tree/master">Github</a></p>
<p>I made a video <code>documentary</code> on this project : <a target="_blank" href="https://www.linkedin.com/feed/update/urn:li:activity:6937459206606204928/">Documentary</a></p>
</blockquote>
</blockquote>
]]></content:encoded></item></channel></rss>