<?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: Anderson Bosa</title>
    <description>The latest articles on DEV Community by Anderson Bosa (@andersonbosa).</description>
    <link>https://dev.to/andersonbosa</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%2F79783%2F879085a9-df37-476e-b309-9a3ccb2df06e.jpg</url>
      <title>DEV Community: Anderson Bosa</title>
      <link>https://dev.to/andersonbosa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andersonbosa"/>
    <language>en</language>
    <item>
      <title>How to Configure Cursor with Java</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Fri, 20 Jun 2025 13:35:49 +0000</pubDate>
      <link>https://dev.to/andersonbosa/how-to-configure-cursor-with-java-3am4</link>
      <guid>https://dev.to/andersonbosa/how-to-configure-cursor-with-java-3am4</guid>
      <description>&lt;h3&gt;
  
  
  Objective
&lt;/h3&gt;

&lt;p&gt;Configure the Cursor IDE to work with Java projects that use a different version of Runtime. In this guide, &lt;code&gt;Corretto v17.0.13&lt;/code&gt; will be used. You will learn how to configure your Cursor to run and debug your Java applications and tests.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please feel free to make suggestions and comments: &lt;a href="https://sandwiche.me/andersonbosadev" rel="noopener noreferrer"&gt;https://sandwiche.me/andersonbosadev&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fkbumiwj9yhvd26zhytfr.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%2Fkbumiwj9yhvd26zhytfr.png" alt="Image" width="634" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting started
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Start by installing the following extensions (you can add them to the &lt;code&gt;.vscode/extensions.json&lt;/code&gt; file so the IDE recommends them)
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"recommendations"&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="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;available&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;marketplace&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Cursor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;IDE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(only&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;VSCODE)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;🥺&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"oracle.oracle-java"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
        &lt;/span&gt;&lt;span class="s2"&gt;"vscjava.vscode-java-debug"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"vscjava.vscode-java-pack"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"oracle.oracle-java"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"vscjava.vscode-maven"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"vscjava.vscode-java-dependency"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"vmware.vscode-boot-dev-pack"&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="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;After installing these extensions, &lt;strong&gt;we need to disable some extensions&lt;/strong&gt; because they &lt;strong&gt;cause malfunction&lt;/strong&gt;. To do this, disable the &lt;code&gt;redhat.java&lt;/code&gt; extension, which will also disable some others (as they depend on it), resulting in the following extensions being disabled:&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="err"&gt;redhat.java&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;vscjava.vscode-java-test&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;vmware.vscode-spring-boot&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;vscjava.vscode-spring-boot-dashboard&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F2kmk94rye90zh0csggmc.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%2F2kmk94rye90zh0csggmc.png" alt="Img" width="594" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Shenanigans
&lt;/h3&gt;

&lt;p&gt;We need the &lt;code&gt;oracle.oracle-java&lt;/code&gt; extension for everything to work, but it is not available in the Cursor IDE Marketplace (&lt;strong&gt;at the time of this guide&lt;/strong&gt;). Therefore, a workaround is needed to download and install the extension in Cursor.&lt;/p&gt;

&lt;p&gt;It's possible, but it's a bit tricky. Fortunately, I found an application that helps us, and I made it available in my repository after doing a Code Review.&lt;/p&gt;

&lt;p&gt;Access the application below to &lt;strong&gt;search and download the VSIX for the&lt;/strong&gt; &lt;code&gt;oracle.oracle-java&lt;/code&gt; extension: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://andersonbosa.github.io/vsix-downloader-webui/" rel="noopener noreferrer"&gt;https://andersonbosa.github.io/vsix-downloader-webui/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&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%2Fig0ic8qhuz0cth2yujrc.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%2Fig0ic8qhuz0cth2yujrc.png" alt="Img" width="800" height="567"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to Cursor, Open “Command Prompt” (cmd + shift + p) and type “&lt;code&gt;extensions: vsix&lt;/code&gt;“ to find the “&lt;code&gt;Extensions: Install from VSIX&lt;/code&gt;” functionality.  &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%2Fckc7oc92kfv8eznmycjx.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%2Fckc7oc92kfv8eznmycjx.png" alt="Img" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then just select the file and install it.  &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%2Fiy9966y1906shau44q4y.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%2Fiy9966y1906shau44q4y.png" alt="Img" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If everything was successful so far, the extension will appear in the extensions menu.  &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%2Fwps18x8rgsi6mtccak34.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%2Fwps18x8rgsi6mtccak34.png" alt="Img" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Configure your Runtime ☺️
&lt;/h3&gt;

&lt;p&gt;To make everything work, you just need to &lt;strong&gt;define where your Runtime is installed&lt;/strong&gt; in your Cursor IDE settings.&lt;/p&gt;

&lt;p&gt;Open “Command Prompt” (cmd + shift + p) and type “&lt;code&gt;pref user json&lt;/code&gt;“ to find the option with the JSON of your settings and add the key &lt;code&gt;jdk.jdkhome&lt;/code&gt; with the path of your Runtime.&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;"jdk.jdkhome"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/Users/anbosa/Library/Java/JavaVirtualMachines/corretto-17.0.13/Contents/Home"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fbkiaj77qkzm0hojo2gxn.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%2Fbkiaj77qkzm0hojo2gxn.png" alt="Img" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To validate that everything is as expected, select a test you want to run and right-click. The following options will appear:  &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%2Fgd5be3g45lze4282tr01.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%2Fgd5be3g45lze4282tr01.png" alt="Img" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now you have Cursor configured to work with Java in a defined Runtime ☺️&lt;/strong&gt;  &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%2Fderhje412yslrfh8qpen.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%2Fderhje412yslrfh8qpen.png" alt="Img" width="503" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cursor</category>
      <category>java</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Power Of Git Log: You don't know how to use it.</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Mon, 28 Apr 2025 22:41:32 +0000</pubDate>
      <link>https://dev.to/andersonbosa/the-power-of-git-log-you-dont-know-how-to-use-it-18jj</link>
      <guid>https://dev.to/andersonbosa/the-power-of-git-log-you-dont-know-how-to-use-it-18jj</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;TL;DR&lt;/li&gt;
&lt;li&gt;Why I wrote this&lt;/li&gt;
&lt;li&gt;What is git log?&lt;/li&gt;
&lt;li&gt;The -G Option: Searching for Changes in Code&lt;/li&gt;
&lt;li&gt;The -S Option: Tracking Additions and Removals of Lines&lt;/li&gt;
&lt;li&gt;Key Differences Between -G and -S&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;This article explains how to use git log with the -G and -S options to track changes in your codebase more effectively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-G&amp;lt;regex&amp;gt;&lt;/code&gt; searches for commits where lines matching a regex were modified (added or removed).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-S&amp;lt;regex&amp;gt;&lt;/code&gt; finds commits where the number of occurrences of a string changed (added or deleted).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Key difference: -G detects edits to matching lines; -S detects changes in the presence/absence of the pattern.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I wrote this
&lt;/h2&gt;

&lt;p&gt;I needed to identify which tests I needed to perform for my PR, which changed the version of the Go runtime environment. Since there were several previous PRs with the details of the manual tests and other information I needed, I could search for another colleague's PR. However, there was a problem: how could I find a PR with this change among so many PRs and Cards? Manually it was not feasible.&lt;/p&gt;

&lt;p&gt;Well, I immediately, already knowing a little about "git log", started looking for how I could find changes in the &lt;code&gt;go.mod&lt;/code&gt; file that matched the regular expression &lt;code&gt;^go [0-9]&lt;/code&gt;. And voila, I found several PRs, rich in information that I needed :3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;-G&lt;/span&gt;&lt;span class="s1"&gt;'^go [0-9]'&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; go.mod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is git log?
&lt;/h2&gt;

&lt;p&gt;Before we delve into the specific options, let’s briefly understand what the &lt;code&gt;git log&lt;/code&gt; command does. The &lt;code&gt;git log&lt;/code&gt; command is used to display the commit history of a Git repository. It provides various options to filter and format this information, allowing developers to examine changes and understand the timeline of a project efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;-G&lt;/code&gt; Option: Searching for Changes in Code
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;-G&amp;lt;regex&amp;gt;&lt;/code&gt; option allows you to look for changes in the commit history where the patch text (the differences made in the code) contains added or removed lines that match a specific regular expression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you use &lt;code&gt;-G&lt;/code&gt;, Git will scan the diffs of commits and show you only those that include lines added or removed that match your given regex pattern. This is especially useful when you are interested in a specific function, variable, or code pattern that may have undergone changes over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose you want to track the history of changes to a function called &lt;code&gt;calculateSum&lt;/code&gt;. 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;git log &lt;span class="nt"&gt;-G&lt;/span&gt;&lt;span class="s1"&gt;'calculateSum'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will show you all commits that altered this function, along with the relevant diffs. It’s a powerful way to track how a particular piece of code has evolved throughout the project, allowing you to connect changes with specific commits.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;-S&lt;/code&gt; Option: Tracking Additions and Removals of Lines
&lt;/h2&gt;

