Friday, 24 October 2025

✨3-step rookie: auto-update BPB VPN | 新手仅需3步,BPB VPN自动更新

Step1️⃣ 🏗️ Create new GitHub repo

Name it whatever like "my-auto-update"


Step2️⃣ 📁 Add workflow file

Must use exact path:

.github/workflows/{yourFileName}.yml

Paste the YAML config we provided

```

name: 晨更作业cf wop


on:

  push:

    branches:

      - main

  schedule:

    - cron: "0 3 * * 1"  # 每周一凌晨3点 UTC 执行(北京时间周一上午11点)

  workflow_dispatch:

    inputs:

      force_update:

        description: '是否强制更新(忽略版本检查)'

        required: false

        default: 'false'


permissions:

  contents: write


jobs:

  update:

    runs-on: ubuntu-latest

    timeout-minutes: 30

    steps:

      - name: 检出代码

        uses: actions/checkout@v4


      - name: 设置 Node.js 环境

        uses: actions/setup-node@v4

        with:

          node-version: "latest"


      - name: 安装依赖

        run: |

          npm install -g javascript-obfuscator

          sudo apt-get update

          sudo apt-get install -y jq curl unzip wget


      - name: 环境变量设置

        run: |

          echo "REPO_URL=https://api.github.com/repos/bia-pain-bache/BPB-Worker-Panel/releases" >> $GITHUB_ENV

          echo "TARGET_FILE=worker.js" >> $GITHUB_ENV  # 调整为 worker.js 以匹配混淆逻辑;如果需要 zip,可修改为 worker.zip 并添加解压后混淆


      - name: 检查与更新 Worker

        id: update_worker

        env:

          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

        run: |

          set -e

          log() { echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"; }


          log "☀️ 清晨启程,检查更新中…"


          LOCAL_VERSION=$(cat version.txt 2>/dev/null || echo "")

          log "本地版本:${LOCAL_VERSION:-无}"


          log "请求最新 Release 信息…"

          RESPONSE=$(curl -s --retry 5 --retry-delay 2 --max-time 30 \

            -H "Authorization: token $GITHUB_TOKEN" \

            -H "Accept: application/vnd.github.v3+json" \

            "$REPO_URL")

          if [ $? -ne 0 ]; then

            log "❌ 无法访问 GitHub API"

            exit 1

          fi


          TAG_NAME=$(echo "$RESPONSE" | jq -r '.[0].tag_name')

          DOWNLOAD_URL=$(echo "$RESPONSE" | jq -r '.[0].assets[] | select(.name == "'"$TARGET_FILE"'") | .browser_download_url')


          if [ -z "$TAG_NAME" ] || [ "$TAG_NAME" = "null" ]; then

            log "❌ 获取版本号失败"

            exit 1

          fi


          if [ -z "$DOWNLOAD_URL" ] || [ "$DOWNLOAD_URL" = "null" ]; then

            # 备用下载方式:从 repo 下载文件(假设文件在 repo 根目录)

            DOWNLOAD_URL="https://github.com/bia-pain-bache/BPB-Worker-Panel/raw/${TAG_NAME}/${TARGET_FILE}"

            log "⚠️ 未找到 Release 资产,使用 raw 文件下载 URL: $DOWNLOAD_URL"

          fi


          log "最新版本:$TAG_NAME"


          FORCE_UPDATE="${{ github.event.inputs.force_update || 'false' }}"

          if [ "$LOCAL_VERSION" = "$TAG_NAME" ] && [ "$FORCE_UPDATE" != "true" ]; then

            log "✅ 已是最新版本,无需更新"

            exit 0

          fi


          log "⬇️ 下载 $TARGET_FILE…"

          wget -q --tries=5 --timeout=30 -O "origin.js" "$DOWNLOAD_URL"

          if [ $? -ne 0 ]; then

            log "❌ 下载失败"

            exit 1

          fi


          # 如果是 zip,添加解压(当前假设 js;如果 zip,取消注释并调整)

          # log "📦 解压中…"

          # unzip -o "origin.js" > /dev/null  # 实际为 zip 时改名

          # rm "origin.js"

          # mv worker.js origin.js  # 假设 zip 内有 worker.js


          log "🔒 混淆 JS 代码…"

          javascript-obfuscator origin.js --output _worker.js \

            --compact true \

            --identifier-names-generator hexadecimal \

            --rename-globals false \

            --string-array false \

            --transform-object-keys false \

            --self-defending false \

            --simplify true

          echo "// Auto obfuscated at $(date -u)" >> _worker.js

          rm origin.js


          echo "$TAG_NAME" > version.txt

          log "✨ 更新完成,当前版本:$TAG_NAME"


          echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT


      - name: 提交同步结果

        if: success()

        uses: stefanzweifel/git-auto-commit-action@v5

        with:

          commit_message: "🔄 自动同步 Worker 版本: ${{ steps.update_worker.outputs.tag_name }}"

          commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

```


