Slack 自己幹的 Cron System

在 HN 上看到「Executing Cron Scripts Reliably at Scale (slack.engineering)」,發現是去年九月的文章:「Executing Cron Scripts Reliably At Scale」(話說 Slack 的 engineering blog 可讀性變差好多,不過這又是另外一回事了...)。

夠大的組織的 cron job system 都會自己幹一套出來用,因為檯面上的都不好用 XD

Slack 的搞法是組合三個內部系統:

  • 一個 container-based 管理實際執行資源的系統,基於 Bedrock,而 Bedrock 則是基於 k8s 上的系統。
  • 一個 job queue 子系統,後面是 Kafka + Redis 組成的。
  • 一組在 Vitess 上的表格,所以後面是 MySQL

這樣的系統也注定這是 Slack-only 的系統了,看一下知道用什麼就好了...

把 AWS 上的 EC2 instance 改成 IPv6-only

因為「AWS 將開始收取 IPv4 的 Public IP 費用」的關係,先試著把其中一台 EC2 instance 改成 IPv6-only,結果遇到不少問題...

首先是對外服務的部分,本來想用 CloudFront 擋在前面,但 CloudFront 到現在還是不支援 IPv6-only origin:「CloudFront support for IPv6 origins」,所以這邊的選擇變成是 Cloudflare

第二個是 AWS 自家的 API 還是有些沒有 IPv6 address,像是取得 AWS 擁有的 IP pool 的 https://ip-ranges.amazonaws.com/ip-ranges.json (本來是要取得 CloudFront 的區段,用在 nginx 的設定裡)。

另外就是周邊的問題,很多服務都沒有 IPv6 address,像是 api.slack.com

各種 proxy 與 NAT 架構還是必要的措施...

佛州眾議院通過禁止 16 歲以下的未成年人使用社群媒體

多個媒體都有報導,這邊挑一篇:「Florida’s GOP-controlled House passes strict social media restrictions for minors」。

之前猶他州通過的法律是要求要有父母明確的同意才能使用,這次則是更嚴格,父母同意也不開放使用:

Florida’s legislation appears to be stronger than laws that passed in other states recently such as Utah, where a new policy requires social media companies to receive parental consent before minors under 18 can open or maintain an account.

“If we just let parents decide on this one, parents are going to be harangued so much because it makes a kid ostracized not to be on social media,” Renner told reporters earlier last week.

是個當作「電子毒品」的概念:

“These dopamine hits [from social media] are so addictive, it’s like a digital fentanyl,” said state Rep. Fiona McFarland.

目前眾議院先通過了 (106 對 13),會送往佛州的參議院:

Legislators passed the social media legislation 106-13, with a few Democrats voting against; the adult websites bill was approved unanimously.

從通過的議案可以看到目標是今年七月生效:

This act shall take effect July 1, 2024.

猶他州那邊幾家 social media 還在跟政府打各種官司,佛州這邊看起來會有新的戰線。

sudo 對 ROWHAMMER 攻擊的 mitigation

看到「Rowhammer Resistant Coding in Sudo (github.com/sudo-project)」這邊的討論,提到了 sudo 專案 (變成 root 那個 sudo 軟體) 怎麼緩解 ROWHAMMER 攻擊的實作,原連結是去年九月時 GitHub 上的 commit:「Try to make sudo less vulnerable to ROWHAMMER attacks.」。

從 commit 裡面可以看到這個:

- #define AUTH_SUCCESS		0
- #define AUTH_FAILURE		1
- #define AUTH_INTR		2
- #define AUTH_ERROR		3
- #define AUTH_NONINTERACTIVE	4
+ #define AUTH_SUCCESS		0x52a2925	/* 0101001010100010100100100101 */
+ #define AUTH_FAILURE		0xad5d6da	/* 1010110101011101011011011010 */
+ #define AUTH_INTR		0x69d61fc8	/* 1101001110101100001111111001000 */
+ #define AUTH_ERROR		0x1629e037	/* 0010110001010011110000000110111 */
+ #define AUTH_NONINTERACTIVE	0x1fc8d3ac	/* 11111110010001101001110101100 */

