Skip to content

Instantly share code, notes, and snippets.

@imba-tjd
imba-tjd / check.c
Created January 11, 2023 10:45
SQLite Device Characteristics Check
/* SQLite Device Characteristics Check
Goal:
Tell you whether -DSQLITE_ENABLE_ATOMIC_WRITE has benefits on your filesystem.
However I don't konw much about sqlite so the logic may not be right.
Usage:
Download sqlite3 source code.
gcc check.c sqlite3.c -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_ATOMIC_WRITE -DSQLITE_OMIT_LOAD_EXTENSION
@imba-tjd
imba-tjd / mi-ftp-open.cs
Last active November 18, 2024 11:10
快速打开我的小米的FTP
// csc /o /t:winexe mi-ftp-open.cs
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
class Program
{
static readonly string[] IPList = {
"192.168.0.100", "192.168.0.101", "192.168.0.102", "192.168.0.103", "192.168.0.104",
https://github.com/2noise/ChatTTS/blob/main/README_CN.md 免费版会加底噪
https://github.com/FunAudioLLM/CosyVoice
https://github.com/RVC-Boss/GPT-SoVITS
https://huggingface.co/spaces/hexgrad/Kokoro-TTS
讯飞:
https://www.ffkuaidu.com/ https://www.zhihu.com/question/443123456
https://github.com/coqui-ai/TTS
@imba-tjd
imba-tjd / youdao.py
Last active February 9, 2022 04:16
有道翻译2
'''fanyi.youdao.com 请求库。支持版本1和2,尽量精简,保留USER_ID且不伪装UA,自动获取新saltkey。不考虑网络异常'''
import urllib3
import time
import hashlib
import json
import logging
logger = logging.Logger(__name__)
logger.addHandler(logging.NullHandler())
__all__ = ['fanyi_v2', 'fanyi_v1']
@imba-tjd
imba-tjd / Update-Golang.psm1
Last active December 3, 2022 06:11
Update Node.js and Golang for Windows
function Get-GolangVer {
$ProgressPreference = 'SilentlyContinue'
$info = iwr 'https://golang.google.cn/dl/'
if (-not $?) { return }
$info -match '"toggleVisible" id="go(.+?)">' | Out-Null
$ver = $Matches[1]
$ProgressPreference = 'Continue'
return $ver
}
  • vertical scroll bar的行为,选Use bar mode
  • preview features,不要开Use new dark theme
  • font,调[All Text Tool Windows]
  • nuget package manager,格式选PackageReference,不清楚现在是不是默认值
  • debugging,勾上Automatically close the console when debugging stops
@imba-tjd
imba-tjd / cmdw.cs
Last active December 3, 2022 06:11
我也忘记这代码是做什么的了
using System.Diagnostics;
class CMDW {
static void Main(string[] args) {
Process.Start(new ProcessStartInfo("cmd") {
Arguments = string.Join(" ", args),
UseShellExecute = false,
CreateNoWindow = true
}).WaitForExit();
}
}
https://github.com/soimort/translate-shell
https://github.com/ssut/py-googletrans
https://github.com/hanmin0822/MisakaTranslator
https://github.com/PantsuDango/Dango-Translator
https://github.com/lmk123/crx-selection-translate
https://github.com/project-yuki/YUKI
https://github.com/UlionTse/translators/blob/master/translators/apis.py 有谷歌batchexecute的API
https://github.com/afc163/fanyi
https://github.com/Isayama-Kagura/TsubakiTranslator
https://github.com/CopyTranslator/CopyTranslator
@imba-tjd
imba-tjd / Routers.txt
Last active May 22, 2023 11:56
路由器
802.11a/b/g/n是WIFI4及之前的,n引入了MIMO和40M频宽;AC是WIFI5(802.11ac, 2013/2016),只支持5G;AX是WIFI6(802.11ax, 2018)
2.4G 40M频宽 单天线150M,5G单天线433M
AC1200是2x2 MIMO,2.4G 300M,5G 867M
AC1900是3x3,2.4G 600M,5G 1300M
AC2100是2.4G 2x2 300M,5G 4x4 1733M
AC2600是4x4
AX1800是2x2
Mesh(802.11k/v/r)自我修复,无缝漫游:能自动根据信号强弱切换路由器且不断网,多个路由之间真的平等,不区分WAN/LAN
WDS和有线要么线状要么星状,同名SSID切换时会断网且有低信号粘性,每加一级就速度减半
AC Wave2(2016)有MU-MIMO,支持同一时刻与多台终端交互,但要终端也都支持。AX改进了

Win下不安装MSVC使用Cython

vcruntime140.dll:涉及memset, strchr, wcschr等函数会用到

无法使用vcruntime140_app,会报ImportError: DLL load failed

ucrtbase不保证API不变,但是它是单个dll,更简洁;商店应用只能用ucrt,也是最正常的方式

编译用python setup.py build_ext -i -DMS_WIN64,结果在build和同级目录(-i)中,可用-c指定编译器。之后再bdist_wheel能成功,但不能直接bdist_wheel,因为好像不能在此verb的参数中定义宏。在setuptools.Extension中能定义宏,Extension.extra_compile_args能指定编译器,但暂时不想学。