Apache Software Foundation 把程式碼交給 GitHub 託管

ASFGitHub 兩邊的新聞稿都釋出了:「Apache Software Foundation joins GitHub open source community」、「The Apache® Software Foundation Expands Infrastructure with GitHub Integration」。

整個搬到 GitHub 上面省得自己管,而且這個年頭的開發者 (至少是 ASF 這群) 大多也都熟悉 Git 與 GitHub 的操作,轉移過去的學習成本不算高...

另外就是一堆既有的服務 (像是 CI/CD 類的) 都有支援 GitHub,不少對 open source project 是有免費方案可以用的,只需要按幾個鍵授權就好了,不用自己架設...

DynamoDB 也有固定的 IP address 區段了

AWS 宣佈 DynamoDB 也有固定的 IP address 區段了:「AWS specifies the IP address ranges for Amazon DynamoDB endpoints」,對於使用 IP firewall 的人可以多一些控制權。

資料可以在 https://ip-ranges.amazonaws.com/ip-ranges.json 這邊抓到,裡面 serviceDYNAMODB 的就是了。

因為沒看到 IPv6 的位置,才發現 DynamoDB 目前沒有提供 IPv6 Endpoint...

Slack 丟出 S-1 要 IPO...

最近一波 IPO 潮,現在輪到了 Slack

Form S-! 的資料可以在「slacks-1.htm」這邊抓到,裡面有些數字可以看看,懶的看的話可以看 TechCrunch 的整理:「Slack files to go public, reports $138.9M in losses on revenue of $400.6M」。

算是相當快的,2013 年八月到現在還不到六年...

回來用 uBlock Origin 擋 Facebook 廣告...

基本上現在是哪個有用就用哪個... @_@

先前提到的「擋 Facebook 廣告的 Userscript」這個又不會動啦... 所以又到處找方法,目前看起來在 uBlock Origin 的「Facebook · Issue #3367 · uBlockOrigin/uAssets」這邊有一直在討論新的擋法,之後如果又看到廣告就過來這邊看一下...

目前用這組:

www.facebook.com##div[id^=hyperfeed_story_id_]:has(span[data-ft="{\"tn\":\"j\"}"])
www.facebook.com##.pagelet-group .pagelet:has(a:has-text(Sponsored))
www.facebook.com##.pagelet-group .pagelet:has(a:has-text(Create ad))

不知道可以活多久...

AWS 推出使用 AMD CPU 的 t3a.*

AWS 推出了 t3a.* 的 EC2 instance:「Now Available – AMD EPYC-Powered Amazon EC2 T3a Instances」。

目前開放的區域有限,但算是個開始:

You can launch T3a instances today in seven sizes in the US East (N. Virginia), US West (Oregon), Europe (Ireland), US East (Ohio), and Asia Pacific (Singapore) Regions in On-Demand, Spot, and Reserved Instance form.

價錢大約再低個 10% 左右:

Pricing is 10% lower than the equivalent existing T3 instances; see the On-Demand, Spot, and Reserved Instance pricing pages for more info.

有些超小的機器可以考慮重開的時候就順便換過去...

AWS 香港區開放

Twitter 上看到 AWS 公開了香港區的消息:「Announcing the AWS Asia Pacific (Hong Kong) Region」,他們總算是想起來有這區了:

有三個 AZ:

The AWS Asia Pacific (Hong Kong) Region consists of three Availability Zones and with this launch, the AWS Global Infrastructure now offers 64 Availability Zones worldwide, serving customers in over 190 countries.

不過在 Region Table 裡面還沒出現,雖然上面已經標「Last updated: April 24, 2019」了... 從「AWS Regions and Endpoints」可以看到區域代碼是 ap-east-1,然後可以看到 S3 的部分是這樣寫:

You must enable this Region before you can use it.

加上之前的一些傳言,可以猜測一些事情?

Anyway,本來是說 2018 年的時候要開 (參考 2017 年的「AWS 香港區 2018 開台」這篇),總算在 2019 年開了...

在 command line 上操作的 Termshark

看到 Termshark 這個專案,程式碼在 gcla/termshark

類似於 tshark 使用 CLI,但操作介面會比 tshark 友善不少,從說明可以看出來是透過 tshark 分析:

Note that tshark is a run-time dependency, and must be in your PATH for termshark to function. Version 1.10.2 or higher is required (approx 2013).

Python 上取代「printf 大法」的工具

「printf 大法」大概是最早期學到的 debug 方式?不同語言有不同的指令,在 Python 裡對應的是 print 指令 (加上 % 或是 .format())。

剛剛看到「cool-RR/pysnooper」這個 Python 上的工具,只要增加 @pysnooper.snoop() 這組 decorator,就可以自動幫你把變數的值印出來。網站上的範例是這樣,可以看到就只是加了一行 decorator:

import pysnooper

@pysnooper.snoop()
def number_to_bits(number):
    if number:
        bits = []
        while number:
            number, remainder = divmod(number, 2)
            bits.insert(0, remainder)
        return bits
    else:
        return [0]

number_to_bits(6)

然後對應的 stderr 就有滿滿的資訊可以看:

Starting var:.. number = 6
21:14:32.099769 call         3 @pysnooper.snoop()
21:14:32.099769 line         5     if number:
21:14:32.099769 line         6         bits = []
New var:....... bits = []
21:14:32.099769 line         7         while number:
21:14:32.099769 line         8             number, remainder = divmod(number, 2)
New var:....... remainder = 0
Modified var:.. number = 3
21:14:32.099769 line         9             bits.insert(0, remainder)
Modified var:.. bits = [0]
21:14:32.099769 line         7         while number:
21:14:32.099769 line         8             number, remainder = divmod(number, 2)
Modified var:.. number = 1
Modified var:.. remainder = 1
21:14:32.099769 line         9             bits.insert(0, remainder)
Modified var:.. bits = [1, 0]
21:14:32.099769 line         7         while number:
21:14:32.099769 line         8             number, remainder = divmod(number, 2)
Modified var:.. number = 0
21:14:32.099769 line         9             bits.insert(0, remainder)
Modified var:.. bits = [1, 1, 0]
21:14:32.099769 line         7         while number:
21:14:32.099769 line        10         return bits
21:14:32.099769 return      10         return bits

另外還可以寫到檔案裡、允許的深度,或是值接指定要哪些變數,另外輸出時也可以指定 prefix 避免混淆 (通常會用在 stderr 不只有 pysnooper 在輸出時)。

Let's Encrypt 從七月開始將會改用自己的 Root 簽發憑證

Let's Encrypt 宣佈了以後的憑證的簽發計畫:「Transitioning to ISRG's Root」。

主要的改變是 2019/07/08 之後提供的 intermediate CA 會改變,從現在的 cross-sign 變成只有自己的 Root CA:

On July 8, 2019, we will change the default intermediate certificate we provide via ACME. Most subscribers don’t need to do anything. Subscribers who support very old TLS/SSL clients may want to manually configure the older intermediate to increase backwards compatibility.

目前的簽發用的兩個中介憑證 (Let's Encrypt Authority X3Let's Encrypt Authority X4) 是由 Let's Encrypt 自己的 ISRG Root X1IdenTrustDST Root CA X3 所 共同簽署的:

這是因為 IdenTrust 的 DST Root CA X3 憑證很久前就被各家瀏覽器信任 (像是 Mozilla 的「Request to add two additional IdenTrust root CA certificates」這篇,可以看到 2007 年就被放進去了),而 Let's Encrypt 當時為了更快把可用的產品推出,所以跟 IdenTrust 合作,採用 cross sign 的方式讓 Let's Encrypt 簽出來的憑證被一般瀏覽器與函式庫所信任。

現在差不多過了三年半,Let's Encrypt 成為目前世界上最大的 SSL Certificate 發放單位,加上自己的 Root CA (ISRG Root X1) 也都差不多被整合進各家系統內了,所以打算要獨立自己簽了。

不過系統上可以設定,使用者如果有遇到相容性問題 (太舊的系統可能還是不包含 Let's Encrypt 自家的 ISRG Root X1),還是可以設定使用有 cross-sign 的版本 (維持現狀)。與 IdenTrust 的 cross-sign 會維持到 2021 年九月,大約再兩年多一些:

Our current cross-signature from IdenTrust expires on March 17, 2021. The IdenTrust root that we are cross-signed from expires on September 30, 2021. Within the next year we will obtain a new cross-signature that is valid until September 29, 2021. This means that our subscribers will have the option to manually configure a certificate chain that uses IdenTrust until September 29, 2021.

對於自用來說應該沒什麼大影響,主要是企業用戶要注意相容性...

CloudFront 開始提供中國大陸的服務

Amazon CloudFront 開始提供中國大陸上的節點:「Amazon CloudFront is now Available in Mainland China」。看起來是綁在 AWS China 上面,而且需要 ICP 才能使用:

To start using CloudFront in China, customers must setup a CloudFront distribution using the AWS Management Console or API in China and also obtain a valid ICP (Internet Content Provider) recordal.

不過第一波提供的節點不多,只有北京、上海與寧夏:

Amazon CloudFront announces the launch of CloudFront in China with three new Edge locations (POPs) located in Beijing, Shanghai, and Zhongwei, operated by Ningxia Western Cloud Data Co. Ltd. (NWCD).

後續不知道還有機會展到哪些地區...