&lt;p&gt;In contrast, the &lt;code&gt;-S&amp;lt;regex&amp;gt;&lt;/code&gt; option, often referred to as the "pickaxe" option, helps you find commits that specifically add or remove lines matching a given regex pattern. This means you’re interested not just in the changes themselves but in whether the number of occurrences of the specified string has changed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;br&gt;
When you invoke the &lt;code&gt;-S&lt;/code&gt; option, Git checks each commit to see if the number of occurrences of the specified string (or pattern) has increased or decreased. If the matches changed, it logs that commit, allowing you to understand when and why a particular pattern came into or out of use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to see when the &lt;code&gt;calculateSum&lt;/code&gt; function was added or removed entirely from the codebase, you can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;-S&lt;/span&gt;&lt;span class="s1"&gt;'calculateSum'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will return commits that specifically dealt with the existence of that function, helping you identify when it was introduced or deleted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Differences Between &lt;code&gt;-G&lt;/code&gt; and &lt;code&gt;-S&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;As illustrated in the original documentation excerpt, the primary distinction between these two options lies in what they track:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;-G&lt;/code&gt;&lt;/strong&gt;: Focuses on the content of the patch. It finds any modifications to the lines that match the regex.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;-S&lt;/code&gt;&lt;/strong&gt;: Concentrates on the count of occurrences. It will look for commits where the count of the matching string has changed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For instance, if a function appears with a new name but has the same logic, &lt;code&gt;-G&lt;/code&gt; may detect this change, whereas &lt;code&gt;-S&lt;/code&gt; won't show a result since the string count hasn't changed.&lt;/p&gt;

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

&lt;p&gt;As developers, mastering these tools can lead us to a deeper understanding of our projects, facilitate smarter debugging, and improve overall collaboration within teams. So go ahead, explore these options, and share your discoveries with fellow developers in your network!&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
      <category>cli</category>
    </item>
    <item>
      <title>Subdomain or Subfolder: Which Is Better for Your Site’s SEO?</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Thu, 27 Feb 2025 11:27:02 +0000</pubDate>
      <link>https://dev.to/andersonbosa/subdomain-or-subfolder-which-is-better-for-your-sites-seo-paf</link>
      <guid>https://dev.to/andersonbosa/subdomain-or-subfolder-which-is-better-for-your-sites-seo-paf</guid>
      <description>&lt;p&gt;When it comes to search engine optimization (SEO), a common question for developers and site owners is: &lt;strong&gt;Should I use a subdomain or a subfolder?&lt;/strong&gt; Both options have their strengths, but the choice you make can directly affect how your site ranks in search results. In this article, we’ll break down the pros and cons of each approach to help you decide which one might work best for your main site’s SEO.&lt;/p&gt;




&lt;h3&gt;
  
  
  What’s a Subdomain?
&lt;/h3&gt;

&lt;p&gt;A subdomain is an extension of your main domain that search engines treat as a separate site. It looks like this: &lt;code&gt;blog.example.com&lt;/code&gt;. This setup is great when you need clear separation between different parts of your site.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros of Using Subdomains
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Niche targeting&lt;/strong&gt;: Subdomains shine when you’re dealing with distinct audiences or products. They let you craft tailored SEO strategies for each segment, which is handy for sites with diverse content.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Geographic targeting&lt;/strong&gt;: If your site serves multiple regions or languages, subdomains can be a perfect fit. Global companies often use them to deliver localized experiences, like &lt;code&gt;us.example.com&lt;/code&gt; or &lt;code&gt;br.example.com&lt;/code&gt;.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Organization&lt;/strong&gt;: For large sites, subdomains can improve user experience by keeping navigation clean and avoiding a cluttered or confusing structure.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Cons of Using Subdomains
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Split domain authority&lt;/strong&gt;: The biggest downside? Search engines see subdomains as separate entities. That means backlinks and authority built on a subdomain don’t directly boost your main domain (&lt;code&gt;example.com&lt;/code&gt;). This can slow down your overall SEO progress.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extra SEO effort&lt;/strong&gt;: Since subdomains are treated as standalone sites, you’ll need to optimize each one individually. That takes more time and resources—tough if you don’t have a dedicated SEO team.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  What’s a Subfolder?
&lt;/h3&gt;

&lt;p&gt;Subfolders (or subdirectories) are part of your main domain, structured like this: &lt;code&gt;example.com/blog&lt;/code&gt;. From an SEO perspective, they keep all your optimization efforts tied to a single domain.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros of Using Subfolders
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Brand consistency&lt;/strong&gt;: Want a unified brand experience? Subfolders are the way to go. By keeping everything under your main domain, you ensure a seamless and cohesive journey for visitors.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stronger domain authority&lt;/strong&gt;: Unlike subdomains, all traffic, backlinks, and authority from subfolders feed directly into your main domain. This can give your search rankings a faster boost.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simpler SEO&lt;/strong&gt;: Managing one SEO strategy is already a big task for most sites. Subfolders keep everything centralized, making it easier to create content, earn backlinks, and track performance.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Cons of Using Subfolders
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Harder to target diverse audiences&lt;/strong&gt;: If your site serves multiple products or groups with different needs, subfolders might make it trickier to focus on specific niches. A unified structure can dilute your targeting efforts.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complex navigation&lt;/strong&gt;: For sites with tons of content, cramming everything into subfolders can make navigation messy. That could hurt user experience and, indirectly, your SEO.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Which Works Best for Your Site?
&lt;/h3&gt;

&lt;p&gt;If your &lt;strong&gt;main goal&lt;/strong&gt; is to boost the ranking of your primary domain (&lt;code&gt;example.com&lt;/code&gt;), subfolders (&lt;code&gt;example.com/blog&lt;/code&gt;) are usually the better choice. They consolidate your site’s authority and amplify the impact of backlinks and optimized content.  &lt;/p&gt;

&lt;p&gt;But if you’re targeting a diverse audience or need separate SEO strategies for different markets, &lt;strong&gt;subdomains&lt;/strong&gt; might be the way to go. They give you flexibility to tailor content and keywords for specific groups without affecting other parts of your site.  &lt;/p&gt;




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

&lt;p&gt;The subdomain vs. subfolder decision hinges on your site’s type and SEO goals. For simplicity and a quick way to build domain authority, subfolders are the most efficient option. But if you’re juggling distinct niches or need flexible organization, subdomains could be your best bet.  &lt;/p&gt;

&lt;p&gt;Now that you’ve got the pros and cons, pick the approach that fits your site’s needs and start optimizing your online presence!  &lt;/p&gt;




&lt;p&gt;Got questions about boosting your site’s SEO? Drop a comment! ✌️&lt;/p&gt;




&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.growthmachine.com/blog/subdomain-vs-domain" rel="noopener noreferrer"&gt;https://www.growthmachine.com/blog/subdomain-vs-domain&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.semrush.com/blog/subdomain-vs-subdirectory/" rel="noopener noreferrer"&gt;https://www.semrush.com/blog/subdomain-vs-subdirectory/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.searchenginejournal.com/subdomain-subdirectory-cctld/226545/" rel="noopener noreferrer"&gt;https://www.searchenginejournal.com/subdomain-subdirectory-cctld/226545/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.impactplus.com/blog/subdomains-vs-subfolders" rel="noopener noreferrer"&gt;https://www.impactplus.com/blog/subdomains-vs-subfolders&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>marketing</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Do you know how to evaluate performance of your Java applications?</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Thu, 27 Feb 2025 11:23:42 +0000</pubDate>
      <link>https://dev.to/andersonbosa/do-you-know-how-to-evaluate-performance-of-your-java-applications-37b8</link>
      <guid>https://dev.to/andersonbosa/do-you-know-how-to-evaluate-performance-of-your-java-applications-37b8</guid>
      <description>&lt;p&gt;Recently, while chatting with an Expert here at MELI (Mercado Livre), I asked more about his past experiences, curious about the problems he’s tackled. That’s when he shared a particular scenario with me that piqued my interest: the impact of boxing and unboxing in poorly implemented algorithms. I won’t share his real case due to NDA reasons. However, I went off to study this topic myself, and now I’m bringing what I’ve learned in this post for you all.  &lt;/p&gt;

&lt;p&gt;If you work with Java, you’ve dealt with collections and autoboxing, but are you aware of the hidden cost of these automatic conversions? I hope you enjoy the content, and all feedback is welcome—thanks!  &lt;/p&gt;

&lt;h3&gt;
  
  
  First, What Are Boxing and Unboxing?
&lt;/h3&gt;

&lt;p&gt;In Java, &lt;em&gt;boxing&lt;/em&gt; is the automatic conversion of a primitive type (e.g., &lt;code&gt;int&lt;/code&gt;) into its wrapper equivalent (e.g., &lt;code&gt;Integer&lt;/code&gt;). &lt;em&gt;Unboxing&lt;/em&gt; is the reverse process. This has been around since Java 5 with autoboxing, making life easier when using APIs like &lt;code&gt;ArrayList&lt;/code&gt;, which only accept objects. Here’s a basic example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;primitive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;wrapper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;primitive&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Autoboxing  &lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;backAgain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;wrapper&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// Autounboxing  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It seems simple, but the problem arises when these conversions happen on a large scale or in poorly designed algorithms.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Some Terms That Came Up
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Heap&lt;/strong&gt; is the memory area where Java allocates objects and arrays. It’s a global memory space, accessible by different threads in the application.  &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Stack&lt;/strong&gt; is a memory area used to store local variables (primitives or object references) and method execution details (parameters, scope variables, return address).  &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Garbage Collector&lt;/strong&gt;, meanwhile, is the JVM’s automatic janitor. It’s responsible for finding objects in the Heap that no longer have active references (nobody’s pointing to them anymore) and freeing up their memory for reuse.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Why Does This Affect Performance?
&lt;/h3&gt;

&lt;p&gt;Primitive types are stored in the stack and are super lightweight—an &lt;code&gt;int&lt;/code&gt; takes up &lt;code&gt;4 bytes&lt;/code&gt;. An &lt;code&gt;Integer&lt;/code&gt;, on the other hand, is an object in the heap, with metadata overhead (it can reach &lt;code&gt;16 bytes&lt;/code&gt; or more, depending on the JVM). Each boxing creates a new object, increasing memory usage and the garbage collector’s workload. In loops or massive operations, this cost piles up fast.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Hands-On
&lt;/h3&gt;

