<?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: Gustavo Novaro</title>
    <description>The latest articles on DEV Community by Gustavo Novaro (@gtavodev).</description>
    <link>https://dev.to/gtavodev</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%2F1256613%2F9ded6f28-0c66-45f2-aebf-2c1161ee1351.jpeg</url>
      <title>DEV Community: Gustavo Novaro</title>
      <link>https://dev.to/gtavodev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gtavodev"/>
    <language>en</language>
    <item>
      <title>The Importance of Including a Static Analyzer in Your Code</title>
      <dc:creator>Gustavo Novaro</dc:creator>
      <pubDate>Thu, 04 Apr 2024 14:04:30 +0000</pubDate>
      <link>https://dev.to/gtavodev/the-importance-of-including-a-static-analyzer-in-your-code-20j1</link>
      <guid>https://dev.to/gtavodev/the-importance-of-including-a-static-analyzer-in-your-code-20j1</guid>
      <description>&lt;p&gt;In software development, code quality is a critical factor for project success. That's why more and more development teams are turning to static analysis tools to ensure their code meets quality standards and is more maintainable in the long run. Two popular tools for this purpose are SonarQube and &lt;a href="https://phpstan.org/"&gt;PhpStan&lt;/a&gt;, although there are also important options for Python, such as &lt;a href="https://flake8.pycqa.org/en/latest/"&gt;Flake8&lt;/a&gt; and &lt;a href="https://pypi.org/project/pylint/"&gt;PyLint&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Static Analyzer?
&lt;/h2&gt;

&lt;p&gt;A static analyzer is a tool that examines source code without the need to execute it. It uses a set of predefined rules to detect potential errors, vulnerabilities, bad practices, and opportunities for improvement in the code. By identifying these issues early in the development cycle, static analyzers help prevent costly errors and improve overall code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  SonarQube: Comprehensive Analysis
&lt;/h2&gt;

&lt;p&gt;SonarQube is an open-source platform that provides comprehensive code analysis across multiple programming languages. It uses a variety of metrics to assess code quality, including cyclomatic complexity, code duplication, test coverage, and compliance with coding standards. Additionally, SonarQube offers detailed reports and recommendations for code improvement, making it easier to identify and address issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  PhpStan: Specific Analysis for PHP
&lt;/h2&gt;

&lt;p&gt;For projects developed in PHP, PhpStan is an invaluable tool. PhpStan performs static analysis of PHP code to identify potential type errors, undefined variable usage, calls to non-existent methods, and other common pitfalls. By providing accurate insights into the health of PHP code, PhpStan helps developers write more robust and secure code.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Static Analyzers for Python
&lt;/h2&gt;

&lt;p&gt;In the Python ecosystem, there are several popular static analysis tools. Flake8 combines multiple tools (including PyFlakes, pycodestyle, and McCabe) to offer comprehensive analysis of Python code, focusing on readability and style. On the other hand, PyLint is a highly configurable tool that detects programming errors, style conventions, and other potential issues in Python code.&lt;/p&gt;

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

&lt;p&gt;Integrating a static analyzer like &lt;strong&gt;SonarQube&lt;/strong&gt;, &lt;strong&gt;PhpStan&lt;/strong&gt;, &lt;strong&gt;Flake8&lt;/strong&gt;, or &lt;strong&gt;PyLint&lt;/strong&gt; into your software development process can have a significant impact on the quality and maintainability of your code. These tools provide immediate feedback on potential code issues, allowing teams to address errors before they become major problems. Ultimately, investing in static analysis is a fundamental practice for ensuring the quality and reliability of the software we develop.&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>php</category>
      <category>python</category>
      <category>testing</category>
    </item>
    <item>
      <title>How to setup your own ChatGPT with OpenLLaMA</title>
      <dc:creator>Gustavo Novaro</dc:creator>
      <pubDate>Mon, 04 Mar 2024 12:35:24 +0000</pubDate>
      <link>https://dev.to/gtavodev/how-to-setup-your-own-chatgpt-with-openllama-158b</link>
      <guid>https://dev.to/gtavodev/how-to-setup-your-own-chatgpt-with-openllama-158b</guid>
      <description>&lt;p&gt;Do you want to have your own &lt;strong&gt;ChatGPT&lt;/strong&gt;? Do you care about privacy? You don't want to pay for the premium version? or you want to use uncensored models. Or even train a model with your company documents.&lt;/p&gt;

&lt;p&gt;For these reasons it is a good idea to set up your own &lt;strong&gt;LLM&lt;/strong&gt; model server.&lt;/p&gt;

