Skip to content

Instantly share code, notes, and snippets.

View pythrick's full-sized avatar

Patrick Rodrigues pythrick

View GitHub Profile
@gianlucamazza
gianlucamazza / distrobox-macos-setup.sh
Created May 3, 2025 00:12
Installing Distrobox on macOS with full Podman support
#!/bin/bash
# Strict mode: exit on error, exit on unset variable, pipefail
set -euo pipefail
echo "🚀 Installing Distrobox on macOS with full Podman support..."
# 1. Check for Homebrew
if ! command -v brew >/dev/null 2>&1; then
echo "❌ Homebrew is not installed. Please install it first: https://brew.sh"
@akshayverma1
akshayverma1 / BootCamp Driver Installation Guide.md
Last active April 9, 2026 02:01
How to get Apple peripherals to work on a Windows PC

How to get Apple peripherals to work on a Windows PC

Published: 8 February, 2024

Updated: 7 April, 2026


This guide will help you get your Apple Studio Display, ProDisplay XDR, Magic Keyboard, Magic Mouse, Magic Trackpad, etc. to work with a Windows 11 PC that doesn’t have native support for BootCamp. I wrote this guide because most methods that I could find elsewhere were either out of date, had sketchy download links, had compatibility issues with Windows 11 version 23H2, didn't support Windows Precision Touchpad, didn’t support all the modules in the BootCamp app, or didn’t explain how to get the most up to date Apple official drivers.

@contraexemplo
contraexemplo / pulseaudio-noise-cancelling.md
Last active October 20, 2023 18:15
Como ativar o módulo de cancelamento de ruído do PulseAudio

Primeiro, verifique se o módulo está presente na sua instalação digitando pacmd em seu terminal, listando todos os módulos presentes pelo comando list-modules e procurando por module-echo-cancel. Não está presente? Você precisa adicionar algumas linhas ao arquivo de texto responsável pela configuração do PulseAudio.

Com o seu editor favorito, abra (com privilégios de administrador) o arquivo /etc/pulse/default.pa e adicione as seguintes linhas ao fim do arquivo:

### Enable Echo/Noise-Cancellation
load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0\ digital_gain_control=1" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active April 11, 2026 11:44
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@manuelep
manuelep / default.py
Last active April 1, 2020 13:00
authenticate woocommerce webhook
def compute(body):
secret = '<here is my secret key>'
dig = hmac.new(secret.encode(),
msg = body.encode(),
digestmod = hashlib.sha256
).digest()
computed = base64.b64encode(dig).decode()
return computed
import os
import pytest
from alembic.command import upgrade
from alembic.config import Config
from project.factory import create_app
from project.database import db as _db