<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amal Satheesan</title>
    <description>The latest articles on DEV Community by Amal Satheesan (@kutt27).</description>
    <link>https://dev.to/kutt27</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1163228%2Fccd6bc06-88ed-4278-861d-6b373f8b3302.png</url>
      <title>DEV Community: Amal Satheesan</title>
      <link>https://dev.to/kutt27</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kutt27"/>
    <language>en</language>
    <item>
      <title>Pi-hole setup(docker) for ad blocking</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Mon, 27 Oct 2025 13:31:49 +0000</pubDate>
      <link>https://dev.to/kutt27/pi-hole-setupdocker-for-ad-blocking-38ch</link>
      <guid>https://dev.to/kutt27/pi-hole-setupdocker-for-ad-blocking-38ch</guid>
      <description>&lt;p&gt;Recently, I set up Pi-hole for network-wide ad blocking, starting with the goal of blocking ads on TV subscriptions like JioHotstar, YouTube, and other video streaming platforms.&lt;/p&gt;

&lt;p&gt;Disclaimer: This didn’t work for streaming services, since their CDNs now frequently change and serve content and ads from constantly rotating domains.&lt;/p&gt;

&lt;p&gt;Still, Pi-hole is a powerful tool for disabling redundant ads. What impressed me most was how it blocked about 20% of all requests sent from my devices. Even without noticing issues, it was eye-opening to analyse online activity across my home network. I could see just how many unnecessary requests my devices make — when I connected my laptop for five minutes while idle, it sent over 400 requests.&lt;/p&gt;

&lt;p&gt;I highly encourage anyone with a Raspberry Pi to set up Pi-hole. It’s a great way to gain insight into your network activity and enjoy a cleaner web experience. I’ll follow up this post with a new blog about using PiVPN and WireGuard, though there are a few nuances I missed—currently, the tunnel isn’t working properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Install docker and docker-compose&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Add the user to the group&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$USER&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; docker &lt;span class="nv"&gt;$USER&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, either log out and log back in or restart the system to apply group membership changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/pi-hole/docker-pi-hole/?tab=readme-ov-file#quick-start" rel="noopener noreferrer"&gt;Link to repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copy the docker-compose.yml file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/&lt;/span&gt;
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      &lt;span class="c"&gt;# DNS Ports&lt;/span&gt;
      - &lt;span class="s2"&gt;"53:53/tcp"&lt;/span&gt;
      - &lt;span class="s2"&gt;"53:53/udp"&lt;/span&gt;
      &lt;span class="c"&gt;# Default HTTP Port&lt;/span&gt;
      - &lt;span class="s2"&gt;"80:80/tcp"&lt;/span&gt;
      &lt;span class="c"&gt;# Default HTTPs Port. FTL will generate a self-signed certificate&lt;/span&gt;
      - &lt;span class="s2"&gt;"443:443/tcp"&lt;/span&gt;
      &lt;span class="c"&gt;# Uncomment the line below if you are using Pi-hole as your DHCP server&lt;/span&gt;
      &lt;span class="c"&gt;#- "67:67/udp"&lt;/span&gt;
      &lt;span class="c"&gt;# Uncomment the line below if you are using Pi-hole as your NTP server&lt;/span&gt;
      &lt;span class="c"&gt;#- "123:123/udp"&lt;/span&gt;
    environment:
      &lt;span class="c"&gt;# Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:&lt;/span&gt;
      TZ: &lt;span class="s1"&gt;'Europe/London'&lt;/span&gt;
      &lt;span class="c"&gt;# Set a password to access the web interface. Not setting one will result in a random password being assigned&lt;/span&gt;
      FTLCONF_webserver_api_password: &lt;span class="s1"&gt;'correct horse battery staple'&lt;/span&gt;
      &lt;span class="c"&gt;# If using Docker's default `bridge` network setting the dns listening mode should be set to 'all'&lt;/span&gt;
      FTLCONF_dns_listeningMode: &lt;span class="s1"&gt;'all'&lt;/span&gt;
    &lt;span class="c"&gt;# Volumes store your data between container upgrades&lt;/span&gt;
    volumes:
      &lt;span class="c"&gt;# For persisting Pi-hole's databases and common configuration file&lt;/span&gt;
      - &lt;span class="s1"&gt;'./etc-pihole:/etc/pihole'&lt;/span&gt;
      &lt;span class="c"&gt;# Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'&lt;/span&gt;
      &lt;span class="c"&gt;#- './etc-dnsmasq.d:/etc/dnsmasq.d'&lt;/span&gt;
    cap_add:
      &lt;span class="c"&gt;# See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities&lt;/span&gt;
      &lt;span class="c"&gt;# Required if you are using Pi-hole as your DHCP server, else not needed&lt;/span&gt;
      - NET_ADMIN
      &lt;span class="c"&gt;# Required if you are using Pi-hole as your NTP client to be able to set the host's system time&lt;/span&gt;
      - SYS_TIME
      &lt;span class="c"&gt;# Optional, if Pi-hole should get some more processing time&lt;/span&gt;
      - SYS_NICE
    restart: unless-stopped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure the Docker daemon is actually running before you run the compose command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status docker
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the status is active, run the following command in the directory you created the &lt;code&gt;docker-compose.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will pull all the images, after successful installation, run:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If you see the &lt;code&gt;pi-hole&lt;/code&gt; container is running, open a new tab in your preferred web browser. Before that:&lt;/p&gt;

&lt;p&gt;Get the PI IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;hostname&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the first local IP address of your Pi. Then type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&amp;lt;PI_IP_ADDRESS&amp;gt;/admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into the web browser.&lt;/p&gt;

&lt;p&gt;You will need to log in using an existing account. The password is given in the &lt;code&gt;docker-compose.yml&lt;/code&gt; file under the variable: &lt;code&gt;FTLCONF_webserver_api_password: 'correct horse battery staple'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy the password and log in. &lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting devices:
&lt;/h3&gt;

&lt;p&gt;In mobile:&lt;/p&gt;

&lt;p&gt;Wifi -&amp;gt; Advanced Settings -&amp;gt; DHCP -&amp;gt; Manual &lt;/p&gt;

&lt;p&gt;Then, on the DNS-1 server, add your Pi IP address you just copied. Then save it. &lt;/p&gt;

&lt;p&gt;Look into the client connection in the Pi-Hole dashboard. You will see the connected device IP address.&lt;/p&gt;

&lt;p&gt;In a laptop: &lt;/p&gt;

&lt;p&gt;Wifi -&amp;gt; Connection Manager -&amp;gt; Update the DNS there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding custom blocklist
&lt;/h3&gt;

&lt;p&gt;If you go to &lt;code&gt;Lists&lt;/code&gt; in the dashboard, you can already see a list added by the Pi-Hole team. An extensive list. You can find more lists on GitHub and the internet. You can add an allowlist and a blocklist to the connections based on your needs.&lt;/p&gt;