&lt;p&gt;This is an example:&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%2Fbik4m5rf7cic1y252ahy.jpg" 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%2Fbik4m5rf7cic1y252ahy.jpg" alt="Image description" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is OpenLLaMA?&lt;br&gt;
LLama 2 is an LLM  (Large Language Model Meta AI)&lt;br&gt;
&lt;a href="https://llama.meta.com/" rel="noopener noreferrer"&gt;LLama Meta&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do we need?&lt;/p&gt;
&lt;h2&gt;
  
  
  Install &lt;strong&gt;OpenLLAMA&lt;/strong&gt;, &lt;strong&gt;OpenWebUI&lt;/strong&gt; and Docker
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Installing Ollama
&lt;/h2&gt;

&lt;p&gt;Ollama have support for Windows, Linux and Mac&lt;br&gt;
I recommend minimum 16Gb of RAM.&lt;br&gt;
&lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;https://ollama.com/download&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For linux setup&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Download models
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull llama2-uncensored
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run model
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama run llama2-uncensored
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Open Web UI
&lt;/h2&gt;

&lt;p&gt;Before install OpenWebUI we need to have installed Docker and running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--network&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;host &lt;span class="nt"&gt;-v&lt;/span&gt; open-webui:/app/backend/data &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;OLLAMA_API_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:11434/api &lt;span class="nt"&gt;--name&lt;/span&gt; open-webui &lt;span class="nt"&gt;--restart&lt;/span&gt; always ghcr.io/open-webui/open-webui:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:8080 &lt;span class="nt"&gt;-v&lt;/span&gt; ollama:/root/.ollama &lt;span class="nt"&gt;-v&lt;/span&gt; open-webui:/app/backend/data &lt;span class="nt"&gt;--name&lt;/span&gt; open-webui &lt;span class="nt"&gt;--restart&lt;/span&gt; always ghcr.io/open-webui/open-webui:ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ia</category>
      <category>llm</category>
      <category>chatgpt</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Beyond UUIDs: The Rise of ULIDs for Enhanced Sorting and Efficiency</title>
      <dc:creator>Gustavo Novaro</dc:creator>
      <pubDate>Wed, 17 Jan 2024 16:44:29 +0000</pubDate>
      <link>https://dev.to/gtavodev/beyond-uuids-the-rise-of-ulids-for-enhanced-sorting-and-efficiency-3pl9</link>
      <guid>https://dev.to/gtavodev/beyond-uuids-the-rise-of-ulids-for-enhanced-sorting-and-efficiency-3pl9</guid>
      <description>&lt;p&gt;In the contemporary digital landscape, the efficient generation of unique identifiers is crucial, particularly in distributed systems where traditional databases with auto-incrementing keys show their limitations. ULIDs (Universally Unique Lexicographically Sortable Identifiers) shine here, offering a robust and efficient solution.&lt;/p&gt;

&lt;p&gt;ULIDs provide a 128-bit structure, split into a 48-bit timestamp recording time in milliseconds and an 80-bit randomness portion. This combination ensures uniqueness and lexicographic sorting, facilitating indexing and data retrieval.&lt;/p&gt;

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

&lt;p&gt;ulid() // 01ARZ3NDEKTSV4RRFFQ69G5FAV&lt;/p&gt;

&lt;p&gt;ULID generates 2 parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Timestamp: int of 48 bits with UNIX timestamp in milliseconds&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Random: Random string of 80 bits&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

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

&lt;p&gt;ULIDs outperform traditional UUIDs in systems where write efficiency and sortability are critical. Their design makes them ideal for modern applications requiring scalability and peak performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ulid/spec"&gt;ULID specification&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For implementations and practical examples, the developer community offers a variety of libraries across different programming languages, ensuring that ULIDs can be seamlessly integrated into any new or existing project.&lt;/p&gt;

</description>
      <category>uuid</category>
      <category>database</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Install k9s in Debian / Ubuntu</title>
      <dc:creator>Gustavo Novaro</dc:creator>
      <pubDate>Sun, 14 Jan 2024 20:42:59 +0000</pubDate>
      <link>https://dev.to/gtavodev/install-k9s-in-debian-ubuntu-4hco</link>
      <guid>https://dev.to/gtavodev/install-k9s-in-debian-ubuntu-4hco</guid>
      <description>&lt;p&gt;If you don't know K9s, it is a &lt;strong&gt;Kubernetes CLI manager&lt;/strong&gt;, one of my favorite tools to use from the console.&lt;/p&gt;

&lt;p&gt;This is an example screenshot.&lt;/p&gt;

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

&lt;p&gt;To install it from Ubuntu, it is best to &lt;strong&gt;download&lt;/strong&gt; the .deb binary from the &lt;a href="https://github.com/derailed/k9s/releases"&gt;releases page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or with &lt;strong&gt;wget&lt;/strong&gt; from the console like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://github.com/derailed/k9s/releases/download/v0.31.5/k9s_linux_amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For setup run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; k9s_linux_amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>linux</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
