Skip to content

Instantly share code, notes, and snippets.

View fellipec's full-sized avatar
💾
Coding for fun.

Luiz Fellipe Carneiro fellipec

💾
Coding for fun.
View GitHub Profile
@fellipec
fellipec / kernel_rollback.md
Created July 28, 2026 19:22
Linux Kernel Rollback Instructions
@fellipec
fellipec / mcu.md
Created July 12, 2026 20:18
MCU MIDI Note controls - Mackie Control Universal
Função Canal Hex Decimal Nota MIDI
REC 1–8 0x00–0x07 0–7 C‑2 → G‑2
SOLO 1–8 0x08–0x0F 8–15 G#‑2 → D#‑1
MUTE 1–8 0x10–0x17 16–23 E‑1 → B‑1
SELECT 1–8 0x18–0x1F 24–31 C‑0 → G‑0
V‑POT PUSH 1–8 0x20–0x27 32–39 G#‑0 → D#‑1
Função Hex Decimal Nota MIDI
@fellipec
fellipec / userscript.js
Created July 11, 2026 22:14
Convert flat to sharp in Cifraclub website
// ==UserScript==
// @name Cifra Club - Sustenidos
// @namespace https://example.com/
// @version 4.0
// @description Converte acordes bemóis para sustenidos (mantendo Bb)
// @match *://*.cifraclub.com.br/*
// @grant none
// ==/UserScript==
(function () {
@fellipec
fellipec / restic-diff-summary.py
Last active June 17, 2026 12:54
Diff summary for Restic backups
#!/usr/bin/env python3
import sys
from collections import defaultdict
import os
# Cores ANSI
GREEN = "\033[32m"
RED = "\033[31m"
YELLOW = "\033[33m"
BOLD = "\033[1m"
@fellipec
fellipec / Teclado-ABNT-Lenovo.reg
Created April 11, 2026 22:56
Tecla / e ? do ThinkPad no Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,73,00,1d,e0,00,00,00,00
@fellipec
fellipec / dc-dc.md
Created November 7, 2025 23:42
How to use an DC-DC isolated converter to avoid noise in sound systems

Some devices, like Bluetooth decoders, have problems with some noise when connected to amplifiers or receivers. Apparently, most of times the issue is a ground loop. That can happen in several devices, like those generic MP3/Bluetooth boards, or those USB powered adapters intended to use in older car units, when the same power supply delivers energy to the amplifier and to the Bluetooth receiver.

One fix is to power the Bluetooth receiver with another power supply. This can work in a car, where instead of using the head unit USB port, you use a cigarette lighter outlet or a power bank. But in the case of a custom speaker like, that is not feasible, or at least impractical.

Enter the DC-DC isolated converters, like the B1212S and others DC-DC isolators. They ta

@fellipec
fellipec / search_i2c.ino
Created May 4, 2025 13:01
Search I²C devices on Arduino compatible boards
#include <Wire.h>
// Mudar conforme a placa
#define SDA_PIN = 14
#define SCL_PIN = 12
void setup() {
Wire.begin(SDA_PIN, SCL_PIN);
Serial.begin(115200);
@fellipec
fellipec / pihole-dhcp.md
Last active May 14, 2026 23:06
Pi-Hole DHCP configuration guide

Introduction

Pi-Hole's primary function is to be a DNS server with the ability to block domains, usually used for advertising, tracking or other unwanted sites. It also features a built-in DHCP Server.

Usually, your router will also have a built-in DHCP server, pre-configured from factory, and for most users this is perfectly fine. But in some cases you may want to run another DHCP server instead of relying on your router's one. This guide will help you understand how a DHCP server works and how to configure it without disturbing your network.

If you already know the networking basics, you can cut to the chase and read just the configuration part

Understanding the IP Addressing

@fellipec
fellipec / everythingisafile.md
Created January 25, 2025 12:18
Everything is a file

To Linux evertything is a file.

When you run mkfs.ext4 /dev/sdx or mkfs.ext4 /dev/sdx1 or even mkfs.ext4 /tmp/dummyfile it doesn't care where it is creating your filesystem, it just does.

Let's demonstrate:

  1. First, let's create a 1GB file in my home dir:
dd if=/dev/zero of=testfile bs=1G count=1 oflag=direct status=progress
@fellipec
fellipec / fingerprint.md
Created November 15, 2024 11:55
Enable finger print authentication, but not for the first login

Enable fingerprint authentication, but not for the first login

Install and enable the fingerprint authentication in pam

First, install the required packages and enable fingerprint support in the PAM configuration:

# Install the module
sudo apt install fprintd libpam-fprintd