<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-03-05T13:52:14+00:00</updated><id>/feed.xml</id><title type="html">Blog++</title><subtitle>My Blog in Jekyll</subtitle><author><name>Blog++</name><email>marco@marcomonteiro.net</email></author><entry><title type="html">Leaving all mozilla projects</title><link href="/post/leaving-all-mozilla-projects/" rel="alternate" type="text/html" title="Leaving all mozilla projects" /><published>2025-03-05T00:00:00+00:00</published><updated>2025-03-05T00:00:00+00:00</updated><id>/post/leaving-all-mozilla-projects</id><content type="html" xml:base="/post/leaving-all-mozilla-projects/"><![CDATA[<p>Recently, Mozilla introduced new terms of service for Firefox, which has sparked significant controversy within the tech community. The changes not only introduce new data usage permissions but also allow Mozilla to update these terms without explicit consent from users. After years of giving Mozilla the benefit of the doubt, this latest move feels like the final straw. This blog post delves into what has changed, why it matters, and the broader implications for Firefox users.</p>

<!--more-->

<p><strong>What Changed in Firefox’s Terms of Service?</strong></p>

<p>On February 28th, Mozilla added terms of service to Firefox for the first time. Previously, the browser operated without formal terms, which in itself is unusual for a modern software product. The new terms grant Mozilla a non-exclusive, royalty-free, worldwide license to use any content you input into the browser. While Mozilla claims this is necessary for basic functionality—such as processing search queries and managing bookmarks—the vague wording of these terms raises concerns about the potential scope of data collection.</p>

<p><strong>Why These Changes Are Concerning</strong></p>

<p>Unlimited Data Access: The broad language in the new terms potentially gives Firefox access to everything you type and upload through the browser. This includes any content you interact with on websites or services accessed via Firefox.</p>

<p>Automatic Acceptance of Updates: Mozilla can update these terms at any time without requiring explicit re-acceptance from users. Continued use of Firefox is taken as acceptance of any changes, which could lead to situations where users are unknowingly agreeing to new data practices.</p>

<p>Termination Rights: Mozilla now reserves the right to terminate anyone’s access to Firefox “for any reason.” While it is unclear how they would enforce this, it introduces a restrictive clause not typical for open-source software.</p>

<p><strong>The AI Connection: Why Mozilla Might Be After Your Data</strong></p>

<p>Mozilla has expressed interest in developing open-source AI tools. AI requires large datasets to train on, and browsing data could be a valuable resource. The concern is that Mozilla might be setting the groundwork to either develop its own AI or sell data to third-party AI companies, potentially turning Firefox into a data collection tool.</p>

<p><strong>A History of Questionable Moves by Mozilla</strong></p>

<p>This isn’t the first time Mozilla’s actions have raised eyebrows:</p>

<ul>
  <li><i class="icon-angle-right"></i> Executive Raises Amid Decline: In 2023, the CEO received a 23% raise despite Firefox’s declining market share.</li>
  <li><i class="icon-angle-right"></i> Privacy-Preserving Attribution: Mozilla previously pushed ad-tech features into Firefox without informing users.</li>
  <li><i class="icon-angle-right"></i> Mr. Robot Extension Incident: Mozilla installed a “Mr. Robot” tie-in extension on Firefox without user consent, causing backlash.</li>
</ul>

<p><strong>Conclusion: Time to Move On from Firefox?</strong></p>

<p>Given the new terms of service, the unclear motivations behind them, and Mozilla’s track record of questionable decisions, it might be time to consider alternatives. Browsers like LibreWolf, Mullvad, Waterfox, and others offer similar functionality without the baggage. If Mozilla’s direction continues down this path, even a switch to Chromium-based browsers might be a safer bet for privacy-conscious users.</p>]]></content><author><name>Marco Monteiro</name></author><category term="Mozilla" /><category term="Firefox" /><category term="open-source" /><category term="mozilla, firefox, opensource" /><summary type="html"><![CDATA[Mozilla introduced new terms of service for Firefox, which has sparked significant controversy within the tech community]]></summary></entry><entry><title type="html">Artificial Intelligence in the EU what changed in February 2025</title><link href="/post/artificial-intelligence-in-the-EU-what-changed-in-february-2025/" rel="alternate" type="text/html" title="Artificial Intelligence in the EU what changed in February 2025" /><published>2025-02-28T00:00:00+00:00</published><updated>2025-02-28T00:00:00+00:00</updated><id>/post/artificial-intelligence-in-the-EU-what-changed-in-february-2025</id><content type="html" xml:base="/post/artificial-intelligence-in-the-EU-what-changed-in-february-2025/"><![CDATA[<p>The European Union’s Artificial Intelligence (AI) regulation is advancing towards a safer and more transparent future, strengthening the protection of fundamental rights. As of February 2, 2025, new rules have come into effect to ensure AI is used ethically and in compliance with human rights. These changes mark a significant step in balancing innovation with responsibility, setting a precedent for global AI governance.</p>

<!--more-->

<h3 id="key-changes">Key Changes:</h3>

<h3 id="prohibition-of-abusive-practices"><strong>Prohibition of Abusive Practices</strong></h3>
<p>One of the most notable aspects of the new AI regulation is the explicit prohibition of certain AI applications that pose ethical and privacy risks. The following practices are now banned:</p>

<ul>
  <li><i class="icon-angle-right"></i> <strong>Emotional monitoring in the workplace</strong>: Employers can no longer use AI-driven sentiment analysis tools to assess employee emotions through facial expressions or voice patterns.</li>
  <li><i class="icon-angle-right"></i> <strong>Psychological manipulation of online users</strong>: AI-powered algorithms designed to exploit user behavior or decision-making vulnerabilities for profit are now restricted.</li>
  <li><i class="icon-angle-right"></i> <strong>Social scoring systems based on irrelevant data</strong>: Systems that rank individuals based on behavioral predictions unrelated to legal or economic activities are forbidden.</li>
  <li><i class="icon-angle-right"></i> <strong>AI-based prediction of criminal behavior without solid justification</strong>: The use of AI in predictive policing must be evidence-based, ensuring that technology does not reinforce biases or lead to unfair profiling.</li>
  <li><i class="icon-angle-right"></i> <strong>Facial recognition in public spaces without explicit authorization</strong>: The use of AI-powered biometric identification in public environments is only permitted under strict legal frameworks and oversight.</li>
</ul>

<h3 id="encouraging-innovation"><strong>Encouraging Innovation</strong></h3>

<p>While imposing necessary restrictions, the EU is also keen on fostering AI advancements. The regulation includes measures to reduce bureaucratic obstacles for startups and companies investing in ethical AI development. Some initiatives include:</p>
<ul>
  <li><i class="icon-angle-right"></i>  <strong>AI sandboxes</strong>: Controlled environments where businesses can test AI solutions without immediate regulatory barriers.</li>
  <li><i class="icon-angle-right"></i> <strong>Funding and grants</strong>: Financial incentives for companies that prioritize transparency, fairness, and security in AI design.</li>
  <li><i class="icon-angle-right"></i> <strong>Harmonization of compliance frameworks</strong>: Reducing fragmentation by aligning AI regulations across EU member states to create a more predictable investment environment.</li>
</ul>

<h3 id="consequences-for-businesses"><strong>Consequences for Businesses</strong></h3>

<p>Non-compliance with the AI Act carries severe penalties, with fines reaching up to <strong>7% of global revenue</strong> for serious violations. Companies operating within the EU must implement robust risk assessment and mitigation strategies to:</p>
<ul>
  <li><i class="icon-angle-right"></i> Ensure AI models are <strong>transparent</strong> and explainable.</li>
  <li><i class="icon-angle-right"></i> Maintain <strong>human oversight</strong> over high-risk AI applications.</li>
  <li><i class="icon-angle-right"></i> Develop <strong>bias-detection</strong> mechanisms to prevent discriminatory outcomes.</li>
</ul>

<p>The regulation also requires companies to document and report AI model decisions to facilitate regulatory audits and ensure accountability.</p>

<h3 id="global-impact-and-future-trends"><strong>Global Impact and Future Trends</strong></h3>

<p>The EU AI Act is expected to influence AI governance worldwide. Other jurisdictions, including the United States, Canada, and Japan, are closely monitoring its impact, potentially adopting similar regulatory measures. Additionally, discussions are ongoing to establish <strong>international AI ethics standards</strong> to ensure a harmonized approach to responsible AI deployment.</p>

<p>This new framework demonstrates that AI can be both innovative and ethical. As professionals, it is essential that we stay up to date with these developments and ensure that AI solutions remain transparent and responsible.</p>]]></content><author><name>Marco Monteiro</name></author><category term="AI" /><category term="AIRegulation" /><category term="ArtificialIntelligence, AIRegulation, Innovation, ResponsibleTechnology, Europe, DigitalTransformation" /><summary type="html"><![CDATA[As of February 2, 2025, new rules have come into effect to ensure AI is used ethically and in compliance with human rights.]]></summary></entry><entry><title type="html">Array spreading and destructuring in PHP</title><link href="/post/array-spreading-and-destructuring-in-PHP/" rel="alternate" type="text/html" title="Array spreading and destructuring in PHP" /><published>2025-01-28T00:00:00+00:00</published><updated>2025-01-28T00:00:00+00:00</updated><id>/post/array-spreading-and-destructuring-in-PHP</id><content type="html" xml:base="/post/array-spreading-and-destructuring-in-PHP/"><![CDATA[<p>PHP 7.4 introduced array spreading and destructuring, powerful features that simplify how we work with arrays. Let’s explore how to use these modern PHP features to write cleaner, more maintainable code.</p>

<!--more-->

<p>This is a simple example on how people tend to use arrays in their projects.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$person = [
    'name' =&gt; 'John Doe',
    'age' =&gt; 30,
    'email' =&gt; 'john.doe@example.com',
];

$name = $person['name'];
$age = $person['age'];
$email = $person['email'];
</code></pre></div></div>

<p>This works, but it’s not the best way to do it. We can use array spreading and destructuring to make this code more readable and maintainable.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[
    'name' =&gt; $name,
    'age' =&gt; $age,
    'email' =&gt; $email,
] = $person;
</code></pre></div></div>

<p>This will assign the values of the array to the variables. This is a very simple example, but it can be used in more complex scenarios.</p>

<p>Let’s see a more complex example and how you maybe doing it at the moment and how you can improve it using array spreading and destructuring.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function hello($name, $age, $email) {
    return "Hello, my name is $name and I'm $age years old. My email is $email.";
}

$person = [
    'name' =&gt; 'John Doe',
    'age' =&gt; 30,
    'email' =&gt; 'john.doe@example.com',
];

echo hello($person['name'], $person['age'], $person['email']);
</code></pre></div></div>

<p>This will work, but it’s not the best way to do it. We can use array spreading and destructuring to make this code more readable and maintainable.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo hello(...$person);
</code></pre></div></div>

<p>This will pass the values of the array as arguments to the function.</p>

<p>Very cool, right?</p>

<p>One other thing I like to do is maybe add some conditions to the array spreading and destructuring. Let’s imagine I want to add some elements to the array, but only if the user has a specific role.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$person = [
    'name' =&gt; 'John Doe',
    'age' =&gt; 30,
    'email' =&gt; 'john.doe@example.com',
    ...$user-&gt;role === 'admin' ? [
        'permissions' =&gt; ['create', 'read', 'update', 'delete']
    ] : [],
];
</code></pre></div></div>

<p>This will add the permissions to the array if the user has the role of admin.</p>

<p>These are just a few examples of how you can use array spreading and destructuring in PHP. I hope you found this useful and that you will start using these features in your projects.</p>]]></content><author><name>Marco Monteiro</name></author><category term="php" /><category term="modern-php" /><category term="webdev, php, modern-php" /><summary type="html"><![CDATA[How to properly use array spreading and destructuring in PHP.]]></summary></entry><entry><title type="html">I identify as a never nester</title><link href="/post/I-identify-as-a-never-nester/" rel="alternate" type="text/html" title="I identify as a never nester" /><published>2022-12-22T00:00:00+00:00</published><updated>2022-12-22T00:00:00+00:00</updated><id>/post/I-identify-as-a-never-nester</id><content type="html" xml:base="/post/I-identify-as-a-never-nester/"><![CDATA[<p>It is not uncommon for programmers to use indentation to organize and structure their code. This practice, known as “nesting,” helps to visually group related code blocks and make the overall structure of the code more clear and easy to understand. However I’ve started to addopt something called never nesting. So what is never nesting?</p>

<!--more-->

<p>Here’s an example of some PHP code with some levels of nesting in it. To be precise it has 4 levels of nesting.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function calculateSum($numbers) {
  $sum = 0;
  if (is_array($numbers)) {
    foreach ($numbers as $number) {
      if (is_numeric($number)) {
        $sum += $number;
      } else {
        throw new Exception("Error: Non-numeric value found in array.");
      }
    }
  } else {
    throw new Exception("Error: Input is not an array.");
  }
  return $sum;
}
</code></pre></div></div>

<p>This function takes an array of numbers as input and calculates the sum of all the numeric values in the array. It has three levels of nesting:</p>

<p>1 The outermost level is the calculateSum function itself.</p>

<p>2 The second level is the if statement that checks whether the input is an array.</p>

<p>3 The third level is the foreach loop that iterates over each element in the array.</p>

<p>4 The fourth level is the if statement inside the loop that checks whether each element is a numeric value.</p>

<p>Each level of nesting is indented to make the structure of the code more clear and easy to follow. <strong>Or is it?</strong></p>

<p>Basically with a <strong>never nesting</strong> concept everything that goes beond 3 levels should not exist. We basically have two ways of achieving this, we can use <strong>Extraction</strong> or <strong>Inversion</strong>.</p>

<h1 id="extraction-method">Extraction method</h1>

<p>With the extraction method basically we should create new functions to remove some the nesting. So with the same code we can do the following.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function calculateSum($numbers) {
  $sum = 0;
  if (is_array($numbers)) {
    foreach ($numbers as $number) {
      $sum += isValidNumberSum($number);
    }
  } else {
    throw new Exception("Error: Input is not an array.");
  }
  return $sum;
}

function isValidNumberSum($input) {
  if (is_numeric($input)) {
    return $input;
  } else {
    throw new Exception("Error: Non-numeric value found in array.");
  }
}
</code></pre></div></div>

<p>The isValidNumber function is a now a new function that encapsulates the is_numeric check. It returns true if the input is a numeric value, and throws an exception if it is not.</p>

<p>You now have an extra function that can be used in other contexts and better yet, your initial function only goes 3 levels deep nesting.</p>

<h1 id="inversion">Inversion</h1>

<p>To rewrite the calculateSum function using an “inversion of control” concept, where it focuses on failure cases first and then the actual use of the function, we can use the following approach:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function calculateSum($numbers) {
  if (!is_array($numbers)) {
    throw new Exception("Error: Input is not an array.");
  }
  $sum = 0;
  foreach ($numbers as $number) {
    if (!is_numeric($number)) {
      throw new Exception("Error: Non-numeric value found in array.");
    }
    $sum += $number;
  }
  return $sum;
}
</code></pre></div></div>

<p>n this version of the function, the first thing we do is check whether the input is an array. If it is not, we throw an exception. This is an example of “failing fast,” as we are immediately handling and reporting an error condition rather than continuing to process the input.</p>

<p>Then, we iterate over each element in the array and check whether it is a numeric value. If it is not, we again throw an exception.</p>

<p>Finally, if all of the input values are valid, we calculate and return the sum of the numeric values in the array.</p>

<p>This approach allows us to handle and report errors as soon as they are detected, rather than waiting until the end of the function to check for errors. This can make the code more robust and easier to maintain, as it is clearer which conditions can cause the function to fail and how to handle those failures.</p>

<h1 id="combine-both-inversion-and-extraction">Combine both Inversion and Extraction</h1>

<p>The best way of doing things is to combine both. And in this case you’ll end up with something like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function calculateSum($numbers) {
  if (!is_array($numbers)) {
    throw new Exception("Error: Input is not an array.");
  }
  $sum = 0;
  foreach ($numbers as $number) {
    $sum += isValidNumberSum($number);
  }
  return $sum;
}

function isValidNumberSum($input) {
  if (!is_numeric($input)) {
    throw new Exception("Error: Non-numeric value found in array.");
  }
  return $input;
}
</code></pre></div></div>

<p>In this case we even went a step further and removed the else statement in our isValidNumberSum function, we just apply the same concept of validation first and return after.</p>

<p>I’ve been adapting all my code to this approach and its way more redable because I know the start of any function is focussed on the errors and exceptions and the actual code will be in the end.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="webdev" /><category term="php" /><category term="sublime" /><category term="standards" /><category term="linux, webdev, php, sublime, standards" /><summary type="html"><![CDATA[How to better structure your code with less nesting]]></summary></entry><entry><title type="html">How to use LSP-intelephense in Sublime Text 4</title><link href="/post/how-to-use-lsp-intelephense-in-sublime-text-4/" rel="alternate" type="text/html" title="How to use LSP-intelephense in Sublime Text 4" /><published>2022-01-28T00:00:00+00:00</published><updated>2022-01-28T00:00:00+00:00</updated><id>/post/how-to-use-lsp-intelephense-in-sublime-text-4</id><content type="html" xml:base="/post/how-to-use-lsp-intelephense-in-sublime-text-4/"><![CDATA[<p>Always wandered how to setup LSP-Intelephense in Sublime Text 4 so you can have propper validation and code completion? I got you covered.</p>

<!--more-->

<p>There’s a few requirements to do this. First you need to install LSP globally in your machine. To do this you need to do the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd ~/
$ mkdir .phpactor
$ cd .phpactor
$ git clone git@github.com:phpactor/phpactor
$ cd phpactor
$ composer install
$ cd /usr/local/bin
$ sudo ln -s ~/.phpactor/phpactor/bin/phpactor phpactor
</code></pre></div></div>

<p>This will make phpactor avaiable globally. To do a small health check on the binary that you just installed go into a project you’re using. Phpactor works best when used with Composer, and is slightly better when used with Git.</p>

<p>Check support using the status command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ phpactor status
✔ Composer detected - faster class location and more features!
✔ Git detected - enables faster refactorings in your repository scope!
</code></pre></div></div>

<p>You might get a different output saying tha there’s some config files missing, but that’s not a problem.</p>

<p>After this you need to install 3 sublime packages.</p>

<ul>
  <li><a href="https://packagecontrol.io/packages/LSP">LSP</a></li>
  <li><a href="https://packagecontrol.io/packages/LSP-intelephense">LSP-intelephense</a></li>
</ul>

<p>After that you need to restart sublime text.</p>

<p>Configuration</p>

<p>Configure the intelephense language server by accessing Preferences &gt; Package Settings &gt; LSP &gt; Servers &gt; LSP-intelephense.</p>

<p>Also in your Preferences &gt; Package Settings &gt; LSP</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// Settings in here override those in "LSP/LSP.sublime-settings"
{
    "clients": {
        "phpactor": {
            "enabled": true,
            "command": ["/usr/local/bin/phpactor", "language-server"],
            "selector": "source.php"
        }
    }
}
</code></pre></div></div>

<p>Now play with the settings to your needs.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="webdev" /><category term="php" /><category term="sublime" /><category term="LSP-intelephense" /><category term="linux, webdev, php, sublime, LSP-intelephense" /><summary type="html"><![CDATA[PHP support for Sublime's LSP plugin provided through intelephense.]]></summary></entry><entry><title type="html">Linux not reading the /etc/hosts file</title><link href="/post/manjaro-linux-not-reading-hosts-file/" rel="alternate" type="text/html" title="Linux not reading the /etc/hosts file" /><published>2021-12-21T00:00:00+00:00</published><updated>2021-12-21T00:00:00+00:00</updated><id>/post/manjaro-linux-not-reading-hosts-file</id><content type="html" xml:base="/post/manjaro-linux-not-reading-hosts-file/"><![CDATA[<p>This week I restarted my laptop. That does not happen too often. Mostly when I let the batery run out for some reason. So when I got back into the system I ran into a weird one. My /etc/hosts file was not being read.</p>

<!--more-->

<p>Let’s say I did:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ping localhost
</code></pre></div></div>

<p>Everything was working out as it should. However I had quite a few more host rules there. like</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>127.0.0.1    foo.loc
</code></pre></div></div>

<p>However when I tried to ping foo.loc it was not working at all. Tried to flush my DNS cache and nothing was working. Then I ran into a post on stackoverflow that did the following solution was to edit /etc/nsswitch.conf file (you may use command sudo vim /etc/nsswitch.conf). I’ve changed line:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hosts:          files mdns4_minimal [NOTFOUND=return] dns
</code></pre></div></div>

<p>to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hosts:          dns files mdns4_minimal [NOTFOUND=return]
</code></pre></div></div>

<p>and now it is working as expected!</p>

<p>I hope this helps anyone that comes accross the same problem.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="webdev" /><category term="manjaro" /><category term="arch" /><category term="linux, webdev, manjaro, arch" /><summary type="html"><![CDATA[In one of my distros last update my hosts file was not being interpreted anymore]]></summary></entry><entry><title type="html">From Sublime Text 3 to Visual Studio Code</title><link href="/post/from-sublime-text-to-vscode/" rel="alternate" type="text/html" title="From Sublime Text 3 to Visual Studio Code" /><published>2021-03-10T00:00:00+00:00</published><updated>2021-03-10T00:00:00+00:00</updated><id>/post/from-sublime-text-to-vscode</id><content type="html" xml:base="/post/from-sublime-text-to-vscode/"><![CDATA[<p>I’ve been a Sublime Text user since version 2. I was a early adopter of that version and used it for at least 9 years now. This month I decided to try something new and opt-in for visual studio code.</p>

<!--more-->

<p>For the last month or so I’ve been learning a bit of Angular along my team. With it we decided to try vscode mostly for its intelisense features when working with JavaScript.</p>

<p>At first I didn’t like it that much, but then I started to fidle with it and it grew on me. Then if I was to move to it full time I had to make it behave well with our team standards, regarding code standards and stuff like that. <strong>Here’s what I did.</strong></p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Look and Feel</u></strong></h3>

<p>I used the same exact theme on sublime and font for a few years. It takes quite a while for me to change that.</p>

<p>The theme I use is called <strong>Material Theme</strong>. You can find the link <a href="https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme">here</a>. You can install that with just one line.</p>

<p>Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext install Equinusocio.vsc-material-theme
</code></pre></div></div>

<p>With it I also installed the propper icons for the material theme, <a href="https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme">Material Icon Theme</a>.</p>

<p>Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext install PKief.material-icon-theme
</code></pre></div></div>

<p>Then I had to fix the problem with the wasted space on the sidebar. Vscode by default has this bar called activity bar, where you can go from file manager, to version control and your settings. I could just hide it but I didn’t want to have to use my mouse to hide and show that bar. Then I found and extension called <a href="https://marketplace.visualstudio.com/items?itemName=iocave.customize-ui">Costumize UI</a>. With it you can move that bar to the bottom part of your sidebar.</p>

<p><img src="https://raw.githubusercontent.com/iocave/customize-ui/master/screenshot.png" alt="Costumize UI" /></p>

<p>This was gold, because now I can just toggle the sidebar with ctrl+b and this bar goes along with it.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>PHP Development</u></strong></h3>

<p>After this step my install of vscode looks exactly like sublime text 3 and the transition was going good.</p>

<p>Then I needed to install some extensions more towards the PHP development than.</p>

<p>First installed the PHPDoc Comment this helps with writing documentation for your code.</p>

<p>Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext install rexshi.phpdoc-comment-vscode-plugin
</code></pre></div></div>

<p><img src="https://raw.githubusercontent.com/shishirui/phpdoc-comment-vscode-plugin/master/images/preview.gif" alt="Dockblocker" /></p>

<p>Then the main reason we moved to vscode. It’s called <a href="https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client">PHP Intelephense</a>. This is PHP code intelligence for Visual Studio Code. Intelephense is a high performance PHP language server packed full of essential features for productive PHP development.</p>

<p>Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ext install bmewburn.vscode-intelephense-client
</code></pre></div></div>

<p>In our team are using PHPfmt for our PHP projects and this is something that we absolutely needed to continue using with the same settings. This is very important so can maintain the same file formats on any project we open and use.</p>

<p>After this I changed a bunch of settings in the editor to suit my needs. Here’s my complete settings.json file.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Complete settings</u></strong></h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{
    "editor.fontFamily": "'M+ 1mn light', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
    "editor.minimap.enabled": false,
    "php.executablePath": "/usr/bin/php7",
    "workbench.colorTheme": "Material Theme",
    "workbench.iconTheme": "material-icon-theme",
    "editor.cursorBlinking": "smooth",
    "files.exclude": {
        "*.exe": true,
        "*.pyo": true,
        "**/.pyc": true
    },
    "editor.rulers": [
        80,
        120
    ],
    "diffEditor.wordWrap": "on",
    "phpfmt.php_bin": "/usr/bin/php7",
    "phpfmt.passes": [
        "ConvertOpenTagWithEcho",
        "PrettyPrintDocBlocks",
        "ReturnNull",
        "OnlyOrderUseClauses"
    ],
    "editor.formatOnSave": true,
    "[php]": {
        "editor.defaultFormatter": "kokororin.vscode-phpfmt"
    },
    "editor.lineHeight": 24,
    "composer.executablePath": "/usr/local/bin/composer",
    "gitlens.hovers.currentLine.over": "line",
    "gitlens.currentLine.enabled": false,
    "gitlens.codeLens.enabled": false,
    "gitlens.statusBar.enabled": false,
    "gitlens.hovers.enabled": false,
    "gitlens.blame.toggleMode": "window",
    "gitlens.changes.toggleMode": "window",
    "grunt.autoDetect": "off",
    "editor.wordWrap": "on",
    "customizeUI.stylesheet": {
        "workbench.useExperimentalGridLayout": true
    },
    "editor.multiCursorModifier": "ctrlCmd",
    "customizeUI.activityBar": "bottom",
    "window.zoomLevel": 2,
    "editor.fontSize": 15,
    "editor.folding": false,
    "editor.glyphMargin": false,
}
</code></pre></div></div>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="webdev" /><category term="php" /><category term="editor" /><category term="sublime" /><category term="vscode" /><category term="linux, webdev, php, editor, sublime, vscode" /><summary type="html"><![CDATA[Recently I've been learning a bit of Angular, and with I tried vscode due to its intelisense properties.]]></summary></entry><entry><title type="html">Protecting your home network from ads and some telemetry</title><link href="/post/protecting-your-home-network-from-ads-and-some-telemetry/" rel="alternate" type="text/html" title="Protecting your home network from ads and some telemetry" /><published>2021-02-21T00:00:00+00:00</published><updated>2021-02-21T00:00:00+00:00</updated><id>/post/protecting-your-home-network-from-ads-and-some-telemetry</id><content type="html" xml:base="/post/protecting-your-home-network-from-ads-and-some-telemetry/"><![CDATA[<p>Recently I've been very interested in this project called Pi-hole. Where you can basically filter all the requests your devices do in your network and just block some undesired behaviours that can occur in your network.</p>

<!--more-->

<p>With Pi-hole you'll get this set of features:</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Network-wide protection</u></strong></h3>

<p>Instead of browser plugins or other software on each computer, install Pi-hole in one place and your entire network is protected.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Block in-app advertisements</u></strong></h3>

<p>Network-level blocking allows you to block ads in non-traditional places such as mobile apps and smart TVs, regardless of hardware or OS.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Improve network performance</u></strong></h3>

<p>Since advertisements are blocked before they are downloaded, network performance is improved and will feel faster.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Monitor statistics</u></strong></h3>

<p>Our Web interface offers control of your Pi-hole and a central place to view statistics. We also include an API for extending these stats. I wanted to re-utilize an old Raspberry Pi version 3 I had laying around that I haven’t used in a long time so here's the process. First, you'll need a Pi, a zero could work fine just make sure you have that, a case, a power brick and an SD card.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Setup the Raspberry Pi</u></strong></h3>

<p>Head on to the Pi <a href="https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit">website</a> and download the latest version of the Pi software. You don't need a desktop environment for this so the lite version should suffice. Then you can use any tool to flash your SD card. Since I'm on Linux I used <a href="https://www.balena.io/etcher/">Balena Etcher</a> way easier than using dd. After this you want to open the boot folder in your SD card and create an empty file called SSH and we're ready to start.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Update your system</u></strong></h3>

<p>Insert your SD card into your Pi and boot it up. Then you'll need to find your Pi IP address in your network. You can easily find this on your router. Once you've done that open up your terminal and access your Pi via SSH.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ssh pi@youripaddresshere
</code></pre></div></div>

<p>This will ask you for a password and that will be raspberry by default. After this you might want to change the default password.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ passwd
</code></pre></div></div>

<p>Then enter your old password and your new password 2 times. To update your system just do the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt update &amp;&amp; sudo apt upgrade
</code></pre></div></div>

<p>This might take a while. Once it's done you might need to check if you have curl installed and if not, install it.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt install curl
</code></pre></div></div>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Install the Pi-hole software</u></strong></h3>

<p>Here we take the easier route. One-Step Automated Install those who want to get started quickly and conveniently may install Pi-hole using the following command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -sSL https://install.pi-hole.net | bash
</code></pre></div></div>

<p>During the process of install you'll be asked a bunch of question, but my process was very straight forward. Just say yes to all the default options and you'll be fine. Once the process is complete, you'll be presented with your Pi-hole password. Make sure to save that somewhere. You can now access your Pi-hole admin panel by just typing the IP address of your pi in your browser.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Setup your Pi-hole so it can be used in your entire network</u></strong></h3>

<p>There's two ways you can use the Pi-hole. You can use it in a per device choice. This way you basically should only go into the router to make sure your Pi always uses the same IP. The best way you can use the Pi-hole is to setup the system to be used by all the devices in your network, and that's what I did. To do that the next steps are different on every router so you might need to do some googling at this point, but here's what I have and what I did.</p>

<p>Setup the IPv4 and IPv6 static IP. In my case these are my settings, you can find yours in your information tab on your Pi-hole admin panel.</p>

<p>192.168.1.2 and 2001:818:xxxx::192:168:1:2 in my case.</p>

<h3 style="font-weight: 400; font-size: 26px;"><strong><u>Huawei HS8247W (Smart Router 2) (Specific to my router)</u></strong></h3>

<p><strong>Step 1</strong> Advanced settings -&gt; LAN -&gt; DHCP Settings Primary DNS Server: 192.168.1.2</p>

<p><strong>Step 2</strong> Advanced Settings -&gt; IPv6 -&gt; DHCPv6 Server DNS LAN administrative origin: Static config Preffered DNS: 2001:818:xxxx::192:168:1:2</p>

<p><strong>Step 3</strong> Advanced Settings -&gt; WAN Config -&gt; DNS Server configuration IPv4 / Origin: Personalized Primary DNS: 1.1.1.1 Secondary DNS: 1.0.0.1</p>

<p><strong>Step 4</strong> Advanced Settings -&gt; WAN Config -&gt; DNS IPv6 Server configuration / Origin: Personalized / Primary DNS: 2606:4700:4700::1111 / Secondary DNS: 2606:4700:4700::1001</p>

<p>That's it, now always leave your Raspberry Pi on and you'll be fine. If your internet connection goes out for some reason, just make sure your cat didn't disconnect the Pi.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="raspberrypi" /><category term="security" /><category term="ads" /><category term="telemetry" /><category term="piHole" /><category term="linux, raspberrypi, security, ads, telemetry, piHole" /><summary type="html"><![CDATA[Recently I&#39;ve been very interested in this project called Pi-hole. Where you can basically filter all the requests your devices do in your network and just block some undesired behaviours that can occur in your network.]]></summary></entry><entry><title type="html">Manjaro a month after</title><link href="/post/manjaro-a-month-after/" rel="alternate" type="text/html" title="Manjaro a month after" /><published>2020-12-05T00:00:00+00:00</published><updated>2020-12-05T00:00:00+00:00</updated><id>/post/manjaro-a-month-after</id><content type="html" xml:base="/post/manjaro-a-month-after/"><![CDATA[<p>One month ago I installed Manjaro on my Laptop. In it I installed all the production tools I have on my production machine where I run Pop!OS. Here’s what I found.</p>

<!--more-->

<h2 id="installation">Installation</h2>

<p>The installation process was really straight forward and really fast too.</p>

<h2 id="desktop-environment">Desktop Environment</h2>

<p>I opt-in for KDE. This was something that I changed a few months ago in my workflow, I moved from gnome into KDE. I even made a video recently about my KDE workflow. You can see it <a href="https://www.youtube.com/watch?v=L7P3vVbQLfU">here</a>. The fact that the Manjaro team leaves the KDE environment almost untouched is quite good. They just made their own theme and icons and thats it. Other than that you get the latest and greatest from KDE. Love it!</p>

<h2 id="base-tools">Base tools</h2>

<p>The base tools the distributions comes with are quite good, sure I installed a lot more things that I use on my day to day, but for normal usage you get a lot.</p>

<h2 id="package-management-and-other-tools">Package management and other tools</h2>

<h3 id="pacman">Pacman</h3>

<p>This was probably what I liked the most about Manjaro. I never works with pacman before, I always used apt distros. Pacman is for sure the best package manager that I ever used. Intuitive to use, fast and even the output you get during updates and stuff like that is pretty good.</p>

<h3 id="pamac--aur">Pamac &amp; AUR</h3>

<p>Manjaro brings a AUR helper called Pamac, works amazing and also pretty intuitive and easy to use.</p>

<h3 id="other-tools">Other tools</h3>

<p>Manjaro doesn’t push you towards one container app environment like snap, appimage or flatpak. You can just activate the ones you want to use and just use whatever you want. It’s not really that intuitive to do, because its kinda hidden in the add/remove software app.</p>

<h3 id="the-addremove-software-app">The add/remove software app</h3>

<p>This was probably what I liked less in the distribution. I think the Manjaro team should work on this app and just make it more like a store, something like PopOs did when they boroed the app from Elementary OS.</p>

<h2 id="final-thoughts">Final thoughts</h2>

<p>I need to actually format my main production machine at the start of 2021. I want to re-arrange my disks and the way I have things. Therefore I really consider moving from Pop!OS to Manjaro for 2021. I’ll keep you posted.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="distro" /><category term="security" /><category term="pacman" /><category term="manjaro" /><category term="arch" /><category term="linux, distro, security, pacman, manjaro, arch" /><summary type="html"><![CDATA[On the month of November I will be testing the Manjaro distribution]]></summary></entry><entry><title type="html">A week on Manjaro Linux</title><link href="/post/a-week-on-manjaro/" rel="alternate" type="text/html" title="A week on Manjaro Linux" /><published>2020-11-07T00:00:00+00:00</published><updated>2020-11-07T00:00:00+00:00</updated><id>/post/a-week-on-manjaro</id><content type="html" xml:base="/post/a-week-on-manjaro/"><![CDATA[<p>Last week I installed Manjaro Linux on my laptop and since then I’ve been using it as I would my work machine, even though I still use my desktop as my primary machine.</p>

<!--more -->

<p>I made my USB stick and went with the KDE version of Manjaro. The installation worked like a charm, even the live USB worked incredible.</p>

<p>Even thought I had my computer configured with my /home in another partition I decided to do a clean install and just format my home directory since if I end up installing it on my Desktop that’s what I’ll do.</p>

<p>After the install I updated the system, but a new version of Manjaro just came out, so I zero updates to do. I was not expeting that.</p>

<p>Then I started to tweak the KDE settings and most of all the “add/remove software” app, where you can configure how you wan your package manager to work.</p>

<p>I decided to enable pacman, AUR, flatpak and appImages.</p>

<p>Just a few momments later I started to install my software and adding my dotfiles from github.</p>

<p>First of all I was quite impressed with te amount of software available on pacman and AUR. I didn’t have to add any sources like ppa on debian. Everything was avaiable and I could install it with one click or via terminal.</p>

<p>One basic example is docker and docker compose. Tools that I use everyday at work and at home. On debian based distros I had to read one or two pages of documentation to get them installed and working. On Manjaro?</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo pacman -S docker docker-compose
</code></pre></div></div>

<p>That’s it!</p>

<p>So far first impressions are looking really good. I’m impressed with the package manager, the speed of everything, even the KDE theme is impressive.</p>

<p>Let’s see how it goes next week.</p>]]></content><author><name>Marco Monteiro</name></author><category term="linux" /><category term="distro" /><category term="security" /><category term="pacman" /><category term="manjaro" /><category term="arch" /><category term="linux, distro, security, pacman, manjaro, arch" /><summary type="html"><![CDATA[On the month of November I will be testing the Manjaro distribution]]></summary></entry></feed>