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 March 3, 2026 09:24
Self-Signed Certificate with Self-Signed CA

Self-Signed Certificate with Self-Signed CA

Create file san.cnf

[ v3_req ]
subjectAltName = @alt_names

[ alt_names ]
DNS.1 = *.myserver.local
DNS.2 = myserver.local
@brccabral
brccabral / 01_README.md
Last active March 1, 2026 01:35
Nginx Proxy Manager using Docker

Nginx Proxy Manager using Docker

We need NPM to run in network host so it can make use of 127.0.0.1 when setting new hosts, otherwise it will be considered NPM container itself, not the server.

services:
  app:
    container_name: nginxproxymanager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
@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
Created February 6, 2026 01:20
Python log to both file and stderr

Python log to both file and stderr

import sys
import logging
from logging.handlers import RotatingFileHandler

stderr_handler = logging.StreamHandler(sys.stderr)
rotate_handler = RotatingFileHandler("logs/rotate.log", maxBytes=5000000, backupCount=10)
@brccabral
brccabral / 01_README.md
Last active March 2, 2026 00:46
Gitlab CE

Gitlab CE

networks:
  gitlab:
    driver: bridge

services:
  gitlab:
 container_name: gitlab
@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