&lt;p&gt;Some of the lists I use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/pro.txt" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/pro.txt&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/youtubelist.txt" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/youtubelist.txt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/crowed_list.txt" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/crowed_list.txt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt" rel="noopener noreferrer"&gt;https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After you add this list as a blocklist, go to &lt;code&gt;tools -&amp;gt; update gravity -&amp;gt; update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we have successfully added a custom list as well. Now you can monitor your network by device. Which are sending which, why, what type of request and more.&lt;/p&gt;

&lt;p&gt;The current setup is enough to play around with the tool, thus figure out and break things, and explore other solutions. Mantra: "Use this until it breaks down". Use this as a monitoring tool heavily rather than an ad blocker. There are hidden gems there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNWtlZDFrb2N2bW4xeXA5cWZoa3hrdHJ5cDlmb3FmOGFrNW92dmRnNCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3ohjVay5BxfnqBmSLC%2Fgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNWtlZDFrb2N2bW4xeXA5cWZoa3hrdHJ5cDlmb3FmOGFrNW92dmRnNCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3ohjVay5BxfnqBmSLC%2Fgiphy.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>pihole</category>
    </item>
    <item>
      <title>Web Architecture: Web1.0 to Web3.0</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Sat, 16 Aug 2025 18:09:12 +0000</pubDate>
      <link>https://dev.to/kutt27/the-journey-of-web-web10-to-web30-1hkb</link>
      <guid>https://dev.to/kutt27/the-journey-of-web-web10-to-web30-1hkb</guid>
      <description>&lt;p&gt;The invention of the internet can be traced back to the 1960s, when researchers, government officials, and other operational heads needed to share information with one another.  However, the Internet phenomenon began in the 1990s, when renowned Tim Berners-Lee introduced the "World Wide Web" in 1989.&lt;/p&gt;

&lt;p&gt;His work was closed during that time, but it was made available to the general public in 1993, and it has since progressed to where we are today. His primary focus was on the inefficient management of files and information at his organization CERN. So he suggested a &lt;strong&gt;linked system of information nodes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This work can be accessed in the following &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.w3.org/History/1989/proposal-msw.html" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;w3.org&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  System diagram
&lt;/h2&gt;

&lt;p&gt;This is a simple system diagram to demonstrate how web1.0 works:&lt;/p&gt;

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

&lt;p&gt;Web 1.0 was the "read-only" web with mostly static web pages. Means it allowed people to only search and view information online, it means none can interact and post to the web, a one way communication.&lt;/p&gt;

&lt;p&gt;The most important point here is, the Websies at that point of time were informational, created and controlled by owners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relevance to Today’s Architecture:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linked nodes and links shaped the Web’s HTML, URLs, and hyperlinks.&lt;/li&gt;
&lt;li&gt;Separation of servers and browsers underpins modern web and APIs.&lt;/li&gt;
&lt;li&gt;Common interfaces enable integration of diverse data sources.&lt;/li&gt;
&lt;li&gt;Live links relate to dynamic content and real-time APIs.&lt;/li&gt;
&lt;li&gt;Graph-like structures influence modern databases and the semantic web.&lt;/li&gt;
&lt;li&gt;User-centered browsing guides web design today.&lt;/li&gt;
&lt;li&gt;Early privacy and annotation ideas appear in social networks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Emergence of Web2.0
&lt;/h2&gt;

&lt;p&gt;One of the drawbacks of Web 1.0 is the lack of a "POST" function; from static websites, the web evolved into something more interactive and collaborative.  It enabled users to create, share, and comment on content, rather than just viewing it.&lt;/p&gt;

&lt;p&gt;Personal activities that gained momentum for web2.0 are of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blogs&lt;/li&gt;
&lt;li&gt;Feeds (RSS)&lt;/li&gt;
&lt;li&gt;Social networking&lt;/li&gt;
&lt;li&gt;Video sharing&lt;/li&gt;
&lt;li&gt;Podcast&lt;/li&gt;
&lt;li&gt;Etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Simple Architecture
&lt;/h3&gt;

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

&lt;p&gt;During this time, websites became more dynamic, with content added by users and communities.  For example, readers were able to leave comments beneath the blogs.  So it addressed Web 1.0's one-way communication limitation.&lt;/p&gt;

&lt;p&gt;Social media, blogs, and wikis became popular with Web 2.0 and it enabled user participation, social networking, and content sharing.&lt;/p&gt;

&lt;p&gt;The other important point to consider in web2.0 is, &lt;strong&gt;control shifted from just owners to users contributing content&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;One of the papers that served as a foundation for the development of web2.0 discussed the following principles for being a web2.0 technology:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deliver services instead of packaged software, enabling cost-effective scalability.&lt;/li&gt;
&lt;li&gt;Maintain control over unique, hard-to-recreate data sources that grow richer with increased user participation.&lt;/li&gt;
&lt;li&gt;Trust users as co-developers and collaborators.&lt;/li&gt;
&lt;li&gt;Harness collective intelligence from the user community.&lt;/li&gt;
&lt;li&gt;Leverage the long tail by enabling customer self-service.&lt;/li&gt;
&lt;li&gt;Provide software that operates beyond a single device or platform.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Refer here:&lt;br&gt;
&lt;a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1008839" rel="noopener noreferrer"&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1008839&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Comes Web3.0
&lt;/h2&gt;

&lt;p&gt;Before we set out, I'd like to provide a simple analogy for why we simply require web3.  Let's say we're playing our favorite game and making some in-game purchases. You should understand that the money in the game is just some numbers stored in a database, and any internal developer can empty your account by simply updating the database.  However, with web3, the money, purchase, and game are all public assets for us, and no one can intervene until we transfer ownership to someone else.  Nobody else is in the middle.&lt;/p&gt;

&lt;p&gt;In essence, it solved the centralized control and data privacy issues of Web 2.0. To give users full ownership and control over their data and digital assets. &lt;/p&gt;

