Skip to content

Instantly share code, notes, and snippets.

View pd12bbf7608ae1's full-sized avatar
💭
I may be slow to respond.

pd12bbf7608ae1 pd12bbf7608ae1

💭
I may be slow to respond.
View GitHub Profile
@pd12bbf7608ae1
pd12bbf7608ae1 / wgDynamic.sh
Created January 20, 2024 13:51
Wireguard Dynamic
#!/bin/bash
# 动态更新指定wg接口对端IP
# debug=1
# 配置
interfaceName="wg0" # wg 命令中的端口名称
# 对端配置
publicKey="123456=" # 对端公钥
domains=(
"example.org"
"example.com"
@pd12bbf7608ae1
pd12bbf7608ae1 / wgDynamic.ps1
Last active January 21, 2024 01:56
Wireguard Dynamic
$config = [PSCustomObject]@{
interfaceName = "wg0" # wg 命令中的端口名称
endPoint = [PSCustomObject]@{
publicKey = "123456=" # 对端公钥
domains = @(
"example.org",
"example.com") # 对端域名 可有多个
type = "A" # 或者AAAA
sshPort = "22"
sshPublicKey = "123456" # sha256
@pd12bbf7608ae1
pd12bbf7608ae1 / curlProxy.sh
Created February 3, 2023 06:12
curlProxy.sh
#!/bin/bash
function curlProxy() {
if [[ -z $apiEndpoint || -z $apiAuthorization ]]; then
return 1
fi
curlPara=("$@")
originalUrl=${curlPara[-1]}
@pd12bbf7608ae1
pd12bbf7608ae1 / doh.sh
Created February 2, 2023 09:27
doh.sh
#!/bin/bash
## doh.sh name type
endPoint='example.org'
name=${1}; type=${2};
if [[ -z ${name} ]]; then
name=example.org
fi
@pd12bbf7608ae1
pd12bbf7608ae1 / ddns_dynv6.sh
Created January 26, 2023 11:11
ddns_dynv6.sh
#!/bin/bash
# debug=1
tokens="" # dynv6 HTTP token
apiEndpoint='dynv6.com'
apiRootPath='/api/v2'
historyFile=".iphistory_dynv6" # history file
@pd12bbf7608ae1
pd12bbf7608ae1 / dns_dynv6_cfworker.sh
Last active January 5, 2023 02:04
acme.sh dns dynv6 cfworker
#!/usr/bin/bash
#Author StefanAbl
#Usage specify a private keyfile to use with dynv6 'export KEY="path/to/keyfile"'
#or use the HTTP REST API by by specifying a token 'export DYNV6_TOKEN="value"
#if no keyfile is specified, you will be asked if you want to create one in /home/$USER/.ssh/dynv6 and /home/$USER/.ssh/dynv6.pub
dynv6_api="https://dynv6.com/api/v2"
# export CFWORK_ENDPOINT='value'
# export CFWORK_AUTHORIZATION=''
@pd12bbf7608ae1
pd12bbf7608ae1 / health_alarm_notify_telegram_cfworks.sh
Created December 24, 2022 08:22
Get TG Notice with cfworkers
#------------------------------------------------------------------------------
# custom notifications
#
# enable/disable sending custom notifications
SEND_CUSTOM="YES"
# if a role's recipients are not configured, use the following.
# (empty = do not send a notification for unconfigured roles)
DEFAULT_RECIPIENT_CUSTOM="sysadmin"
@pd12bbf7608ae1
pd12bbf7608ae1 / cf_workers_proxy.js
Created December 24, 2022 08:17
CF Workers Proxy
// Var apiAuthorization as key
// Header apihost
// Header apiAuthorization as key
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const defaultPage = '<!DOCTYPE html><html><head><title>Welcome to nginx!</title><style>body{width:35em;margin:0 auto;font-family:Tahoma,Verdana,Arial,sans-serif}</style></head><body><h1>Welcome to nginx!</h1><p>If you see this page,the nginx web server is successfully installed and working.Further configuration is required.</p><p>For online documentation and support please refer to<a href="http://nginx.org/">nginx.org</a>.<br/>Commercial support is available at<a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p></body></html>';
@pd12bbf7608ae1
pd12bbf7608ae1 / telegram_cfwork.sh
Created December 24, 2022 08:13
telegram_cfwork For acme.sh
#!/usr/bin/bash
#Support Telegram Bots
#Modify for CF Worker
# export TELEGRAM_CFWORK_BOT_APITOKEN TELEGRAM_CFWORK_BOT_CHATID CFWORK_ENDPOINT CFWORK_AUTHORIZATION
#TELEGRAM_CFWORK_BOT_APITOKEN=""
#TELEGRAM_CFWORK_BOT_CHATID=""
#CFWORK_ENDPOINT=""
@pd12bbf7608ae1
pd12bbf7608ae1 / getInfo.sh
Created May 7, 2022 03:00
get port info from switch
#!/bin/bash
ip='192.168.1.1'
username='admin'
password='123456789'
# curl -w "\nCode:%{response_code}\n" "http://${ip}" # 获取登录状态
# curl 'http://192.168.1.1/logon.cgi' --data-raw 'username=admin&password=123456789&logon=%E7%99%BB%E5%BD%95' # 登录