&lt;p&gt;Comparing Boxing vs. Primitives. Let’s test this with real code. The goal here is to sum 10 million integers in two ways:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using an &lt;code&gt;ArrayList&lt;/code&gt; (with boxing)
&lt;/li&gt;
&lt;li&gt;Using an &lt;code&gt;int&lt;/code&gt; array.
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/andersonbosa/boxing-performance-test/blob/main/src/BoxingPerformanceTest.java" rel="noopener noreferrer"&gt;https://github.com/andersonbosa/boxing-performance-test/blob/main/src/BoxingPerformanceTest.java&lt;/a&gt;&lt;br&gt;&lt;br&gt;
I kept it in the repo for better readability.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The results on your computer might vary slightly from those below (since computational power differs between machines):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Time with array (primitive): 29 ms  
Memory used by primitive array: 0 MB  
----------------------------------------  
Time with ArrayList (boxing): 171 ms  
Memory used by ArrayList: 288 MB  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why? With the &lt;code&gt;ArrayList&lt;/code&gt;, every &lt;code&gt;int&lt;/code&gt; becomes an &lt;code&gt;Integer&lt;/code&gt; (10 million objects!), while the array uses just &lt;strong&gt;contiguous memory&lt;/strong&gt; (TL;DR: fast access, slow insertion) for primitives. The garbage collector also has to clean up those objects afterward, adding to the impact.  &lt;/p&gt;

&lt;p&gt;Sure, you might be thinking you’re not about to go summing 10 million numbers, right? So let’s move on—I’ll show the impact of boxing/unboxing in poorly thought-out real-world algorithms.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoiler&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Try setting the size to &lt;code&gt;500_000_000&lt;/code&gt; to see the consequences!  &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%2Fjvxyrunecol68xyomvi4.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%2Fjvxyrunecol68xyomvi4.png" alt="VisualVM + IntelliJ Plugin" width="539" height="316"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;h3&gt;
  
  
  Beware of Poorly Implemented Algorithms
&lt;/h3&gt;

&lt;p&gt;Nested loops (a loop inside a loop) handling request data, authentication operations, or hash calculations processing large input volumes—what do they have in common? The memory and CPU overhead can easily scale, turning functional code into a bottleneck. Here are some practical examples I picked up from my research and chats with colleagues who’ve faced these issues in real systems:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication: Batch ID Verification&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A REST API validates user IDs from a JWT against an authorized list.&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AuthService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;AUTHORIZED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashSet&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1001&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1002&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1003&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;  

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;validateIds&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;userIds&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;userIds&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Unboxing  &lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;&lt;span class="no"&gt;AUTHORIZED&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;contains&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// More unboxing  &lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
            &lt;span class="o"&gt;}&lt;/span&gt;  
        &lt;span class="o"&gt;}&lt;/span&gt;  
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
    &lt;span class="o"&gt;}&lt;/span&gt;  
&lt;span class="o"&gt;}&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a request with thousands of IDs (e.g., batch validation), each &lt;code&gt;Integer&lt;/code&gt; requires unboxing. The alternative? Use &lt;code&gt;int[]&lt;/code&gt; and &lt;code&gt;IntHashSet&lt;/code&gt; (from the &lt;a href="https://github.com/vigna/fastutil" rel="noopener noreferrer"&gt;FastUtil&lt;/a&gt; library).  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Request Processing: Status Filtering&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Imagine an endpoint that filters HTTP status codes (e.g., 200, 404, etc.) from received logs.&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LogProcessor&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;filterStatus&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;statusCodes&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;filtered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;  
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statusCodes&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Unboxing  &lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// More unboxing  &lt;/span&gt;
                &lt;span class="n"&gt;filtered&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Boxing  &lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;  
        &lt;span class="o"&gt;}&lt;/span&gt;  
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;filtered&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
    &lt;span class="o"&gt;}&lt;/span&gt;  
&lt;span class="o"&gt;}&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With thousands of requests, each filtering operation generating boxing/unboxing would degrade performance. Using &lt;code&gt;int[]&lt;/code&gt; would solve the issue.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Encryption/Hashing: Data Integrity Validation&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, a web service calculates and compares SHA-256 hashes of file chunks sent via request to verify integrity (e.g., in a chunked upload).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.security.MessageDigest&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HashValidator&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;calculateHashBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
        &lt;span class="nc"&gt;MessageDigest&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MessageDigest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SHA-256"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  
        &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;digest&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;hashValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;  
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  
            &lt;span class="n"&gt;hashValues&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Boxing to Integer  &lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;  
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hashValues&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Returns for comparison  &lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;  
&lt;span class="o"&gt;}&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How could we improve this? Each byte of the hash (32 bytes for SHA-256) is converted into an &lt;code&gt;Integer&lt;/code&gt;, creating 32 objects per call. I simulated this with 10,000 1 KB chunks: boxing increased memory usage by 20% and added overhead to the garbage collector, impacting endpoint latency. Alternative? Stick with &lt;code&gt;byte[]&lt;/code&gt; or use &lt;code&gt;int[]&lt;/code&gt; if conversion is needed.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Takeaways
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefer primitives&lt;/strong&gt;: If you don’t need objects, use &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;, etc. Arrays like &lt;code&gt;int[]&lt;/code&gt; are your friends in intensive operations.
&lt;/li&gt;
&lt;li&gt;Avoid boxing in loops: Each iteration with autoboxing means one more object in the heap.
&lt;/li&gt;
&lt;li&gt;Know your alternatives! Libraries like Trove or Eclipse Collections offer optimized collections for primitives.
&lt;/li&gt;
&lt;li&gt;Profile your code: Tools like VisualVM or JProfiler reveal where boxing is costing you.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Boxing and unboxing are handy mechanisms, but their indiscriminate use can severely compromise performance, especially in critical or poorly tested code sections. As developers and engineers, our role goes beyond just making code work. We should aim for solutions that not only solve the problem but are also efficient, resource-sustainable, and resilient to failures.  &lt;/p&gt;

&lt;p&gt;Test, compare, and optimize—your code, your users, and your career will thank you (lol).  &lt;/p&gt;

</description>
      <category>java</category>
      <category>performance</category>
      <category>algorithms</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Você sabe avaliar performance de suas aplicações Java?</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Thu, 27 Feb 2025 11:19:24 +0000</pubDate>
      <link>https://dev.to/andersonbosa/voce-sabe-avaliar-performance-de-suas-aplicacoes-java-1a2n</link>
      <guid>https://dev.to/andersonbosa/voce-sabe-avaliar-performance-de-suas-aplicacoes-java-1a2n</guid>
      <description>&lt;p&gt;Recentemente, enquanto conversava com um Expert aqui no MELI (Mercado Livre), perguntei mais sobre as experiências passadas dele, curioso sobre os problemas que ele já atacou. Foi aí que ele compartilhou um cenário particular comigo que me deixou intrigado: o impacto do boxing e unboxing em algoritmos mal implementados. Não vou compartilhar o caso real dele por questões de NDA. Porém, fui atrás de estudar isso esta e, agora, trago o que aprendi nesta publicação para vocês. &lt;/p&gt;

&lt;p&gt;Se você trabalha com Java, já lidou com coleções e autoboxing, mas será que está atento ao custo escondido dessas conversões automáticas? Espero que gostem do conteúdo, e todo feedback é bem-vindo, obrigado!&lt;/p&gt;

&lt;h3&gt;
  
  
  Primeiro, o que são Boxing e Unboxing?
&lt;/h3&gt;

&lt;p&gt;Em Java, boxing é a conversão automática de um tipo primitivo (ex.: int) para seu equivalente wrapper (ex.: Integer). Unboxing é o processo inverso. Isso existe desde o Java 5 com o autoboxing, facilitando a vida ao usar APIs como ArrayList, que só aceitam objetos. Veja um exemplo básico:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;primitivo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;wrapper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;primitivo&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Autoboxing&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;deVolta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;wrapper&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// Autounboxing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parece simples, mas o problema surge quando essas conversões acontecem em larga escala ou em algoritmos mal planejados.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alguns nomes que apareceram
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Heap&lt;/strong&gt; é a área de memória onde o Java aloca objetos e arrays. É uma área de memória global, acessível por diferentes threads da aplicação.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Stack&lt;/strong&gt; é uma área de memória usada para guardar variáveis locais (primitivos ou referências a objetos) e informações de execução de métodos (parâmetros, variáveis do escopo, endereço de retorno).&lt;/p&gt;

&lt;p&gt;Já o &lt;strong&gt;Garbage Collector&lt;/strong&gt; é o lixeiro automático da JVM. Ele é responsável por achar objetos na Heap que não têm mais referências ativas (ninguém mais aponta para eles). E também de liberar a memória desses objetos para que possa ser reutilizada.&lt;/p&gt;

&lt;h3&gt;
  
  
  Por que isso afeta a performance?
&lt;/h3&gt;

&lt;p&gt;Tipos primitivos são armazenados na stack e são super leves — um int ocupa &lt;code&gt;4 bytes&lt;/code&gt;. Já um Integer é um objeto na heap, com overhead de metadados (pode chegar a &lt;code&gt;16 bytes&lt;/code&gt; ou mais, dependendo da JVM). Cada boxing cria um novo objeto, aumentando o consumo de memória e o trabalho do garbage collector. Em loops ou operações massivas, esse custo acumula rápido.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hands-on
&lt;/h3&gt;

