Skip to content

Instantly share code, notes, and snippets.

@eduavila
eduavila / verificar_cert.md
Created February 9, 2024 20:52
Verificar se key e do certificado correspondente

Imprimir sha256sum da key.

 openssl pkey -in key.pem -pubout -outform pem | sha256sum
 

Imprimir sha256sum da key.

@eduavila
eduavila / nginx-tuning.md
Created February 7, 2024 14:31 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@eduavila
eduavila / ubuntu-acesso-ssh-root.md
Created November 27, 2023 17:45 — forked from fabianogoes/ubuntu-acesso-ssh-root.md
LIBERANDO O USUÁRIO ROOT PARA ACESSO REMOTO VIA SSH

LIBERANDO O USUÁRIO ROOT PARA ACESSO REMOTO VIA SSH

Configurando uma máquina linux para liberar acesso remoto via ssh para o usuário root.

Instalar openssh-server

apt-get install openssh-server

Configurar senha para o root

@eduavila
eduavila / docker-compose.yml
Created October 28, 2023 15:01
Docker-compsoe mysql 5.6
version: '3.6'
services:
mysql:
platform: linux/x86_64
image: mysql:5.6
ports:
- "3306:3306"
volumes:
- ./docker/data/mysql:/var/lib/mysql
command: --lower_case_table_names=1
@eduavila
eduavila / kubernetes.md
Created October 25, 2023 21:31
Kubernetes debug pod

kubectl run -it --image=jrecord/nettools nettools --restart=Never --namespace=mensageiro-prod

@eduavila
eduavila / create_user.sql
Last active May 9, 2024 14:43
criar_usuarios_postgres.sql
-- Cria usuário com permissão para login
CREATE ROLE novousuario WITH LOGIN;
-- Criar usuário com permissão para login
CREATE USER novousuario;
-- Criar usuáriio com senha.
CREATE ROLE novousuario WITH LOGIN PASSWORD 'senha';
-- Alterar senha
@eduavila
eduavila / command.md
Created September 21, 2023 18:03
curl with trace

curl --trace - https://catonmat.net

curl --trace - --trace-time https://catonmat.net

@eduavila
eduavila / adb.md
Created September 6, 2023 20:15
Conectar remotamente com adb no emulador no host do docker.
// Lista devices 
$ adb -H host.docker.internal devices

// Conectar no 
$ adb connect host.docker.internal:5555

// Redefinir conexão
$ adb kill-server
@eduavila
eduavila / command.md
Last active March 9, 2025 19:51
Liberar porta do wsl para acesso externo.

Busca IP do wsl wsl hostname -I

Troca IP do connectaddress para ip interno do WSL.

netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.18.x.x

@eduavila
eduavila / create_user.sql
Created June 5, 2023 17:16
Criar usuário POSTGRES.
CREATE DATABASE nome_banco;
CREATE USER usuario_banco WITH PASSWORD 'senha...';
GRANT ALL PRIVILEGES ON DATABASE nome_banco TO usuario_banco;
ALTER USER usuario_banco WITH PASSWORD 'nova senha..';