Skip to content

Instantly share code, notes, and snippets.

View learnerLj's full-sized avatar
🎯
Focusing

Michael Luo learnerLj

🎯
Focusing
View GitHub Profile
xcode-select --install
sudo cp -R /Applications/WeChat.app /Applications/WeChat2.app
sudo /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier com.tencent.xinWeChat2" /Applications/WeChat2.app/Contents/Info.plist
sudo codesign --force --deep --sign - /Applications/WeChat2.app
nohup /Applications/WeChat2.app/Contents/MacOS/WeChat >/dev/null 2>&1 &
@learnerLj
learnerLj / readvideo.sh
Created July 6, 2025 17:37
1. 输入识别 - 自动判断是URL还是本地文件 2. 音频获取 - 下载或读取音频文件 3. 格式转换 - 统一转换为16kHz单声道WAV 4. 语音转录 - 使用large-v3模型转录 5. 文件输出 - 生成.txt转录文件 6. 清理临时文件 - 删除中间WAV文件
#!/bin/bash
# 检查参数
if [ $# -eq 0 ]; then
echo "Usage: readvideo <video_url_or_audio_file>"
echo "Supports:"
echo " - YouTube: https://www.youtube.com/watch?v=..."
echo " - Bilibili: https://www.bilibili.com/video/BV..."
echo " - Local audio: audio.mp3, audio.m4a, audio.wav, etc."
echo ""
fio --name=random_read_iops_test \
--ioengine=posixaio \
--rw=randread \
--bs=4k \
--size=10G \
--numjobs=16 \
--iodepth=64 \
--runtime=60 \
--time_based \
--filename=fio_test_file \
@learnerLj
learnerLj / solana_tx.json
Created April 8, 2025 01:17
solana transction example
{
"slot":331916416,
"transaction":{
"signatures":[
"3TJB6skkXLyDKxxjREX3tGcMt1DHJxnWoK74KPkoDwNUniXJuhXhKbNrHp4qrqeZofD9gQH7gpX7jfi5RBRxV7uH"
],
"message":{
"header":{
"numRequiredSignatures":1,
"numReadonlySignedAccounts":0,
@learnerLj
learnerLj / link_box.rs
Created March 28, 2025 19:20
singly-linked list implemented by Box
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
class SortingVisualizer:
def __init__(self, array_size=50, speed=10):
"""Initialize the sorting visualizer."""
self.array_size = array_size
self.speed = speed
self.array = np.random.randint(1, 101, array_size)
@learnerLj
learnerLj / decrypt-mac-chrome-password.py
Last active December 25, 2024 10:33
此脚本适用于较老版本的 Chrome(使用 AES-128-CBC + PBKDF2("saltysalt", 1003, length=16) + 固定 IV = 16 个 0x20 空格)。如果你的 Chrome 版本较新,改用 AES-GCM,以及hash算法改变,那么该脚本可能无法解密。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import glob
import sqlite3
import hashlib
import subprocess
import binascii
corrupted double-linked list
SIGABRT: abort
PC=0x7f33955b700b m=9 sigcode=18446744073709551610
signal arrived during cgo execution
goroutine 4363907769 [syscall]:
runtime.cgocall(0x1693870, 0xc221494cb8)
#011runtime/cgocall.go:157 +0x5c fp=0xc221494c90 sp=0xc221494c58 pc=0x41965c
github.com/cockroachdb/pebble/internal/manual._Cfunc_free(0x7f3328b9b2f0)
#011_cgo_gotypes.go:57 +0x45 fp=0xc221494cb8 sp=0xc221494c90 pc=0xaa1145
@learnerLj
learnerLj / fibMonad.hs
Last active January 8, 2024 14:44
mutable
module Mp14 where
import Control.Monad (forM_)
import Control.Monad.ST
import Data.STRef
fibM :: Intger -> Intger
fibM n
| n <= 0 = 0
| otherwise = runST $ do
@learnerLj
learnerLj / monadArray.hs
Created January 8, 2024 08:59
monad example
import Control.Monad (forM_)
import Data.Array
import Data.Array.ST
dynamicProgramming :: Int -> Array Int Int
dynamicProgramming n = runSTArray $ do
arr <- newArray (1, n) 0
writeArray arr 1 1
forM_ [2 .. n] $ \i -> do
val <- readArray arr (i - 1)