往上升級或是用 Unlimited mode 撐

這個 blog 跑在 Amazon EC2t4g.micro 上面,以往跑起來 baseline 是 10% CPU credit 也還算夠用,但最近的 loading 特別的大,發現是有 bot 在砍站砍的比較兇 (參考「t4g 的 CPU credit 被吃完了」這邊),雖然擋掉後有降不少,但看起來還是比之前高不少:(這邊是一天的平均,拉三個月資料來看)

以往這種一陣一陣的可以靠 CPU credit 頂過去,但因為先前 CPU credit 被 bot 砍完後沒了,就常常撞到底,只好先開 Unlimited mode 擋著了。

另外一方面,當初買的三年 RI 時間也快到了 (居然),這幾天差不多要處理了:

Start
February 9, 2021, 17:43 (UTC+8:00)

Expires
February 9, 2024, 17:43 (UTC+8:00)

升級到 t4g.small 剛好會符合 AWS 的免費方案,看起來可以先掙扎一陣子:

Until December 31, 2024, all AWS customers will be enrolled automatically in the T4g free trial as detailed in the AWS Free Tier. During the free-trial period, customers who run a t4g.small instance will automatically get 750 free hours per month deducted from their bill during each month.

我記得我算過但沒找到文章,所以這邊還是算一下... 如果 t4g.small 要錢的話,與 Unlimited mode 的消費差異大概是多少。

us-east-1t4g.small 是 $0.0168/hr,用 720 小時換算是 $12.096/mo。

假設 CPU 使用率平均在 15%,那用 t4g.micro 的 $0.0084/hr 會是 $6.408/mo,另外加上 5% * 2vCPU = 10% 的 Unlimited mode 費用 ($0.04/hr/vCPU),會是 $2.88/mo。

假設 CPU 使用率平均在 20% (剛好跟 t4g.small 的 baseline 相同的話),會是 $5.76/mo,所以如果用不到對應的記憶體的話,跑 Unlimited mode 會比較划算。

先開一張票。年底的時候再來看看當時的機種與優惠方案...

AWS 延長 t4g.small 的 free trial

Plurk 上看到朋友貼的「Announcing Amazon EC2 T4g Free Trial Extension」。

t4g.small 的 free trial 延長到明年年底了:

The Amazon Elastic Compute Cloud (Amazon EC2) T4g instance Free Trial is extended to December 31, 2024. All new and existing AWS customers can utilize the free trial to automatically deduct up to 750 hours per month with the t4g.small instances through December 31, 2024. You can start building on Graviton-based instances for no charge with the T4g free trial, though charges may apply for surplus CPU credits. Refer to Amazon EC2 FAQs for more details on the free-trial.

這台算是還蠻好用的 ARM-based 主機,t4g.small 是 2 vCPU + 2GB RAM 的規格,如果是自己會 tune 的話已經可以做不少事情了,再加上 EC2 在前 12 個月的 t3.micro (2 vCPU + 1GB RAM) 免費,就已經可以玩不少東西了:

750 hours per month of Linux, RHEL, or SLES t2.micro or t3.micro instance dependent on region

Evernote 限縮免費版的方案

Evernote 這次算是完全限縮了免費版的方案:「Update: Evernote Free accounts will have fifty notes and one notebook」。

從 2023/12/04 開始限縮成一個 notebook 以及 50 個 note:

From December 4, the Evernote Free experience is changing. Going forward, new and existing Free users will have a maximum of fifty notes and one notebook per account.

從今年一月被併購後,二月就把整個 Evernote 團隊砍掉,就有蠻多人有悲觀的看法了,所以想轉的應該都已經轉的差不多了...

常看到的替代方案是 Notion 以及 Obsidian,反而沒看到什麼 open source 的討論?(剛剛找了一下,是有不少選擇,但名字都沒看過...)

GCP 提供每個區域的 Standard Tier Networking 每個月 200GB 的免費頻寬

GCP 提供每個區域 Standard Tier Networking 每個月有 200GB 的免費頻寬:「Announcing 200 GB free Standard Tier internet data transfer per month」。

這類優惠應該是要給練習或是試用的人用的,吸引他們放一些量上來...

另外雖然是每個區域都有 200GB/mo 的 free bandwidth,但通常也只會用一個或兩個區域,以台灣的 asia-east1 來說,如果有量在上面跑的話,省下來的會是 $0.07/GB 這個部分,大概就是 $14/mo 左右?

Tailscale 放鬆免費版的使用限制,以及商業版的計算方式

昨天在 Hacker News 上注意到的:「Changes to Tailscale Pricing and Plans (tailscale.com)」,Tailscale 宣佈了新的免費與收費方式 (直接叫做 Pricing v3):「Pricing v3, plans, packages, and debugging」。

這次有許多改變,首先是免費版本來只能一個使用者使用,現在變成三個使用者可以在同一個 tailnet 裡面,這對於超級早期的 startup 方便不少,另外家庭用戶也可以受益。

