This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 通过 Cloudflare Worker 批量打包和下载现存文件 | |
// curl -X POST https://your-worker-endpoint/create-zip \ | |
// -H "Authorization: Bearer YOUR_AUTH_SECRET" \ | |
// -H "Content-Type: application/json" \ | |
// -d '{ | |
// "filePaths": [ | |
// "path/to/file1.jpg", | |
// "path/to/file2.png", | |
// "path/to/file3.pdf" | |
// ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule-providers: | |
reject: | |
type: http | |
behavior: domain | |
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt" | |
path: ./ruleset/reject.yaml | |
interval: 86400 | |
icloud: | |
type: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --env-filter ' | |
OLD_NAME="old_name" | |
OLD_EMAIL="[email protected]" | |
CORRECT_NAME="luolei" | |
CORRECT_EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_NAME" = "$OLD_NAME" ] && [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$CORRECT_NAME" | |
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import hashlib | |
# 设定工作目录 | |
DIR = "/Volumes/Desktop" | |
def calculate_hash(filepath): | |
hasher = hashlib.sha256() | |
with open(filepath, 'rb') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cloudflare Images 鉴权API文档 | |
// https://developers.cloudflare.com/images/cloudflare-images/api-request/ | |
const CF_IMAGES_ACCOUNT_ID: string = "<账号ID>"; | |
const CF_IMAGES_API_KEY: string = "<CLOUDFLARE IMAGES API KEY>"; | |
const CF_IMAGES_BUCKET_NAME: string = "<账号HASH>"; | |
// 白名单域名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 记录日志时间 | |
log_time=$(TZ=UTC-8 date +"%Y-%m-%d-%H:%M:%S") | |
log_dir="/www/wwwlogs/" | |
server_name="DHCP" | |
# 获取 ens192 网卡对应的 IP 地址和子网掩码 | |
ipaddr=$(ip addr show ens192 | grep -w inet | awk '{print $2}') | |
netmask=$(ip addr show ens192 | grep -w inet | awk '{print $2}' | awk -F '/' '{print $2}') | |
# 判断 IP 地址是否为局域网 IPV4 地址(以 10.x.x.x、172.16.x.x 至 172.31.x.x、192.168.x.x 开头) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 配合定时脚本使用 | |
# 订阅后台接口,建议自己搭建,参考 https://github.com/tindy2013/subconverter | |
SERVER_API_URL="https://any.sub.domain/subconver" | |
# 输出的目录位置, nginx 解析目录 | |
OUTPUT_FOLDER="/www/wwwroot/sub.domain.com" | |
# bark 推动提醒地址 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen 443 ssl http2; | |
server_name demo.domain.com; | |
index index.php index.html index.htm default.php default.htm default.html; | |
root /www/wwwroot/demo.domain.com; | |
recursive_error_pages on; | |
proxy_intercept_errors on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -w " \ntime_namelookup:%{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnect: %{time_appconnect}\ntime_redirect: %{time_redirect}\ntime_pretransfer: %{time_pretransfer}\ntime_starttransfer: %{time_starttransfer}\n----------\ntime_total: %{time_total}\n" -o /dev/null -s -L "https://www.google.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cheerio = require('cheerio'); | |
var http = require('http'); | |
var iconv = require('iconv-lite'); | |
var express = require('express'); | |
var app = express(); | |
app.get('/api/baidu/:keyword', function(req, res) { | |
var keyword = req.param('keyword'); | |
var encodeKey = encodeURIComponent(keyword); | |
var url = 'http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=' + encodeKey + '&rsv_pq=d1bc678500027fae&rsv_t=b1baqnanzIu6%2B%2B6jgA5UgJY9hPGjPUfG2I03drYiQCZLKs41hn1TBNqN2tg&rqlang=cn&rsv_enter=1&rsv_sug3=14&rsv_sug1=13&rsv_sug7=100&rsv_sug2=0&inputT=1230&rsv_sug4=1231' |
NewerOlder