Sometimes we don’t need commit history from long time ago, and only want to keep last n commits. For example: Let’s say we want to perform this operation on our main branch, and backup the previous status as another branch main_old, then force push new main branch to the remote. The PowerShell script above willContinue reading “Create New Branch Only Contains Last N Commits”
Category Archives: Techs
Anime Upscaling Workflow Research
Incentive My incentive to do this is that one of my commonly used 4K super-resolution subtitle group stop their activity, and I still want to be able to watch latest 4K anime, so I need to find a way to perform super resolution on existing 1080P anime video resources. Real-time Shader There are things likeContinue reading “Anime Upscaling Workflow Research”
Move Docker Data Directory
Why I Need to Do This I have a server with both SSD and HDD, concretely: I use this VPS to run my blog and some docker containers. Here comes the problem: 50GB SSD is not enough. I mount the HDD at /sto to store some large files like videos and cloud backups. However, DockerContinue reading “Move Docker Data Directory”
Shallow Git Repository
Create Shallow Repository Just run shallow fetch command: Unshallow Checkout official doc for more info. Remove Unused Remote Branch Update Fetch Config We can edit the git config file to determine which branches should be fetched automatically. As you see, we could change the fetch config in the remote section to tell Git which branchContinue reading “Shallow Git Repository”
Use Clash TUN and Fiddler Everywhere to Capture All Traffic
If you are not familiar with Clash Meta and Fiddler Everywhere, follow the link to learn about them before reading this post. Basic Thought Then we have the following thought: Rule Settings First create an HTTP proxy node pointing to Fiddler Everywhere HTTP proxy: Based on previous settings, the actual config should be: Note thatContinue reading “Use Clash TUN and Fiddler Everywhere to Capture All Traffic”
VS Code Python Project PowerShell Integration
This article introduces an approach to enable VS Code PowerShell integration in Python projects, including some basic python environment management. Define Helper Function Note in some cases, code.cmd could be mandatory instead of code, otherwise there could be error. You could use Get-Command to check details about it: VS Code Workspace Config Below are someContinue reading “VS Code Python Project PowerShell Integration”
Disable Jetpack Image Optimization
When using WordPress with Jetpack plugin, the image in the post will be automatically optimized to use Jetpack CDN: And such image hosted on CDN could have lower quality compared to the original image you provided. To avoid this, we could go to the Jetpack settings to disable image optimation: After this, the image shouldContinue reading “Disable Jetpack Image Optimization”
Check Actual Memory Usage on Windows 11
Sometimes, the total memory usage show up in the “Memory” tab is not the same with the sum-up value in “Processes” tab. Concretely: This post provided an approach to check the actual memory usage of running processes and thus to locate a memory leak of a certain program. Which Process Used the Memory We couldContinue reading “Check Actual Memory Usage on Windows 11”
Create Shared-Permission Directory Using ACL
Senarios Let’s say we have a directory animes, with several sub directories, one of which is animes/Dandadan. And now: In this scenario, we could use ACL (getfacl and setfacl) to achieve such permission management. Check ACL Status First let’s go to animes directory: -a/–access means only showing the access setting, without default::*, we will useContinue reading “Create Shared-Permission Directory Using ACL”
Clash Load Balancing to Bypass Speed Limit
Note: Author is using: As the image shows, some proxy providers will provide some nodes specifically dedicated to downloading task, with lower ratio but lower rate limit (10Mbps in image above). This post demonstrates how to use Load Balance proxy group feature in clash core to download files using several such “download nodes”, effectively bypassingContinue reading “Clash Load Balancing to Bypass Speed Limit”