Step3️⃣ 🚀 Let magic happen

GitHub Actions auto-triggers

Monitors source repo changes

Completes Build & Deploy automatically


💡 Tech highlights:

✅ Webhook auto-monitoring

✅ CI/CD pipeline

✅ Real-time GitHub sync

✅ Zero manual operation


Result preview👉

Every time source updates

Your VPS auto-pulls latest code

Runs Build Script for new version

Totally hands-free!




Step1️⃣ 🏗️ 新建GitHub仓库

创建你的专属代码库 Repository

命名超随意~比如"my-auto-update"


Step2️⃣ 📁 创建Workflow文件

路径必须严格按:

.github/workflows/{你的文件名}.yml

复制提供的YAML配置 一键粘贴就行


Step3️⃣ 🚀 坐等自动化执行

GitHub Actions自动触发

实时监控源Repo更新

自动完成Build & Deploy


💡 核心科技:

✅ Webhook自动监听

✅ CI/CD无缝衔接

✅ 实时同步GitHub源

✅ 完全告别手动操作


效果预览👉

每次源仓库更新

你的VPS都会自动拉取最新代码

执行Build Script生成新版本

全程无需人工干预!


Referencing this/参考了这个 https://github.com/DuolaD/BPB-Auto-update-and-obfuscate/blob/main/.github/workflows/update_worker.yml

Thursday, 16 October 2025

Must‑Know Hack: Hidden Costs of Kids’ Classes | 赶紧避坑:兴趣班收费内幕曝光💥

Know this early, save half your wallet | 早知道这些,家长钱包能省一半💰

👶 1. Pickup Service: Manual pickup costs extra, farther & later = pricier. Private car pickup? Super expensive. DIY = free.


👕 2. Uniform Economics: Regular classes cost $30‑80, “noble” ones like horse riding $1000+ AUD. Even basic riding = $100‑150.


⏰ 3. 6pm Deals: Wed‑Fri, join right after school, get 15‑20% off.


🎁 4. Free Trial: First class usually free, parents can sit in. Newbies may get 5‑10% off, sometimes need Cognito Forms.


🛡️ 5. Insurance Fee: Sports classes often charge $50‑200.


👨‍👩‍👧 6. Sibling Discount: Recommend siblings/cousins, usually 10% off. But if your kid quits, discount gone.


📅 7. Quit Rules: Need 2 weeks’ notice, some require 4 weeks written.


📌 8. Schedule Change: Hard mid‑term, usually wait till next term.


💳 9. Payment: Bank transfer, online, cash. Some kids earn vouchers, valid this/next term.


🌍 10. Performances: Some classes include shows or overseas trips. Travel/living self‑paid. One parent may join with discounted ticket.


⚠️ 11. Final Info: Always check the official website.


—— Know this early, save money & avoid tears 😂



👶 1. 接送服务:低学龄兴趣班常有人工接送,越远越贵,晚接更贵。专车接送?价格直接劝退。自己接送=0元。

👕 2. 校服经济学:普通兴趣班30-80澳元,骑马等“贵族班”校服1000+澳币,普通骑马也要100-150。买前先问清。

