Skip to content

Instantly share code, notes, and snippets.

import os
import re
import shutil
import argparse
import json
def backup_file(filepath):
backup = f"{filepath}.bak"
if not os.path.exists(backup):
@knowlet
knowlet / trainer.c
Created November 4, 2026 08:08
小小 CS 中文版 FRONT LINE Ver.1.49
/* FRONT LINE Ver.1.49 dynamic trainer.
Patches the running process only. It never opens FrontLine.exe for writing.
RVAs are file VAs minus the preferred image base 0x400000, taken from objdump
of the shipped PE (not from a decompiler). ASLR is handled by adding the
live module base. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tlhelp32.h>
#include <wchar.h>
@knowlet
knowlet / main.py
Created May 19, 2026 05:36
openrouter video-generation cli python script
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import base64
import json
import mimetypes
import os
import time
from datetime import datetime
@knowlet
knowlet / docker-compose.yml
Created March 16, 2026 02:54
litellm + autoheal + traefik + cloudflare
services:
traefik:
image: traefik:v3.6.6
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/etc/traefik/dynamic.yml
- --entrypoints.websecure.address=:443
- --entrypoints.metrics.address=:9100
- --metrics.prometheus=true
@knowlet
knowlet / DynamicTranslation.js
Last active September 30, 2025 01:56
RPGMaker 動態翻譯系統 - 支援 mtool 工具的 key-value 翻譯檔案格式
//=============================================================================
// DynamicTranslation.js
//=============================================================================
/*:
* @plugindesc 動態翻譯系統 - 支援 mtool 工具的 key-value 翻譯檔案格式
* @author Supernova
*
* @param Default Language
* @desc 預設語言代碼 (例如: zh, en, ja)
@knowlet
knowlet / fuckgpg.sh
Created September 8, 2025 04:49
fuckgpg: aliased to gpgconf --kill gpg-agent; gpg-connect-agent reloadagent /bye; gpg-connect-agent reloadagent /bye
gpgconf --kill gpg-agent; gpg-connect-agent reloadagent /bye; gpg-connect-agent reloadagent /bye
@knowlet
knowlet / rolldice.py
Last active May 7, 2025 15:26
Auto dice maplestory on Mac, test with MapleStory Worlds Artale.
import pyautogui
import time
# import os # Removed as it's unused
from ocrmac import ocrmac
import random # Added import for random offset
# --- Configuration ---
SCREENSHOT_REGION = (1220, 690, 60, 30) # x, y, width, height
CLICK_COORDINATES = (1355, 690) # x, y
THRESHOLD_NUMBER = 12
@knowlet
knowlet / settour-cruise.user.script
Created April 2, 2025 01:07
東南旅行社郵輪快速篩選小工具
// ==UserScript==
// @name 東南旅行社郵輪查詢小工具
// @namespace https://knowlet.me
// @version 2025-04-01
// @description try to take over the world!
// @author knowlet
// @match https://tour.settour.com.tw/cruise.html
// @icon https://www.google.com/s2/favicons?sz=64&domain=settour.com.tw
// @grant GM_registerMenuCommand
// @grant GM_getValue
@knowlet
knowlet / arc-runner-set.helmchart.yaml
Last active April 9, 2026 09:20
Deploy GitHub Actions Controller with K3s helm-controller
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: arc-runner-set
namespace: kube-system
spec:
chart: oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
set:
githubConfigUrl: "https://github.com/<your_enterprise/org/repo>"
githubConfigSecret.github_token: "<PAT>"
@knowlet
knowlet / crossover.sh
Created March 11, 2025 06:51
Unlimited CrossOver Trial (macOS)
echo "🧹 Resetting CrossOver bottles..."
pkill CrossOver && echo "✅ CrossOver processes killed."
echo "🕒 Modifying trial timestamps..."
DATETIME=$(date -u -v -3H '+%Y-%m-%dT%TZ')
echo "✅ New trial date set to: ${DATETIME}"
defaults write com.codeweavers.CrossOver FirstRunDate -date "${DATETIME}"
defaults write com.codeweavers.CrossOver SULastCheckTime -date "${DATETIME}"
echo "✅ Updated trial timestamps in preferences."
echo "🧹 Resetting CrossOver bottles..."
find ~/Library/Application\ Support/CrossOver/Bottles/ -type f \( -name ".eval" -o -name ".update-timestamp" \) -exec rm -f "{}" +