Author: Henry

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 »

Issue: An event source mapping with SQS arn (” arn:aws:sqs:* “) and function (” * “) already exists. Please update or delete the existing mapping with UUID dc07eb6b-b360-4f6c-9e41-1eb1835cc678

My Cloudformation stack is created with above error and its status is ROLLBACK_COMPLETE. After my investigation, I notice that at times what happens is that the mapping will still remain even though the stack is deleted. Easiest way to get around it would be to use AWS CLI and delete the mapping. I delete the event source mapping with UUID…

Read More »