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

沒有留言:

Linux PPPoE NAT MTU and MSS

Linux 在 PPPoE 環境下 NAT,下面的 Client 可能會有部份網站連不上, 已知 LINE 的網站 ( https://line.me ) 及 LINE 服務就有這個狀況 這個問題是因為 Client 的 MTU 1500 大於 Linux NAT WAN 端的 ...