&lt;p&gt;Comparando Boxing vs. Primitivos. Vamos testar isso com um código real. O objetivo aqui é somar 10 milhões de números inteiros de duas formas: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;usando uma ArrayList (com boxing)&lt;/li&gt;
&lt;li&gt;um array int. &lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Repositório GitHub&lt;/strong&gt;: &lt;a href="https://github.com/andersonbosa/boxing-performance-test/blob/main/src/BoxingPerformanceTest.java" rel="noopener noreferrer"&gt;https://github.com/andersonbosa/boxing-performance-test/blob/main/src/BoxingPerformanceTest.java&lt;/a&gt;&lt;br&gt;
Eu mantive no repositório para melhorar legibilidade.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;O resultado no seu computador pode variar um pouco do resultado abaixo (já que o poder computacional de cada máquina varia):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tempo com array (primitivo): 29 ms
Memória usada pelo array primitivo: 0 MB
----------------------------------------
Tempo com ArrayList (boxing): 171 ms
Memória usada pelo ArrayList: 288 MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Por quê? No caso da ArrayList, cada int vira um Integer (10 milhões de objetos!), enquanto o array usa apenas &lt;strong&gt;memória contígua&lt;/strong&gt; (TL;DL: acesso rápido, inserção lento) para primitivos. O garbage collector ainda precisa limpar esses objetos depois, aumentando o impacto.&lt;/p&gt;

&lt;p&gt;Certo, mas você pode estar pensando que não vai sair por aí somando 10 milhões de números, não é? Então vamos adiante, vou trazer o impacto do boxing/unboxing em algoritmos mal pensados no mundo real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoiler&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Experimente usar tamanho = 500_000_000 para ver a consequência!&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%2Fjvxyrunecol68xyomvi4.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%2Fjvxyrunecol68xyomvi4.png" alt="VisualVM + IntelliJ Plugin" width="539" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cuidado com Algoritmos Mal Implementados
&lt;/h3&gt;

&lt;p&gt;Loops aninhados (loop dentro de loop) manipulando dados de requisições, operações de autenticação ou cálculos de hashing processando grandes volumes de entrada. O que eles tem em comum? O overhead de memória e CPU pode facilmente escalar, transformando um código funcional em um gargalo. Aqui eu trago alguns exemplos práticos que aprendi durante minha pesquisa ao ir atrás dos meus colegas, que tiveram essas experiências em sistemas reais:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Autenticação: Verificação de IDs em Lote&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Uma API REST valida IDs de usuários de um JWT contra uma lista autorizada.&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AuthService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;AUTORIZADOS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashSet&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1001&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1002&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1003&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;validarIds&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;userIds&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;userIds&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// unboxing&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;&lt;span class="no"&gt;AUTORIZADOS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;contains&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// mais unboxing&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Em uma requisição com milhares de IDs (ex.: validação em lote), cada Integer exige unboxing. A alternativa aqui seria usar &lt;code&gt;int[]&lt;/code&gt; e &lt;code&gt;IntHashSet&lt;/code&gt; (da biblioteca &lt;a href="https://github.com/vigna/fastutil" rel="noopener noreferrer"&gt;FastUtil&lt;/a&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Processamento de Requisições: Filtro de Status&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Imagine que você tem um endpoint que filtra os de status HTTP (ex.: 200, 404, etc) de logs recebidos.&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LogProcessor&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;filtrarStatus&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;statusCodes&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;filtrados&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;statusCodes&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Unboxing&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Mais unboxing&lt;/span&gt;
                &lt;span class="n"&gt;filtrados&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Boxing&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;filtrados&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Com milhares de requisições e cada filtragem gerando boxing/unboxing isso causaria degradação da performance. Usar &lt;code&gt;int[]&lt;/code&gt; já resolveria o problema.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Criptografia/Hashing: Validação de Integridade de Dados&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Por exemplo, você tem um serviço web que calcula e compara hashes SHA256 de partes de um arquivo enviado via requisição para verificar integridade (ex.: em um upload em chunks).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.security.MessageDigest&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HashValidator&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;calcularHashBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;MessageDigest&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MessageDigest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SHA-256"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;md&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;digest&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;hashValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;hashValues&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Boxing para Integer&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hashValues&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Retorna para comparação&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Como poderíamos melhorar aqui? Cada byte do hash (32 bytes para SHA-256) é convertido em um Integer, gerando 32 objetos por chamada. Simulei com 10.000 chunks de 1 KB: o boxing aumentou o uso de memória em 20% e adicionou overhead ao garbage collector, impactando a latência do endpoint. Alternativa? Manter como byte[] ou usar int[] se conversão for necessária&lt;/p&gt;

&lt;h3&gt;
  
  
  Aprendizados
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prefira primitivos&lt;/strong&gt;: Se não precisa de objetos, use int, double, etc. Arrays como int[] são seus amigos em operações intensivas.&lt;/li&gt;
&lt;li&gt;Evite boxing em loops: Cada iteração com autoboxing é um objeto a mais na heap.&lt;/li&gt;
&lt;li&gt;Conheça alternativas! Bibliotecas como Trove ou Eclipse Collections oferecem coleções otimizadas para primitivos. &lt;/li&gt;
&lt;li&gt;"Perfilize" seu código: Ferramentas como VisualVM ou JProfiler mostram onde boxing está custando caro.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Minha conclusão
&lt;/h3&gt;

&lt;p&gt;Boxing e unboxing são mecanismos úteis, mas seu uso indiscriminado pode comprometer severamente a performance, especialmente em trechos críticos ou pouco testados. Como desenvolvedores e engenheiros, nosso papel vai além de simplesmente garantir que o código funcione. Devemos buscar soluções que não só resolvam o problema, mas que também sejam eficientes, sustentáveis em termos de uso de recursos e resilientes a falhas.&lt;/p&gt;

&lt;p&gt;Teste, compare e otimize — seu código e seus usuários vão agradecer (e sua carreira tbm rsrs).&lt;/p&gt;

</description>
      <category>java</category>
      <category>performance</category>
      <category>algorithms</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>LGPD para devs</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Wed, 06 Mar 2024 00:18:08 +0000</pubDate>
      <link>https://dev.to/andersonbosa/lgpd-para-devs-mk0</link>
      <guid>https://dev.to/andersonbosa/lgpd-para-devs-mk0</guid>
      <description>&lt;h2&gt;
  
  
  Índice
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;O que é a LGPD&lt;/li&gt;
&lt;li&gt;Qual a importância da LGPD&lt;/li&gt;
&lt;li&gt;Você Desenvolvedor, o que precisa saber&lt;/li&gt;
&lt;li&gt;Riscos do não cumprimento da LGPD&lt;/li&gt;
&lt;li&gt;Onde Aprender Mais sobre a LGPD&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;O cenário digital no mundo inteiro está em contante evolução, nesse ambiente a proteção de dados torna-se uma prioridade crucial. No Brasil, a Lei Geral de Proteção de Dados (LGPD) surge como um marco legal para para zelar pelas informações pessoais. Neste artigo, eu quero explorar o que é a LGPD, sua importância, o que um desenvolvedor de software precisa saber para alinhar seus projetos com essa legislação essencial, e os riscos associados ao não cumprimento.&lt;/p&gt;

&lt;h3&gt;
  
  
  O que é a LGPD? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A LGPD, &lt;a href="https://www.gov.br/esporte/pt-br/acesso-a-informacao/lgpd" rel="noopener noreferrer"&gt;Lei nº 13.709/2018&lt;/a&gt;, foi criada para regular o tratamento de dados pessoais por entidades públicas e privadas. Inspirada no Regulamento &lt;a href="https://gdpr-info.eu" rel="noopener noreferrer"&gt;Geral de Proteção de Dados da União Europeia (GDPR)&lt;/a&gt;, a LGPD estabelece diretrizes claras sobre a coleta, armazenamento, processamento e compartilhamento de dados pessoais.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Lei nº 13.709, de 14 de agosto de 2018, foi promulgada com o objetivo de proteger os direitos fundamentais de liberdade e de privacidade e a livre formação da personalidade de cada indivíduo. &lt;a href="https://www.gov.br/esporte/pt-br/acesso-a-informacao/lgpd/conheca-a-lgpd" rel="noopener noreferrer"&gt;source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A LGPD fala sobre o tratamento de dados pessoais, dispostos em meio físico ou digital, feito por pessoa física ou jurídica de direito público ou privado, e engloba um amplo conjunto de operações efetuadas em meios manuais ou digitais.&lt;/p&gt;

&lt;h3&gt;
  
  
  Qual a importância da LGPD? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Proteção da Privacidade&lt;/strong&gt;: A LGPD busca garantir que os dados pessoais dos cidadãos sejam tratados com respeito, transparência e segurança, protegendo sua privacidade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reputação e Confiança&lt;/strong&gt;: Empresas que aderem à LGPD demonstram compromisso com a integridade e segurança dos dados. Isso fortalece a confiança do cliente e preserva a reputação da organização.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Padrões Internacionais&lt;/strong&gt;: Alinhando-se a padrões internacionais, a LGPD facilita a troca de dados com empresas e clientes ao redor do mundo, promovendo uma abordagem global de proteção de dados.&lt;/p&gt;

&lt;h3&gt;
  
  
  Você Desenvolvedor, o que precisa saber? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Mapeamento de Dados&lt;/strong&gt;: Entenda quais dados pessoais são coletados e processados pelos sistemas que você desenvolve. Realize um mapeamento completo para garantir conformidade com a LGPD.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy by Design e by Default&lt;/strong&gt;: Adote práticas de privacidade desde o início do desenvolvimento, integrando a proteção de dados nos processos e sistemas, e garantindo que desde o príncipio as configurações favoreçam a privacidade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consentimento Transparente&lt;/strong&gt;: Implemente mecanismos claros de obtenção de consentimento para o tratamento de dados. Certifique-se de que os usuários estejam plenamente informados sobre como suas informações serão utilizadas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Segurança da Informação&lt;/strong&gt;: Reforce a segurança em todos os níveis do desenvolvimento. A LGPD exige medidas adequadas para proteger dados pessoais contra acessos não autorizados e vazamentos.&lt;/p&gt;