可以看到想法上是讓要攻擊時需要改變的 bit 數量大幅增加?尤其是對 AUTH_SUCCESShamming distance

另外這段也是類似的設計:

+ /* Allowed by policy (rowhammer resistent). */
+ #undef ALLOW
+ #define ALLOW	 0x52a2925	/* 0101001010100010100100100101 */
+ 
+ /* Denied by policy (rowhammer resistent). */
+ #undef DENY
+ #define DENY	 0xad5d6da	/* 1010110101011101011011011010 */

這邊 ALLOWDENY 這邊也是把 hamming distance 設計到最大,兩個 XOR 後剛好是 0xffffffff

會不會變成安全相關軟體實作上的 practice?

npm 被拿來放影片...

這邊講的 npm 是指 official repository... 在 Lobsters 上看到在 npm 上放 ts 檔的文章:「npm flooded with 748 packages that store movies」,原文在這:「npm flooded with 748 packages that store movies」。

發現問題的是 wlwz 這個 user (不確定什麼時候會不見,不過備份在 Internet ArchiveArchive Today 上都有)。

以列出來的第一個 wlwz-2312-1405 來看,可以從裡面看到十個 ts 檔:

找了一下字串,看起來中國那邊有人認出來是「武林外傳」了 (縮寫剛好就是 wlwz):「npm 被用来保存盗版视频」。

這算是是各種 hosting 需要面對的問題...

1990 年代俄羅斯人用 VHS 帶 (錄影帶) 備份數位資料的方法:ArVid

Hacker News 上看到「ArVid: how Russians squeezed 4 hard drives into one VHS tape in the 90s」這篇,在 1990 年代俄羅斯人發明了用 VHS 帶 (錄影帶) 備份數位資料的方式,這個套件叫做 ArVid

方法是利用家裡已經有的 VHS 機 (錄影機),然後在 386 的電腦上接一張 ISA 介面的卡 (對比現在的電腦環境就是 PCI-e 介面卡),然後把 ISA 卡接到 VHS 機的 Video In (負責備份資料) 與 Video Out (負責取回資料),另外 ISA 卡還有一個紅外線 LED 發射的模組線可以接到 (貼到) VHS 機器的接收處,這樣可以讓 ISA 卡透過「遙控器」的協定控制 VHS 播放器。

這個點子用的媒介其實類似於磁帶機,只是 ArVid 為了使用現成的 VHS 機,多了一個轉換成影像的步驟。

這邊 ArVid 加上了 Hamming code,提供之後讀取時,發現錯誤以及修正的能力。

三個小時的 VHS 帶可以存 2GB 的資料,這個空間大小的感覺拉一下「History of hard disk drives」這頁的資訊,可以感覺一下 1990 年代前期時這樣的東西大概是什麼感覺:

1990 – IBM 0681 "Redwing" – 857 megabytes, twelve 5.25-inch disks. First HDD with PRML Technology (Digital Read Channel with 'partial-response maximum-likelihood' algorithm).

1991 – Areal Technology MD-2060 – 60 megabytes, one 2.5-inch disk platter. First commercial hard drive with platters made from glass.

1991 – IBM 0663 "Corsair" – 1,004 megabytes, eight 3.5-inch disks; first HDD using magnetoresistive heads

1991 – Intégral Peripherals 1820 "Mustang" – 21.4 megabytes, one 1.8-inch disk, first 1.8-inch HDD

1992 – HP Kittyhawk – 20 MB, first 1.3-inch hard-disk drive

是個很有趣的產品啊...

libchewing 更新,0.6.0 釋出

新酷音的 libchewing 專案釋出了 0.6.0,上次的 release 的 0.5.1 是 2016 年了:「Release v0.6.0 · chewing/libchewing」。

This release contains many improvements and bug fixes. It's the first release since 2016. We have started a major rewrite in Rust so we expect to have more frequent releases in the following months.

Contributors to chewing/libchewing 這邊可以看到近期主要是 kanru 的貢獻,然後就如同上面引用的 release note 中提到的,目前朝著 Rust 這邊開始走。

