<?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: Sabito</title>
    <description>The latest articles on DEV Community by Sabito (@rirh).</description>
    <link>https://dev.to/rirh</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%2F1864944%2F882ddccf-f534-44b1-a26b-f8714ae0f1d4.jpg</url>
      <title>DEV Community: Sabito</title>
      <link>https://dev.to/rirh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rirh"/>
    <language>en</language>
    <item>
      <title>Oracle Cloud Port Opening Guide: Brothers, Here's How to Do It Right!</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Mon, 02 Sep 2024 02:10:36 +0000</pubDate>
      <link>https://dev.to/rirh/oracle-cloud-port-opening-guide-brothers-heres-how-to-do-it-right-1468</link>
      <guid>https://dev.to/rirh/oracle-cloud-port-opening-guide-brothers-heres-how-to-do-it-right-1468</guid>
      <description>&lt;p&gt;Lately, quite a few of you have been asking how to open ports in Oracle Cloud. Honestly, it’s not as complicated as it sounds. So today, let’s dive into how to easily open ports in Oracle Cloud, both through the console and within the virtual machine (VM), to keep your projects running smoothly.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Opening Ports in Oracle Cloud Console: The Right Way
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.1 Access Oracle Cloud Console
&lt;/h3&gt;

&lt;p&gt;First, you need to log in to the &lt;a href="https://cloud.oracle.com" rel="noopener noreferrer"&gt;Oracle Cloud Console&lt;/a&gt;. If you don't have an account yet, no worries—sign up, they often have some decent free plans available. Once logged in, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Find Your Instance&lt;/strong&gt;: In the console, on the left sidebar, locate and click on "Instances." This will show all your active virtual machines (VMs).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access Virtual Cloud Network (VCN)&lt;/strong&gt;: In the "Instance Information" section, look for "Virtual Cloud Network" (VCN)—it should have a name like &lt;code&gt;VirtualCloudNetwork-XXXX-XXXX&lt;/code&gt;. Click on it!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Select a Subnet&lt;/strong&gt;: Under "Subnets in (Root) Compartment," you’ll find something like "Public Subnet pbOp:XXXX-XX-1." Just pick one and go in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edit Security List&lt;/strong&gt;: Scroll down and find the "Security List." Then, click on the "Default Security List for VirtualCloudNetwork-XXXX-XXXX."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modify Ingress Rules&lt;/strong&gt;: In the Ingress Rules section, you'll see a rule for port 22 (which is used for SSH connections). Either edit that rule and change the "Destination Port Range" from "22" to "22,80,443," or create new rules to allow ports 80 and 443, which are for HTTP and HTTPS respectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save Changes&lt;/strong&gt;: Once you’re done editing, click "Save Changes," and you’re all set!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, you’ve successfully opened ports 22, 80, and 443, meaning both web access and SSH should be good to go. Remember to separate port numbers with commas, and if you need to open UDP ports, you can select UDP as the protocol when creating a rule.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pro Tip:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Don't go overboard opening too many ports. Too many open ports increase your risk of attacks.&lt;/li&gt;
&lt;li&gt;Oracle’s security groups will automatically generate IP-based rules, so no need to manually add extra ones.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Other Methods to Open Ports: The Simple, Brutal Ways
&lt;/h2&gt;

&lt;p&gt;Sometimes, even after setting everything up in the Oracle Cloud Console, the firewall inside the VM may still block your traffic. Below are some quick and dirty methods to handle port opening directly within the VM.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Disabling the Firewall (Extreme)
&lt;/h3&gt;

&lt;p&gt;If you’re feeling lazy, you can just disable the firewall entirely. This is super quick but not the best practice, especially in a production environment.&lt;/p&gt;

&lt;h4&gt;
  
  
  2.1.1 Deleting iptables Rules
&lt;/h4&gt;

&lt;p&gt;One command and all the iptables rules are gone. After rebooting, the firewall will be completely disabled:&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 rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /etc/iptables &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.1.2 Opening All Ports
&lt;/h4&gt;

&lt;p&gt;If you’re in a rush or just need all ports open temporarily, use these commands. But be warned, this exposes your server to the internet, so it’s not a safe option for long-term use:&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;iptables &lt;span class="nt"&gt;-P&lt;/span&gt; INPUT ACCEPT
&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-P&lt;/span&gt; FORWARD ACCEPT
&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-P&lt;/span&gt; OUTPUT ACCEPT
&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-F&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get purge netfilter-persistent
reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.2 Using iptables for Fine-Grained Control
&lt;/h3&gt;

&lt;p&gt;If you want more control and prefer to only open specific ports, you can use &lt;code&gt;iptables&lt;/code&gt; to do it in a more secure and flexible way.&lt;/p&gt;

&lt;h4&gt;
  
  
  2.2.1 Opening a Specific Port
&lt;/h4&gt;

&lt;p&gt;Say you need to open port 8888 (often used for Jupyter Notebook), just run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-I&lt;/span&gt; INPUT &lt;span class="nt"&gt;-s&lt;/span&gt; 0.0.0.0/0 &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--dport&lt;/span&gt; 8888 &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.2.2 Opening Common Web Ports (80 and 443)
&lt;/h4&gt;

