Month: May 2025

How do I remove *.pyc files are already tracked by Git?

I have .gitignore in my repo but it’s not ignoring .pyc files. After investigation, I noticed that .gitignore only prevents new files from being tracked. If a .pyc file is already in the repository, Git will continue to track it even if it’s now in .gitignore. Solution Run the following command to remove tracked .pyc files:git rm –cached -r ‘*.pyc’…

Read More »

Discuz! DB fix

Login to MySQL: mysql -u your_user -p Then run: USE your_discuz_db; # My DB name is ultrax. SHOW TABLE STATUS WHERE Comment LIKE ‘%crashed%’; In my case, I can see 3 tables crashed. The output confirms that the key Discuz tables (pre_forum_post, pre_forum_sofa, and pre_forum_thread) are badly corrupted. Step-by-Step Recovery with myisamchk Because myisamchk works on raw table files, MySQL must not be running: sudo systemctl stop…

Read More »