<?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>Forem: Gustavo Lima</title>
    <description>The latest articles on Forem by Gustavo Lima (@gustavorglima).</description>
    <link>https://forem.com/gustavorglima</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%2F401139%2F962d41a2-4fc9-4f22-a6c2-236e975c8588.jpeg</url>
      <title>Forem: Gustavo Lima</title>
      <link>https://forem.com/gustavorglima</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gustavorglima"/>
    <language>en</language>
    <item>
      <title>How to Clear the Cache for FTP Updates on NuvemShop?</title>
      <dc:creator>Gustavo Lima</dc:creator>
      <pubDate>Sun, 09 Feb 2025 16:14:25 +0000</pubDate>
      <link>https://forem.com/gustavorglima/how-to-force-clear-cache-of-updates-via-ftp-on-nuvemshop-14g0</link>
      <guid>https://forem.com/gustavorglima/how-to-force-clear-cache-of-updates-via-ftp-on-nuvemshop-14g0</guid>
      <description>&lt;p&gt;This past weekend, I needed to perform maintenance on a website hosted on &lt;a href="https://www.nuvemshop.com.br/" rel="noopener noreferrer"&gt;NuvemShop&lt;/a&gt;, a platform quite popular in Brazil.  &lt;/p&gt;

&lt;p&gt;The problem? I edited the files via &lt;strong&gt;FTP&lt;/strong&gt;, but the changes took forever to reflect on the site. I tried everything: &lt;strong&gt;Cmd + Shift + R&lt;/strong&gt;, disabling the cache in &lt;strong&gt;Google Chrome DevTools&lt;/strong&gt;, using various headers with &lt;strong&gt;ModHeader&lt;/strong&gt;... and nothing worked. I searched a lot but couldn’t find a direct solution.  &lt;/p&gt;

&lt;p&gt;Until I had an idea 💡 and discovered a simple way to fix it!  &lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Step-by-step to Clear NuvemShop’s Cache&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
1️⃣ Go to the NuvemShop admin panel:&lt;br&gt;&lt;br&gt;
   &lt;strong&gt;My NuvemShop » Edit Current Layout » Advanced CSS Editing&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
2️⃣ Inside the CSS box, add any text, like (remove this after finish your work):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nt"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Click on &lt;strong&gt;"Test CSS"&lt;/strong&gt;, and then click &lt;strong&gt;"Publish Changes"&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%2F413vf4q5xg3pc2cwpv2k.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%2F413vf4q5xg3pc2cwpv2k.jpg" alt="NuvemShop - Advanced CSS Editing" width="420" height="662"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will &lt;strong&gt;force the cache to clear&lt;/strong&gt;, and your FTP changes will appear instantly! 🎉&lt;/p&gt;

&lt;p&gt;I hope this tip helps! If anyone knows an even simpler method, feel free to share in the comments.&lt;/p&gt;

</description>
      <category>cache</category>
      <category>cdn</category>
      <category>nuvemshop</category>
      <category>css</category>
    </item>
    <item>
      <title>AWS EKS - Auth error or Forbidden access</title>
      <dc:creator>Gustavo Lima</dc:creator>
      <pubDate>Sun, 25 Aug 2024 16:24:43 +0000</pubDate>
      <link>https://forem.com/gustavorglima/aws-eks-auth-error-or-forbidden-access-15l4</link>
      <guid>https://forem.com/gustavorglima/aws-eks-auth-error-or-forbidden-access-15l4</guid>
      <description>&lt;p&gt;If you're trying to deploy Kubernetes on AWS EKS and encountering authentication errors like these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error from server (Forbidden): error when retrieving current configuration of:
