Skip to content

Instantly share code, notes, and snippets.

View pLogicador's full-sized avatar
🕵️
Currently exploring microservices architecture

Pedro Miranda pLogicador

🕵️
Currently exploring microservices architecture
View GitHub Profile
@pLogicador
pLogicador / useContext.jsx
Created February 12, 2025 21:23 — forked from luizomf/useContext.jsx
React Hook useContext - Curso React
import { useContext, createContext, useState } from 'react';
import './App.css';
const globalState = {
title: 'O título que contexto',
body: 'O body do contexto',
counter: 0,
};
const GlobalContext = createContext();
@pLogicador
pLogicador / tutorial.txt
Created January 30, 2025 02:41 — forked from luizomf/tutorial.txt
WSL2 e Docker no Windows 10.
### Tutorial oficial:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
### Passo 1 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
### Passo 2 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
### Passo 3
# Update all your packages
sudo apt update
sudo apt upgrade -y
# Add postgresql repository and key
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update again
@pLogicador
pLogicador / create-self-signed-ssl-certificates.sh
Created December 26, 2024 10:14 — forked from luizomf/create-self-signed-ssl-certificates.sh
create openssl self-signed certificates
cd /var/lib/postgresql/13/main
# Create a self-signed certificate
openssl req -new -nodes -text -out server.csr \
-keyout server.key -subj "/CN=postgresql.otaviomiranda.com.br"
openssl x509 -req -in server.csr -text -days 3650 \
-extfile /etc/ssl/openssl.cnf -extensions v3_ca \
-signkey server.key -out server.crt
@pLogicador
pLogicador / README.md
Created November 18, 2024 18:45 — forked from luizomf/README.md
Useful Linux/Unix commands.

Se você usa MacOS

O macOs roda sobre Darwin OS (kernel XNU), que é um sistema UNIX-like. Então, todos os comandos abaixo também funcionam normalmente no MacOS. Recomendo utilizar o gerenciador de pacotes homebrew caso necessário instalar algo. Se quiser o mesmo terminal que eu (ZSH com Oh My ZSH), utilize este vídeo para configurar https://youtu.be/bs1-Wxb_KIc

Se você usa Windows

No Windows é possível utilizar o wsl2 e instalar uma versão do linux para acompanhar. Eu fiz alguns vídeos para você usar o Linux no Windows.