Skip to content

Instantly share code, notes, and snippets.

View cpuwolf's full-sized avatar
🎯
Focusing

Wei Shuai cpuwolf

🎯
Focusing
View GitHub Profile
@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
@cpuwolf
cpuwolf / rmNvidia.ps1
Last active September 24, 2023 22:46
#written by cpuwolf@gmail.com 2023 Sep.
#
# Set-WinUILanguageOverride -Language en-US
# pop up msg box for users
#$PSScriptRoot
# get script path
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Write-Host "script dir=$scriptPath"
Add-Type -AssemblyName System.Windows.Forms
@cpuwolf
cpuwolf / datetime.bat
Created July 24, 2023 09:39
Windows 10 batch get date time string
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
echo hour=%hour%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
echo min=%min%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
echo secs=%secs%
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.algolia-autocomplete {
width: 80%;
max-width: 700px;
}
//
// main.cpp
// fdouble
//
// Created by wshuai on 2021/12/29.
//
#include <stdio.h>
void * store[3];