Skip to content

Instantly share code, notes, and snippets.

View hexiyou's full-sized avatar

He Xiyou hexiyou

View GitHub Profile
@hexiyou
hexiyou / winguake.ahk
Created October 13, 2025 17:19 — forked from salmonax/winguake.ahk
A simple Autohotkey script for running Mintty in Windows like GNOME Guake
MinttyPath := "C:\cygwin64\bin\mintty.exe"
f12::
if (!WinActive("ahk_class mintty"))
{
WinGet, active_id, ID, A
}
ConsoleHandler(active_id)
return
@hexiyou
hexiyou / HTMLClipboard.py
Created October 10, 2025 17:18 — forked from Erreinion/HTMLClipboard.py
HTMLClipboard with updates for Python 3. Includes exception handling for locked clipboard. Improvement of: http://code.activestate.com/recipes/474121/
"""
Created on Sep 24, 2013
@author: RandomHardcoreJerks
Requires pywin32
original: http://code.activestate.com/recipes/474121/
# HtmlClipboard
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
@hexiyou
hexiyou / 1
Created May 16, 2025 09:38 — forked from noodles-v6/1
Perl中文匹配
!/usr/bin/perl
use strict;
use warnings;
use utf8;
use open ":encoding(utf8)",":std";
open my $infh, "<:encoding(utf8)", "zh.dat" or die $!;
while (<$infh>) {
@hexiyou
hexiyou / longest_chinese_tokens_gpt4o.py
Created April 28, 2025 09:34 — forked from ctlllll/longest_chinese_tokens_gpt4o.py
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@hexiyou
hexiyou / douyin.js
Created April 24, 2025 19:04 — forked from brainbush/douyin.js
抖音直播地址解析
addEventListener("fetch", (event) => {
event.respondWith(
handleRequest(event.request).catch(
(err) => new Response(err.stack, { status: 500 })
)
);
});
async function handleRequest(request) {
const { pathname } = new URL(request.url);
@hexiyou
hexiyou / btwaf-init.lua
Created April 15, 2025 08:10
宝塔Nginx防火墙Lua脚本
--[[
#-------------------------------------------------------------------
# 宝塔Linux面板
#-------------------------------------------------------------------
# Copyright (c) 2015-2099 宝塔软件(http://bt.cn) All rights reserved.
#-------------------------------------------------------------------
# Author: 梁凯强 <[email protected]>
# 宝塔Nginx防火墙
# OUT_Time: 2022-05-20
# 祝福大家 2022年一直开心一直快乐,在新的一年中更加美好!!!!
@hexiyou
hexiyou / fix-wwwroot-permission.sh
Last active March 7, 2025 14:22
shell命令:适用于安装有宝塔面板的服务器批量网站整站目录加固,防止木马侵入和篡改;
适用于安装有宝塔面板的服务器批量网站整站目录加固,防止木马侵入和篡改:
#__________________________________________________________________
#请在 /www/wwwroot 目录下运行下列命令:
#__________________________________________________________________
for webroot in `ls`;
do
pushd "$webroot" &>/dev/null && {
echo "Working on `pwd` ..."
chown -Rv www:www ./
#记得依次执行多条chmod更改权限命令的顺序,有讲究,权限小的命令放在前面,权限大的命令放在后面
@hexiyou
hexiyou / clear-history-www-backup-data.sh
Created February 10, 2025 19:34
NAS计划任务一键清除宝塔面板自动备份下来的网站数据历史老文件(DSM918+专用)
#!/bin/bash
#NAS上查找并删除历史备份文件;
#综合条件判定:
#根据文件修改时间(mtime)删除n-m天内的产生(变动的),且文件大小大于指定数值的文件;
[[ "${1,,}" == "--notest" ]] && findAction="-exec rm -vf {} \\;" #只有$1指定--notest参数,才执行删除操作,否则仅打印查找到的文件;
startDay=10 #起始天数(最近几天最新生成的备份文件不删除)
endDay=45 #终止天数(很多天很久之前生成的备份文件也不删除)
minSize="500M" #指定要删除的文件最小大小(文件大小小于此数值的不予删除)
@hexiyou
hexiyou / ssh-snippets.md
Created January 11, 2025 14:04 — forked from real-jiakai/ssh-snippets.md
ssh工具代码脚本片段

1、debian、ubuntu更新并升级软件包

apt update && apt upgrade -y

2、docker compose重新部署

docker compose down && docker compose up -d