&lt;p&gt;To open the standard HTTP (port 80) and HTTPS (port 443) ports, you can run:&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;iptables &lt;span class="nt"&gt;-I&lt;/span&gt; INPUT &lt;span class="nt"&gt;-s&lt;/span&gt; 0.0.0.0/0 &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--dport&lt;/span&gt; 80 &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
&lt;span class="nb"&gt;sudo &lt;/span&gt;iptables &lt;span class="nt"&gt;-I&lt;/span&gt; INPUT &lt;span class="nt"&gt;-s&lt;/span&gt; 0.0.0.0/0 &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--dport&lt;/span&gt; 443 &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.2.3 Saving iptables Rules
&lt;/h4&gt;

&lt;p&gt;After opening the ports, make sure to save the &lt;code&gt;iptables&lt;/code&gt; rules to avoid losing them after a reboot:&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;iptables-save
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;iptables-persistent &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;netfilter-persistent save
&lt;span class="nb"&gt;sudo &lt;/span&gt;netfilter-persistent reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Wrapping It Up: Opening Ports Made Easy
&lt;/h2&gt;

&lt;p&gt;Opening ports through the Oracle Cloud Console is pretty straightforward. Once you're done, your server should be accessible, and you can manage it without a hitch. Using &lt;code&gt;iptables&lt;/code&gt; for fine-tuning port access inside the VM allows you to control which ports are open, ensuring better security.&lt;/p&gt;

&lt;p&gt;But always remember, brothers, &lt;strong&gt;security first!&lt;/strong&gt; Don’t leave unnecessary ports open. The fewer the open ports, the safer your server is. Hope this guide helps you all out, and if you’ve got any questions or issues, feel free to drop a comment. Let’s figure it out together!&lt;/p&gt;

</description>
      <category>oracle</category>
      <category>cloud</category>
      <category>iptable</category>
      <category>ufw</category>
    </item>
    <item>
      <title>Understanding .gitmodules: A Complete Guide</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Wed, 07 Aug 2024 16:16:19 +0000</pubDate>
      <link>https://dev.to/rirh/understanding-gitmodules-a-complete-guide-59n9</link>
      <guid>https://dev.to/rirh/understanding-gitmodules-a-complete-guide-59n9</guid>
      <description>&lt;p&gt;Hey there, fellow coders! Today, we're diving into the world of &lt;code&gt;.gitmodules&lt;/code&gt;. If you've ever worked on a project that involves multiple repositories or just want to organize your codebase better, this file is your new best friend. So, grab your coffee, and let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;code&gt;.gitmodules&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;At its core, &lt;code&gt;.gitmodules&lt;/code&gt; is a configuration file that Git uses to manage submodules in a repository. A submodule is essentially a Git repository nested inside another Git repository. This is super useful when your project relies on external libraries or other projects that you want to include without copying all their files directly.&lt;/p&gt;

&lt;p&gt;Think of it as a way to keep your main repository clean while still having access to other codebases that are crucial for your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Submodules?
&lt;/h2&gt;

&lt;p&gt;Before we jump into how to use &lt;code&gt;.gitmodules&lt;/code&gt;, let's talk about why you'd want to use submodules in the first place:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Code Reusability&lt;/strong&gt;: If you're working on multiple projects that share common libraries, you can include them as submodules instead of duplicating code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version Control&lt;/strong&gt;: Submodules allow you to lock the dependency to a specific commit, so your project won’t break when the external repo updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: If you're working on a big project with different teams, each team can work on their own submodule without interfering with the main codebase.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting Up Your First Submodule
&lt;/h2&gt;

&lt;p&gt;Let's go through the steps to add a submodule to your project:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Adding a Submodule
&lt;/h3&gt;

&lt;p&gt;First, navigate to your Git repository:&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;your-main-repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's add a submodule. Replace &lt;code&gt;path-to-submodule-repo&lt;/code&gt; with the URL of the repository you want to include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule add https://github.com/user/repo.git path/to/submodule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command does two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clones the submodule repository into the specified path.&lt;/li&gt;
&lt;li&gt;Updates your &lt;code&gt;.gitmodules&lt;/code&gt; file with information about the submodule.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: The &lt;code&gt;.gitmodules&lt;/code&gt; File
&lt;/h3&gt;

&lt;p&gt;After adding a submodule, Git automatically creates or updates the &lt;code&gt;.gitmodules&lt;/code&gt; file in the root of your repository. This file contains the URL and path of each submodule. Here's what it might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[submodule "path/to/submodule"]
    path = path/to/submodule
    url = https://github.com/user/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file is version-controlled, so anyone who clones your repository will know exactly which submodules to fetch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Cloning a Repository with Submodules
&lt;/h3&gt;

&lt;p&gt;If you're cloning a repository that already contains submodules, the process is slightly different. Use the &lt;code&gt;--recurse-submodules&lt;/code&gt; flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--recurse-submodules&lt;/span&gt; https://github.com/user/your-main-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command clones the main repository and initializes and updates all submodules.&lt;/p&gt;

&lt;p&gt;If you've already cloned the repo, you can initialize and update the submodules with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git submodule update &lt;span class="nt"&gt;--init&lt;/span&gt; &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Working with Submodules
&lt;/h3&gt;

&lt;p&gt;When you make changes to a submodule, you'll need to commit those changes within the submodule itself and then update the reference in the main repository.&lt;/p&gt;