另外一個比較大的改變 (build stage 的) 是把本來用 autotools 的部分換成 cmake 了:

Add several CMake presets for supported configurations [Kan-ru Chen]. #424

CMake minimum version changed to 3.21.0

Autotools build tools are removed. CMake is the recommended way to build libchewing.

整體看起來,這版看起來主要是把這七年多的各種 bugfix 整理起來出一個 release 了,讓各 repository 可以更新一波?

.internal 被提案要列入 Reserved Top-Level Domain

意外看到「Proposed top-level domain string for private use: ".internal" (icann.org)」這篇,發現 .internal 還沒被 ICANN 列入 reserved top-level domain?原文在 ICANN 的網站上:「Proposed Top-Level Domain String for Private Use」。

這邊有兩個不同的權力組織 (團體),一邊是掌握著 root name server 規範的非營利組織 ICANN,不過 ICANN 也決定了有哪些 top-level domain 可以賣...;另外一邊是社群與 IETF 在寫下各種建議與制定標準。

現在看起來是在 RFC 6762 (Multicast DNS) 這邊講 Multicast DNS 的地方,意外的在附錄的提到了 .internal 這組 domain:

We do not recommend use of unregistered top-level domains at all, but should network operators decide to do this, the following top-level domains have been used on private internal networks without the problems caused by trying to reuse ".local." for this purpose:

然後列出了六個 domain:

      .intranet.
      .internal.
      .private.
      .corp.
      .home.
      .lan.

看起來也不是說這六組要被保留,比較像是講個現象?現在 .internal 要被放進去算是補一些決議?真的有公司想要申請這六組任何一個應該都不會過...

Apple 在歐盟 DMA 的法規下被強制開放 App Store 與各種限制

昨天科技圈最熱門的消息應該是 Apple 公開了在歐盟區開放 App Store 限制的計畫:「Apple announces changes to iOS, Safari, and the App Store in the European Union」,Hacker News 上的討論也很熱鬧,也提出了很多蘋果想盡辦法讓你不要換過去所設定的障礙:「Apple announces changes to iOS, Safari, and the App Store in the European Union (apple.com)」。

從文章可以看出 Apple 不斷的用 FUD 在擋,而且從文章裡面就可以看出來 Apple 極度不情願開放這塊肥肉。

除了文章的不情願態度外,Apple 也試著要建立各種機制讓 developer 無法轉移,其中目前最毒的是 Core Technology Fee 的設計,即使 app 後續會透過第三方的 app marketplace 下載,你仍然要付給 Apple 一筆很貴的費用:

Core Technology Fee — iOS apps distributed from the App Store and/or an alternative app marketplace will pay €0.50 for each first annual install per year over a 1 million threshold.

不確定現有的 DMA 是否有阻止的能力,但這個是目前已經看到的重點項目,歐盟應該會有動作...

另外看一些群組討論,Apple 很不願意放 App Store 出來,看起來這個功能是被鎖到 countryd 層級的,無法單純註冊歐盟 App Store 的帳號就能安裝。

反正先坐著等一兩個月看新聞消化...

Kagi 訂閱數量過兩萬

看到 Kagi 公佈了訂閱數量破兩萬的新聞:「Celebrating our first 20,000 members」,翻了一下先前的文章,九月的時候才接近 9k:「Kagi 又恢復 $10/mo 的 Unlimited Search Plan 了」。

目前的目標看起來是訂在 50k (至少圖表上面的是 50k):

Internet Archive 上面查,可以看到九月到十月那波是漲最多的,差不多 22%:(出自 https://web.archive.org/web/20231011042040/https://kagi.com/stats 這邊)

依照 2022 年當時在「Kagi status update: First three months」這篇的說法,要 25k users 才能打平所有的開銷,雖然後來產品線改變蠻多的,但 25k 應該還是會算個重要的 milestone?

We are planning to reach sustainability at around 25,000 users mark, by further improving the product, introducing new offerings and pricing changes. With the product metrics being as good as they are, we should be able to reach this as our visibility increases.

現在看起來應該再給幾個月就會達到了,看起來會證明這塊小眾市場還是能做的?