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

沒有留言:

Chromecast CLI Tools

catt go-chromecast 這兩套功能類似,可以投放到 Chromecast 的設備,各有優缺點 catt 可以指定 YouTube 網址,也可以指定本機或網路直連的網址 (例如 http://192.168.1.100/foo.mp3),參數較少 catt 在 You...