Skip to content

Instantly share code, notes, and snippets.

@uubulb
uubulb / ugreenforum.py
Created September 25, 2024 10:41
ugreenforum.py
from argparse import ArgumentParser
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
import base64
import hashlib
import requests
from requests.exceptions import RequestException, ConnectionError, Timeout
ENDPOINT = "https://cloud.ugreengroup.com/api"
<script>
let selectedType = '';
let rules = [];
const ruleData = {
monitorDuration: 3,
minValue: 0,
maxValue: 0,
serverMap: {},
cycleStart: '',
@uubulb
uubulb / update.sh
Last active July 28, 2024 16:19
Nezha Agent update script
#!/bin/sh
# 哪吒 Agent 更新脚本
NZ_BASE_PATH="/opt/nezha"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent"
sudo() {
myEUID=$(id -ru)
if [ "$myEUID" -ne 0 ]; then
const backendUrl = '替换成后端地址';
const apiToken = '替换成获取到的ssr token';
const authToken = '替换成要设置的哪吒兼容api token(随意填写)';
const ipv4Regex = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:
@uubulb
uubulb / alpinebbr3.sh
Last active April 23, 2024 06:06
One-click script for installing BBRv3 kernel on Alpine Linux 3.19
#!/bin/bash
[ -e /etc/os-release ] && cat /etc/os-release | grep -i "PRETTY_NAME" | grep -qi "Alpine Linux v3.19" && os_alpine='1'
pre_check() {
apk add virt-what
[ "$os_alpine" != 1 ] && echo "本脚本仅支持 Alpine 3.19!" && exit 1
# check root