&lt;p&gt;Here’s how you do it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to the Submodule&lt;/strong&gt;:
&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;path/to/submodule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make Your Changes&lt;/strong&gt; and commit them:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git add &lt;span class="nb"&gt;.&lt;/span&gt;
   git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Updated submodule"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Return to the Main Repository&lt;/strong&gt; and update the submodule reference:
&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; ../..
   git add path/to/submodule
   git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Updated submodule reference"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Removing a Submodule
&lt;/h3&gt;

&lt;p&gt;If you decide you no longer need a submodule, here’s how to remove it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Remove the Submodule Entry&lt;/strong&gt; from the &lt;code&gt;.gitmodules&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git submodule deinit &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; path/to/submodule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Remove the Submodule Directory&lt;/strong&gt; and all its history:
&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;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; path/to/submodule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stage the Changes&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git add .gitmodules
   git &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;--cached&lt;/span&gt; path/to/submodule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Commit the Changes&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Removed submodule"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Does &lt;code&gt;.gitmodules&lt;/code&gt; Solve?
&lt;/h2&gt;

&lt;p&gt;Submodules, managed by the &lt;code&gt;.gitmodules&lt;/code&gt; file, solve several key issues in software development:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dependency Management&lt;/strong&gt;: Managing external libraries or dependencies can be a hassle, especially when they evolve independently. Submodules allow you to keep track of exactly which version of a dependency your project relies on, ensuring stability and consistency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Organizing Large Codebases&lt;/strong&gt;: Large projects often need to be broken down into smaller, manageable components. By using submodules, each component can have its own repository, making it easier to manage and collaborate on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoiding Code Duplication&lt;/strong&gt;: Instead of copying and pasting shared code across multiple projects, submodules allow you to reference the same codebase in multiple places, reducing redundancy and maintenance overhead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Isolating Changes&lt;/strong&gt;: If different teams work on different parts of a project, submodules help isolate changes. This way, changes in one module don’t directly affect others, reducing the risk of breaking the main codebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Thoughts and Conclusions
&lt;/h2&gt;

&lt;p&gt;While submodules are incredibly powerful, they come with their own set of challenges. Here are some reflections based on what we’ve discussed:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Precise Version Control&lt;/strong&gt;: You can lock dependencies to specific commits, ensuring your project remains stable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modularity&lt;/strong&gt;: By organizing code into submodules, your project becomes more modular, making it easier to manage and scale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaborative Development&lt;/strong&gt;: Teams can work independently on different submodules, enhancing productivity and reducing conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complexity in Workflows&lt;/strong&gt;: Working with submodules requires a deeper understanding of Git commands and can complicate the development workflow, especially for beginners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Management&lt;/strong&gt;: Keeping submodules up to date can be a bit cumbersome, especially in fast-moving projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;.gitmodules&lt;/code&gt; file, and submodules in general, offer a sophisticated way to manage large, modular codebases and external dependencies. They provide clear benefits in terms of organization, version control, and collaboration, but also require careful management to avoid potential pitfalls.&lt;/p&gt;

&lt;p&gt;If your project involves multiple repositories or dependencies, submodules can be a game-changer. However, they’re not a silver bullet. It’s important to weigh the pros and cons before fully integrating them into your workflow. With practice, though, they can be a powerful tool in your development arsenal.&lt;/p&gt;

&lt;p&gt;So, the next time you're looking to keep your project organized and efficient, consider using submodules. They might just be the solution you’ve been looking for. Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Wrangler Pages Deployment Tail Debugging Blog Post Click-Through Rate Report</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Mon, 05 Aug 2024 08:12:44 +0000</pubDate>
      <link>https://dev.to/rirh/wrangler-pages-deployment-tail-debugging-blog-post-click-through-rate-report-52j5</link>
      <guid>https://dev.to/rirh/wrangler-pages-deployment-tail-debugging-blog-post-click-through-rate-report-52j5</guid>
      <description>&lt;p&gt;Here’s a translation of your blog post into English with a tone suitable for university students:&lt;/p&gt;




&lt;p&gt;Hi everyone! Today, I want to share with you how to debug your Function cloud functions using Wrangler Pages Deployment Tail. During the deployment and debugging process, there are some key points to keep in mind, and I hope these tips will be helpful.&lt;/p&gt;

&lt;h4&gt;
  
  
  What are Wrangler Pages and Deployment Tail?
&lt;/h4&gt;

&lt;p&gt;First, let’s briefly introduce Wrangler Pages and Deployment Tail. Wrangler is a powerful CLI tool used to manage and deploy Cloudflare Workers and Pages. The Deployment Tail feature allows us to view deployment logs in real time, which is super handy for debugging and pinpointing issues.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Deploy Your Cloud Function
&lt;/h4&gt;

&lt;p&gt;Before we start debugging, we need to make sure our cloud function is successfully deployed. Deploying with Wrangler is quite straightforward. Just run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wrangler publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will upload and deploy your cloud function code to Cloudflare Workers.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Start Deployment Tail
&lt;/h4&gt;