&lt;h3&gt;
  
  
  Riscos do não cumprimento da LGPD &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;O não cumprimento da LGPD pode acarretar em diversos riscos, incluindo:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Perda de Clientes&lt;/strong&gt;: A reputação da empresa pode ser severamente afetada, levando à perda de confiança e clientes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Danos à Marca&lt;/strong&gt;: Violações de dados podem resultar em danos irreparáveis à marca e impactar negativamente a percepção pública.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multa&lt;/strong&gt;: As multas podem atingir até 2% do faturamento da empresa, limitadas a R$ 50 milhões por infração.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Processos Legais&lt;/strong&gt;: A organização pode enfrentar processos legais, desencadeando custos legais significativos.&lt;/p&gt;

&lt;h3&gt;
  
  
  Onde Aprender Mais sobre a LGPD? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A príncipío a &lt;a href="https://www.gov.br/anpd/pt-br" rel="noopener noreferrer"&gt;ANPD (Autoridade Nacional de Proteção de Dados)&lt;/a&gt; é uma fonte oficial e de referência para consultar informações, dado que é a ANPD a responsável por fiscalizar e regulamentar a LGPD. &lt;/p&gt;

&lt;p&gt;Porém, na Internet é possível achar muitos outros recursos como cursos, certificações e webinars/eventos. &lt;a href="https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/L13709compilado.htm" rel="noopener noreferrer"&gt;&lt;strong&gt;Aqui&lt;/strong&gt;&lt;/a&gt; é possível consultar na íntegra o texto completo da lei.&lt;/p&gt;




&lt;p&gt;A LGPD é uma realidade que todos os desenvolvedores devem incorporar em seus projetos. Ao entender os princípios fundamentais e adotar práticas que priorizam a privacidade, os desenvolvedores contribuem para um ambiente digital mais seguro e em conformidade com as leis de proteção de dados. Então é importante manter-se informado pois a proteção de dados é uma responsabilidade compartilhada por todos nós.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>privacy</category>
      <category>lgpd</category>
    </item>
    <item>
      <title>The "Something else" option in Linux installation</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Thu, 07 Sep 2023 17:12:27 +0000</pubDate>
      <link>https://dev.to/andersonbosa/the-something-else-option-in-linux-installation-1c54</link>
      <guid>https://dev.to/andersonbosa/the-something-else-option-in-linux-installation-1c54</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I won't be very detailed in this post, it's more of a future reference for my future self in case I need to go through this again. In the "References" section of the post, I will leave some links to content by people who have explained what is being done in more detail. Still, I hope it can help someone else as well.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;How it does not happens every day, I always forget how to setup the partitions in Ubuntu (or other OS's) when I need reinstall the system keeping my dual boot in order.&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%2Fwdclkj6soq6ri2nbq46k.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%2Fwdclkj6soq6ri2nbq46k.png" alt="Image" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I recommend you format your Linux system (ig Ubuntu) in Windows, and when installing the new one, use the option "alongside". It's more safe and simple.&lt;/p&gt;

&lt;p&gt;But we are here to use the "Something else" option. Below is a simple step by step of how use it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The biggest space (which will be for the operating system) use type &lt;code&gt;ext4&lt;/code&gt;. For its &lt;code&gt;mount point&lt;/code&gt; put the value &lt;code&gt;/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a "swap" partition with 2048MB (2GB)&lt;/li&gt;
&lt;li&gt;Setup the field &lt;code&gt;Device for boot loader installation&lt;/code&gt; to your &lt;code&gt;Windows boot manager&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;And you are ready to "install now"&lt;/li&gt;
&lt;/ol&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%2F6hlh2wg522qy9ckm7fz4.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%2F6hlh2wg522qy9ckm7fz4.png" alt="Image" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=GXxTxBPKecQ&amp;amp;ab_channel=SavvyNik" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=GXxTxBPKecQ&amp;amp;ab_channel=SavvyNik&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicetests.com/install-ubuntu-alongside-windows" rel="noopener noreferrer"&gt;https://devicetests.com/install-ubuntu-alongside-windows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=4PXbdGHo5I8&amp;amp;ab_channel=LearnComputerTechnologies" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=4PXbdGHo5I8&amp;amp;ab_channel=LearnComputerTechnologies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=vcOMWfykE34&amp;amp;ab_channel=QiroLab" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=vcOMWfykE34&amp;amp;ab_channel=QiroLab&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>linux</category>
    </item>
    <item>
      <title>Revolutionizing Git Workflow: My Experience with aicommits</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Sun, 05 Mar 2023 00:51:30 +0000</pubDate>
      <link>https://dev.to/andersonbosa/my-experience-with-aicommits-794</link>
      <guid>https://dev.to/andersonbosa/my-experience-with-aicommits-794</guid>
      <description>&lt;p&gt;As a developer, optimizing and improving workflow is always a priority. That's why I'm excited to share my experience with aicommits. &lt;/p&gt;

&lt;p&gt;This open-source tool uses OpenAPI to analyze code changes and generate descriptive commit messages automatically. Installation is straightforward, using &lt;code&gt;npm install -g aicommits&lt;/code&gt;. After installation, aicommits will create commit messages automatically based on the changes made to your repository.&lt;/p&gt;

&lt;p&gt;The awesome feature of aicommits is its ability to understand the context of your code changes and create a contextual commit message. This tool helps save time and improve the quality of your codebase by accurately reflecting changes made, making it easier for your team to review and understand the code.&lt;/p&gt;

&lt;p&gt;While aicommits is undoubtedly an excellent tool for developers, it's essential to highlight a potential security issue associated with its usage. Since aicommits reads and analyzes the code context, it could potentially expose sensitive information such as API keys, passwords, and other secrets or the intellectual property itself, in this case, the source code.&lt;/p&gt;

&lt;p&gt;While aicommits can be an invaluable tool for developers, it's essential to use it with caution and follow best practices to ensure the security of your codebase. By taking the necessary precautions, you can enjoy the benefits of aicommits while keeping your codebase safe and secure.&lt;/p&gt;

&lt;p&gt;In conclusion, aicommits is an excellent tool for optimizing your workflow and codebase quality and git log. Its ease of use, powerful NLP (Natural Language Processing) capabilities, and ability to understand the context of your code changes make it an indispensable tool for any developer. Give aicommits a try and simplify your Git workflow while saving time.&lt;/p&gt;




&lt;h4&gt;
  
  
  Thanks
&lt;/h4&gt;

&lt;p&gt;Special thanks to the creators Nutlope and Hiroki Osame, this project its really awesome! &lt;/p&gt;




&lt;h4&gt;
  
  
  References
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/Nutlope/aicommits" rel="noopener noreferrer"&gt;https://github.com/Nutlope/aicommits&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Natural_language_processing" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Natural_language_processing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/privatenumber" rel="noopener noreferrer"&gt;https://github.com/privatenumber&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Nutlope" rel="noopener noreferrer"&gt;https://github.com/Nutlope&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>welcome</category>
    </item>
    <item>
      <title>How to use nodemon with VSCode debugger?</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Fri, 03 Mar 2023 23:33:11 +0000</pubDate>
      <link>https://dev.to/andersonbosa/how-to-use-nodemon-with-vscode-debugger-2bpa</link>
      <guid>https://dev.to/andersonbosa/how-to-use-nodemon-with-vscode-debugger-2bpa</guid>
      <description>&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Intro&lt;/li&gt;
&lt;li&gt;Step by step&lt;/li&gt;
&lt;li&gt;Demo&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intro &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;As a developer, you know that debugging is a crucial aspect of your workflow. It helps you identify and fix issues in your code, and ultimately improve your application's performance. However, the process of debugging can be time-consuming and tedious, especially if you have to manually restart your application every time you make a change. This is where Nodemon and Visual Studio Code Debugger come in handy.&lt;/p&gt;

&lt;p&gt;Nodemon is a tool that helps you automate the process of restarting your Node.js application whenever you make changes to your code. It monitors your application for changes and automatically restarts it when it detects any modifications. This saves you a lot of time and effort, as you don't have to manually stop and start your application every time you make changes.&lt;/p&gt;

&lt;p&gt;Visual Studio Code Debugger, on the other hand, is an integrated development environment (IDE) that provides a powerful debugging experience for Node.js applications. It allows you to set breakpoints, step through your code, and inspect variables and objects at runtime.&lt;/p&gt;

&lt;p&gt;VSCode provides a configuration for nodemon (see image below), but I couldn't use it at first, so I had to update to the package path installed in "node_modules".&lt;/p&gt;

&lt;p&gt;This is because the "nodemon" package is installed in the project, not globally.&lt;/p&gt;




&lt;h3&gt;
  
  
  So how do I do it? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The steps to integrate nodemon in VSCode debugger are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;nodemon&lt;/code&gt; as development dependency in your repository:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; nodemon
