Skip to content

Instantly share code, notes, and snippets.

View chisaato's full-sized avatar
🎯
Focusing

Hoshino 0x1bf52 chisaato

🎯
Focusing
  • China
  • 12:37 (UTC +08:00)
View GitHub Profile
@chisaato
chisaato / 0003-add-bt-blacklist-ip.patch
Last active August 22, 2024 10:23
Aria2 添加 IP 黑名单补丁
diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc
index 7e566b42..bf044da9 100644
--- a/src/ActivePeerConnectionCommand.cc
+++ b/src/ActivePeerConnectionCommand.cc
@@ -133,6 +133,15 @@ void ActivePeerConnectionCommand::makeNewConnections(int num)
for (; num && peerStorage_->isPeerAvailable(); --num) {
cuid_t ncuid = e_->newCUID();
std::shared_ptr<Peer> peer = peerStorage_->checkoutPeer(ncuid);
+ // 在这里检查 IP
+ if (bittorrent::isIpInList(peer->getIPAddress(),requestGroup_->getOption()))
@chisaato
chisaato / dump-pack-manifest.js
Created July 17, 2024 22:50
生成Modrinth规范的整合包信息,共HMCL用
import { $ } from "bun";
import { readdir } from "node:fs/promises";
import { mkdirSync, cpSync } from "node:fs";
const PACK_VERSION = "1.3";
const PACK_NAME = "creators-adventure";
const FORGE_VER = "47.3.5";
const MC_VER = "1.20.1";
// 只有在客户端出现的 Mod
// 采用 contains 匹配
@chisaato
chisaato / init2.gradle.kts
Created March 15, 2023 16:40
另一种版本,受 OpenAI 启发
allprojects {
repositories {
maven {
url = uri("https://maven.aliyun.com/repository/gradle-plugin")
}
// 中央仓库
maven {
url = uri("https://maven.aliyun.com/repository/central")
}
// 中央仓库,但是腾讯云
@chisaato
chisaato / hooks.json
Last active July 11, 2023 17:58
Volta.sh 使用 Hooks 实现镜像站
{
"node": {
"index": {
"prefix": "https://npmmirror.com/mirrors/node/"
},
"distro": {
"template": "https://registry.npmmirror.com/-/binary/node/v{{version}}/{{filename}}"
}
},
"npm": {
@chisaato
chisaato / build-fcitx5-for-dvc.sh
Last active May 14, 2022 16:41
为 Davinci Resolve 构建 fcitx5 支持
# 首先去获取闭源程序对应的 Qt 版本,主要是获取 GCC 编译器
# 然后拿 fcitx5-qt 源码
# 在源码根目录执行下面的命令,别忘了修改路径
# cmake -DCMAKE_PREFIX_PATH=$QT_PATH/Qt5.9.6/5.9.6/gcc_64 -DENABLE_QT4=0 .
# 来做第一次构建
# make -j$(nproc)
# 然后来到 qt5/platforminputcontext 目录执行下面的一长串代码
# 请自行更改系统库路径
@chisaato
chisaato / settings.xml
Created November 22, 2021 16:05
Maven镜像站
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository />
<interactiveMode />
<usePluginRegistry />
<offline />
<pluginGroups />
<servers />
<mirrors>
<mirror>
@chisaato
chisaato / rule.txt
Last active June 4, 2023 09:47
广告拦截规则
klpbbs.com##html > body > div.container > div.gg
! 专杀反拦截器
!iguangdie.xyz##^script:has-text("blockadblock")
!iguangdie.xyz##+js(noeval-if, blockadblock)
! 使用这个反杀就可以了
iguangdie.xyz##+js(nobab)
www.iruanp.com##+js(aeld, DOMContentLoaded, sessionStorage.getItem)
!www.iruanp.com##+js(aell)
! MineBBS 页面底部广告
@chisaato
chisaato / init.gradle.kts
Last active March 15, 2023 16:33
全国首发,更换阿里云镜像的kts脚本
import kotlin.*
import kotlin.reflect.full.*
var replaceRepository = { arg: RepositoryHandler ->
var ALIYUN_MAVEN_REPOSITORY_URL = "https://maven.aliyun.com/repository/central"
// var ALIYUN_MAVEN_REPOSITORY_URL = "https://mirrors.cloud.tencent.com/nexus/repository/maven-public"
var ALIYUN_JCENTER_URL = "https://maven.aliyun.com/repository/jcenter"
var ALIYUN_GOOGLE_URL = "https://maven.aliyun.com/repository/google"
var ALIYUN_GRADLE_PLUGIN_URL = "https://maven.aliyun.com/repository/gradle-plugin"
var ALIYUN_SPRING_URL = "https://maven.aliyun.com/repository/spring"
@chisaato
chisaato / init.gradle
Last active November 30, 2020 08:32
init.gradle
def replaceRepository = {
def ALIYUN_MAVEN_REPOSITORY_URL = "https://maven.aliyun.com/repository/public"
def ALIYUN_JCENTER_URL = "https://maven.aliyun.com/repository/jcenter"
def ALIYUN_GOOGLE_URL = "https://maven.aliyun.com/repository/google"
def ALIYUN_GRADLE_PLUGIN_URL = "https://maven.aliyun.com/repository/gradle-plugin"
def ALIYUN_SPRING_URL = "https://maven.aliyun.com/repository/spring"
def ALIYUN_SPRING_PLUGIN_URL = "https://maven.aliyun.com/repository/spring-plugin"
def ALIYUN_GRAILS_CORE_URL = "https://maven.aliyun.com/repository/grails-core"
def ALIYUN_APACHE_SNAPSHOTS_URL = "https://maven.aliyun.com/repository/apache-snapshots"
all { ArtifactRepository repo ->
@chisaato
chisaato / score.js
Created April 22, 2020 09:54
申必代码
let script = document.createElement("script");
script.setAttribute('src', '//code.jquery.com/jquery-latest.min.js');
script.addEventListener('load', function() {
let script = document.createElement('script');
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
// 首先是修改今日积分
jQuery('.my-points-points').eq(1).text(25)
// 修改学习卡片-进度