另外一個是擴大「免費」的定義,本來的「免費」只有在完全免費的方案裡面用,一個人是免費,但五個人會收五個人的費用;現在變成「既然在 Pricing v3 我說三個人以下免費,那五個人的方案裡面還是有三個免費的名額,我就只收額外的兩個人的費用」,而且只有 active user 才會收:

That is, if you have a 5-person team at work, the first three are still free. You’d pay for only the 2 additional users (and only if they’re active, more on that below).

然後是拔掉限制 (包括「No more limits on subnet routers」與「No more limits on admin accounts」),以及放鬆限制 (包括「More free nodes, and twice as many nodes per user」)。

所以看起來 Tailscale 現在的策略是成長,趁這波調價時做了一波 PR...

Twitter 的 API 收費方案出爐了

Twitter 上看到的公告:

然後這次的 prior notice 是 30 天:

而在「Use Cases, Tutorials, & Documentation」這頁上可以看到各種方案了:

可以看到付費方案對業餘開發者其實頗不友善,現在比較不確定的是這邊 free tier 提到的 write-only 是連自己的 timeline 都不能抓,還是指不能抓其他人的... 如果是前者的話就得用其他方法跑 twitter2facebooktwitter2plurk 了,或是乾脆跳船了?

用 Automerge 處理 CRDT 問題

上個月看到 Automerge 出了 2.0 版的消息:「Automerge 2.0」,Automerge 這個套件可以幫你處理複雜的 CRDT 結構 (Conflict-free replicated data type)。

可以看到 Automerge 在 2.0 之後的效能改善不少,可以跟 yjs 比較了:

所以練了一下手測界面怎麼用,另外也看一下 conflict 時的處理方式。

這邊先產生 hello, world.,然後做了三個操作,第一個是把開頭的 h 改成 H;第二個是把 world 改成 test;第三個是把 world 改成 example

(() => {
  const Automerge = require('@automerge/automerge');

  let doc1 = Automerge.init();

  doc1 = Automerge.change(doc1, 'Init', doc => {
    doc.text = new Automerge.Text();
    doc.text.insertAt(0, 'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '.');
  });
  
  let doc2 = Automerge.clone(doc1);
  let doc3 = Automerge.clone(doc1);

  doc1 = Automerge.change(doc1, 'Capitalize', doc => {
    doc.text.deleteAt(0);
    doc.text.insertAt(0, 'H');
  });
  doc2 = Automerge.change(doc2, 'world => test', doc => {
    delete doc.text.deleteAt(7, 5);
    doc.text.insertAt(7, 'test');
  });
  doc3 = Automerge.change(doc3, 'world => example', doc => {
    delete doc.text.deleteAt(7, 5);
    doc.text.insertAt(7, 'example');
  });

  let finalDoc = Automerge.merge(doc1, doc2);
  finalDoc = Automerge.merge(finalDoc, doc3);
  console.log(finalDoc);
})();

這樣最後會產生出 Hello, testexample.

{
  text: Text {
    elems: [
      'H', 'e', 'l', 'l', 'o',
      ',', ' ', 't', 'e', 's',
      't', 'e', 'x', 'a', 'm',
      'p', 'l', 'e', '.'
    ]
  }
}

這結果看起來還行。

只能說以前要是有這些 library 就好了,當初在 KKBOX 做雲端歌單自己搞半天...

用 YouTube 影片當作免空的方式

Hacker News 上看到「Infinite-Storage-Glitch – Use YouTube as cloud storage for any files (github.com/dvorakdwarf)」這個討論,裡面的專案在 DvorakDwarf/Infinite-Storage-Glitch 這邊。

這種搞法有點像是以前 Love machine 的玩法,記得當年是和信這樣玩去塞爆 HiNetTWIX 中間的頻寬,算是老故事了。

看起來他的作法是透過 2x2 的黑白 pixel 儲存,然後讓 YouTube 壓縮,最終 YouTube 生出來的 mp4 檔案大概是四倍大:

Use the embed option on the archive (THE VIDEO WILL BE SEVERAL TIMES LARGER THAN THE FILE, 4x in case of optimal compression resistance preset)

另外真的是比較學術面的討論的話,有 Information hiding 這個主題 (不過這次這個專案沒在演),在討論要怎麼「藏」資訊在媒體載體上。

不過現在有不少直接做免空服務的,這種方式算是好玩而已,「實用性」已經沒以前那麼高了。

Twitter 砍免費 API 的時程延到 2/13

先前在「Twitter 宣佈要廢掉免費的 API 權限」這邊有提到在 2/9 要廢掉 API free tier 的事情延期了,延到 2/13:

據說跟老闆很在意 Super Bowl,然後丟了內部信件出來有關:

本來想說今天會爛掉,剛好可以來弄弄,看起來可以拖延到週末了...

Twitter 宣佈要廢掉免費的 API 權限

昨天下午的時候看到這則官方在 Twitter 上提到的消息,要廢掉 free tier 的 API access:

但這邊提到的 paid basic tier 的價錢還沒看到公告。以「API Pricing - It’s very dark out here」這邊看到的價格,目前的 premium plan 超級貴:

這下看起來是真的得搬了,目前有好幾隻程式在上面跑 :o