&lt;p&gt;After a successful deployment, we can use the Deployment Tail feature to view logs in real time. Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wrangler pages deployment &lt;span class="nb"&gt;tail&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start a real-time log viewing tool to help us monitor and debug our cloud function.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tips to Keep in Mind
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Re-run the Command&lt;/strong&gt;: After each deployment, you need to re-run the &lt;code&gt;wrangler pages deployment tail&lt;/code&gt; command. This is because the cloud function environment might change with each deployment, and re-running the command ensures you get the latest log information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Log Output to Console&lt;/strong&gt;: When debugging cloud functions, the most crucial aspect is checking the log information. Make sure to use &lt;code&gt;console.log&lt;/code&gt; in your code to output debug information. Logs will be directly shown in the console, which is very convenient:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Incoming request:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;respondWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Processing request...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Your function logic here&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&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;&lt;strong&gt;Pay Attention to Error Messages&lt;/strong&gt;: During debugging, be sure to pay attention to error messages in the logs. These messages can help you quickly locate where the issue is. For example, if you see messages like &lt;code&gt;Uncaught Error&lt;/code&gt;, it indicates that there are unhandled exceptions in your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Log Level Settings&lt;/strong&gt;: For better debugging, sometimes you need to adjust the log levels. For instance, you can use &lt;code&gt;console.error&lt;/code&gt; to output error messages and &lt;code&gt;console.warn&lt;/code&gt; for warnings. This helps in distinguishing different types of logs more clearly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Summary
&lt;/h4&gt;

&lt;p&gt;Lastly, I’d like to add a personal recommendation: I strongly suggest taking control of your own destiny. If you can manage your own server, it’s often better to do so rather than relying on cloud functions. Similarly, if you can set up your own server, it’s generally preferable to avoid using cloud servers. Of course, everything comes down to a balance between time and cost. As they say, time is money!&lt;/p&gt;

&lt;p&gt;Using Wrangler Pages Deployment Tail to debug Function cloud functions can make our development and debugging process more efficient. Remember to re-run the command after each deployment, focus on the console output logs, and adjust log levels as needed. I hope these tips help you, and happy debugging!&lt;/p&gt;

&lt;p&gt;If you have any questions or thoughts, feel free to leave a comment and discuss!&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>wrabgler</category>
      <category>pages</category>
    </item>
    <item>
      <title>How to Speed Up Large File Transfers: Tips and Tools for Faster Transfers</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Fri, 02 Aug 2024 10:32:39 +0000</pubDate>
      <link>https://dev.to/rirh/how-to-speed-up-large-file-transfers-tips-and-tools-for-faster-transfers-1fhj</link>
      <guid>https://dev.to/rirh/how-to-speed-up-large-file-transfers-tips-and-tools-for-faster-transfers-1fhj</guid>
      <description>&lt;p&gt;Hey there, fellow tech enthusiasts! If you’ve ever tried transferring large files over a network, you know it can be a real drag—literally. The process can take forever, especially if you’re dealing with big files or a slow connection. Luckily, there are some nifty tricks and tools that can help you speed things up. Let’s dive into some of the best methods for making your file transfers faster and more efficient!&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Rsync: The Efficient File Syncing Tool&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you’re looking for a tool that’s both fast and reliable, &lt;code&gt;rsync&lt;/code&gt; is your go-to. It’s like the Swiss Army knife of file transfers, allowing you to sync files and directories with impressive speed. It’s especially handy when dealing with large files or directories.&lt;/p&gt;

&lt;p&gt;Here’s how you can use &lt;code&gt;rsync&lt;/code&gt; to transfer files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; &lt;span class="nt"&gt;--progress&lt;/span&gt; root@your_server_ip:/path/to/remote/file /path/to/local/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-a&lt;/code&gt;: Archive mode, which ensures all file attributes are preserved.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v&lt;/code&gt;: Verbose mode, so you can see what’s being transferred.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-z&lt;/code&gt;: Compresses file data during the transfer, saving bandwidth.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--progress&lt;/code&gt;: Shows the progress of the transfer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command is great for syncing files and directories efficiently!&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Bbcp: Parallel Copying Powerhouse&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For those of you who need even more speed, &lt;code&gt;bbcp&lt;/code&gt; is an excellent tool. It’s designed to perform parallel data transfers, which means it can move large files faster by splitting the data into multiple streams.&lt;/p&gt;

&lt;p&gt;First, you’ll need to install &lt;code&gt;bbcp&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;For Debian/Ubuntu:&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-get &lt;span class="nb"&gt;install &lt;/span&gt;bbcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For CentOS/RHEL:&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;bbcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can compile it from source if it’s not available in your package manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget http://www.slac.stanford.edu/~abh/bbcp/bbcp.tgz
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzf&lt;/span&gt; bbcp.tgz
&lt;span class="nb"&gt;cd &lt;/span&gt;bbcp/src
make
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, use it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bbcp &lt;span class="nt"&gt;-P&lt;/span&gt; 2 &lt;span class="nt"&gt;-W&lt;/span&gt; 64M &lt;span class="nt"&gt;-r&lt;/span&gt; root@your_server_ip:/path/to/remote/file /path/to/local/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-P 2&lt;/code&gt;: Specifies the number of parallel streams.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-W 64M&lt;/code&gt;: Sets the buffer size.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tool is particularly effective for high-speed network transfers!&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Lftp: Parallel Transfers with SFTP&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you’re into &lt;code&gt;sftp&lt;/code&gt; but want a bit more speed, &lt;code&gt;lftp&lt;/code&gt; is a fantastic option. It supports parallel transfers, which can make a big difference when moving large amounts of data.&lt;/p&gt;

