多集群的配置文件管理,可以在~/.kube/目录中,放置多个集群的配置文件,如
~/.kube/cluster_a.yaml
~/.kube/cluster_b.yaml
~/.kube/cluster_c.yaml
然后配置环境变量
| 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" |
| 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' |
多集群的配置文件管理,可以在~/.kube/目录中,放置多个集群的配置文件,如
~/.kube/cluster_a.yaml
~/.kube/cluster_b.yaml
~/.kube/cluster_c.yaml
然后配置环境变量
| # -*- 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 |
| 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" |
| # 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 |