Amazon Redshift 的 Query 效能調教

Amazon Redshift 在 Web Console 上推出的新功能:「Custom ODBC/JDBC Drivers and Query Visualization for Amazon Redshift」:

會把 query 的步驟拆成多個步驟,針對比較吃資源的步驟標出來,讓設計的人可以思考要怎麼改。

Firefox 成為第一個預設啟用 HTTP/2 的主流瀏覽器

Firefox 36 的 Release Notes 內宣佈預設啟用 HTTP/2

Support for the full HTTP/2 protocol. HTTP/2 enables a faster, more scalable, and more responsive web.

另外 Firefox 36 也拔除 RC4

No longer accept insecure RC4 ciphers whenever possible

接下來應該是 Google Chrome 預設啟用,以及 nginx 的 server implementation...

CloudFlare 的 Universal SSL

CloudFlare 這幾天的動作頗多:「Universal SSL: Encryption all the way to the origin, for free」。

Universal SSL 要保護的是右邊 CloudFlare 到 Origin Server 這段:現在可以讓 CloudFlare 簽 SSL certificate,而不用到外面買了。

這邊的 SSL certificate 只有 CloudFlare 認得,一般的瀏覽器預設值不會認:

The CloudFlare Origin CA is currently not trusted by browsers, so these certificates should not be used on sites that are not behind CloudFlare.

用 jq 操作 JSON 文件

jq 用一陣子了 (因為配合著 AWS 官方的 AWS Command Line Interface 一起用),剛好看到有人介紹:「jq is sed for JSON」。

現在 Ubuntu 的 package repository 內都有 jq 了 (Ubuntu – Package Search Results -- jq),雖然版本舊了一點,不過基本功能都穩定了,除非有特別的需求,不然應該夠用。

照原文章的範例,假設 1.json 是這樣:

[
  {
    "type": "message",
    "user": "U024HFHU5",
    "text": "hey there",
    "ts": "1385407681.000003"
  },
  {
    "type": "message",
    "user": "U024HGJ4E",
    "text": "right back at you",
    "ts": "1385407706.000006"
  }
]

而你下這樣的 command 就可以抽出來:

$ jq "[.[] | { the_user: .user, the_text: .text }]" 1.json
[
  {
    "the_user": "U024HFHU5",
    "the_text": "hey there"
  },
  {
    "the_user": "U024HGJ4E",
    "the_text": "right back at you"
  }
]

很好用的工具 :o

IRCCloud 的檔案上傳功能...

IRCCloud 宣佈的新功能:「File Uploads」。

CloudFront 擋在前面,而且不是 Price Class 100 (因為 mtr 時至少有看到亞洲區的 PoP),不過看起來後面不是 S3...

在公告的文章裡有提到 Imgur,現在 Imgur 的 CDN 品質好像不是很好?台灣連過去用的是 Fastly 美國的點,但選點好像不太行啊?不過算是堪用...

innodb_file_per_table 對於 CREATE TABLE 與 DROP TABLE 的速度

雖然平常應該不會常常用到 CREATE TABLEDROP TABLE,不過還是很有趣的 benchmark:「Is MySQL’s innodb_file_per_table slowing you down?」。

重點在這段:

  • With innodb_file_per_table=ON
    • Schema and table creation = 1m54.852s
    • Schema drops = 1m21.682s
  • With innodb_file_per_table=OFF
  • Schema and table creation = 0m59.968s
  • Schema drops = 0m54.870s

不過作者測試時沒有用 ENGINE=COMPRESSED (必須在 innodb_file_per_table 打開時才支援,而且這也是選擇打開 innodb_file_per_table 的重要因素),不知道壓縮開起來以後會差多少...

不過就算再怎麼慢,相較於 CREATE TABLEDROP TABLE 的效能,還是比較計較壓縮換來的 I/O 效能。(尤其是資料量超過記憶體大小時)

Comodo 的 PrivDog 更厲害:直接關掉 CA Certificate 檢查

感覺接下來的整個月會拿有無窮無盡的 Superfish-like 新聞,下次如果出現 NSA 或是 GCHQ 已經在用這些漏洞的話也不太意外就是了:「Adware Privdog worse than Superfish」。

PrivDogComodo 發行的 adware,比起 Superfish 更厲害,直接把 CA Certificate 的檢查關掉:

It will turn your Browser into one that just accepts every HTTPS certificate out there, whether it's been signed by a certificate authority or not.

而 Comodo 是發行 SSL certificate 的公司,很多便宜的 SSL certificate 都是由他們家發出來的... (包括我的 blog)

刪除 Mac OS X 裡面與政府相關的 SSL certificate

最近因為 Superfish 的關係,對 root certificate 的檢視就愈來愈仔細,在「The Mac Facilitates Spying Too」這篇文章裡,作者發現 Mac OS X 裡面有不少可疑的憑證,像是 DoD (美國政府):

文章裡面提到包括了 US、JP、CN、TW。

有人在 GitHub 上放了 script,可以簡單的清除掉這些 root CA:「Delete Known Government-Linked Certificate Authorities in OS X」,這隻程式也不難改,對於有疑慮的 CA 也可以放進去一併處理。

Gemalto 被 NSA 與 GCHQ 滲透的問題...

前幾天 Snowden 發佈出來的消息,全世界最大的 SIM 卡製造商 GemaltoNSAGCHQ 滲透進去,取得所有的 SIM key:「NSA/GCHQ Hacks SIM Card Database and Steals Billions of Keys」、「Gemalto Hack May Have Far-Reaching Effects」。

The attack, reported by The Intercept, is breathtaking in its scope and audacity. Attackers allegedly associated with the NSA and GCHQ, the British spy agency, were able to compromise a number of machines on the network of Gemalto, a global manufacturer of mobile SIM cards.

不過,只要牽扯上 NSA 與 GCHQ 這對搭檔,事情直接往最糟糕的方面去想就好了。可以假設他們家所有的產品線都失守,包括 AWS 所使用的硬體 2FA:「Multi-Factor Authentication」。

這讓我頭好痛...