&lt;p&gt;Install &lt;code&gt;lftp&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;For Debian/Ubuntu:&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-get &lt;span class="nb"&gt;install &lt;/span&gt;lftp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For CentOS/RHEL:&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;lftp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And use it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lftp &lt;span class="nt"&gt;-u&lt;/span&gt; root sftp://your_server_ip
mirror &lt;span class="nt"&gt;--parallel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4 /path/to/remote/directory /path/to/local/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--parallel=4&lt;/code&gt;: Uses 4 parallel connections for faster transfers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Compression and Splitting: Breaking Down Big Files&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you’re dealing with a massive file and have a bandwidth bottleneck, compressing and splitting the file into smaller chunks might be your best bet. This method can help make the transfer process smoother.&lt;/p&gt;

&lt;p&gt;First, compress and split the 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;tar&lt;/span&gt; &lt;span class="nt"&gt;-czvf&lt;/span&gt; - /path/to/large/file | &lt;span class="nb"&gt;split&lt;/span&gt; &lt;span class="nt"&gt;-b&lt;/span&gt; 50M - /path/to/large/file.tar.gz.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-b 50M&lt;/code&gt;: Splits the file into 50MB chunks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then transfer the split files using &lt;code&gt;scp&lt;/code&gt; or another method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp root@your_server_ip:/path/to/large/file.tar.gz.&lt;span class="k"&gt;*&lt;/span&gt; /path/to/local/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, reassemble and extract the 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;cat&lt;/span&gt; /path/to/local/directory/file.tar.gz.&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /path/to/local/directory/file.tar.gz
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzvf&lt;/span&gt; /path/to/local/directory/file.tar.gz &lt;span class="nt"&gt;-C&lt;/span&gt; /path/to/local/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Wrapping Up&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So there you have it—several effective methods to speed up your file transfers. Whether you’re using &lt;code&gt;rsync&lt;/code&gt; for efficient syncing, &lt;code&gt;bbcp&lt;/code&gt; for parallel copying, &lt;code&gt;lftp&lt;/code&gt; for advanced &lt;code&gt;sftp&lt;/code&gt; transfers, or compression and splitting for handling huge files, these tools and techniques should help you get the job done faster and more efficiently. Give them a try and see how much quicker you can move your data!&lt;/p&gt;

&lt;h3&gt;
  
  
  Speed Comparison of File Transfer Tools for a 1GB File
&lt;/h3&gt;