Resource: "/v1, Resource=secrets", GroupVersionKind: "/v1, Kind=Secret"
Name: "YOUR_SECRET_NAME", Namespace: "YOUR_NAMESPACE_NAME"
from server for: "STDIN": secrets "YOUR_SECRET_NAME" is forbidden: User "arn:aws:iam::***:user/YOUR_IAM_AWS_USERNAME" cannot get resource "secrets" in API group "" in the namespace "YOUR_NAMESPACE_NAME"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: error validating "deployment.yaml": error validating data: failed to download openapi: the server has asked for the client to provide credentials; if you choose to ignore these errors, turn validation off with --validate=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need to configure the policies correctly. To do this, go to the &lt;strong&gt;AWS Console&lt;/strong&gt; and search for &lt;strong&gt;IAM&lt;/strong&gt;. Select the user you are using to deploy, then go to &lt;strong&gt;Add permission » Create inline policy&lt;/strong&gt;. On the next page, click on &lt;strong&gt;JSON&lt;/strong&gt;, delete everything, and paste the policy below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecr:GetAuthorizationToken",
        "ecr:BatchCheckLayerAvailability",
        "ecr:GetDownloadUrlForLayer",
        "ecr:BatchGetImage",
        "ecr:PutImage",
        "ecr:InitiateLayerUpload",
        "ecr:UploadLayerPart",
        "ecr:CompleteLayerUpload"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "eks:DescribeCluster",
        "eks:ListClusters",
        "eks:DescribeNodegroup",
        "eks:DescribeFargateProfile",
        "ec2:DescribeSubnets",
        "ec2:DescribeRouteTables",
        "ec2:DescribeSecurityGroups"
      ],
      "Resource": "*"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first block allows ECR access, the second grants access to Secrets Manager, and the last one covers EKS. If you don't need some of them, feel free to remove.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;, give the policy a name, e.g., &lt;strong&gt;GitHubActionsDeploy&lt;/strong&gt;, and then click &lt;strong&gt;Save changes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's it! With this policy, you will grant only the necessary permissions to deploy a pod on EKS.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>aws</category>
      <category>eks</category>
    </item>
    <item>
      <title>Laravel: vendor/bin/sail: No such file or directory</title>
      <dc:creator>Gustavo Lima</dc:creator>
      <pubDate>Mon, 31 Jul 2023 16:08:00 +0000</pubDate>
      <link>https://forem.com/gustavorglima/laravel-vendorbinsail-no-such-file-or-directory-gp1</link>
      <guid>https://forem.com/gustavorglima/laravel-vendorbinsail-no-such-file-or-directory-gp1</guid>
      <description>&lt;p&gt;I got this error when clone an existing project from my own repository and tried to bring back with sail up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sail up
sh: vendor/bin/sail: No such file or directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And after that I realize that obviously I can't do that because I don't have composer dependencies installed.&lt;/p&gt;

&lt;p&gt;So, if you don't want to use the local PHP or don't have it, you can use the following command to run a docker container with the right PHP version to install Composer dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run it inside you root project folder:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php81-composer:latest \
    composer install --ignore-platform-reqs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done! Now you can use &lt;code&gt;sail up&lt;/code&gt; without any problem.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>sail</category>
      <category>composer</category>
      <category>docker</category>
    </item>
    <item>
      <title>Disabling ONLY_FULL_GROUP_BY on MySQL docker Laravel Sail</title>
      <dc:creator>Gustavo Lima</dc:creator>
      <pubDate>Sun, 20 Nov 2022 12:58:55 +0000</pubDate>
      <link>https://forem.com/gustavorglima/disabling-onlyfullgroupby-on-mysql-docker-laravel-sail-bob</link>
      <guid>https://forem.com/gustavorglima/disabling-onlyfullgroupby-on-mysql-docker-laravel-sail-bob</guid>
      <description>&lt;p&gt;&lt;strong&gt;When you get this error:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Error Code: 1055. Expression #11 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'YOUR_COLUMN_NAME_HERE' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Just put on your &lt;code&gt;docker-compose.yml&lt;/code&gt; the follow command on &lt;code&gt;mysql container&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        command:
            --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "%"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        command:
            --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
        volumes:
            - 'sail-mysql:/var/lib/mysql'
            - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart and test again :D&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Solve: "ERROR: unsatisfiable constraints (python)"</title>
      <dc:creator>Gustavo Lima</dc:creator>
      <pubDate>Wed, 03 Jun 2020 14:09:20 +0000</pubDate>
      <link>https://forem.com/gustavorglima/how-to-solve-error-unsatisfiable-constraints-python-48k7</link>
      <guid>https://forem.com/gustavorglima/how-to-solve-error-unsatisfiable-constraints-python-48k7</guid>
      <description>&lt;p&gt;When try to install python2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apk add --update --no-cache build-base python2-dev python libffi-dev libressl-dev bash git gettext curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get this Error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
    python (missing):
      required by: world[python]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To solve change &lt;code&gt;python2-dev python&lt;/code&gt; to &lt;code&gt;python3-dev python3&lt;/code&gt;, E.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apk add --update --no-cache build-base python3-dev python3 libffi-dev libressl-dev bash git gettext curl \
 &amp;amp;&amp;amp; curl -O https://bootstrap.pypa.io/get-pip.py \
 &amp;amp;&amp;amp; python3 get-pip.py \
 &amp;amp;&amp;amp; pip install --upgrade six awscli awsebcli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>docker</category>
      <category>alpine</category>
      <category>pip</category>
    </item>
  </channel>
</rss>
