Skip to content

Instantly share code, notes, and snippets.

View TRSWNCA's full-sized avatar
🎯
Focusing

Chen Yichi TRSWNCA

🎯
Focusing
View GitHub Profile
@TRSWNCA
TRSWNCA / build-python-on-musl.md
Created October 1, 2025 02:05
Coding Journal: Build Python on musl

Build Python on musl

Docker error

Context: Working with python-build-standalone project on Manjaro Linux, attempting to build Python for x86_64-unknown-linux-musl target. The Docker build process was failing during package installation phase in Debian-based containers.

Problem/Need:

  • Docker build failing with "Unable to locate package" errors for essential build tools
  • Outdated Debian Jessie snapshot repositories from March 2023 were no longer accessible
  • Multiple packages (bzip2, ca-certificates, curl, gcc, make, etc.) could not be installed in Docker containers
@TRSWNCA
TRSWNCA / opentabletdriver-autostart.md
Last active October 1, 2025 02:06
Coding Journal: OpenTabletDriver Autostart

OpenTabletDriver Autostart

Context: Setting up OpenTabletDriver daemon auto-launch on a systemd-based Linux system where the service failed to start automatically due to unmet display server conditions.

Problem/Need: The opentabletdriver.service failed to start because it required DISPLAY or WAYLAND_DISPLAY environment variables that weren't available when the systemd user service initialized.

Solution/Approach: Created a systemd service override to explicitly set environment variables and remove restrictive conditions:

# Create override directory and config
mkdir -p ~/.config/systemd/user/opentabletdriver.service.d/
cat <<EOF > ~/.config/systemd/user/opentabletdriver.service.d/override.conf
@TRSWNCA
TRSWNCA / certbot-ssl-auto-renewal.md
Created September 30, 2025 08:47
Coding Journal: Certbot: SSL Auto-renewal

Certbot: SSL Auto-renewal

Context: Managing HTTPS certificates for multiple domains via Certbot, previously done manually. The system lacked default renewal tasks.

Problem/Need: Automate certificate renewal monthly via cron while preserving custom Nginx paths (/usr/local/nginx/conf), ensuring zero downtime.

Solution/Approach:

  1. Create cron job (run as root):
    sudo crontab -e
@TRSWNCA
TRSWNCA / cursor-bypass-model-region-blocking.md
Created September 30, 2025 08:47
Coding Journal: Cursor: Bypass model region-blocking

Cursor: Bypass model region-blocking

Context: Cursor’s AI models are region-locked, requiring a proxy for access in unsupported regions.

Problem/Need:

  • While a system-wide TUN proxy works, it’s not an elegant solution.
  • Attempting to use proxychains caused crashes (zygote_host_impl_linux.cc errors) and network timeouts.
  • Needed a native proxy solution to avoid Electron compatibility issues.

Solution/Approach:

@TRSWNCA
TRSWNCA / git-modify-author-information.md
Created September 30, 2025 08:47
Coding Journal: Git: Modify author information

Git: Modify author information

Context: In a Git - based project, there were multiple commits made with an incorrect author. To ensure proper attribution, it was necessary to change the author of these commits to Chen Yichi <trswnca@yeah.net>.

Problem/Need: Change the author information of six specific commits in the Git repository to Chen Yichi <trswnca@yeah.net>.

Solution/Approach:

  1. Start an interactive rebase:
git rebase -i 2028312c0e4325e5eccbc72f12fe47adbce2df98^