Skip to content

Instantly share code, notes, and snippets.

View cpuwolf's full-sized avatar
🎯
Focusing

Wei Shuai cpuwolf

🎯
Focusing
View GitHub Profile
#include <vector>
#include <cstdint>
#include <stdexcept>
#include <algorithm>
#include <iostream>
#include <bitset> // For printing binary in main
#include <iomanip> // For std::hex, std::setw, std::setfill in main
// Assuming a max byte array length of 20 bytes
// Max bit offset: 20 bytes * 8 bits/byte = 160 bits (relative to start of array)
@cpuwolf
cpuwolf / bios.py
Created January 19, 2026 22:43
i9 14900K ASUS BIOS change
Performance Core0 Specific Ratio Limit [Auto]->[56]
Performance Core1 Specific Ratio Limit [Auto]->[56]
Performance Core2 Specific Ratio Limit [Auto]->[56]
Performance Core3 Specific Ratio Limit [Auto]->[56]
Performance Core4 Specific Ratio Limit [Autoj->[56]
Performance Core5 Specific Ratio Limit [Auto]->[56]
Performance Core6 Specific Ratio Limit [Auto]->[56]
Performance Core7 Specific Ratio Limit [Auto]->[56]
IA VR Voltage Limit [Auto]->[1450]
@cpuwolf
cpuwolf / QMPE_JENNY.lua
Last active October 27, 2025 11:42
show system local data and time
-- *****************************************************************
-- created by Wei Shuai <cpuwolf@gmail.com> 2025-10-21
-- *****************************************************************
if ilua_is_acfpath_excluded("jenny") or ilua_is_acfpath_excluded("curt") then
return
end
-- Do not remove below lines: hardware detection
local qmpe = com.sim.qm.Qmpe:new()
if not qmpe:Init() then
@cpuwolf
cpuwolf / QMOVHA_pmdg777.lua
Created October 25, 2025 10:55
QMOVH-A PMDG-777 christmas tree blink, must run inside QmdevSimConnect 5.0 and above
-- *****************************************************************
-- created by Wei Shuai <cpuwolf@gmail.com> 2025-10-21
-- *****************************************************************
if ilua_is_acfpath_excluded("PMDG") or ilua_is_acfpath_excluded("777") then
return
end
-- Do not remove below lines: hardware detection
local qmovha = com.sim.qm.Qmovha:new()
if not qmovha:Init() then
@cpuwolf
cpuwolf / dynamicdnsupdater.sh
Created April 1, 2024 12:01
Dynamic update DNS inside UFW
#!/bin/bash
#SET THE FOLLOWING
HOSTNAME=xxx.com
SSH_PORT=27017
WIREGUARD_PORT=27017
#IF IT DOES NOT WORK, AT LEAST ON UBUNTU INSTALL, bind-utils to get the host command
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************
*** WARNING: Unable to verify checksum for WwiseLibPCx64P.dll
*** WARNING: Unable to verify checksum for libcrypto-1_1-x64.dll
*** WARNING: Unable to verify checksum for CoherentUIGT.dll
*** WARNING: Unable to verify checksum for WTF.dll
@cpuwolf
cpuwolf / AirScriptII.js
Last active January 12, 2024 07:37
金山数据表Airscript数据处理
//
// Get a date object for the current time
var d = new Date();
// Set it to one month ago
d.setMonth(d.getMonth() - 1);
d.setDate(1)
// Zero the time component
d.setHours(0, 0, 0, 0);
// Get the time value in milliseconds and convert to seconds
@cpuwolf
cpuwolf / AirScript.js
Last active January 12, 2024 06:12
金山文档数据表查询脚本AirScript
//
// Get a date object for the current time
var d = new Date();
// Set it to one month ago
d.setMonth(d.getMonth() - 1);
d.setDate(1)
// Zero the time component
d.setHours(0, 0, 0, 0);
// Get the time value in milliseconds and convert to seconds
@cpuwolf
cpuwolf / gist:2b884e0d9432208a1b54f026f130e039
Created December 21, 2023 09:49
Xiaomi Miot Auto延迟问题,反应慢
Xiaomi Miot Auto是以默认15秒轮询的方式运行。
所以不要用Xiaomi Miot Auto实时触发事件,Node-RED中,最好也用轮询来开始你的逻辑。
对于实时触发事件,我建议放在米家做,比home assitant效果好很多
作者给出了详细的解释,非常合理
https://github.com/al-one/hass-xiaomi-miot/issues/100#issuecomment-909031222
@cpuwolf
cpuwolf / run.cmd
Last active September 23, 2023 22:13
run power shell script from batch file
::written by cpuwolf@gmail.com 2023 Sep.
::
::must run as administrator
@chcp 437 >nul 2>&1
:: Add value for UAC shield icon:
REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas" /v HasLUAShield /t REG_SZ /d "" /f
:: Add value to create context menu item:
REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas\command" /ve /t REG_EXPAND_SZ /d "\"%%SYSTEMROOT%%\System32\WindowsPowerShell\v1.0\powershell.exe\" -executionpolicy bypass -nologo -file \"%%1\"" /f