&lt;span class="c"&gt;# or&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; nodemon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Configure the VSCode "launch.json" as follows, updating the value of &lt;code&gt;runtimeExecutable&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"configurations"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nodemon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"console"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"integratedTerminal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"internalConsoleOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"neverOpen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"program"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${workspaceFolder}/app.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"request"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"launch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"restart"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="c1"&gt;// "runtimeExecutable": "nodemon", /* ORIGINAL VALUE */&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"runtimeExecutable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${workspaceFolder}/node_modules/nodemon/bin/nodemon.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&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"&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="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  And it done! &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;For your convenience I created this demo repository: &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial" rel="noopener noreferrer"&gt;andersonbosa/nodemon-vscode-tutorial&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/andersonbosa" rel="noopener noreferrer"&gt;
        andersonbosa
      &lt;/a&gt; / &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial" rel="noopener noreferrer"&gt;
        nodemon-vscode-tutorial
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/andersonbosa/nodemon-vscode-tutorial./docs/banner.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fandersonbosa%2Fnodemon-vscode-tutorial.%2Fdocs%2Fbanner.svg" title="Project banner" alt="Project banner"&gt;&lt;/a&gt;
  
  &lt;br&gt;
  &lt;p&gt;
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#about" rel="noopener noreferrer"&gt;About&lt;/a&gt; •
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#technologies" rel="noopener noreferrer"&gt;Technologies&lt;/a&gt; •
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#contribution" rel="noopener noreferrer"&gt;Contribution&lt;/a&gt; •
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#author" rel="noopener noreferrer"&gt;Author&lt;/a&gt; •
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#license" rel="noopener noreferrer"&gt;License&lt;/a&gt; •
    &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#statistics" rel="noopener noreferrer"&gt;Statistics&lt;/a&gt;
  &lt;/p&gt;
  &lt;br&gt;


&lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-about" class="heading-element"&gt;💬 About&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;This repository shows how to integrate the nodemon tool with the VSCode Debugger. For more details, see my &lt;a href="https://dev.to/t4inha/how-to-use-nodemon-with-vscode-debugger-2bpa" rel="nofollow"&gt;https://dev.to/t4inha/how-to-use-nodemon-with-vscode-debugger-2bpa&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-technologies" class="heading-element"&gt; 🛠️ Technologies&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#" rel="noopener noreferrer"&gt;VSCode debugger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial#" rel="noopener noreferrer"&gt;Nodemon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🚀 Distribution&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Here in &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial" rel="noopener noreferrer"&gt;Github&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-contribution" class="heading-element"&gt;🤝 Contribution&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;
  All kinds of contributions are very welcome and appreciated! 
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-author" class="heading-element"&gt;👨‍💻 Author&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/andersonbosa" rel="noopener noreferrer"&gt;@andersonbosa&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-license" class="heading-element"&gt; 📝 License&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;This project is under the MIT &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial./LICENSE.md" rel="noopener noreferrer"&gt;license&lt;/a&gt;.&lt;/p&gt;


  
    &lt;div class="markdown-heading"&gt;
&lt;h2 id="user-content-statistics" class="heading-element"&gt;📊 Statistics &lt;/h2&gt;

&lt;/div&gt;
  
  &lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt; Stargazers &lt;/h4&gt;

&lt;/div&gt;
  &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial/stargazers" rel="noopener noreferrer"&gt;
    &lt;img src="https://camo.githubusercontent.com/e59407ad97c61e7c6d6cd8cf687a9fda44a82c80aa93e4ec910528238f544cbf/68747470733a2f2f7265706f726f737465722e636f6d2f73746172732f616e646572736f6e626f73612f6e6f64656d6f6e2d7673636f64652d7475746f7269616c" alt="Stargazers" title="Stargazers"&gt;
  &lt;/a&gt;
  &lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt; Forkers &lt;/h4&gt;

&lt;/div&gt;
  &lt;a href="https://github.com/andersonbosa/nodemon-vscode-tutorial/network/members" rel="noopener noreferrer"&gt;
    &lt;img src="https://camo.githubusercontent.com/f5357a9acc1ebcd8e2fa03469161e8a012aae69bdd409967e308cd3cb62f3c87/68747470733a2f2f7265706f726f737465722e636f6d2f666f726b732f616e646572736f6e626f73612f6e6f64656d6f6e2d7673636f64652d7475746f7269616c" alt="Forkers" title="Forkers"&gt;
  &lt;/a&gt;





&lt;div class="markdown-heading"&gt;
&lt;h4 class="heading-element"&gt;  
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6bbc839f1cb2860458d2e920dd10e4a50c04216bcae237455ce9a662d9379a4a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616e646572736f6e626f73612f6e6f64656d6f6e2d7673636f64652d7475746f7269616c3f7374796c653d736f6369616c"&gt;&lt;img alt="GitHub Repo stars" src="https://camo.githubusercontent.com/6bbc839f1cb2860458d2e920dd10e4a50c04216bcae237455ce9a662d9379a4a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616e646572736f6e626f73612f6e6f64656d6f6e2d7673636f64652d7475746f7269616c3f7374796c653d736f6369616c"&gt;&lt;/a&gt;
  | Did you like the repository? Give it a star! 😁
&lt;/h4&gt;

&lt;/div&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/andersonbosa/nodemon-vscode-tutorial" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;





&lt;p&gt;Do you know how to integrate other languages with the VSCode Debugger? Please share in the comments! All kinds of contributions are very welcome and appreciated.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
      <category>security</category>
    </item>
    <item>
      <title>O poder por trás do terminal Linux</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Mon, 15 Mar 2021 15:56:53 +0000</pubDate>
      <link>https://dev.to/andersonbosa/o-poder-por-tras-do-terminal-linux-2m63</link>
      <guid>https://dev.to/andersonbosa/o-poder-por-tras-do-terminal-linux-2m63</guid>
      <description>&lt;h4&gt;
  
  
  Choose your preferred language:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;🇧🇷 Brazilian&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;🇺🇸 English&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🇧🇷 Brazilian &lt;a id="brazilianVersion"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Table of contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Introdução&lt;/li&gt;
&lt;li&gt;Comandos básicos&lt;/li&gt;
&lt;li&gt;Comandos que nos ajudam a se ajudar&lt;/li&gt;
&lt;li&gt;Tenha seus próprios snippets&lt;/li&gt;
&lt;li&gt;Prática!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introdução &lt;a id="chapter-bra-1"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Procurar, diferenciar, analisar, compartilhar, descompactar, criptografar um arquivo, acessar computador na nuvem, converter um vídeo em gif e etc. Essas são algumas das coisas possíveis de se fazer com a linha de comando.&lt;/p&gt;

&lt;p&gt;O terminal é uma varinha de condão para interagir com os recursos do computador. Permitindo a interação de maneira prática e flexível, o que a torna uma ferramenta muito poderosa.&lt;/p&gt;

&lt;p&gt;Basicamente em todos os sistemas operacionais (e.g., Windows, Android, Mac and etc) a linha de comando é uma interface de texto para se comunicar com o computador (ou dispositivo).&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%2Fi.giphy.com%2Fmedia%2FtoXKzaJP3WIgM%2Fgiphy.webp" 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%2Fi.giphy.com%2Fmedia%2FtoXKzaJP3WIgM%2Fgiphy.webp" title="likeagod" alt="image" width="490" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Também conhecida como &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;console&lt;/code&gt;, &lt;code&gt;prompt&lt;/code&gt;, &lt;code&gt;terminal&lt;/code&gt; e entre outros nomes, o terminal pode assustar e deixar confuso em um primeiro contato. Como todo novo conhecimento, no início pode haver mais dificuldades. Porém, conforme vencemos essas barreiras vamos nos deparando com a nossa evolução.&lt;/p&gt;

&lt;p&gt;Saber usar o terminal pode ser essencial ao tentar lidar com os problemas que pipocam no dia-a-dia como profissional de TI. Eu li um post outro dia em que o autor disse uma coisa que me coçou:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Se você é um usuário Linux, o Terminal é provavelmente a ferramenta mais poderosa que você já teve. Mas o problema do Terminal é que você precisa aprender a usá-lo se quiser se beneficiar dele. - &lt;a href="https://dev.to/mauro_codes"&gt;Mauro Garcia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt; aí eu: SIMMMMMMMMMM &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%2Fi%2Fxkjs7elno05bdzdrn67i.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%2Fi%2Fxkjs7elno05bdzdrn67i.png" title="SSSIIIIIIIIIMMMMMMMMMMMMMMMMMMMMMMMM" alt="image" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isso me coçou a querer compartilhar um pouco do que aprendi por aí com os meus colegas, e então trouxe para cá também. Saber de algumas dessas coisas fazem diferença no meu dia-a-dia como desenvolvedor de software.&lt;/p&gt;

