Skip to content

Instantly share code, notes, and snippets.

View brccabral's full-sized avatar
🐔
Vamos, Galo! Ganhar o Brasileiro!

Bruno Cabral brccabral

🐔
Vamos, Galo! Ganhar o Brasileiro!
View GitHub Profile
@brccabral
brccabral / 01_README.md
Last active August 24, 2026 05:26
Nginx Proxy Manager using Docker

Nginx Proxy Manager using Docker

Add NPM to a shared-net, then add all new web applications to same network and reference them by hostname in the proxy creation.

networks:
  shared-net:
    name: shared-net
services:
  npm:
@brccabral
brccabral / 01_README.md
Created February 26, 2026 23:32
C# init Solution with multiple projects

C# init Solution with multiple projects

mkdir SomeSolution
cd SomeSolution
dotnet new sln -n SomeSolution
dotnet new console -o ConsoleApp
dotnet new winforms -o WinFormApp
dotnet sln add ConsoleApp\ConsoleApp.csproj
dotnet sln add WinFormApp\WinFormApp.csproj
@brccabral
brccabral / 01_README.md
Created February 26, 2026 21:45
C# in VSCode

C# in VSCode

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "dotnet: build Release",
            "command": "dotnet",
@brccabral
brccabral / 01_README.md
Last active July 28, 2026 02:18
Python log to both file and stderr

Python log to both file and stdout

import sys
import logging
from logging.handlers import RotatingFileHandler

stdout_handler = logging.StreamHandler(sys.stdout)
rotate_handler = RotatingFileHandler("logs/rotate.log", maxBytes=5000000, backupCount=10)
@brccabral
brccabral / 01_README.md
Last active August 23, 2026 08:03
Gitlab CE

Gitlab CE

networks:
  gitlab:
    driver: bridge
  shared-net:
    external: true

services:
@brccabral
brccabral / 01_README.md
Last active August 30, 2025 22:05
C++ Print formatter

std::print - C++ Print formatter

  • To use std::print need g++-14 and compile with -std=c++23.
    sudo apt install g++-14
    sudo rm /usr/bin/g++
    sudo ln -s /usr/bin/g++-14 /usr/bin/g++

g++ -std=c++23 print_me.cpp -o print_me

@brccabral
brccabral / 01_README.md
Last active October 17, 2025 21:22
Emscripten

Emscripten

  • Clone and install SDK
    • save $EMSDK as environment var in your .profile/.zprofile/.bashrc/zshrc to make it easier later
    • install will run for a long time
git clone --depth=1 --recurse-submodules --shallow-submodules https://github.com/emscripten-core/emsdk.git
cd emsdk
export EMSDK=$(pwd) # save in you .profile or .bashrc/.zshrc
$EMSDK/emsdk install --shallow sdk-main-64bit # this takes a long time
@brccabral
brccabral / README.md
Last active December 29, 2025 23:35
Let's Encrypt Certbot

Let's Encrypt Certbot

sudo apt update
sudo apt install python3 python3-venv libaugeas0
# remove if installed from package manager, use python version
# sudo apt-get remove certbot
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx
@brccabral
brccabral / 01_README.md
Created March 3, 2025 20:11
Termux Config

Termux Config

Install Termux from F-Droid.

Update and install useful packages.

pkg update
pkg upgrade
pkg install openssh
pkg install iproute2
@brccabral
brccabral / 01_Readme.md
Last active February 27, 2026 18:12
Ollama OpenWebUI Raspberry Pi

Ollama OpenWebUI Raspberry Pi

  • Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
  • Install the models
ollama run deepseek-r1:1.5b
ollama stop deepseek-r1:1.5b