Skip to content

Instantly share code, notes, and snippets.

View avandrevitor's full-sized avatar
😎
A mind that opens up to a new idea never returns to its original size

André Vitor Cuba de Miranda avandrevitor

😎
A mind that opens up to a new idea never returns to its original size
View GitHub Profile
@negri
negri / Modem-Vivo-Askey-Bridge-Telefone.md
Created October 30, 2024 11:52
Modem Vivo Askey em Bridge sem Perder o Telefone

Modem Vivo Askey em Bridge sem perder o telefone (e TV)

"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

O Problema

A Vivo oferece um serviço de Internet por Fibra Óptica, de boa velocidade e preço competitivo em São Paulo. Para pessoas jurídicas eles entregam um IPv4 real (embora dinâmico) e um belo bloco de IPv6 plenamente funcional. Por um pouco a mais eles entregam um número de telefone, e por um pouco mais eles habilitam o "Siga-Me", que te permite direcionar todas as chamadas para um outro número, um celular, por exemplo, muito útil.

Eles entregam o serviço (em 2024) através de um modem Askey (no nosso caso um RTF8225VW), que em tese é bastante competente: aguenta taxas até gigabit, Wi-Fi 6, e é um aparelho discreto.

@vczb
vczb / sources.list
Last active May 5, 2026 03:10
Ubuntu 20.04 /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
@rponte
rponte / using-uuid-as-pk.md
Last active June 8, 2026 16:53
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@NatalNW
NatalNW / instalação_ansible_awx_linux.md
Last active June 7, 2024 22:48
Guia de Instalação Ansible AWX para Linux
======================================
mysql 8.0.15 -> 8.0.16 upgrade error
======================================
1) The mysql server refused to start when we upgraded from 8.0.15 to 8.0.16
on Ubuntu 16.04
Apr 25 09:08:09 yuktix-apiv11devm1 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
@leocavalcante
leocavalcante / watch.php
Created February 21, 2019 20:45
Watch script for Swoole HTTP server restarts.
<?php declare(strict_types=1);
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\Process\Process;
$process = new Process(['php', 'index.php']);
echo "Starting process\n";
$process->start();
@warlock
warlock / chrome-solver.sh
Created August 30, 2018 06:29
[3996:3996:0830/082616.049145:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
sudo chown root /opt/google/chrome/chrome-sandbox
sudo chmod 4755 /opt/google/chrome/chrome-sandbox
  • Existem diversas discussões sobre qual deve ser o tamanho de uma função.
  • Mas algo mais importante é se perguntar: "Quando devemos envolver um código na sua própria função?"
  • Algumas pessoas se guiam por:
    • tamanho - uma função não deve ser tão grande que não caiba na tela
    • reuso - qualquer código utilizado mais de uma vez deve ser colocado em uma função, caso contrário, deve ser deixado inline
  • Uma abordagem interessante é separação entre intenção e implementação.
  • Se você tiver que se esforçar ao olhar um fragmento de código para entender o que ele faz, o código deve ser extraído para um função e a função nomeada.
  • Quando você ler o código novamente, o propósito da função ficará explícito sem a necessidade de entender o seu funcionamento internamente.
@giansalex
giansalex / docker-php-ext-install.md
Last active October 13, 2024 20:15
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@jeffersonmartin
jeffersonmartin / composer-private-package-github-token.md
Last active September 18, 2025 14:41
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.