Tips
Kubernetes Batch Operation Commands
· β˜• 1 min read
1. Delete Pods in the Evicted State in Bulk 1 kubectl get pods --all-namespaces -o wide | grep Evicted | awk '{print $1,$2}' | xargs -L1 kubectl delete pod -n 2. Delete Pods in a Given State in a Given Namespace in Bulk Using field-selectors, you can delete Pods in a given state in a given namespace.

Advanced curl Usage
· β˜• 1 min read
1. RESTful Requests 1 curl -X POST --data 'keyword=value' http://domain.com/mypath/ After -X you can also use DELETE, PUT, and so on. 2. Adding Headers 1 curl -H 'Content-Type:application/json' -H 'Authorization: bearer MyToken' http://domain.com/mypath/ 3. Basic Authentication 1 curl -u username:password http://domain.com/mypath/ 4. Download and Execute 1 curl -sSL http://domain.com/my.sh | bash 5.

Surface Pen Not Responding
· β˜• 1 min read
Recently, while using my Surface, I dug out the stylus and found it was out of battery. I swapped in a new AAAA battery, and then discovered the pen tip had stopped responding to touch. Many documents online recommend uninstalling Marvell AVASTAR Bluetooth and rebooting for this to take effect. But that method did not work for me; uninstalling Precise Touch Device is what actually worked.

Docker Tips You Didn't Know
· β˜• 3 min read
1. Multi-Stage Builds Compiling a project requires a set of specific tools, but those tools are not needed at runtime. To reduce the image size, you can build in stages. Build in the first stage, then carry the compiled output into the next stage to produce a smaller image. 1 2 3 4 5 6 7 8 9 10 11 FROM golang:1.

How to Clear All Commit History from a Git Repository
· β˜• 1 min read
Here we take clearing the entire commit history of the main branch as the example. Switch to the main branch 1 git checkout main Create a clean branch 1 git checkout --orphan new_main Commit all files 1 2 git add -A git commit -m "msg" Delete the main branch 1 git branch -D main Rename the new branch to main 1 git branch -m main Force push to the remote repository 1 git push -f origin main