Skip to content

Instantly share code, notes, and snippets.

View thiagozs's full-sized avatar
:octocat:
Have a nice day

Thiago Zilli Sarmento thiagozs

:octocat:
Have a nice day
View GitHub Profile
@thiagozs
thiagozs / init-cluster-rabbitmq.sh
Last active February 23, 2026 16:59
Init cluster rabbitmq
#!/bin/sh
set -e
echo "#########################################"
echo "### INIT SCRIPT VERSION: 2026-02-23-v6 ###"
echo "#########################################"
get_container_id() {
docker ps --filter "name=$1" --format "{{.ID}}" | head -n 1
}
@thiagozs
thiagozs / rabbitmq.conf
Created February 23, 2026 13:38
Rabbitmq config docker compose cluster
cluster_formation.peer_discovery_backend = dns
cluster_formation.dns.hostname = tasks.rabbitmq
cluster_partition_handling = autoheal
loopback_users.guest = false
log.console = true
log.console.level = info
@thiagozs
thiagozs / guia_encargos_iof.md
Created February 4, 2026 12:30
Guia encargos e IOF

Guia de Consulta: Encargos e IOF no Cartão de Crédito (Brasil)

Este documento resume as fórmulas e alíquotas oficiais aplicadas pelas instituições financeiras, conforme as normas do Banco Central (BCB) e da Receita Federal.

1. IOF (Imposto sobre Operações Financeiras)

O IOF varia conforme o tipo de movimentação:

A. Compras Internacionais (Transação Individual)

@thiagozs
thiagozs / saga_example.go
Last active February 2, 2026 12:48
SAGA example system, steps and engine for execution
package main
import (
"context"
"fmt"
"log/slog"
"os"
"reflect"
"sync"
"time"
@thiagozs
thiagozs / canvas_eco_launch.md
Created October 15, 2025 18:42
Game designer Canvas - Eco Launh

Game Design Canvas — Jogo: "Eco Launch"

1. Game Concept

Nome: Eco Launch Inspiração: Angry Birds e Cut the Rope

Objetivo: Salvar animais de uma floresta poluída, lançando sementes que regeneram o ambiente e libertam os bichos presos.

Ideia: Um puzzle ecológico que combina física, estratégia e conscientização ambiental.

@thiagozs
thiagozs / create_user_with_home.sh
Last active November 3, 2025 13:15
Create user home with password linux
#!/usr/bin/env bash
#
# Script para criar um usuário no Ubuntu e configurar o diretório HOME
# Autor: Thiago Zilli Sarmento
# Uso:
# sudo ./create_user_with_home.sh <nome_usuario> [grupo_adicional]
#
# Exemplo:
# sudo ./create_user_with_home.sh asapadm sudo
#
@thiagozs
thiagozs / clamav_freshclam_no_sudo.md
Created August 14, 2025 17:22
ClamAV Freshclam sem sudo

Configurando ClamAV Freshclam para rodar sem sudo

Este guia mostra como permitir que o usuário thiagozs execute o freshclam sem precisar de permissões de root, corrigindo o erro:

ERROR: Failed to open log file /var/log/clamav/freshclam.log: Permission denied
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!
@thiagozs
thiagozs / Makefile
Last active October 31, 2024 19:52
Makefile semver
.PHONY: help
## ENVIRONMENT VARIABLES
VERSION_FILE = release-candidate.txt
SEMVER ?= 0.1.0
CURRENT_VERSION := $(shell [ -f $(VERSION_FILE) ] && cat $(VERSION_FILE) || echo $(SEMVER))
# Self-Documented Makefile
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@thiagozs
thiagozs / dynscan.go
Created July 12, 2024 12:57
Dynamic scan you query DB to struct golang
package dynscan
import (
"database/sql"
"fmt"
"reflect"
"strings"
"time"
"github.com/google/uuid"