Mac App: Mac Mouse Fix

💡 Make sure your mouse uses generic USB driver other than a private or modified protocol, or the below contents may not be applied to your case. Further discussion: https://github.com/noah-nuebling/mac-mouse-fix/discussions/935 Today I found Logi Options Plus consumes a lot of memory: What the heck? Should you take more than 512 MB memory, Logi? It makes no sense. A friend recommended me an open source project: mac-mouse-fix. I have taken a deep look into it and find that’s really awesome!...

April 26, 2024 · 2 min · 260 words · Me

Migrate Big Table in MySQL

Migrate MySQL big table(50 Million) rows using insert into xxx select * from yyy and it said ERROR 1206 (HY000): The total number of locks exceeds the lock table size It’s due to MySQL MVCC control, the rows were in memory and exceeds the limit. You can use this command to quickly find the limit: SELECT @@innodb_buffer_pool_size/1024/1024/1024; For me, that’s 0.125. So I changed it by this command: SET GLOBAL innodb_buffer_pool_size = 1073741824; 10x the original size, so everything works fine....

April 11, 2024 · 1 min · 138 words · Me

Helm stucking at "Uninstalling" Status

Sometimes if we do not pay attention to the helm release uninstallation order, like we removed one release which includes CRDs and then we try to remove a customized resource which does not have a reference or finalization, that means this resource will cause resource recycle stuck, in other words, the helm release stuck at “uninstalling” status. There is a quick fix which can easily sort it out. helm plugin install https://github....

April 6, 2024 · 1 min · 103 words · Me

TOTP in Go

一个很小的 TOTP 的实现 代码写的非常简洁易懂 代码注释已经说明了每一步的实现 package main import ( "crypto/hmac" "crypto/sha1" "encoding/base32" "encoding/binary" "fmt" "strings" "time" ) func generateTOTP(secretKey string, timestamp int64) uint32 { // The base32 encoded secret key string is decoded to a byte slice base32Decoder := base32.StdEncoding.WithPadding(base32.NoPadding) secretKey = strings.ToUpper(strings.TrimSpace(secretKey)) // preprocess secretBytes, _ := base32Decoder.DecodeString(secretKey) // decode // The truncated timestamp / 30 is converted to an 8-byte big-endian // unsigned integer slice timeBytes := make([]byte, 8) binary....

March 24, 2024 · 2 min · 278 words · Me