2023年1月6日 星期五

Detect if a VM is running in Google Compute Engine

Detect if a VM is running in Compute Engine

sudo dmidecode -s system-product-name | grep "Google Compute Engine"
這個需要 root 權限,實際上是去讀取 /sys/firmware/dmi/tables/DMI
用 strings /sys/firmware/dmi/tables/DMI | grep "Google Compute Engine" 也行

若程式沒有 root 權限,可以去讀取 /etc/hosts 有沒有包含 Added by Google 字樣
grep "Added by Google" /etc/hosts

沒有留言:

Let's Encrypt IP certificate

https://letsencrypt.org/2026/01/15/6day-and-ip-general-availability 2026年一月開放使用,但效期只有 160 小時 可以同時申請 IPv4 + IPv6 在同一張 必需指定用 shortlived profi...