多集群的配置文件管理,可以在~/.kube/目录中,放置多个集群的配置文件,如
~/.kube/cluster_a.yaml
~/.kube/cluster_b.yaml
~/.kube/cluster_c.yaml
然后配置环境变量
| # uv add pillow | |
| from PIL import Image, ImageOps | |
| # 打开原图 | |
| input_path = "/path/to/input/image.jpg" | |
| img = Image.open(input_path) | |
| # 2寸照片尺寸:3.5cm x 5.3cm -> 换算像素 (300 dpi = 118.11 px/cm) | |
| cm_to_px = lambda cm: int(cm * 118.11) | |
| target_size = (cm_to_px(3.5), cm_to_px(5.3)) # 约 413 x 626 px |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/aws/aws-sdk-go-v2/aws" | |
| "github.com/aws/aws-sdk-go-v2/config" | |
| "github.com/aws/aws-sdk-go-v2/feature/s3/manager" | |
| "github.com/aws/aws-sdk-go-v2/service/s3" | |
| "github.com/dustin/go-humanize" |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| # common config for master and node | |
| config.vm.provision "shell", path: "init.sh" | |
| config.vm.box = "gyptazy/ubuntu22.04-arm64" | |
| config.vm.box_check_update = false |
多集群的配置文件管理,可以在~/.kube/目录中,放置多个集群的配置文件,如
~/.kube/cluster_a.yaml
~/.kube/cluster_b.yaml
~/.kube/cluster_c.yaml
然后配置环境变量
| from telethon import TelegramClient, events | |
| import pathlib | |
| # Remember to use your own values from my.telegram.org! | |
| api_id = 12345 | |
| api_hash = '0123456789abcdef0123456789abcdef' | |
| # Replace the checkin bot and text with yourown | |
| checkin_at_bot_id = '@checkin_bot' | |
| checkin_text = '/checkin' |
| package main | |
| import ( | |
| "context" | |
| "encoding/hex" | |
| "fmt" | |
| "github.com/ethereum/go-ethereum/accounts/abi" | |
| "github.com/ethereum/go-ethereum/common" | |
| "github.com/ethereum/go-ethereum/core/types" | |
| "github.com/ethereum/go-ethereum/ethclient" |
| [email protected] | |
| DASHBOARD_DOMAIN=traefik.example.com | |
| WHOAMI_SERVICE_DOMAIN=whoami.example.com | |
| # echo "DASHBOARD_USER=$(htpasswd -nb your_name your_password)" >> .env | |
| DASHBOARD_USER=your_name:$apr1$eMFHYd7e$2rl6G/UF80alLYInwv/tz0 |
| # bare secure mode: no https, no basic auth | |
| version: '3.8' | |
| services: | |
| reverse_proxy: | |
| image: traefik:v2.6 | |
| command: | |
| # - "--log.level=DEBUG" | |
| # Enable Docker in Traefik, so that it reads labels from Docker services | |
| - "--providers.docker" |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/ethereum/go-ethereum/common" | |
| "github.com/ethereum/go-ethereum/ethclient" | |
| "log" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/ethereum/go-ethereum" | |
| "github.com/ethereum/go-ethereum/accounts/abi" | |
| "github.com/ethereum/go-ethereum/common" | |
| "log" | |
| "math/big" |