Skip to content

Instantly share code, notes, and snippets.

View walternascimentobarroso's full-sized avatar
🎯
Focusing

Walter Nascimento Barroso walternascimentobarroso

🎯
Focusing
View GitHub Profile
@walternascimentobarroso
walternascimentobarroso / SQL.md
Created January 10, 2025 10:56
Coding Pattern SQL
CREATE TABLE {table_name} (
    id SERIAL PRIMARY KEY,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP NULL,
    modified_by INT
);
@walternascimentobarroso
walternascimentobarroso / build.sh
Created August 15, 2024 15:18
Build ECR into AWS
#!/bin/bash
# Configuration
REGION="us-east-1"
ACCOUNT_ID="xxxxxxxx"
REPOSITORY_NAME="project-name"
TAG="v1.2"
echo "Logging in to ECR..."
aws ecr get-login-password --region $REGION | docker login --username AWS --password-stdin $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com
@walternascimentobarroso
walternascimentobarroso / config-ssh-agent.sh
Last active July 19, 2024 20:25
Script para Configuração do ssh-agent
#!/bin/bash
## wget -O - https://gist.github.com/walternascimentobarroso/c140cc2ef381e7355613f824ca6b6906/raw/23880e914a60bd82b560e734a2e7e11e1949acee/config-ssh-agent.sh | bash
# Caminho para o arquivo de chave SSH
SSH_KEY="~/.ssh/id_rsa"
# Função para adicionar configuração ao arquivo
add_to_file() {
local file=$1
@walternascimentobarroso
walternascimentobarroso / NFS.sh
Last active July 19, 2024 19:39
Interactive Script to Set Up an NFS Server
#!/bin/bash
## wget -O - https://gist.github.com/walternascimentobarroso/5db431533c53ae75e80130611d728259/raw/34730b96cd1fe24780edaf50534a9332b7a5e593/NFS.sh | bash
## Or download
## wget -O NFS.sh https://gist.github.com/walternascimentobarroso/5db431533c53ae75e80130611d728259/raw/34730b96cd1fe24780edaf50534a9332b7a5e593/NFS.sh
# Function to read user input with a default value
read_with_default() {
local prompt="$1"
local default="$2"
#!/bin/bash
# Gera uma chave SSH com seu email
echo "Digite o seu email para gerar a chave SSH:"
read user_email
ssh-keygen -t ed25519 -C "$user_email" -f ~/.ssh/id_ed25519 -N ""
# Adiciona a chave SSH ao agente SSH
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
#!/bin/bash
## wget -O - https://gist.github.com/walternascimentobarroso/bfd2ddd55a0a688cce26022e94b8d02d/raw/c8b4ec1bfd3983a5c7bfa77ec1cd2c0ca8c8f4fe/mac-setup.sh | bash
# Instala o Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Adiciona Homebrew ao PATH
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
@walternascimentobarroso
walternascimentobarroso / move_logs.sh
Last active June 25, 2024 19:11
Move logs for backup folder
#!/bin/bash
## wget -O - https://gist.github.com/walternascimentobarroso/b38fc1d9b7c7330457767a88326142aa/raw/b601f38dea1bcd2fc6fd4eb8d77d97a5b9050861/move_logs.sh | bash
# Diretório onde estão as pastas db_linked, db_master, db_max, etc.
# Ajuste conforme necessário
BASE_DIR="./"
# Data atual menos 15 dias em formato YYYY-MM-DD
@walternascimentobarroso
walternascimentobarroso / EC2-Config.sh
Last active June 25, 2024 12:20
Generic config for EC2
#!/bin/bash
## wget -O - https://gist.github.com/walternascimentobarroso/eadfc95e483a951dd34bcc059f618d33/raw/3a1d95d59c54ebc1db70af52574ccfe0acffa042/EC2-Config.sh | bash
# Atualiza todos os pacotes
sudo yum update -y
# Verifica se há atualizações disponíveis
sudo yum check-update
@walternascimentobarroso
walternascimentobarroso / .vimrc
Created February 22, 2024 17:52
Config for vim
syntax on " modo visual/colorido ativo
set showmode " apresenta o modo de utilizacao atual (command/insert)
set ignorecase " ignora case sensitive durante a busca
set ruler " apresenta a posicao do cursor
set showcmd " visualiza comandos incompletos
set smarttab " trabalha a identacao do arquivo
set sm " ativar/desativar as coincidencias
set laststatus=1 " exibe a linha de status
set title " habilita o titulo
set term=xterm-256color " modo do terminal
@walternascimentobarroso
walternascimentobarroso / reset.css
Last active February 2, 2023 22:44
My reset css
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scroll-behavior: smooth;
}