Skip to content

Instantly share code, notes, and snippets.

View at-wr's full-sized avatar
💭
Thinking

Alan Ye at-wr

💭
Thinking
View GitHub Profile
@at-wr
at-wr / README.md
Last active March 12, 2026 17:56
connectivityd

connectivityd

Surge Module that automatically switches policy groups when your network location changes — so you don't have to.

Designed for people who travel or live abroad while maintaining a local proxy / home server (e.g. via Surge Ponte), and need domestic traffic to route through home when away.

How it works

When a network change is detected (Wi-Fi / Cellular switch, Airplane Mode toggle), the script checks your exit IP against your home country. It then sets your policy groups to either Home or Abroad mode:

@at-wr
at-wr / bilibili_evolved_active_video_links.js
Created April 6, 2025 03:51
activeVideoLinks for Bilibili Evolved
@at-wr
at-wr / mountpoint_check.sh
Created August 5, 2024 09:31
Notify via Telegram Bot if mount point doesn't exist
#!/bin/bash
# Telegram Bot API Token
API_TOKEN="YOUR_TELEGRAM_BOT_API_TOKEN"
# Your Chat ID
CHAT_ID="YOUR_CHAT_ID"
# API Proxy Domain (optional)
API_PROXY_DOMAIN="YOUR_API_PROXY_DOMAIN"
# Mount Path
MOUNT_POINT="/mnt/example"
@at-wr
at-wr / keybase.md
Created August 29, 2023 02:43
keybase.md

Keybase proof

I hereby claim:

  • I am alanye-dev on github.
  • I am wryedev (https://keybase.io/wryedev) on keybase.
  • I have a public key ASCJ4A8rFkDrJ8sbWgsMg3R_lR6FDHUxJ9Zfu7hIupYoDwo

To claim this, I am signing this object:

@at-wr
at-wr / connect-op.py
Created August 23, 2023 07:57
Connect 1Password CLI with Python
#!/usr/bin/python3
import subprocess
# Replace with 1Password Secret Reference (op://)
username = "op://Your-Vault/Your-Item/Your-Username-Section"
password = "op://Your-Vault/Your-Item/Your-Credential-Section"
# Fetch with 1Password-CLI
op_credentials = subprocess.check_output(f"op read {username} && op read {password}", shell=True, text=True)
username = op_credentials.split('\n')[0]