Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import os
import bencode
import re
import sys
# Inspired by https://github.com/ctminime/QB_Migrate_to_Linux
# Need `pip3 install bencode.py`.
# Run in folder like "/home/user/.local/share/data/qBittorrent/BT_backup/" (configured in qBitTorrent).
# Takes 2 parameters:
@LostInsight
LostInsight / NexusPHP Hightlight.user.js
Last active January 30, 2022 15:22
A script for highlighting free and 2xfree items in NexusPHP based PT sites
// ==UserScript==
// @name NexusPHP Hightlight
// @name:zh-CN NexusPHP 高亮脚本
// @version 0.0.2
// @description A script for highlighting free and 2xfree items in NexusPHP based PT sites
// @description:zh-CN 适用于基于 NexusPHP 的 PT 站的高亮脚本,包括free、2xfree高亮和鼠标悬停高亮
// @author LostMelody
// @note 大量站点未测,特别是CHD,TTG,影客,U2,HDChina
// @note 网址和入口参考PT-Plugin-Plus内置地址
// @note 部分识别接口参考Juszoe的flexget-nexusphp但具体未测
#**********************************************************************
# 07.27
# 2019年7月27日09:18:55
# 转载需要注明版权和来源
#
# 屏蔽常用网站、视频、手机rom广告&运营商劫持广告&数据跟踪&开屏广告
#
# 参照lhie1的surge规则改编,致谢!! https://github.com/lhie1/Surge
# 参照scomper的surge规则改编,致谢!! https://gist.github.com/scomper/915b04a974f9e11952babfd0bbb241a8/revisions
#
@LostInsight
LostInsight / oneup.sh
Created May 12, 2019 14:41
Shell script to fix permission for downloaded files, upload to cloud with onedrivecmd, refresh customized oneindex cache, and notify with serverchan.
#!/bin/bash
echo `date --rfc-3339=seconds` "oneup.sh" "$1" "$2" "$3">>/tmp/oneup.log
GID="$1";
FileNum="$2";
File="$3";
MaxSize="15728640"
RemoteDIR="od:/share/Downloads"; # no "/" at last
LocalDIR="/data/downloads"; # no "/" at last
@LostInsight
LostInsight / kcptun.sh
Last active May 29, 2018 05:19 — forked from zjx20/gist:1c7f4dd1392866f9d8b00dd2a05bd481
kcptun install and systemd daemon
wget https://github.com/xtaci/kcptun/releases/download/v20180316/kcptun-linux-amd64-20180316.tar.gz
tar xvf kcptun-linux-amd64-20180316.tar.gz
sudo mv server_linux_amd64 /usr/local/bin/kcptun_server
sudo mv client_linux_amd64 /usr/local/bin/kcptun_client
sudo mkdir -p /etc/kcptun
sudo bash -c "cat <<EOT > /etc/kcptun/server_conf.json
{
\"listen\": \":4321\",
\"target\": \"127.0.0.1:8421\",