Skip to content

Instantly share code, notes, and snippets.

View danilogco's full-sized avatar

Danilo Carolino danilogco

View GitHub Profile
@danilogco
danilogco / Tutorial.md
Last active November 7, 2026 19:21
NVIDIA secure boot MOK - Ubuntu - Linux Mint

Enrolling the NVIDIA driver key (MOK) with Secure Boot enabled

For Linux Mint and Ubuntu with the NVIDIA driver installed through the Driver Manager.

Why this is needed: with Secure Boot on, Linux only loads modules signed by a key the firmware knows. The NVIDIA driver is compiled on your PC and signed with a local key. That key must be enrolled once. If it is not, the driver does not load and rendering falls back to the CPU.

1. Check that this is really the problem

nvidia-smi
@danilogco
danilogco / config.sh
Created October 13, 2026 22:04
Git global config + cleanup alias + gpg sign
[user]
email = email@gmail.com
name = User
signingkey = XXXXXXXXXXXXX
[pull]
rebase = true
[alias]
cleanup = "!f() { git fetch -f --prune && def=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||'); cur=$(git branch --show-current); git branch --format='%(refname:short)' | grep -Ev \"^(dev|master|main|$def|$cur)$\" | xargs --no-run-if-empty git branch -D; git gc; }; f"
[commit]
template = /home/User/.gitmessage
@danilogco
danilogco / resize.sh
Created October 6, 2026 16:44
Fix p10k resize bug
sed -i.bak3 '/POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(/,/^ *)/{ /^ *newline/s/^\( *\)/\1# / }' ~/.p10k.zsh && exec zsh
sed -i.bak2 '/POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(/,/^ *)/{ /RIGHT_PROMPT_ELEMENTS=(/b; /^ *)/b; /^ *#/b; /^ *$/b; s/^\( *\)/\1# / }' ~/.p10k.zsh && exec zsh
@danilogco
danilogco / nvidia_mok_enrollment.md
Created September 24, 2026 16:57
Linux Mint + SecureBoot - Nvidia MOK enrollment

Registrar a chave (MOK) do driver NVIDIA com Secure Boot ativo

Para Linux Mint e Ubuntu com o driver NVIDIA instalado pelo Gerenciador de Drivers.

Por que é preciso: com o Secure Boot ligado, o Linux só carrega módulos assinados por uma chave que o firmware conhece. O driver NVIDIA é compilado no seu PC e assinado com uma chave local. Essa chave precisa ser registrada (fazer o "enroll") uma vez. Se não for, o driver não carrega e a imagem fica na CPU.

1. Ver se esse é mesmo o problema

nvidia-smi
@danilogco
danilogco / aws_update.sh
Last active March 29, 2026 18:04
Check and update all AWS clients / aws cli, cdk, kubectl, sam
#!/usr/bin/env bash
set -Eeuo pipefail
readonly TMP_DIR="$(mktemp -d)"
readonly ARCH="$(uname -m)"
readonly TARGET="${1:-all}"
AWS_ARCH=""
K8S_ARCH=""
SAM_ARCH=""
@danilogco
danilogco / gist:ad5fa0d37204698b4d1e02ea93cb2a11
Created March 10, 2026 17:42
Linux Mint fix for broadcom-sta (Wifi)
cd /tmp
wget https://archive.ubuntu.com/ubuntu/pool/restricted/b/broadcom-sta/broadcom-sta-dkms_6.30.223.271-23ubuntu1.2_all.deb
sudo apt install ./broadcom-sta-dkms_6.30.223.271-23ubuntu1.2_all.deb
sudo nano /etc/docker/daemon.json
```json
{
"iptables": false
}
```
---
# 1. Verifique se o Docker parou de mexer no iptables
@danilogco
danilogco / gist:c2eefc066d63fe7d6f49ce18a9c40037
Created September 3, 2025 04:11
Logitech G PRO X TKL (Linux mint based)
sudo cp /usr/share/X11/xkb/symbols/us /usr/share/X11/xkb/symbols/us_shiftaccents
sudo nano /usr/share/X11/xkb/symbols/us_shiftaccents
# No arquivo, adicione uma nova variante que herde do us(intl):
partial alphanumeric_keys
xkb_symbols "shift_accents" {
include "us(intl)"
// Acentos com Shift
key <AC01> { [ a, A, aacute, Aacute ] }; // A
@danilogco
danilogco / no-network-change.sh
Last active September 2, 2025 17:01
Stop "network changed" message in browser while using docker
sudo nano /etc/NetworkManager/conf.d/10-ignore-docker.conf
# add it inside the file
# [keyfile]
# unmanaged-devices=interface-name:br-*;interface-name:veth*;interface-name:docker*;interface-name:lo
docker network prune
@danilogco
danilogco / install.sh
Last active June 27, 2026 19:50
Install Bluemail on Linux Mint/Debian/Ubuntu without snapshit
wget https://download.bluemail.me/BlueMail/deb/BlueMail.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gconf/gconf2-common_3.2.6-6ubuntu1_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gconf/libgconf-2-4_3.2.6-6ubuntu1_amd64.deb
sudo dpkg -i gconf2-common_3.2.6-6ubuntu1_all.deb
sudo dpkg -i libgconf-2-4_3.2.6-6ubuntu1_amd64.deb
sudo dpkg -i BlueMail.deb
# add --no-sandbox in the end of the launcher command