⏰ 3. 6pm优惠:周三到周五常见,孩子放学直奔兴趣班,折扣15%-20%,算是“加班价”。

🎁 4. 试课福利:大部分首节免费,家长可旁听。新生报名偶有5%-10%折扣,部分需填Cognito Forms。

🛡️ 5. 保险费:运动类兴趣班常要交50-200元保险,别忽略。

👨‍👩‍👧 6. 兄弟姐妹折扣:推荐兄弟姐妹一起报,常有10%优惠。但孩子退班后再推荐,大概率没戏。

📅 7. 退班规则:一般需提前2周申请,少数要4周书面申请。

📌 8. 时间调整:学期中几乎不能改,只能等下学期再沟通。

💳 9. 支付方式:银行转账、在线支付、现金都行。部分孩子努力还能拿代金券,本学期/下学期有效。

🌍 10. 演出活动:有的班会安排演出甚至出国,吃住行自费,家长可陪同,但机票折扣仅限1人。

⚠️ 11. 最终信息:一切以兴趣班官网为准。

—— 早知道这些,省钱不踩坑,家长少掉眼泪😂


Thursday, 9 October 2025

Google Cloud Free Tier Traps! CDN/Snapshot Costs? | 谷歌云免费版避坑!CDN/快照不花钱?

💡Master GCP at zero cost, newbies turn pro instantly | 零成本玩转GCP,小白秒变云专家

🚨 Hidden Cost Traps Exposed
• CDN Fees: Cache Fill $0.01-0.04/GiB + Data Transfer $0.02-0.20/GiB
• Snapshot Costs: Stored in Cloud Storage, from $0.026/GiB-month
• Network Egress: Charges after 1GB free, $0.08-0.20/GiB
• Load Balancing: Forwarding rules from $0.025/hour
• API Calls: Costs exceed 5000 Class A operations

🛡️ Cost Avoidance Guide
• 📊 Set Budget Alerts for instant overspend notifications
• 🗑️ Choose "No Snapshot Schedule" when creating VM
• 🔄 Use rsync or gsutil instead of Snapshot backups
• 🌐 Optimize Network Egress, transfer only NA data
• 🚫 Use Public IP directly for small projects, skip Load Balancing
• 💻 Efficient code to reduce API Calls

💎 Tech Terms Crash Course
E2-micro instance · Always Free Tier · Cloud CDN · Persistent Disk Snapshot
Network Egress · Cloud Storage · Budget Alerts · Load Balancing
Public IP · API Calls · Class A Operations · gsutil tool

🎯 Bottom Line
Free GCP tastes sweet, remember these cost traps
Run projects smoothly at zero cost, easy for beginners!
Share your cloud stories in comments~


🚨 隐藏扣费陷阱大揭秘

• CDN连接费:缓存填充$0.01-0.04/GiB + 数据出口$0.02-0.20/GiB

• 快照备份费:存储在Cloud Storage,$0.026起/GiB-month

• 网络出口费:超1GB免费额度就收费,$0.08-0.20/GiB

• 负载均衡费:转发规则$0.025/小时起

• API调用费:超5000次Class A操作就收费


🛡️ 避坑实战指南

• 📊 设置Budget Alerts预算警报,超支立即提醒

• 🗑️ 创建VM时选择"No Snapshot Schedule"无备份计划

• 🔄 用rsync或gsutil工具替代Snapshot备份

• 🌐 优化Network Egress流量,只传北美数据

• 🚫 小项目直接用Public IP公网IP,跳过Load Balancing

• 💻 高效代码减少API Calls调用次数


💎 专业名词小课堂

E2-micro实例 · Always Free Tier · Cloud CDN · Persistent Disk Snapshot

Network Egress · Cloud Storage · Budget Alerts · Load Balancing

Public IP · API Calls · Class A操作 · gsutil工具


🎯 总结

免费GCP香喷喷,避坑指南要记牢

零成本丝滑跑项目,小白也能轻松搞!

评论区分享你的云上囧事~