Skip to content

Instantly share code, notes, and snippets.

View PillarsZhang's full-sized avatar
🎯
Focusing

章鱼DS PillarsZhang

🎯
Focusing
View GitHub Profile
@PillarsZhang
PillarsZhang / chatgpt-trace-timezone.user.js
Last active October 28, 2026 09:09
ChatGPT - Timezone Match (Cloudflare Trace) | ChatGPT 时区匹配(Cloudflare Trace)| https://linux.do/t/topic/3025709/30
// ==UserScript==
// @name ChatGPT - Timezone Match (Cloudflare Trace)
// @name:zh-CN ChatGPT 时区匹配(Cloudflare Trace)
// @namespace https://chatgpt.com/
// @version 3.4.1
// @icon https://chatgpt.com/favicon.ico
// @description Match timezone using trace loc and same-country colo, with cached fallback.
// @match https://chatgpt.com/*
// @exclude https://chatgpt.com/cdn-cgi/*
// @run-at document-start
@PillarsZhang
PillarsZhang / example.yaml
Last active August 2, 2025 04:37
An example of integrating a Haier air conditioner with ESPHome via infrared.
esphome:
name: $name
friendly_name: $friendly_name
name_add_mac_suffix: true
platformio_options:
board_build.flash_mode: dio
board_build.mcu: esp32c3
includes:
- haier_ir.h
@PillarsZhang
PillarsZhang / Invoke-CommandAsScheduledTask.ps1
Last active January 20, 2024 14:38
A PowerShell function `Invoke-CommandAsScheduledTask` designed to launch foreground GUI applications on a remote Windows system via SSH, by creating and executing a temporary Scheduled Task.
function Invoke-CommandAsScheduledTask {
param(
[string]$Command,
[bool]$RunAsAdmin = $false
)
$bytes = [System.Text.Encoding]::Unicode.GetBytes($Command)
$encodedCommand = [Convert]::ToBase64String($bytes)
$taskName = "TemporaryTask${PID}FromInvokeCommandAsScheduledTask"
@PillarsZhang
PillarsZhang / sha256gen.sh
Created November 20, 2023 17:22
Generate SHA256 checksums for files with progress. Saves output to .sha256 files.
#!/bin/bash
# Generate SHA256 checksums for files with progress. Saves output to .sha256 files.
# Usage check
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <filename1> [filename2] ..."
exit 1
fi
@PillarsZhang
PillarsZhang / watch-dns-wireguard.psm1
Last active October 5, 2023 11:49
Restart WireGuard when the DNS resolution of the domain name changes.
function Write-Log {
Param(
[Parameter(Mandatory = $true)]
[string]$Message
)
$timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss.fff'
$logMessage = "$timestamp - $Message"
Write-Host $logMessage
@PillarsZhang
PillarsZhang / byebye-node_moudles.bat
Created January 5, 2020 15:43
和目录下和子目录下的一切node_moudles文件夹说再见
::cnpm install rimraf -g
rimraf ./**/node_modules