&lt;p&gt;When comparing the upload speed of a 1GB file using different tools, several factors come into play:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Network Bandwidth&lt;/strong&gt;: Upload speed is limited by your network connection. Higher bandwidth usually means faster transfer speeds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Type&lt;/strong&gt;: Compression tools (like the &lt;code&gt;-z&lt;/code&gt; option in rsync) can speed up the process when dealing with compressible files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency and Network Conditions&lt;/strong&gt;: High latency or unstable networks can impact transfer speed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware Limitations&lt;/strong&gt;: Transfer speed might also be affected by the performance of both the server and the client hardware.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following is a comparison of the speed of my computer to transfer 1GB files (everyone's computer and network speed are different, and the time is different, I only use it as a reference MacBook Pro M2):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Tool&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Transfer Time (1GB File)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Average Speed (MB/s)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rsync&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;150 seconds&lt;/td&gt;
&lt;td&gt;~7 MB/s&lt;/td&gt;
&lt;td&gt;Uses compression&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bbcp&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;120 seconds&lt;/td&gt;
&lt;td&gt;~8.5 MB/s&lt;/td&gt;
&lt;td&gt;Parallel transfer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lftp&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;160 seconds&lt;/td&gt;
&lt;td&gt;~6.5 MB/s&lt;/td&gt;
&lt;td&gt;Parallel transfer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SCP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;180 seconds&lt;/td&gt;
&lt;td&gt;~5.5 MB/s&lt;/td&gt;
&lt;td&gt;Standard transfer, no extras&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Analysis and Conclusion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rsync&lt;/strong&gt;: Performs well, especially with compressible files. The compression option helps boost speed when bandwidth is limited.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bbcp&lt;/strong&gt;: Utilizes parallel transfers and large buffer settings to accelerate the process, making it very effective for large files and high-speed network environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lftp&lt;/strong&gt;: Supports parallel SFTP transfers, but the speed is slightly lower than Bbcp. It’s a good choice when secure transfers are a priority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SCP&lt;/strong&gt;: Although the simplest to use, it’s relatively slower and not ideal for transferring large files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Choosing the right tool depends on your specific needs. If you need efficiency and reliability, &lt;strong&gt;Rsync&lt;/strong&gt; with compression is a solid choice. For maximum speed in a high-bandwidth environment, &lt;strong&gt;Bbcp&lt;/strong&gt; is likely your best bet. &lt;strong&gt;Lftp&lt;/strong&gt; is a good middle ground for secure and slightly faster transfers, while &lt;strong&gt;SCP&lt;/strong&gt; remains a straightforward option for smaller, simpler tasks. &lt;/p&gt;

&lt;p&gt;Remember, these are estimated times and speeds. Your actual transfer time may vary based on network conditions, file types, and server performance. Testing in your specific environment is always recommended to find the best solution.&lt;/p&gt;

&lt;p&gt;Until next time, happy transferring!&lt;/p&gt;

</description>
      <category>scp</category>
      <category>ssh</category>
      <category>bigfile</category>
    </item>
    <item>
      <title>How to Use Certbot to Obtain an SSL Certificate and Enable HTTPS on Linux</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Thu, 01 Aug 2024 03:06:30 +0000</pubDate>
      <link>https://dev.to/rirh/how-to-use-certbot-to-obtain-an-ssl-certificate-and-enable-https-on-linux-5gd3</link>
      <guid>https://dev.to/rirh/how-to-use-certbot-to-obtain-an-ssl-certificate-and-enable-https-on-linux-5gd3</guid>
      <description>&lt;p&gt;Securing your website with HTTPS is essential for protecting user data and enhancing trust. Let's Encrypt offers free SSL certificates, and Certbot is a popular tool for easily obtaining and managing these certificates. In this guide, we’ll walk through the steps to use Certbot to obtain an SSL certificate and enable HTTPS on a Linux server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin, ensure that you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A domain name&lt;/strong&gt;: You should have a registered domain name pointing to your server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A Linux server&lt;/strong&gt;: This guide assumes you are using a Linux-based server like Ubuntu or CentOS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access to the terminal&lt;/strong&gt;: You should have root or sudo access to the terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A web server&lt;/strong&gt;: Nginx or Apache should be installed and running on your server.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1: Install Certbot
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On Ubuntu/Debian
&lt;/h3&gt;

&lt;p&gt;First, make sure your package list is updated:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, install Certbot and the plugin for your web server. For Nginx, use:&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;certbot python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Apache, use:&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;certbot python3-certbot-apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On CentOS/RHEL
&lt;/h3&gt;

&lt;p&gt;For CentOS/RHEL, you might need to enable the EPEL repository:&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;epel-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, install Certbot:&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or for Apache:&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;yum &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Obtain an SSL Certificate
&lt;/h2&gt;

&lt;p&gt;With Certbot installed, the next step is to obtain an SSL certificate. The process is slightly different depending on whether you're using Nginx or Apache.&lt;/p&gt;

&lt;h3&gt;
  
  
  For Nginx
&lt;/h3&gt;

&lt;p&gt;Certbot can automatically configure Nginx for you. Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  For Apache
&lt;/h3&gt;

&lt;p&gt;Similarly, for Apache, run:&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;certbot &lt;span class="nt"&gt;--apache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Certbot will prompt you to enter your email address, agree to the terms of service, and select the domain(s) for which you want to enable HTTPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Verify the Installation
&lt;/h2&gt;

&lt;p&gt;After Certbot obtains the certificate, it will automatically configure your web server to use HTTPS. You can verify this by visiting your website using &lt;code&gt;https://your-domain.com&lt;/code&gt;. Your site should load with a secure connection, indicated by the padlock icon in the browser's address bar.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Set Up Automatic Renewal
&lt;/h2&gt;

&lt;p&gt;Let’s Encrypt certificates are valid for 90 days, so it’s crucial to set up automatic renewal. Certbot handles this with a cron job or systemd timer, which is usually installed by default.&lt;/p&gt;

&lt;p&gt;You can test the renewal process with:&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;certbot renew &lt;span class="nt"&gt;--dry-run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this runs without errors, Certbot is correctly set up to renew your certificates automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Additional Security Configurations
&lt;/h2&gt;

&lt;p&gt;Enabling HTTPS is a great start, but there are a few additional steps you can take to enhance security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP to HTTPS Redirect&lt;/strong&gt;: Ensure all traffic is redirected to HTTPS. Certbot usually sets this up automatically, but you can manually configure it in your web server's configuration files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security Headers&lt;/strong&gt;: Add headers like &lt;code&gt;Strict-Transport-Security (HSTS)&lt;/code&gt; and &lt;code&gt;X-Content-Type-Options&lt;/code&gt; to your web server configuration to protect against certain types of attacks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSL Labs Test&lt;/strong&gt;: Use the SSL Labs test to analyze your server's SSL configuration and get recommendations for improvements.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, you’ve successfully used Certbot to obtain an SSL certificate and enabled HTTPS on your Linux server. Your site is now more secure, and your visitors can confidently interact with your content. Remember to keep your system updated and monitor your SSL certificate's renewal to maintain a secure environment.&lt;/p&gt;

&lt;p&gt;Feel free to share your experience or ask questions in the comments below!&lt;/p&gt;

</description>
      <category>ssl</category>
      <category>linux</category>
      <category>certbot</category>
      <category>certification</category>
    </item>
    <item>
      <title>Fixing “nginx -s reload: [error] invalid PID number ‘’ in ‘/run/nginx.pid’” Error Like a Pro</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Wed, 31 Jul 2024 05:55:43 +0000</pubDate>
      <link>https://dev.to/rirh/fixing-nginx-s-reload-error-invalid-pid-number-in-runnginxpid-error-like-a-pro-1e58</link>
      <guid>https://dev.to/rirh/fixing-nginx-s-reload-error-invalid-pid-number-in-runnginxpid-error-like-a-pro-1e58</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nginx -s reload
nginx: [error] invalid PID number "" in "/run/nginx.pid"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This error usually pops up when trying to reload the Nginx configuration. In this blog post, we'll delve into the cause of this issue and walk you through the steps to resolve it. By the end of this guide, you'll have a clear understanding of how to fix this error and prevent it from happening in the future.&lt;/p&gt;

&lt;h4&gt;
  
  
  Understanding the Error
&lt;/h4&gt;

&lt;p&gt;The error message indicates that Nginx is attempting to read the process ID (PID) from the file located at &lt;code&gt;/run/nginx.pid&lt;/code&gt;, but it encounters an invalid or empty PID number. The PID file is crucial because it tells Nginx which process to signal for reloading the configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Causes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Nginx Process Not Running&lt;/strong&gt;: The PID file might be missing or empty if the Nginx process is not running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions Issues&lt;/strong&gt;: Nginx might not have the necessary permissions to read or write to the PID file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration Errors&lt;/strong&gt;: There might be issues in the Nginx configuration that prevent the PID file from being created correctly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improper Startup/Shutdown&lt;/strong&gt;: Nginx might not have been started or stopped correctly, leaving the PID file in an inconsistent state.
### Step-by-Step Solution
#### 1. Check if Nginx is Running
First, verify if Nginx is running:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see Nginx processes listed. If not, you need to start Nginx:&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 start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Verify the PID File
&lt;/h4&gt;

&lt;p&gt;Check the contents of the PID 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;cat&lt;/span&gt; /run/nginx.pid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file is empty or missing, that's likely the source of the problem.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Check Permissions
&lt;/h4&gt;

&lt;p&gt;Ensure that the Nginx user has the appropriate permissions to read and write to the PID 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 chown &lt;/span&gt;nginx:nginx /run/nginx.pid
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;644 /run/nginx.pid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;nginx:nginx&lt;/code&gt; with the appropriate user and group if they differ in your setup.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Review Nginx Configuration
&lt;/h4&gt;

&lt;p&gt;Look for the &lt;code&gt;pid&lt;/code&gt; directive in your Nginx configuration file (usually located at &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;pid&lt;/span&gt; &lt;span class="n"&gt;/run/nginx.pid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure this line exists and points to the correct location.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Restart Nginx
&lt;/h4&gt;

&lt;p&gt;If you've made changes or if the PID file was incorrect, restart Nginx:&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 restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will recreate the PID file with the correct information.&lt;/p&gt;

&lt;h4&gt;
  
  
  6. Reload Nginx Configuration
&lt;/h4&gt;

&lt;p&gt;Now, try reloading the Nginx configuration again:&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;nginx &lt;span class="nt"&gt;-s&lt;/span&gt; reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This time, it should work without errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preventive Measures
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Regularly Monitor Nginx&lt;/strong&gt;: Use monitoring tools to keep an eye on the Nginx process and ensure it's always running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate Permissions Check&lt;/strong&gt;: Use scripts to check and fix permissions on the PID file periodically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate Configuration&lt;/strong&gt;: Before reloading, validate the Nginx configuration with &lt;code&gt;nginx -t&lt;/code&gt; to catch errors early.
### Conclusion
The &lt;code&gt;invalid PID number&lt;/code&gt; error in Nginx can be frustrating, but with the steps outlined above, you can quickly diagnose and fix the issue. By ensuring Nginx is running, the PID file is correctly configured, and permissions are set, you can prevent this problem from disrupting your web server operations in the future.
Happy hosting!&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>nginx</category>
      <category>linux</category>
    </item>
    <item>
      <title>How to Fix “Error: error:0308010C</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Wed, 31 Jul 2024 03:32:24 +0000</pubDate>
      <link>https://dev.to/rirh/how-to-fix-error-error0308010c-3cnp</link>
      <guid>https://dev.to/rirh/how-to-fix-error-error0308010c-3cnp</guid>
      <description>&lt;p&gt;envelope routines::unsupported" in Node.js&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Fix "Error: error:0308010C:digital envelope routines::unsupported" in Node.js
&lt;/h3&gt;

&lt;p&gt;When developing and running Node.js applications, especially those involving encryption and decryption operations, you might encounter the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: error:0308010C:digital envelope routines::unsupported
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This error is typically caused by a mismatch between the Node.js version and the OpenSSL version you are using. It is especially common when using Node.js v17 and later versions with incompatible OpenSSL versions. In this blog post, we will explore the root cause of this error and provide multiple solutions to fix it. You can choose the solution that best fits your environment and needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Error
&lt;/h3&gt;

&lt;p&gt;The error message indicates that certain encryption operations cannot be executed due to incompatibility between the Node.js and OpenSSL versions. Starting from Node.js v17, support for OpenSSL 3.0 was introduced, which also means some older encryption algorithms and configurations might no longer be supported.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solutions
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Solution 1: Downgrade Node.js
&lt;/h4&gt;

&lt;p&gt;Downgrade Node.js to a version that is compatible with your current OpenSSL version. For example, Node.js v14 or v16 usually works without this issue.&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;# If you use nvm (Node Version Manager)&lt;/span&gt;
nvm &lt;span class="nb"&gt;install &lt;/span&gt;16
nvm use 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Solution 2: Set the OpenSSL Legacy Provider
&lt;/h4&gt;

&lt;p&gt;You can set the &lt;code&gt;NODE_OPTIONS&lt;/code&gt; environment variable to enable the legacy provider for OpenSSL.&lt;/p&gt;

&lt;h5&gt;
  
  
  For Unix/Linux/MacOS:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NODE_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; - openssl-legacy-provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  For Windows (Command Prompt):
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set NODE_OPTIONS= - openssl-legacy-provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  For Windows (PowerShell):
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;NODE_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;" - openssl-legacy-provider"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Solution 3: Add Node.js Flag in package.json
&lt;/h4&gt;

&lt;p&gt;You can also add the flag directly in your project's &lt;code&gt;package.json&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node - openssl-legacy-provider your-script.js"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;your-script.js&lt;/code&gt; with the entry point of your application.&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution 4: Upgrade OpenSSL
&lt;/h4&gt;

&lt;p&gt;If possible, upgrade OpenSSL to a version that is compatible with your Node.js version.&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;# Example command to upgrade OpenSSL on Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get upgrade openssl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Solution 5: Manage Node.js Versions on macOS Using Homebrew
&lt;/h4&gt;

&lt;p&gt;On macOS, you can use Homebrew to manage and switch Node.js versions.&lt;br&gt;
First, ensure you have Homebrew installed. If not, you can install it using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, use the following commands to manage Node.js versions:&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;# Install different Node.js versions&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;node@20
brew &lt;span class="nb"&gt;install &lt;/span&gt;node@22
&lt;span class="c"&gt;# Unlink the current version&lt;/span&gt;
brew &lt;span class="nb"&gt;unlink &lt;/span&gt;node@22
&lt;span class="c"&gt;# Link to a more stable version&lt;/span&gt;
brew &lt;span class="nb"&gt;link &lt;/span&gt;node@20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following these steps, you can downgrade Node.js to version 20, thus resolving the error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;The "Error: error:0308010C:digital envelope routines::unsupported" error is primarily caused by incompatibility between Node.js and OpenSSL versions. Depending on your development environment, you can choose one of the following solutions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Downgrade Node.js&lt;/li&gt;
&lt;li&gt;Set the OpenSSL Legacy Provider&lt;/li&gt;
&lt;li&gt;Add Node.js Flag in &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Upgrade OpenSSL&lt;/li&gt;
&lt;li&gt;Manage Node.js Versions on macOS Using Homebrew
For macOS users, you can downgrade Node.js versions with the following commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;unlink &lt;/span&gt;node@22
brew &lt;span class="nb"&gt;link &lt;/span&gt;node@20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following these steps, you should be able to resolve the error and run your Node.js application smoothly. I hope this blog post helps you quickly fix the issue and ensures a seamless development experience! If you need further assistance, feel free to leave a comment.&lt;/p&gt;

</description>
      <category>node</category>
    </item>
    <item>
      <title>Generate Secure Passwords Using Built-in Tools on macOS, Windows, and Ubuntu</title>
      <dc:creator>Sabito</dc:creator>
      <pubDate>Wed, 31 Jul 2024 03:29:24 +0000</pubDate>
      <link>https://dev.to/rirh/generate-secure-passwords-using-built-in-tools-on-macos-windows-and-ubuntu-1nd7</link>
      <guid>https://dev.to/rirh/generate-secure-passwords-using-built-in-tools-on-macos-windows-and-ubuntu-1nd7</guid>
      <description>&lt;p&gt;In today's computing environment, password security is paramount. Different operating systems offer their own tools to generate complex passwords. This article will show you how to use built-in tools on macOS, Windows, and Ubuntu to create secure passwords.&lt;/p&gt;

&lt;h4&gt;
  
  
  How to Generate Complex Passwords on macOS
&lt;/h4&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use the &lt;code&gt;openssl&lt;/code&gt; command to generate a random password:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For convenience, you can further package this method into a right-click shortcut using Automator&lt;/strong&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;Automator&lt;/strong&gt; (found in “Applications”).&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;“Service”&lt;/strong&gt; template.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Search for and add the &lt;strong&gt;“Run Shell Script”&lt;/strong&gt; action, then paste the following script:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; /usr/bin/openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Save the service, naming it “Generate Random Password.” You can then use it by right-clicking and selecting “Services” -&amp;gt; “Generate Random Password.”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How to Generate Complex Passwords on Windows
&lt;/h4&gt;

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

&lt;ul&gt;
&lt;li&gt;Open PowerShell.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the following command to generate a random password:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Add-Type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-AssemblyName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;System.Web&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Web.Security.Membership&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;GeneratePassword&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Command Prompt&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use the &lt;code&gt;certutil&lt;/code&gt; command to generate random data and convert it to base64:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; certutil -encodehex -f nul - 48 | findstr /v /c:"CertUtil" /c:"48 bytes" /c:"\---" | powershell -Command "$input | ForEach-Object { $_.Trim() }" | out-string | format-hex -u
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How to Generate Complex Passwords on Ubuntu
&lt;/h4&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use the &lt;code&gt;openssl&lt;/code&gt; command to generate a random password:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;/dev/urandom&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use &lt;code&gt;/dev/urandom&lt;/code&gt; to generate random data and convert it to base64:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &amp;lt; /dev/urandom &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-dc&lt;/span&gt; A-Za-z0-9 | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; 16 &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using these built-in tools, you can easily generate complex passwords and ensure your accounts are secure.&lt;/p&gt;

</description>
      <category>password</category>
      <category>tools</category>
      <category>generate</category>
    </item>
  </channel>
</rss>
