Starlink 想要在太空直接提供 5G 網路訊號讓地面手機使用

Hacker News 上看到 Starlink 打算跟 T-Mobile 合作,直接用衛星提供 5G 訊號讓地面手機使用:「SpaceX, T-Mobile to connect satellites to cellphones in remote areas (wsj.com)」,原報導在 WSJ 的「SpaceX, T-Mobile to Connect Satellites to Cellphones in Remote Areas」這邊,另外因為 paywall 的關係,可以在這邊讀。

會用二代衛星:

Mr. Musk said the service would use second-generation Starlink satellites that would be outfitted with large antennas that cover swaths of land that have no service. SpaceX has a pending application before the FCC to launch around 30,000 of the second-generation satellites over time.

在另外一篇報導「SpaceX and T-Mobile team up to use Starlink satellites to ‘end mobile dead zones’」裡面有提到更細一點,不是衛星電話,是目前一般的手機:

The service won’t require mobile users to get a new phone. Musk said in or after a natural disaster, even if all the cell towers are taken out, the planned service should work.

不過可以預期只會有很基本的服務 (大概確保通話與簡訊會通),針對緊急危難狀況會特別有幫助:

Mr. Musk said that the bandwidth would be limited and that the new satellite service wouldn’t supplant existing ground-based cellular services. “This is meant to provide basic coverage to areas that are completely dead,” he said.

翻了翻 wiki,目前 Starlink 第一代衛星的軌道高度是 340km 左右,好像還不確定二代衛星會在哪個高度...

Hacker News 上有蠻多人在算技術上的可行性,除了訊號強度外,衛星與地面相對速度比目前地面上的交通工具都快,都卜勒效應 (Doppler effect) 看起來也是個會影響很多的主題...

不過討論裡面有提到 2021 年就已經有其他商用公司在幹類似的事情,所以看起來不只是講講而已?應該是有些可能性:「Lynk demos global satellite connection for ordinary phones and prepares for commercial launch」。

用 SATA 界面產生的電磁訊號突破 Air Gap 限制傳輸資料

Hacker News 首頁上看到「SATAn: Air-Gap Exfiltration Attack via Radio Signals From SATA Cables」這個,透過 SATA 界面產生的電磁訊號突破 Air Gap 限制傳輸資料,對應的討論在「SATAn: Air-Gap Exfiltration Attack via Radio Signals from SATA Cables (arxiv.org)」。

Although air-gap computers have no wireless connectivity, we show that attackers can use the SATA cable as a wireless antenna to transfer radio signals at the 6 GHz frequency band.

翻了一下論文裡面提到的距離,在 PC-1 上測試到 120cm,對應的 SNR 有 9db:

Table IV presents the signal-to-noise ratio (SNR) received with the three transmitting computers. The signal transmitted from PC-1 has a strength of 20 dB at 30 cm to 9 dB at 120 cm apart. The signal generated from PC-1 and PC-2 were significantly weaker, with 15 dB at 60 cm (PC-2) and 7 dB at 30 cm (PC-3).

另外大概是 PoC 的關係,只有簡單測一下是可行的 (對於真的有利用 air gap 的環境當作一種保護機制的威脅就夠大了),看起來沒有測極限可以跑多快:

We transmitted the data with a bit rate of 1 bit/sec, which is shown to be the minimal time to generate a signal which is strong enough for modulation.

關於反制的部份,這類的技術 (透過電磁訊號) 之前在其他的裝置上都有發生過,目前的 air gap 標準應該都有電磁訊號洩漏的防範了,這篇主要還是在展示 SATA 也可以這樣搞 XD

Bash Script 的好習慣

這篇給了一份 bash script 用的 tempalte,但更重要的反而是裡面提到的 best practice:「Minimal safe Bash script template」。

首先是不要寫 /bin/bash 這件事情,因為有些系統是沒有 /bin/bash 的,像是 FreeBSD

如果程式是可以用 POSIX sh 語法的話,應該優先考慮 /bin/sh,如果用到非 POSIX 標準的語法的話,用 env 帶出來會少一些問題:

#!/usr/bin/env bash

再來是 fail 時就趕快停止,不要再往下執行,這點算是老生常談了,文章作者也有給一個範例說明:

set -Eeuo pipefail

再來另外一個還蠻有用的事情是攔下常見的 signal 處理「後事」:

trap cleanup SIGINT SIGTERM ERR EXIT

cleanup() {
  trap - SIGINT SIGTERM ERR EXIT
  # script cleanup here
}

其他的可以看一看,但未必要全盤收下...

第五堂:「Command-line Environment」

這個系列是從『MIT 的「The Missing Semester of Your CS Education」』這邊延伸出來的,這邊講的是「Command-line Environment」這篇。

開始聊之前先看一下其他的東西,我注意到這系列文章有簡體中文 (這裡,已經翻完) 與繁體中文 (這裡,還有幾篇還沒翻完) 的版本了,如果讀英文會比較累的人可以參考看看。

這堂講 command line 下的各種事情,感覺起來比起前面硬不少。

首先就先開始講 signal,各家系統的 signal 應該還是有些微差異,可以參考各家的 signal(7) (在 command line 下用 man 7 signal 可以列出來)。

這邊講的 signal 都比較通用,像是 SIGKILL 的殺傷力,SIGTERMSIGQUIT,然後有提到 SIGHUP,但 SIGHUP 的設計慣例是拿來重讀設定檔好像就沒提到了...

接下來就帶過 tmux,只大概講了一下概念 (sessions、windows、panes) 與用法。

然後講 shell 的 alias 對於打造環境的幫助,以及 dotfiles 的設計。

後面講 SSH 的應用,然後還提到了兩個不同方向的 port forwarding。

這些對於初學者來說應該蠻有幫助的,第一次打造自己的 shell environment 的過程應該還蠻有趣的?(已經是很久前了...)

透過 Docker 跑 Command Line 程式時,螢幕大小改變時程式不會變更的問題...

其實是我拿 DockerrTorrent 遇到的問題... (在 gslin/rtorrent-docker 這包裡面)

因為平常都是用 tmux 掛著,有時候是使用桌機接起來,有時候是使用 Mac 接起來,就會遇到 resize 的問題了 :o

GitHub 上其實有討論這個問題:「SIGWINCH attached processes · Issue #5736 · moby/moby」(Docker 改名叫 Moby 了,如果你看到網址不是很確定的話,提醒一下... XD)。

在 resize 的機制上是透過 SIGWINCH 這個 signal 傳進去,所以就一層一層檢查... 然後發現是 su 不會把 SIGWINCH 傳下去,改用 sudo 就解決了,這樣就不用每次切換時還要重跑 rTorrent...