Skip to content

Instantly share code, notes, and snippets.

# Disable XON/XOFF
[[ $- == *i* ]] && stty -ixon
@thanksshu
thanksshu / aida64keygen.py
Created February 2, 2025 20:26
Generate AIDA64 key
"""
Generate AIDA64 key.
AIDA64 download link, edition and version can be changed:
https://download.aida64.com/aida64business750.zip
"""
import random
from datetime import datetime, timezone
from enum import Enum
@thanksshu
thanksshu / cf_cors_worker.js
Last active May 10, 2024 08:57
CORS proxy in Cloudflare Worker
export default {
/**
* Send request to this API with querys param "url" and "apikey"
* @param {Request} request
* @param {*} env
* @param {*} ctx
* @returns Response
*/
async fetch(request, env, ctx) {
const supportMethods = new Set(['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'PATCH']);
@thanksshu
thanksshu / deeplx_cloudflare_workers.js
Created April 20, 2024 07:19
deeplx for cloundflare workers (not working)
export default {
async fetch(request, env, ctx) {
const DEEPL_BASE_URL = 'https://www2.deepl.com/jsonrpc';
const DEEPLX_TOKEN = env.DEEPLX_TOKEN;
const headers = new Headers({
'Content-Type': 'application/json',
'Accept': '*/*',
'x-app-os-name': 'iOS',
'x-app-os-version': '16.3.0',
'Accept-Language': 'en-US,en;q=0.9',
@thanksshu
thanksshu / gen_wg_conf_from_cf_zero_trust.py
Last active June 3, 2025 18:49
Generate wireguard config from cloudflare zero trust
"""
Generate wireguard config from cloudflare zero trust
Credit to https://gitlab.com/Misaka-blog/warp-script
"""
import datetime
import json
import random
import string
from urllib import request
@thanksshu
thanksshu / check_cf_warp_endpoint.py
Last active June 28, 2025 23:50
Test cloudflare WARP endpoints (FAILDED)
"""
Test cloudflare WARP endpoints
Select all the best WARP endpoints
Thanks to https://gitlab.com/Misaka-blog/warp-script#warp-endpoint-ip-优选脚本
"""
import asyncio
import csv
import ipaddress
import logging
@thanksshu
thanksshu / cf_genshin_checkin_worker.js
Last active May 10, 2024 08:59
Genshin Impact Daily Check-In Cloudflare Worker script
/// Cloudflare Worker script for Genshin Impact Daily Check-In
/// LTUID, LTOKEN must be set for check-in
/// TELEGRAM_CHAT_ID, TELEGRAM_BOT_TOKEN may be set for messaging
const CHECK_IN_URL = "https://hk4e-api-os.mihoyo.com/event/sol/sign?act_id=e202102251931481";
async function handleScheduled(request) {
const headers = new Headers();
headers.set("Cookie", `ltuid=${LTUID}; ltoken=${LTOKEN};`);
headers.set(
@thanksshu
thanksshu / ali_fc_biliroaming.js
Last active May 10, 2024 09:00
BiliRoaming Alibaba Cloud FC Node.js script
/**
* @file BiliRoaming Alibaba Cloud FC Node.js script, need a layer with "axios"
* @author thanksshu
* @license MIT
*/
'use strict';
const axios = require('axios').default;
const TARGET_URL = 'https://api.bilibili.com';
@thanksshu
thanksshu / .inputrc
Last active February 14, 2025 08:08
# Auto completion
set completion-ignore-case on
set show-all-if-ambiguous on
set show-all-if-unmodified on
set menu-complete-display-prefix on
"\t": menu-complete
"\e[Z": menu-complete-backward # Shift + Tab
@thanksshu
thanksshu / convert_crlf_to_lf.py
Created June 16, 2021 15:22
Convert line endings in-place (Windows to Linux/Unix)
# replacement strings
WINDOWS_LINE_ENDING = b'\r\n'
UNIX_LINE_ENDING = b'\n'
# relative or absolute file path, e.g.:
file_path = r'file_path'
with open(file_path, 'rb') as fs:
content = fs.read()