Docker多平台构建

问题 今天遇到个问题,Mac m1 上拉取之前java构建的程序发现跑不起来,第一反应arm平台不兼容之前在x86架构下构建的镜像。 现如今云厂商好多服务器都是arm架构的,加上window11都支持arm架构了(Windows on ARM),arm以后会越来越频繁使用了。 这时就得祭出docker出的利器 buildx,可以一次构建多个平台的镜像。废话不多,开搞。。 buildx其实是个容器工具 moby/buildkit:buildx-stable-1 # Create a new builder ➜ ~ docker buildx create --name mybuilder --bootstrap --use # 查看builder ➜ ~ docker buildx inspect mybuilder Name: mybuilder Driver: docker-container Nodes: Name: mybuilder0 Endpoint: unix:///var/run/docker.sock Status: running Buildkit: v0.11.2 Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6 构建 # 一条命令搞定,会pudh到registry 区别于常规build ➜ ~ docker buildx build --platform linux/arm64/v8,linux/amd64 -t registry....

January 4, 2023

红米Ax6000刷机

背景 家里路由器信号太差了想换一台,真好看到拼多多有活动(360RMB)就入手了一台,顺便手痒想刷下机,看看有什么好玩的软件和应用。 配置 红米 AX6000 搭载的是 MTK 2021 年发布的 Filogic 830 平台,具体型号是 mt7986a,四核 ARM A53 的架构, 512M 内存和 128M 闪存 刷机openwrt https://openwrt.org/toh/xiaomi/redmi_ax6000 官方固件还没有release 先不刷机了 https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/ 先贴一个官方刷机教材,等release再回头看看 https://github.com/openwrt/openwrt/pull/11115 Gain ssh access (see the link: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation) Check current stock system COMMAND: cat /proc/cmdline sample OUTPUT: console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1 if firmware=1, current system is ubi1 if firmware=0, current system is ubi0 Setup nvram If the current system is ubi1, please set it up so that the next time it will boot from ubi: nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=0 nvram set flag_last_success=0 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit If the current system is ubi, please set it up so that the next time it will boot from ubi1:...

December 20, 2022

Iterm lrzsz

https://wsgzao.github.io/post/lrzsz/ https://gist.github.com/meowoodie/4bcf6d6ae81727b618bf lrzsz 客户端 服务端都得安装 # 安装本地 默认装在/opt/homebrew/bin 目录 brew install lrzsz # 在 / usr/loal/bin 目录下创建两个文件 cd /usr/local/bin wget https://raw.githubusercontent.com/RobberPhex/iterm2-zmodem/master/iterm2-recv-zmodem.sh wget https://raw.githubusercontent.com/RobberPhex/iterm2-zmodem/master/iterm2-send-zmodem.sh # 赋予这两个文件可执行权限 chmod 777 /usr/local/bin/iterm2-* # 配置item 见下图 Perference-> Profiles -> Default -> Advanced -> Triggers 的 Edit 按钮, Regular expression: rz waiting to receive.\*\*B0100 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-send-zmodem.sh Instant: checked Regular expression: \*\*B00000000000000 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-recv-zmodem.sh Instant: checked 改脚本sh /usr/local/bin to /opt/homebrew/bin/

December 16, 2022

Openssl

reference https://www.madboa.com/geek/openssl 常用命令 X509证书 # 等于cat alipay/alipayCertPublicKey_RSA2.crt openssl x509 -in alipay/alipayCertPublicKey_RSA2.crt # 格式化输出 openssl x509 -in alipay/alipayCertPublicKey_RSA2.crt -noout -text # 导出 public key openssl x509 -in ~/cert/wxpay/apiclient_cert.pem -pubkey -noout > public.pem 摘要 openssl md5 ~/Downloads/CertTrustChain.p7b openssl sha256 ~/Downloads/CertTrustChain.p7b p12 p12是个keystore,可以存放证书,私钥 # 提取私钥 可能需要输入密码 openssl pkcs12 -in wxpay/apiclient_cert.p12 -out aa-key.pem -nocerts # 提取证书(证书带公钥) openssl pkcs12 -in wxpay/apiclient_cert.p12 -out aa.crt -clcerts -nokeys # 证书提取公钥 openssl x509 -in aa.crt -pubkey -noout > public.pem p7 证书信任链...

December 9, 2022