&lt;p&gt;Some of the features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It enable decentralized applications without intermediaries using blockchain.&lt;/li&gt;
&lt;li&gt;To enhance security, transparency, and trust via immutable, tamper-proof ledgers.&lt;/li&gt;
&lt;li&gt;To create new economic models like decentralized finance (DeFi) and token economies.&lt;/li&gt;
&lt;li&gt;To improve interoperability and allow seamless interaction across platforms.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why Early Web3 Was Full of Scandals?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because, it had a rough start, because of the idea of decentralization affected the control for regulation (in some way it's good, but do they?). The rapid growth, and overhyped expectations attracted a lot of scams, frauds, hacks, and failed projects especially in crypto and NFT's. Lack of governance and standards causes abuse and exploitation. Also the inexperience of developers and bad actors exploited decentralization. &lt;/p&gt;

</description>
      <category>web</category>
      <category>web3</category>
      <category>website</category>
    </item>
    <item>
      <title>Publishing a static website from Raspberry Pi</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Mon, 02 Sep 2024 17:36:06 +0000</pubDate>
      <link>https://dev.to/kutt27/launch-website-to-public-from-raspberry-pi-2klh</link>
      <guid>https://dev.to/kutt27/launch-website-to-public-from-raspberry-pi-2klh</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Securing Your WordPress Website on Raspberry Pi with Cloudflare Tunnel&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You're halfway through releasing your website to the public from your Raspberry Pi. Before proceeding, ensure you have the following essentials:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Raspberry Pi with a WordPress site installed.&lt;/li&gt;
&lt;li&gt;Nginx server configured on the Raspberry Pi.&lt;/li&gt;
&lt;li&gt;An active Cloudflare account.&lt;/li&gt;
&lt;li&gt;A registered domain.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Update DNS Records in Your Domain Dashboard&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log in to Cloudflare&lt;/strong&gt;: Access your &lt;a href="https://dash.cloudflare.com" rel="noopener noreferrer"&gt;Cloudflare dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add Your Domain&lt;/strong&gt;: Go to the “Websites” section and register a new domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update DNS Settings&lt;/strong&gt;: Follow the on-screen instructions to update the DNS records on your domain registrar’s dashboard with the nameservers provided by Cloudflare. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wait for Propagation&lt;/strong&gt;: DNS changes can take some time to propagate. Once the nameservers are updated and Cloudflare has authorized your domain, you're ready to move on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have any doubts about these steps, feel free to ask in the comments section.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Install the Cloudflared Daemon on Raspberry Pi&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download Cloudflared&lt;/strong&gt;: Depending on your Raspberry Pi architecture, use the appropriate &lt;code&gt;wget&lt;/code&gt; command to download Cloudflared:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- For ARMv7 (Raspberry Pi 2 and 3):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```bash
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- For ARMv6 (Raspberry Pi Zero):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```bash
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-armv6
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- For ARM64 (Raspberry Pi 3/4 with 64-bit OS):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```bash
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Move the Downloaded File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mv &lt;/span&gt;cloudflared-linux-arm /usr/local/bin/cloudflared
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;(Adjust the filename if you downloaded a different architecture version.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Make the Binary Executable&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /usr/local/bin/cloudflared
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify Installation&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Authenticate Cloudflared with Cloudflare&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Log in to Cloudflare&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared login
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authorize Cloudflared&lt;/strong&gt;: Copy the URL displayed in the terminal and open it in your browser. Select your domain in Cloudflare and click &lt;strong&gt;Authorize&lt;/strong&gt;. Make sure you're already logged in to your Cloudflare dashboard to complete this step seamlessly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Create a Secure Tunnel&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create the Tunnel&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared tunnel create mywpsite
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Save Important Details&lt;/strong&gt;: Make a note of the tunnel ID and the path to the JSON file generated. You’ll need these later.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5: Configure Cloudflared&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a Configuration File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano ~/.cloudflared/config.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add Configuration Details&lt;/strong&gt;:&lt;br&gt;
Replace the placeholders with your actual tunnel UUID, JSON file path, domain, and Raspberry Pi IP address:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;tunnel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;your-tunnel-uuid&lt;/span&gt;
&lt;span class="na"&gt;credentials-file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/home/pi/.cloudflared/your-tunnel-uuid.json&lt;/span&gt;
&lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
 &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hostname&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yourdomain.com&lt;/span&gt;
   &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://your-raspberry-pi-ip-address&lt;/span&gt;
 &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http_status:404&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure you update &lt;code&gt;pi&lt;/code&gt; with the correct username and remove any trailing slashes from the IP address (e.g., &lt;code&gt;http://192.168.*.*&lt;/code&gt; is correct).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Save and Exit&lt;/strong&gt;: Press &lt;code&gt;CTRL + X&lt;/code&gt;, then &lt;code&gt;Y&lt;/code&gt;, and hit &lt;code&gt;Enter&lt;/code&gt; to save the configuration.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6: Create DNS Entry in Cloudflare&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Route DNS&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared tunnel route dns mywpsite yourdomain.com
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Troubleshooting Tip&lt;/strong&gt;: If you encounter an error, log in to your Cloudflare dashboard, delete any existing DNS records for your domain, and run the command again.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 7: Run the Cloudflare Tunnel&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Start the Tunnel&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared tunnel run mywpsite
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify&lt;/strong&gt;: Visit &lt;code&gt;https://yourdomain.com&lt;/code&gt; to ensure your site is live and accessible.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;If your network changes and local ip changes, just login to the tunnel in cloudflare and change the local ip their itself and will work as same before.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 8: Update WordPress Settings&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Access WordPress Admin&lt;/strong&gt;: Go to &lt;code&gt;http://your-raspberry-pi-ip-address/wp-admin&lt;/code&gt; and log in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update URLs&lt;/strong&gt;: Under &lt;strong&gt;Settings &amp;gt; General&lt;/strong&gt;, update both the WordPress Address and Site Address to &lt;code&gt;https://yourdomain.com&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 9: Run Cloudflare Tunnel as a Service&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Move Configuration File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mv&lt;/span&gt; /home/pi/.cloudflared/config.yml /etc/cloudflared/
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install as a Service&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;cloudflared service &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By running Cloudflared as a service, your Raspberry Pi will automatically start the Cloudflare tunnel whenever it reboots, ensuring continuous availability of your site.&lt;/p&gt;




&lt;p&gt;With these steps completed, your WordPress site on Raspberry Pi is securely accessible from the internet, complete with SSL encryption, thanks to Cloudflare Tunnel.&lt;/p&gt;

&lt;p&gt;Will share more update regarding a updated version on this setup if it works soon. Stay tuned, will host a real website with multiple webpages.&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Wordpress installation in Raspberry Pi using Nginx</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Mon, 02 Sep 2024 15:53:39 +0000</pubDate>
      <link>https://dev.to/kutt27/wordpress-installation-in-raspberry-pi-using-nginx-5dld</link>
      <guid>https://dev.to/kutt27/wordpress-installation-in-raspberry-pi-using-nginx-5dld</guid>
      <description>&lt;p&gt;We will be continuing from were we left off. Disclaimer: You can use apache if you want. Apache is easier to setup compared to Nginx.&lt;/p&gt;

&lt;p&gt;Keywords used in the guide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi &lt;/li&gt;
&lt;li&gt;NGINX server &lt;/li&gt;
&lt;li&gt;WordPress&lt;/li&gt;
&lt;li&gt;MySQL &lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Update the Raspberry Pi
&lt;/h3&gt;

&lt;p&gt;First, make sure your Raspberry Pi is up-to-date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update 
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Install NGINX
&lt;/h3&gt;

&lt;p&gt;NGINX will serve as your web server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install NGINX:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start and enable NGINX:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start nginx
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify NGINX is running:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check in a browser by typing your Raspberry Pi's IP address (e.g., &lt;code&gt;http://192.168.x.x&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Install MySQL (MariaDB)
&lt;/h3&gt;

&lt;p&gt;WordPress needs a database, so we will install MariaDB.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install MariaDB server:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mariadb-server &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Secure the installation:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Follow the prompts to secure your database (set root password, remove anonymous users, disable root login remotely, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Log in to MariaDB:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a database for WordPress:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;wordpress&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'wpuser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;wordpress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'wpuser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Install PHP
&lt;/h3&gt;

&lt;p&gt;PHP will be used to process dynamic content for WordPress.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install PHP and necessary extensions:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php-fpm php-mysql php-curl php-gd php-xml php-mbstring &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5: Configure NGINX to Use PHP
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an NGINX server block for WordPress:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/nginx/sites-available/wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the following configuration:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/var/www/wordpress&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.php&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt; &lt;span class="s"&gt;index.htm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;\.php$&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;include&lt;/span&gt; &lt;span class="nc"&gt;snippets/fastcgi-php&lt;/span&gt;&lt;span class="s"&gt;.conf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="s"&gt;unix:/var/run/php/php-fpm.sock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;/\.ht&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;deny&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enable the configuration:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; /etc/nginx/sites-enabled/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test and restart NGINX:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 6: Download and Configure WordPress
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install &lt;code&gt;wget&lt;/code&gt; and &lt;code&gt;unzip&lt;/code&gt; (if not installed):&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;wget unzip &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download WordPress:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/www
&lt;span class="nb"&gt;sudo &lt;/span&gt;wget https://wordpress.org/latest.zip
&lt;span class="nb"&gt;sudo &lt;/span&gt;unzip latest.zip
&lt;span class="nb"&gt;sudo mv &lt;/span&gt;wordpress /var/www/
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set correct permissions:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/wordpress
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 755 /var/www/wordpress
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure WordPress to connect to your database:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/www/wordpress
&lt;span class="nb"&gt;sudo cp &lt;/span&gt;wp-config-sample.php wp-config.php
&lt;span class="nb"&gt;sudo &lt;/span&gt;nano wp-config.php
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Update the database settings in &lt;code&gt;wp-config.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'DB_NAME'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wordpress'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'DB_USER'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wpuser'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'DB_PASSWORD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'password'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'DB_HOST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 7: Complete WordPress Installation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your web browser and navigate to &lt;code&gt;http://your_domain_or_IP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Follow the on-screen instructions to complete the WordPress installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After these steps, your Raspberry Pi should be hosting a fully functional WordPress site using NGINX, PHP, and MariaDB.&lt;/p&gt;

&lt;p&gt;In the next blog, we will be hosting the site to public using a secure tunnel. Stay tuned for that....!&lt;/p&gt;

</description>
      <category>nginx</category>
      <category>raspberrypi</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Setting Raspberry Pi with Laptop</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Thu, 27 Jun 2024 17:48:52 +0000</pubDate>
      <link>https://dev.to/kutt27/setting-raspberry-pi-with-laptop-3hie</link>
      <guid>https://dev.to/kutt27/setting-raspberry-pi-with-laptop-3hie</guid>
      <description>&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Raspberry Pi (all models)&lt;/li&gt;
&lt;li&gt;Memory card (16GB or larger recommended)&lt;/li&gt;
&lt;li&gt;SD Card adapter&lt;/li&gt;
&lt;li&gt;LAN cable&lt;/li&gt;
&lt;li&gt;Power adapter&lt;/li&gt;
&lt;/ol&gt;




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

&lt;blockquote&gt;
&lt;p&gt;You can use any operating system of your choice. I'll be demonstrating with Arch Linux, but the steps are applicable across different OSes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Installing the Operating System
&lt;/h2&gt;

&lt;p&gt;Start by downloading your preferred Raspberry Pi operating system &lt;a href="https://www.raspberrypi.com/software/operating-systems/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. If you prefer another ARM-based OS, feel free to download it instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flashing the OS
&lt;/h2&gt;

&lt;p&gt;To flash the OS onto your SD card, download Raspberry Pi Imager from &lt;a href="https://www.raspberrypi.com/software/" rel="noopener noreferrer"&gt;here&lt;/a&gt; or from their &lt;a href="https://github.com/raspberrypi/rpi-imager.git" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt; for other systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect the SD card to your computer.&lt;/li&gt;
&lt;li&gt;Open Raspberry Pi Imager.&lt;/li&gt;
&lt;li&gt;Select your device.&lt;/li&gt;
&lt;li&gt;Choose the downloaded OS.&lt;/li&gt;
&lt;li&gt;Select the SD card as the storage location.&lt;/li&gt;
&lt;li&gt;Configure hostname, username, and password.&lt;/li&gt;
&lt;li&gt;Enable SSH.&lt;/li&gt;
&lt;li&gt;Write the image to the SD card.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My setup:&lt;/p&gt;

&lt;p&gt;I already downloaded the OS to local system. Also using a raspberry pi 4 Model B having 4 GB of RAM. My settings will be this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcckrnreos286x3e2jnxs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcckrnreos286x3e2jnxs.png" alt="Image description" width="695" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you need to make sure you are remembering the settings in this page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fosmy8ct96xp49xjyf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fosmy8ct96xp49xjyf3.png" alt="Image description" width="548" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Remote Access
&lt;/h2&gt;

&lt;p&gt;After flashing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an empty file named &lt;code&gt;ssh&lt;/code&gt; (without an extension) in the &lt;code&gt;bootfs&lt;/code&gt; directory of the SD card.&lt;/li&gt;
&lt;li&gt;Eject the SD card and insert it into your Raspberry Pi.&lt;/li&gt;
&lt;li&gt;Power on the Raspberry Pi.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enabling VNC
&lt;/h3&gt;

&lt;p&gt;Open a terminal or cmd. Type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &amp;lt;username&amp;gt;@&amp;lt;localhost-name&amp;gt;.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type &lt;code&gt;yes&lt;/code&gt; and enter the password you set during setup. You will be logged into the terminal and you are good to go.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get the IP address of the Raspberry Pi&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember the local IP address of the device connected to the device (This only works when the pi and your device are both connected to the same network).&lt;/p&gt;

&lt;p&gt;To enable VNC for graphical access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;raspi-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Display options&lt;/strong&gt;: Set a resolution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface options&lt;/strong&gt;: Enable VNC.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Access pi by typing &lt;code&gt;ip address&lt;/code&gt; into your VNC top bar for connection.&lt;/p&gt;

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

&lt;p&gt;Stay tuned for more exciting projects and tutorials in my Raspberry Pi series! Happy tinkering!&lt;/p&gt;

</description>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>How to install Anaconda on Arch Linux</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Wed, 26 Jun 2024 17:36:15 +0000</pubDate>
      <link>https://dev.to/kutt27/how-to-install-anaconda-on-arch-linux-5a1c</link>
      <guid>https://dev.to/kutt27/how-to-install-anaconda-on-arch-linux-5a1c</guid>
      <description>&lt;p&gt;Update 16/08/2025:&lt;/p&gt;

&lt;p&gt;When I was writing the blog, I was a beginner to Arch Linux, so I forgot it was also a linux machine. There's a simple way to install both anaconda and miniconda to your system, follow the link to this index page: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Miniconda: &lt;a href="https://repo.anaconda.com/miniconda/" rel="noopener noreferrer"&gt;https://repo.anaconda.com/miniconda/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anaconda: &lt;a href="https://repo.anaconda.com/archive/" rel="noopener noreferrer"&gt;https://repo.anaconda.com/archive/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can get all the release from this page, follow the command for linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &amp;lt;filename&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o&lt;/span&gt; &amp;lt;filename&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the package is delivered, open the folder with the directrory and run the file as bash:&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash ~/Miniconda3-latest-Linux-x86_64.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accept the terms and conditions and install the location you want to install. The default directory is &lt;code&gt;/user/home/miniconda/&lt;/code&gt; if you want to change the location you can use &lt;code&gt;-p -u &amp;lt;directory-link&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;or desired location&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash Miniconda3-latest-Linux-x86_64.sh &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /home/user/Downloads/Installation/miniconda

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

&lt;/div&gt;



&lt;p&gt;No need to follow the below instruction, make sure to close the terminal for enabling the service or you can reload your shell based on the install.&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;Anaconda: &lt;a href="https://aur.archlinux.org/packages/anaconda" rel="noopener noreferrer"&gt;Anaconda AUR Package&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Miniconda: &lt;a href="https://aur.archlinux.org/packages/miniconda3" rel="noopener noreferrer"&gt;Miniconda AUR Package&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Clone the Package to Your System
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click on the &lt;code&gt;Git Clone URL&lt;/code&gt; and copy the repository link.&lt;/li&gt;
&lt;li&gt;Open your terminal and navigate to your desired directory. Here, I'm moving to the &lt;code&gt;/Downloads/&lt;/code&gt; directory.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://aur.archlinux.org/packages/anaconda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the cloning process completes successfully, proceed to the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install the Package into Your System
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open a terminal and change directory to where you cloned the repository.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /Downloads/anaconda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Build and install the package using &lt;code&gt;makepkg&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;makepkg &lt;span class="nt"&gt;-si&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This process will take some time. Once it finishes, proceed to the next steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Locate the installation script, typically named &lt;code&gt;anaconda_xxxxxx.sh&lt;/code&gt;. Make it executable from the terminal.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x anaconda_xxxxxx.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Execute the installation script.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./anaconda_xxxxxx.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the on-screen prompts, including reading the agreement and typing &lt;code&gt;yes&lt;/code&gt; to proceed with the setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Environment and Example
&lt;/h2&gt;

&lt;p&gt;To activate the base environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda activate base
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see &lt;code&gt;(base)&lt;/code&gt; in front of your terminal prompt indicating the base environment is active.&lt;/p&gt;

&lt;p&gt;For those who installed Anaconda, you can launch Anaconda Navigator using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;anaconda-navigator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it for Anaconda installation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Miniconda Verification
&lt;/h3&gt;

&lt;p&gt;Verify the Miniconda installation by checking its version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Checking Miniconda Path
&lt;/h4&gt;

&lt;p&gt;To ensure Miniconda's binaries are in your PATH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for a directory like &lt;code&gt;/path/to/miniconda3/bin&lt;/code&gt; in the output. If it's missing, you'll need to add it to your PATH.&lt;/p&gt;

&lt;p&gt;Assuming everything is correct, activate the base environment again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda activate base
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Opening Jupyter Notebook
&lt;/h4&gt;

&lt;p&gt;Install Jupyter Notebook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;install &lt;/span&gt;jupyter notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, launch Jupyter Notebook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jupyter-notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You've successfully run Jupyter Notebook with Miniconda.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra Perks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Creating a New Conda Environment
&lt;/h3&gt;

&lt;p&gt;Create a new environment specifying Python version and install packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda create &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;env_name&amp;gt; &lt;span class="nv"&gt;python&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;version&amp;gt;
conda activate &amp;lt;env_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda create &lt;span class="nt"&gt;-n&lt;/span&gt; myenv &lt;span class="nv"&gt;python&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3.9
conda activate myenv
conda &lt;span class="nb"&gt;install &lt;/span&gt;numpy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Listing and Deleting Environments
&lt;/h3&gt;

&lt;p&gt;List all environments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete an environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;env_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Deactivating an Environment
&lt;/h3&gt;

&lt;p&gt;Deactivate the current environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information on managing environments, refer to &lt;a href="https://askubuntu.com/questions/1026383/why-does-base-appear-in-front-of-my-terminal-prompt" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>anaconda</category>
      <category>python</category>
      <category>archlinux</category>
      <category>jupyter</category>
    </item>
    <item>
      <title>OSPF vs. RIP: A Comparison of Interior Gateway Protocols</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Fri, 21 Jun 2024 08:51:42 +0000</pubDate>
      <link>https://dev.to/kutt27/ospf-vs-rip-a-comparison-of-interior-gateway-protocols-71i</link>
      <guid>https://dev.to/kutt27/ospf-vs-rip-a-comparison-of-interior-gateway-protocols-71i</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/cs"&gt;DEV Computer Science Challenge v24.06.12: One Byte Explainer&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;OSPF and RIP are different roads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OSPF is a well-planned city highway, managing traffic capably with clear signs and fast adjustments.&lt;/li&gt;
&lt;li&gt;RIP is a simpler, slower rural road network, with fewer signs, suited for smaller towns with fewer routes to manage.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>cschallenge</category>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Difference between var and let in Javascript</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Wed, 10 Apr 2024 16:40:01 +0000</pubDate>
      <link>https://dev.to/kutt27/difference-between-var-and-let-in-javascript-247h</link>
      <guid>https://dev.to/kutt27/difference-between-var-and-let-in-javascript-247h</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Why Two Ways to Declare Variables in JavaScript?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you're starting with JavaScript, you might wonder why there are two ways to declare variables (&lt;code&gt;var&lt;/code&gt; and &lt;code&gt;let&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Different Methods for Variable Declaration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript offers multiple keywords for variable declaration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;var&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;let&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;const&lt;/code&gt; (introduced in ES6)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Someone&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3.14&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Constant value (cannot be reassigned)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Reasons for &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; (Introduced in ES6)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES6 introduced &lt;code&gt;const&lt;/code&gt; and &lt;code&gt;let&lt;/code&gt; to address limitations with &lt;code&gt;var&lt;/code&gt;. While &lt;code&gt;var&lt;/code&gt; allowed variable declaration, it caused issues due to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hoisting:&lt;/strong&gt; Variables declared with &lt;code&gt;var&lt;/code&gt; are accessible before their declaration, leading to unexpected behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope:&lt;/strong&gt; &lt;code&gt;var&lt;/code&gt; is function-scoped, meaning variables can be accessed throughout the entire function regardless of code blocks. This can make code harder to reason about.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const&lt;/code&gt; and &lt;code&gt;let&lt;/code&gt; fixed these issues by introducing block-level scoping, preventing unexpected behavior and making code more predictable and maintainable.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Problem with &lt;code&gt;var&lt;/code&gt; for Beginners&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Without proper understanding, beginners might not be familiar with the differences between &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;var&lt;/code&gt;. This can lead to confusion and potential bugs in their code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding Scope&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;var&lt;/code&gt;:&lt;/strong&gt; Function-scoped. A variable declared with &lt;code&gt;var&lt;/code&gt; is accessible throughout the entire function it's declared in, regardless of code blocks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;let&lt;/code&gt;:&lt;/strong&gt; Block-scoped. A variable declared with &lt;code&gt;let&lt;/code&gt; is only accessible within the code block (like an if statement or loop) where it's declared.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example: Scope Difference&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;letSci&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Modifying `x` declared outside the block with `let` is allowed&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 2&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 2 (x is accessible here)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;letSci&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// y can be accessed here because it's function-scoped with var&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 2 (assuming y was declared before letSci())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Hoisting and Redeclaration&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;var&lt;/code&gt;:&lt;/strong&gt; Hoisted to the top of their function scope. You can access them even before they are declared in the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;let&lt;/code&gt;:&lt;/strong&gt; Not hoisted. You cannot access them before their declaration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents errors that might occur with &lt;code&gt;var&lt;/code&gt; due to accessing an undeclared variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Hoisting Difference&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;var section&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// This will result in an error because `y` is declared with `var` later in the code&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 10&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;let section&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// This will result in an error because `x` is declared with `let` and cannot be accessed before its declaration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Additional Considerations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While not covered here due to space limitations, exploring &lt;code&gt;const&lt;/code&gt; is also recommended. It's used for variables that shouldn't be reassigned after their initial declaration.&lt;/p&gt;

&lt;p&gt;By understanding the differences between &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;const&lt;/code&gt;, you can write cleaner, more maintainable JavaScript code.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Getting your basics ready | Data types, Control flow, and Functions in GOLANG</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Sun, 08 Oct 2023 14:30:51 +0000</pubDate>
      <link>https://dev.to/kutt27/getting-your-basics-ready-data-types-control-flow-and-functions-in-golang-2klo</link>
      <guid>https://dev.to/kutt27/getting-your-basics-ready-data-types-control-flow-and-functions-in-golang-2klo</guid>
      <description>&lt;h1&gt;
  
  
  Data Types in Go: A Fun-filled Adventure
&lt;/h1&gt;

&lt;p&gt;Ahoy there, fellow code wranglers! Today, we're delving into the marvelous world of data types in Go, also known as Golang. You might be wondering, "Why should I care about data types?" Well, my friends, data types are like the spice of programming. They add flavor, structure, and a touch of elegance to your code. So, let's embark on this data-driven journey, but before we get too carried away, let's put on our professional hats, just for a moment, shall we? 😎&lt;/p&gt;

&lt;p&gt;Now, let's uncover the thrilling reasons why data types are the superheroes of the programming universe:&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fantastic Functions of Data Types
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Organization:&lt;/strong&gt; Imagine your code as a chaotic kitchen with ingredients scattered everywhere. Data types act like tidy organizers, neatly categorizing your data into logical containers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Validation:&lt;/strong&gt; Have you ever tried to slice a tomato with a spoon? Data types ensure that you're using the right tool for the job by making sure your data is appropriate for the task at hand.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Memory Efficiency:&lt;/strong&gt; In the realm of data, space is precious. Data types are like expert Tetris players, ensuring that every byte is utilized efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Prevention:&lt;/strong&gt; Picture this: you're making a sandwich, and someone hands you a rubber duck instead of a tomato. Data types act as vigilant gatekeepers, preventing such absurd scenarios in your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Clarity:&lt;/strong&gt; Readable code is like a good book you can't put down. Proper data types make your code a page-turner, enhancing its clarity and maintainability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; Different data types come with their own bag of tricks. They bring built-in functions and methods to the party, making your life as a programmer easier and more fun.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Integrity:&lt;/strong&gt; Just like a good friend who keeps your secrets, data types maintain the integrity and consistency of data within your program, ensuring that nothing goes awry.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Fabulous Four Categories of Data Types in Golang
&lt;/h3&gt;

&lt;p&gt;Now, let's slice this data pie into four delightful categories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic types:&lt;/strong&gt; These are the humble heroes of data types, including booleans, integers, floating-point numbers, and strings. They're like the bread and butter of programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Aggregate types:&lt;/strong&gt; These data types are the Frankenstein's monsters of the programming world. They're made up of other data types, such as arrays, slices, and structs. Imagine a sandwich made of smaller sandwiches!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reference types:&lt;/strong&gt; These data types are the GPS of programming; they point to other data in memory. We're talking about pointers, slices, maps, functions, and channels. They help you navigate through the data wilderness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interface types:&lt;/strong&gt; Last but not least, interface types are like the universal remote controls of programming. They define a set of methods that any type can implement. It's the ultimate "plug-and-play" experience for your code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, let's consult this handy table for a quick overview:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data type&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;true, false&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;int&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;1, 100, -1000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uint&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;1, 100, 1000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float32&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;3.141592653589793, 1.234567890123456, -1.234567890123456&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float64&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;3.141592653589793, 1.234567890123456, -1.234567890123456&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;string&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;"Hello, world!", "1234567890", ""&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[]int&lt;/td&gt;
&lt;td&gt;Aggregate&lt;/td&gt;
&lt;td&gt;[1, 2, 3, 4, 5]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[]string&lt;/td&gt;
&lt;td&gt;Aggregate&lt;/td&gt;
&lt;td&gt;["Hello", "world", "!"]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;struct { name string; age int }&lt;/td&gt;
&lt;td&gt;Aggregate&lt;/td&gt;
&lt;td&gt;{ name: "Alice", age: 25 }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;*int&lt;/td&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;td&gt;var p *int = nil&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;map[string]int&lt;/td&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;td&gt;map[string]int{"Alice": 25, "Bob": 30}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;func()&lt;/td&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;td&gt;func() { println("Hello, world!") }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;chan string&lt;/td&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;td&gt;chan string = make(chan string)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;interface{}&lt;/td&gt;
&lt;td&gt;Interface&lt;/td&gt;
&lt;td&gt;var i interface{} = 10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Let's Inject Some Variable Fun into Go!
&lt;/h1&gt;

&lt;p&gt;Ahoy, Go enthusiasts! We're setting sail on a thrilling journey into the heart of variables in Go. Buckle up because things are about to get wild in the world of data storage. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules of the Variable Jungle
&lt;/h2&gt;

&lt;p&gt;But before we jump into the variable jungle, let's lay down some ground rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables are like pets; they need names. So, we start with a letter or an underscore _.&lt;/li&gt;
&lt;li&gt;They're not picky eaters; they can gobble up letters, digits, and underscores.&lt;/li&gt;
&lt;li&gt;No spaces, please! Variables have a strict diet.&lt;/li&gt;
&lt;li&gt;Finally, they can't pretend to be Go keywords. Let's not play dress-up with variables, okay?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some examples of well-behaved variable names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;my_integer&lt;/span&gt;
&lt;span class="n"&gt;my_float&lt;/span&gt;
&lt;span class="n"&gt;my_string&lt;/span&gt;
&lt;span class="n"&gt;my_array&lt;/span&gt;
&lt;span class="n"&gt;my_slice&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Grand Declaration
&lt;/h2&gt;

&lt;p&gt;Now, let's talk about declaring variables. There are two ways to do it, and they each have their own flair:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Normal Way
&lt;/h3&gt;

&lt;p&gt;In the normal way, you play it by the book. You use the &lt;code&gt;var&lt;/code&gt; keyword, followed by the variable name and the data type, like a proper introduction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;my_integer&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. The Short Variable Way
&lt;/h3&gt;

&lt;p&gt;Now, here's where things get spicy! You can declare a variable in a shorter, snappier way using the &lt;code&gt;:=&lt;/code&gt; operator. It's like a casual nod instead of a formal handshake:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;my_integer&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But wait, there's a catch! The short variable declaration can only be used inside functions. It's like the cool kid who's only available at the weekend party.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spot the Difference
&lt;/h2&gt;

&lt;p&gt;So, what's the deal? Why choose one declaration over the other? Here's the scoop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Normal Declaration:&lt;/strong&gt; This one is like the boss telling you exactly what to do. It explicitly states the data type of the variable:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Short Declaration:&lt;/strong&gt; It's like having a friend who just gets you. It infers the data type from the value you assign to it:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See the magic? In the short declaration, Go looks at the value and says, "Ah, this must be an integer!" It's like Go's version of mind-reading.&lt;/p&gt;

&lt;p&gt;But remember, the normal declaration can be used anywhere, even outside functions. Meanwhile, the short declaration is a party animal, only allowed inside functions. 🎉&lt;/p&gt;

&lt;h1&gt;
  
  
  Arrays and Slices in Go: A Tale of Two Data Structures
&lt;/h1&gt;

&lt;p&gt;Ah, the dynamic duo of data structures in Go – arrays and slices! They're like Batman and Robin, always ready to save the day in your coding adventures. But don't be fooled, they have their own superpowers and quirks. Let's dive into the exciting world of arrays and slices!&lt;/p&gt;

&lt;h2&gt;
  
  
  Crafting Arrays and Slices
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Array
&lt;/h3&gt;

&lt;p&gt;To conjure an array in Go, you wield the following spell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;myArray&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;array_size&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;data_type&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;array_size&lt;/code&gt; determines how many elements your array can hold, and &lt;code&gt;data_type&lt;/code&gt; specifies the type of data it will store.&lt;/p&gt;

&lt;h3&gt;
  
  
  Slice
&lt;/h3&gt;

&lt;p&gt;Now, let's talk about slices. To summon a slice, you chant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;mySlice&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="n"&gt;data_type&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;data_type&lt;/code&gt; remains the same, but here's the kicker: slices are dynamic! They can grow and shrink as your code demands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessing Elements from Array
&lt;/h2&gt;

&lt;p&gt;To retrieve the treasure (element) from an array, you use this incantation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;index&lt;/code&gt; is like a treasure map, guiding you to the element you seek. But beware, it must be a non-negative integer smaller than the array's size.&lt;/p&gt;

&lt;p&gt;For slices, it's the same chant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;mySlice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, the &lt;code&gt;index&lt;/code&gt; should be a non-negative integer, but this time, it should be smaller than the slice's length.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enchanting Updates
&lt;/h2&gt;

&lt;p&gt;To weave a new spell (update) on an array, you recite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;index&lt;/code&gt; directs your magic to the specific element you wish to change, and &lt;code&gt;new_value&lt;/code&gt; is the enchantment you bestow upon it.&lt;/p&gt;

&lt;p&gt;For slices, it's déjà vu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;mySlice&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;index&lt;/code&gt; still follows the same rules - non-negative and less than the slice's length.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two sides: Arrays vs. Slices
&lt;/h2&gt;

&lt;p&gt;Let's put on our boxing gloves and compare these titans:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Characteristic&lt;/th&gt;
&lt;th&gt;Array&lt;/th&gt;
&lt;th&gt;Slice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Size&lt;/td&gt;
&lt;td&gt;Fixed&lt;/td&gt;
&lt;td&gt;Dynamic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;Square brackets&lt;/td&gt;
&lt;td&gt;Square brackets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Update&lt;/td&gt;
&lt;td&gt;Can be updated&lt;/td&gt;
&lt;td&gt;Can be updated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Comparison&lt;/td&gt;
&lt;td&gt;Can use == and !=&lt;/td&gt;
&lt;td&gt;Can use == and !=&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Passing to Functions&lt;/td&gt;
&lt;td&gt;Passed by value&lt;/td&gt;
&lt;td&gt;Passed by value&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Whom to choose?
&lt;/h2&gt;

&lt;p&gt;So, when do you call upon arrays, and when do you summon slices?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrays are like trusty Swiss army knives; use them when you know the exact size of your data collection.&lt;/li&gt;
&lt;li&gt;Slices are your shape-shifters, perfect for dynamic data collections and when you want to share your data with functions without creating copies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember, whether you're wielding arrays or unleashing slices, you've got the tools you need to conquer the coding kingdom! So, go forth, brave programmer, and may your arrays and slices always be in your favor! 🦸‍♂️🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  Navigating the Control Flow in Go
&lt;/h1&gt;

&lt;p&gt;Ah, control flow statements in Go – the rudders that steer the ship of your program's execution! These are the tools that keep your code on the right track. Let's embark on a voyage through the seas of control flow!&lt;/p&gt;

&lt;h2&gt;
  
  
  If-Else: The Decision Maker
&lt;/h2&gt;

&lt;p&gt;The trusty if-else statement is your first mate when it comes to making decisions in your code. It works like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed if the condition is true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed if the condition is false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;condition&lt;/code&gt; can be any Boolean expression. If it's true, the code in the &lt;code&gt;if&lt;/code&gt; block sails smoothly. Otherwise, the ship navigates towards the &lt;code&gt;else&lt;/code&gt; block.&lt;/p&gt;

&lt;h2&gt;
  
  
  Switch: The Multitasker
&lt;/h2&gt;

&lt;p&gt;Next up is the switch statement, the multitasker of the control flow crew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;expression&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;value1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed if the expression equals value1&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;value2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed if the expression equals value2&lt;/span&gt;
&lt;span class="c"&gt;// ...&lt;/span&gt;
&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed if the expression doesn't match any cases&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;expression&lt;/code&gt; can take on various values. The switch statement evaluates it and compares it to each case value. If it matches one, the corresponding case block sets sail. If no match is found, the default block becomes the navigator's choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  For Loop: The Repetition Enthusiast
&lt;/h2&gt;

&lt;p&gt;The for loop is the workhorse of the control flow family:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;initialization&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iteration&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed in the loop&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;initialization&lt;/code&gt; block sets the stage before the loop.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;condition&lt;/code&gt; is evaluated before each loop iteration. If it's true, the loop's code is executed; otherwise, the journey ends.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;post-iteration&lt;/code&gt; block ensures something happens after each iteration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  While Loop: The Persevering Explorer
&lt;/h2&gt;

&lt;p&gt;Finally, we have the while loop, the tireless explorer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;while&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Code to be executed in the loop&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;condition&lt;/code&gt; is evaluated before each iteration. If it remains true, the loop keeps marching forward; otherwise, it bids adieu.&lt;/p&gt;

&lt;h3&gt;
  
  
  Declaring and Defining Functions in Go
&lt;/h3&gt;

&lt;p&gt;To declare a function, you use the &lt;code&gt;func&lt;/code&gt; keyword, followed by the function name and parameters in parentheses. The function body goes inside curly braces. For example, here's a function named &lt;code&gt;add()&lt;/code&gt; that takes two integers and returns their sum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To define a function, simply assign a function body to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Passing Arguments to Functions
&lt;/h3&gt;

&lt;p&gt;To pass arguments to a function, list them in parentheses when you call the function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arguments are passed by value, so changes inside the function don't affect the caller's scope.&lt;/p&gt;

&lt;h3&gt;
  
  
  Returning Values from Functions
&lt;/h3&gt;

&lt;p&gt;Functions can return values using the &lt;code&gt;return&lt;/code&gt; statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The caller can access the returned value using a variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Function Signatures
&lt;/h3&gt;

&lt;p&gt;A function's signature is its name and the types of its parameters and return value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells us &lt;code&gt;add()&lt;/code&gt; takes two integers and returns an integer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Named Returns
&lt;/h3&gt;

&lt;p&gt;Named returns let you name the values returned from a function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The caller can then access the returned value by name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Variadic Functions
&lt;/h3&gt;

&lt;p&gt;Variadic functions take a variable number of arguments. Declare them with &lt;code&gt;...&lt;/code&gt; before the last parameter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They can be called with any number of arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you're ready to navigate the high seas of control flow and harness the power of functions in Go! Fair winds and happy coding! 🌊🚢🌟&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizq6a9mz9vzg4zny1klo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizq6a9mz9vzg4zny1klo.gif" alt="Image description" width="498" height="281"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Some challenge:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem Statement:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You are tasked with creating a command-line calculator program in the Go programming language. This calculator should be able to perform basic arithmetic operations, including addition, subtraction, multiplication, and division. The user will input two numbers and an operator, and the program will display the result of the operation.&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;The calculator should support the following operations:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;The program should take three command-line arguments:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- The first argument should be a floating-point number (operand 1).
- The second argument should be one of the supported operators (+, -, *, /).
- The third argument should be another floating-point number (operand 2).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If the user provides incorrect or insufficient arguments, the program should display a usage message explaining how to use the calculator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For division, the program should check if the denominator is zero to avoid division by zero errors. If the denominator is zero, an error message should be displayed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The program should perform the requested operation and display the result with two decimal places.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example Usage:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ go run calculator.go 5 + 3
5.00 + 3.00 = 8.00 

$ go run calculator.go 10.5 - 3.2 
10.50 - 3.20 = 7.30 

$ go run calculator.go 2.5 * 4.0 
2.50 * 4.00 = 10.00 

$ go run calculator.go 6 / 0 
Error: division by zero
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I even spend so many times mitigating even small errors in the code. So refer this code if needed:&lt;br&gt;
&lt;a href="https://github.com/kutt27/go_series/blob/main/Beginner/calculator_cli/dev_calculator_program.go"&gt;https://github.com/kutt27/go_series/blob/main/Beginner/calculator_cli/dev_calculator_program.go&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run the code, follow:&lt;br&gt;
&lt;a href="https://github.com/kutt27/go_series/blob/main/Beginner/calculator_cli/runnning_the_program.md"&gt;https://github.com/kutt27/go_series/blob/main/Beginner/calculator_cli/runnning_the_program.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you encounter any problem or any error, pull a PR. &lt;/p&gt;

&lt;p&gt;Thanks again for reading!!! 😊🚀&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>datatype</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Print Hello World in Go: A Beginner's Guide</title>
      <dc:creator>Amal Satheesan</dc:creator>
      <pubDate>Sat, 23 Sep 2023 11:02:23 +0000</pubDate>
      <link>https://dev.to/kutt27/how-to-print-hello-world-in-go-a-beginners-guide-d54</link>
      <guid>https://dev.to/kutt27/how-to-print-hello-world-in-go-a-beginners-guide-d54</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This post will guide you through printing the universally beloved "Hello, World!" message in Go. But before we dive into the code, let's provide a brief introduction to the Go programming language:&lt;/p&gt;

&lt;p&gt;Go, also commonly referred to as Golang, emerged in 2009 as a statically typed, compiled programming language developed by Robert Griesemer, Rob Pike, and Ken Thompson at Google. Although it shares syntactical similarities with C, Go incorporates memory safety, garbage collection, structural typing, and CSP-style concurrency.&lt;/p&gt;

&lt;p&gt;Go is a modern and versatile programming language, purpose-built for simplicity, efficiency, and reliability. Its capabilities span across various domains, including web development, distributed systems, command-line tools, and more.&lt;/p&gt;

&lt;p&gt;If you've already set up your Go environment on your system, feel free to follow along. If not, don't worry; we'll also discuss setting up your Go environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing Your First Go Program
&lt;/h2&gt;

&lt;p&gt;Let's embark on the journey to print everyone's favorite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create a Directory
&lt;/h3&gt;

&lt;p&gt;Begin by creating a new directory for your Go project, giving it a name of your choice. For this example, we'll call it &lt;code&gt;hello-world&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate into your newly created directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create a Go File
&lt;/h3&gt;

&lt;p&gt;Inside your project directory, create a new file named &lt;code&gt;main.go&lt;/code&gt;. You can use any text editor or integrated development environment (IDE) to create and edit the file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hello, World Program
&lt;/h3&gt;

&lt;p&gt;Within the &lt;code&gt;main.go&lt;/code&gt; file, insert the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to save the file. That's all there is to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Your Go Program
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the terminal, either within your IDE or using your system's built-in terminal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To execute the program, utilize the &lt;code&gt;go run &amp;lt;filename&amp;gt;&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go run main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the following output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have successfully run your first Go program, printing the timeless "Hello, World!" message. This marks the beginning of your exciting journey into the Go programming language.&lt;/p&gt;

&lt;p&gt;Stay tuned for more Go tutorials and exploration. Happy coding! 😊&lt;/p&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