&lt;p&gt;Espero que possa ajudá-los a se sentirem um pouco mais confortáveis da próxima vez que precisarem abrir o terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mas antes de começarmos... uma dica para não-nativos do inglês:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Pensar em inglês ajuda a assimilar os comandos!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Se você for como eu, não-nativo do inglês, acredito que entenderá melhor o que quero dizer. Vamos entender com um exemplo, o comando &lt;code&gt;pwd&lt;/code&gt; é para &lt;code&gt;Print Working Directory&lt;/code&gt;. O que no meu idioma (braziliano) seria algo como &lt;code&gt;edt&lt;/code&gt; (&lt;code&gt;Escrever o Diretório de Trabalho&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Acho que esse exemplo ajuda a deixar claro que pensar sobre o que você quer fazer em inglês ajuda a assimilar o que está sendo feito. Ajudando a internalizar o que você deseja fazer. Tal como acontece com &lt;code&gt;ls&lt;/code&gt; (list) ou&lt;code&gt;cd&lt;/code&gt; (change directory).&lt;/p&gt;

&lt;h3&gt;
  
  
  Comandos básicos &lt;a id="chapter-bra-2"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Aqui alguns comandos práticos a se saber. Utilizei um comando para descrever eles, veremos a frente qual.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;mv&lt;/strong&gt; - mover (renomear) arquivos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cp&lt;/strong&gt; - copia arquivos e diretórios&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rm&lt;/strong&gt; - remove arquivos ou diretórios&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ls&lt;/strong&gt; - lista o conteúdo do diretório&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pwd&lt;/strong&gt; - imprime o nome do diretório atual / de trabalho&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;mkdir&lt;/strong&gt; - cria diretórios, cria um diretório&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rmdir&lt;/strong&gt; - remove diretórios vazios, exclui um diretório&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cat&lt;/strong&gt; - concatena arquivos e imprime na saída padrão&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tac&lt;/strong&gt; - concatena e imprime arquivos ao contrário&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;more&lt;/strong&gt; - filtro de leitura de arquivo para visualização de crt&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;less&lt;/strong&gt; - oposto de mais&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chown&lt;/strong&gt; - altera o proprietário e o grupo do arquivo, altera a propriedade de um arquivo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chmod&lt;/strong&gt; - altera bits de modo de arquivo, altera as permissões de um arquivo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chattr&lt;/strong&gt; - altera atributos de arquivo em um sistema de arquivos Linux&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;curl&lt;/strong&gt; - transferir um URL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;wget&lt;/strong&gt; - O downloader de rede não interativo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tar&lt;/strong&gt; - um utilitário de arquivamento&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gzip&lt;/strong&gt; - comprime ou expande arquivos, uma espécie de Linux 'WinRar'&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ping&lt;/strong&gt; - envia ICMP ECHO_REQUEST para hosts de rede&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sort&lt;/strong&gt; - classificar linhas de arquivos de texto&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;filter&lt;/strong&gt; - interface de filtro de conversão de arquivo do Cups&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;uniq&lt;/strong&gt; - relatar ou omitir linhas repetidas&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;history&lt;/strong&gt; - Biblioteca de História GNU&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;top&lt;/strong&gt; - exibe processos Linux&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ps&lt;/strong&gt; - relata um instantâneo dos processos atuais.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pkill&lt;/strong&gt; - procura ou sinaliza processos com base no nome e outros atributos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ssh&lt;/strong&gt; - cliente de login remoto OpenSSH&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git&lt;/strong&gt; - controle de versão distribuído&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Todos comandos podem ser concatenados no terminal, é uma questão de saber como fazê-los. O poder de concatenar comandos nos dá um poder incrível com a linha de comando.&lt;/p&gt;

&lt;p&gt;Por exemplo, digamos que queremos encontrar quais comandos estão no histórico, mas existem muitas repetições e informações irrelevantes no momento (como os parâmetros)... Poderiamos fazer unificando 4 comandos na seguinte ordem: &lt;code&gt;history | cut --delimiter=" " -f 4 | sort | uniq&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Ou talvez você queira usar uma imagem como ícone... Você poderia:&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;# 1) baixar a imagem e 2) encodá-la na hora.&lt;/span&gt;
curl https://duckduckgo.com/i/bfc48a09.jpg &lt;span class="nt"&gt;--output&lt;/span&gt; - | &lt;span class="nb"&gt;base64&lt;/span&gt; -
&lt;span class="c"&gt;# agora está pronta para utilizar em uma tag HTML 😎&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Aqui está uma bruxaria preciosa para a próxima vez que sua memória virtual se esgotar:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;xkill&lt;/strong&gt; - matar um cliente por seu recurso X. Basicamente, quando você proclama este comando, a ponta do seu querido mouse se torna a varinha de Alvo Dumbledore, onde quer que você clique (com o botão esquerdo), aquilo onde você clicou, morre 😱.&lt;/li&gt;
&lt;/ul&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%2F5s9wjv4dj0k3d4cierja.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5s9wjv4dj0k3d4cierja.gif" alt="image" width="360" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Comandos que nos ajudam a se ajudar &lt;a id="chapter-bra-3"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;whatis&lt;/strong&gt; - exibir descrições de página de manual de uma linha. Ajuda a identificar a finalidade de qualquer comando em segundos. &lt;strong&gt;Foi este o comando que citei acima.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;which&lt;/strong&gt; - localize um comando.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;whereis&lt;/strong&gt; - localize os arquivos binários, de origem e de página de manual para um comando.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;man&lt;/strong&gt; - o manual do programa. Uma interface para os manuais de referência do sistema. &lt;a href="https://youtu.be/uelA7KRLINA?t=8" rel="noopener noreferrer"&gt;This's the way!&lt;/a&gt; para qualquer coisa. As informações relevantes sobre o programa estarão no manual.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Tente no seu terminal&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;whatis whatis which whereis man
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tenha seus próprios snippets &lt;a id="chapter-bra-4"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Um snippet é uma função criada para servir a um propósito. Em Bash/shellscript nós temos os famosos "one-liners". Recomendo tê-los por dois motivos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Medo: eles obviamente assustam. Uma cadeia de comandos interligados para servir a um propósito? Eu acho incrível e aterrorizante. &lt;del&gt;Sempre que me vejo rodando um penso que se quebrar na metade vai deletar meu sistema todo 😅.&lt;/del&gt; Com isso você vai ficando cautelo-so com o terminal, pois, até um martelo faz mal se não for utilizado da forma correta.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;E novidades: você será exposto a novas soluções e também a novas formas de utilizar o que já conhece.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Vou deixar no roda-pé algumas referências, lugares em que podemos dar uma conferida nesses "one-liners". 😆&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Prática! &lt;a id="chapter-bra-5"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A melhor forma de aprender e assimilar é fazendo. Então vamos coloca em prática o que vimos até agora por meio de alguns exercícios. Para isso vamos utilizar o Capture The Flag &lt;a href="https://overthewire.org/wargames/bandit/" rel="noopener noreferrer"&gt;Bandit&lt;/a&gt; da &lt;a href="https://overthewire.org/wargames" rel="noopener noreferrer"&gt;OverTheWire&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;O &lt;strong&gt;Capture The Flag&lt;/strong&gt; é um estilo de competição que envolve diversas competências para a resolução de desafios relacionados à &lt;code&gt;infosec&lt;/code&gt;, com o objetivo de capturar a bandeira (normalmente um código) e pontuar. No &lt;strong&gt;Bandit&lt;/strong&gt; os níveis do CTF acontecem em uma máquina remota, no qual nos conectaremos pelo terminal através da &lt;a href="https://en.wikipedia.org/wiki/SSH_(Secure_Shell)" rel="noopener noreferrer"&gt;ssh&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;O &lt;strong&gt;Bandit&lt;/strong&gt; nos ajudará a colocar em prática e lapidar nossas habilidades com o Terminal. Daqui em diante, é com vocês. Boa sorte!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://overthewire.org/wargames/bandit/" rel="noopener noreferrer"&gt;#Partiu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Feedbacks 💙
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Faltou alguma coisa, ou estava errada, ou você tem alguma sugestão? Por favor, me deixe saber suas opiniões! &lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  One-liners
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;⭐ &lt;a href="https://linuxcommandlibrary.com/" rel="noopener noreferrer"&gt;https://linuxcommandlibrary.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;a href="http://www.bashoneliners.com/" rel="noopener noreferrer"&gt;http://www.bashoneliners.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://catonmat.net/top-ten-one-liners-from-commandlinefu-explained" rel="noopener noreferrer"&gt;https://catonmat.net/top-ten-one-liners-from-commandlinefu-explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.stefanjudis.com/notes/1025-shell-command-one-liners-on-one-page/" rel="noopener noreferrer"&gt;https://www.stefanjudis.com/notes/1025-shell-command-one-liners-on-one-page/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rosettacode.org/wiki/Shell_one-liner" rel="noopener noreferrer"&gt;https://rosettacode.org/wiki/Shell_one-liner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Credits, fonts and articles:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/maurogarcia_19/linux-terminal-the-ultimate-cheat-sheet-2g5b"&gt;https://dev.to/maurogarcia_19/linux-terminal-the-ultimate-cheat-sheet-2g5b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ubuntu.com/tutorials/command-line-for-beginners#1-overview" rel="noopener noreferrer"&gt;https://ubuntu.com/tutorials/command-line-for-beginners#1-overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/" rel="noopener noreferrer"&gt;https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ctf-br.org/sobre/" rel="noopener noreferrer"&gt;https://ctf-br.org/sobre/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Dash" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Dash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Bash" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Bash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Command-line_shell" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Command-line_shell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Bourne_shell" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Bourne_shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
      <category>overthewire</category>
    </item>
    <item>
      <title>The Power Behind The Linux Terminal</title>
      <dc:creator>Anderson Bosa</dc:creator>
      <pubDate>Mon, 15 Mar 2021 15:45:28 +0000</pubDate>
      <link>https://dev.to/andersonbosa/the-power-behind-the-linux-terminal-189h</link>
      <guid>https://dev.to/andersonbosa/the-power-behind-the-linux-terminal-189h</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/andersonbosa/o-poder-por-tras-do-terminal-linux-2m63"&gt;🇧🇷 Brazilian Version&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Table of contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Basic commands&lt;/li&gt;
&lt;li&gt;Commands that help us help each other&lt;/li&gt;
&lt;li&gt;Have your own Snippets&lt;/li&gt;
&lt;li&gt;Practice!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introduction &lt;a id="chapter-eng-1"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Search, differentiate, analyze, share, unzip, encrypt a file, access a cloud computer, convert a video to gif, etc. These are some of the possible things to do with the command line.&lt;/p&gt;

&lt;p&gt;The terminal is a magic wand to interact with the computer's resources. Allowing interaction practically and flexibly, which makes it a very powerful tool.&lt;/p&gt;

&lt;p&gt;Basically on all operating systems (e.g., Windows, Android, Mac and etc.), the command line is a text interface to communicate with the computer (or device).&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%2Fi.giphy.com%2Fmedia%2FtoXKzaJP3WIgM%2Fgiphy.webp" 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%2Fi.giphy.com%2Fmedia%2FtoXKzaJP3WIgM%2Fgiphy.webp" title="likeagod" alt="image" width="490" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also known as &lt;code&gt;shell&lt;/code&gt;,&lt;code&gt;console&lt;/code&gt;, &lt;code&gt;prompt&lt;/code&gt;, and among other names, the terminal can be frightening and confusing at first contact. Like all new knowledge, in the beginning, there may be more difficulties. However, as we overcome these barriers, we are faced with our evolution.&lt;/p&gt;

&lt;p&gt;Knowing how to use the terminal can be essential when trying to deal with the problems that pop up daily as an IT professional. I read a post the other day when the author said something that itched me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are a Linux user, Terminal is probably the most powerful tool you have ever had. But the problem with Terminal is that you need to learn how to use it if you want to benefit from it. - &lt;a href="https://dev.to/mauro_codes"&gt;Mauro Garcia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt; me: YYEESSSS &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%2Fi%2Fxkjs7elno05bdzdrn67i.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%2Fi%2Fxkjs7elno05bdzdrn67i.png" title="YEEEEESSSSSSSSS" alt="image" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It scratched me to want to share a little of what I learned out there with my colleagues. And then I brought it here too. Knowing some of these things makes a difference in my day-to-day life as a software developer.&lt;/p&gt;

&lt;p&gt;I hope I can help you feel a little more comfortable the next time you need to open the terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  But before we start ... a tip for non-native speakers of English:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Thinking in English helps to assimilate the commands!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are like me, non-native English, I believe you will understand better what I mean.&lt;/p&gt;

&lt;p&gt;Let's understand with an example, the command &lt;code&gt;pwd&lt;/code&gt; is for &lt;code&gt;Print Working Directory&lt;/code&gt;. What in my language (Brazilian*) would be something like &lt;code&gt;edt&lt;/code&gt; (&lt;code&gt;Write the Working Directory&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;I think this example helps to make it clear that thinking about what you want to do in English helps to assimilate what is being done. Helping to internalize what you want to do. As with &lt;code&gt;ls&lt;/code&gt; (list) or &lt;code&gt;cd&lt;/code&gt; (change directory).&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic commands &lt;a id="chapter-eng-2"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Here are some practical commands to know. I used a command to describe them, we'll see which one is ahead.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;mv&lt;/strong&gt; - move (rename) files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cp&lt;/strong&gt; - copy files and directories&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rm&lt;/strong&gt; - remove files or directories&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ls&lt;/strong&gt; - list directory contents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pwd&lt;/strong&gt; - print name of current/working directory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;mkdir&lt;/strong&gt; - make directories, create a directory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rmdir&lt;/strong&gt; - remove empty directories, delete a directory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cat&lt;/strong&gt; - concatenate files and print on the standard output&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tac&lt;/strong&gt; - concatenate and print files in reverse&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;more&lt;/strong&gt; - filter for paging through text one screenful at a time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;less&lt;/strong&gt; - opposite of &lt;code&gt;more&lt;/code&gt;. allows backward movement in the file as well as forward movement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chown&lt;/strong&gt; - change file owner and group, change ownership of a file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chmod&lt;/strong&gt; - change file mode bits, change permissions of a file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;chattr&lt;/strong&gt; - change file attributes on a Linux file system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;curl&lt;/strong&gt; - transfer a URL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;wget&lt;/strong&gt; - The non-interactive network downloader.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tar&lt;/strong&gt; - an archiving utility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gzip&lt;/strong&gt; - compress or expand files, sort of Linux 'WinRar'&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ping&lt;/strong&gt; - send ICMP ECHO_REQUEST to network hosts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sort&lt;/strong&gt; - sort lines of text files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;filter&lt;/strong&gt; - cups file conversion filter interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;uniq&lt;/strong&gt; - report or omit repeated lines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;history&lt;/strong&gt; - GNU History Library&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;top&lt;/strong&gt; - display Linux processes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ps&lt;/strong&gt; - report a snapshot of the current processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pkill&lt;/strong&gt; - look up or signal processes based on name and other attributes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ssh&lt;/strong&gt; - OpenSSH remote login client&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git&lt;/strong&gt; - the stupid content tracker&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All commands can be concatenated in the terminal, it is a matter of knowing how to do them. The power to concatenate commands gives us incredible power with the command line.&lt;/p&gt;

&lt;p&gt;For example, let's say we want to find which commands are in the history, but there are a lot of repetitions and irrelevant information at the moment (like the parameters) ... We could do it by unifying 4 commands in the following order: &lt;code&gt;history | cut --delimiter=" " -f 4 | sort | uniq&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Or maybe you want to use an image as an icon ... You could:&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;# 1) download the image and 2) encode it on the fly.&lt;/span&gt;
curl https://duckduckgo.com/i/bfc48a09.jpg &lt;span class="nt"&gt;--output&lt;/span&gt; - | &lt;span class="nb"&gt;base64&lt;/span&gt; -
&lt;span class="c"&gt;# is now ready to use in an HTML tag 😎&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Here is precious witchcraft for the next time your virtual memory runs out:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;xkill&lt;/strong&gt; - kill a client by its X resource. Basically when you proclaim this command the point of your mouse will become Alvo Dumbledore's wand. Wherever you (left) click, the thing where you clicked dies.&lt;/li&gt;
&lt;/ul&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%2F5s9wjv4dj0k3d4cierja.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5s9wjv4dj0k3d4cierja.gif" alt="image" width="360" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Commands that help us help each other &lt;a id="chapter-eng-3"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;whatis&lt;/strong&gt; - display one-line manual page descriptions. It helps to identify the purpose of any command in seconds. &lt;strong&gt;This was the command I mentioned above.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;which&lt;/strong&gt; - locate a command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;whereis&lt;/strong&gt; - locate the binary, source, and manual page files for a command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;man&lt;/strong&gt; - the program manual. An interface to the system reference manuals.
&lt;a href="https://youtu.be/uelA7KRLINA?t=8" rel="noopener noreferrer"&gt;This is the way&lt;/a&gt; to anything. The relevant information about the program will be in the manual.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Try on your terminal&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;whatis whatis which whereis man
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Have your own Snippets &lt;a id="chapter-eng-4"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A snippet is a function designed to serve a purpose. In Bash / shellscript we have the famous "one-liners". I recommend having them for two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Fear: they obviously scare. A chain of interconnected commands to serve a purpose? I find it incredible and terrifying. ~~ Whenever I find myself running a I think that if it breaks in half it will delete my entire system 😅. ~~ With that you will be cautious with the terminal because even a hammer is bad if it is not used correctly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And news: you will be exposed to new solutions and also to new ways of using what you already know.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;I will leave some references on the wheel, places where we can check out these "one-liners". 😆&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Practice! &lt;a id="chapter-eng-5"&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The best way to learn and assimilate is by doing. So let's put into practice what we've seen so far through some exercises. For this we will use Capture The Flag &lt;a href="https://overthewire.org/wargames/bandit/" rel="noopener noreferrer"&gt;Bandit&lt;/a&gt; from &lt;a href="https://overthewire.org/wargames" rel="noopener noreferrer"&gt;OverTheWire&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Capture The Flag&lt;/strong&gt; is a style of competition that involves several skills to solve challenges related to &lt;code&gt;infosec&lt;/code&gt;, to capture the flag (usually a code), and scoring. In &lt;strong&gt;Bandit&lt;/strong&gt; the CTF levels take place on a remote machine, where we will connect via the terminal via &lt;a href="https://en.wikipedia.org/wiki/SSH_(Secure_Shell)" rel="noopener noreferrer"&gt;ssh&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bandit&lt;/strong&gt; will help us to put into practice and polish our skills with the Terminal. From here on, it's up to you. Good luck!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://overthewire.org/wargames/bandit/" rel="noopener noreferrer"&gt;#Start here!&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Feedbacks 💙
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Was something missing, or was it wrong, or do you have any suggestions? Please let me know your opinions!&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  One-liners
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;⭐ &lt;a href="https://linuxcommandlibrary.com/" rel="noopener noreferrer"&gt;https://linuxcommandlibrary.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;a href="http://www.bashoneliners.com/" rel="noopener noreferrer"&gt;http://www.bashoneliners.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://catonmat.net/top-ten-one-liners-from-commandlinefu-explained" rel="noopener noreferrer"&gt;https://catonmat.net/top-ten-one-liners-from-commandlinefu-explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.stefanjudis.com/notes/1025-shell-command-one-liners-on-one-page/" rel="noopener noreferrer"&gt;https://www.stefanjudis.com/notes/1025-shell-command-one-liners-on-one-page/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rosettacode.org/wiki/Shell_one-liner" rel="noopener noreferrer"&gt;https://rosettacode.org/wiki/Shell_one-liner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Credits, fonts and articles:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/maurogarcia_19/linux-terminal-the-ultimate-cheat-sheet-2g5b"&gt;https://dev.to/maurogarcia_19/linux-terminal-the-ultimate-cheat-sheet-2g5b&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ubuntu.com/tutorials/command-line-for-beginners#1-overview" rel="noopener noreferrer"&gt;https://ubuntu.com/tutorials/command-line-for-beginners#1-overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/" rel="noopener noreferrer"&gt;https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ctf-br.org/sobre/" rel="noopener noreferrer"&gt;https://ctf-br.org/sobre/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Dash" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Dash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Bash" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Bash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Command-line_shell" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/index.php/Command-line_shell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Bourne_shell" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Bourne_shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
      <category>overthewire</category>
    </item>
  </channel>
</rss>
