Skip to content

Instantly share code, notes, and snippets.

View henrique502's full-sized avatar

Henrique Schmidt henrique502

View GitHub Profile
@henrique502
henrique502 / README.md
Last active March 20, 2025 17:20
EKS Configs
@henrique502
henrique502 / params.go
Created October 14, 2024 21:21
secretsmanager env loader
package params
import (
"context"
"encoding/json"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/secretsmanager"
"os"
"strconv"
"strings"
@henrique502
henrique502 / terraform.md
Last active December 19, 2024 14:51
Terraform

Terraform

Recomendações

Existe algumas configurações que devem ser colocadas nos recursos de Terraform para evitar que aquele recurso infle de e gere altos valores sem necessidade ou que tenha problemas em futuras manutenções, a baixo segue uma lista e suas configurações.

Security Groups

Security Groups são a principal configuração de segurança de um recurso, é possível utilizar o mesmo em vários tipos de recurso. Mas é altamente recomendado que você tenha um Security Group para cada tipo ou grupo de recurso, pois existem recursos que não permitem alteração do mesmo depois de criado e será necessário recriar o recurso na AWS caso precise alterar. Como não tem custo não tenha preguiça, faça um Security Group por resource ou por grupo do mesmo resource.

@henrique502
henrique502 / PostgreSQL.md
Last active December 11, 2024 17:31
PostgreSQL

PostgreSQL

Padrões

Para facilitar integrações entre banco de dados e sistemas, Utilizar padrões de mercado de nomenclatura que facilitam o entendimento e utilização de bibliotecas de banco de dados.

Tabelas

Alguns padrões para tabelas em bancos de dados incluem:

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@henrique502
henrique502 / Dockerfile
Last active June 7, 2024 17:27
devcontainer ruby
FROM ruby:3.3-alpine
COPY scripts/functions.sh .
RUN apk add \
bash \
bash-completion \
curl \
gcc \
g++ \
@henrique502
henrique502 / main.go
Created February 22, 2024 19:35
Recaptcha Enterprise - Assessments
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/http/httputil"
@henrique502
henrique502 / links.txt
Created February 1, 2024 16:40
AWS - transfer - datasync
@henrique502
henrique502 / caa.tf
Last active October 16, 2023 21:04
DNS CAA terraform example
resource "cloudflare_record" "" {
name = "exemplo.com"
proxied = false
ttl = 3600
type = "CAA"
zone_id = ""
data {
flags = 0
tag = "issuewild"
value = "amazon.com"
@henrique502
henrique502 / 0-go-os-arch.md
Created November 11, 2022 13:13 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android