以前好像沒遇過,換了 M1 以後才注意到 desktop 位置位自己被改變,覺得很阿雜... 找了資料才發現是個 "feature":「How to prevent Mac from changing the order of Desktops/Spaces」。

關掉就好了,網路上的資料最早出現在 2018 年左右,大概是那個時候被加進去的?
幹壞事是進步最大的原動力
以前好像沒遇過,換了 M1 以後才注意到 desktop 位置位自己被改變,覺得很阿雜... 找了資料才發現是個 "feature":「How to prevent Mac from changing the order of Desktops/Spaces」。
關掉就好了,網路上的資料最早出現在 2018 年左右,大概是那個時候被加進去的?
在「Conditional CSS」這篇裡面在講很多 CSS 條件過濾的方式,裡面看到有 @support
這個規格,可以透過 feature detection 的方式來過濾:「CSS at-rule: @supports: selector()」。
文章作者給的範例是這樣:
@supports selector(:has(p)) { .card-thumb { aspect-ratio: 1; } }
在瀏覽器支援 :has(p)
的情況下才指定裡面的 CSS。
翻了一下 @support
在各家瀏覽器上實做的情況:在 Firefox 上是 69 開始支援,推出的日期是 2019/09/03。在 Chrome 上是 83 開始支援,推出的日期是 2020/05/19。在 Safari 上是 14.1 開始支援 (對應到 iOS 版本是 14.5),推出的日期是 2021/04/26。
從日期可以看出來算是比較新的功能,但主要幾個大的瀏覽器都支援了。
這個讓我想起來早期利用各家瀏覽器的 bug 產生出的各種 hack:「Browser Specific Hacks」。
在 Hacker News 上看到「DNS Esoterica - Why you can't dig Switzerland」這篇,裡面提到 dig 的 "feature"。
拿來查 tw
的 NS 會這樣下:
$ dig tw ns
結果會是列出所有的 NS server:
;; ANSWER SECTION: tw. 3600 IN NS h.dns.tw. tw. 3600 IN NS a.dns.tw. tw. 3600 IN NS g.dns.tw. tw. 3600 IN NS d.dns.tw. tw. 3600 IN NS anytld.apnic.net. tw. 3600 IN NS f.dns.tw. tw. 3600 IN NS b.dns.tw. tw. 3600 IN NS e.dns.tw. tw. 3600 IN NS c.dns.tw. tw. 3600 IN NS ns.twnic.net.
照著作者說的,uk
的 dig uk ns
可以得到類似的結果:
;; ANSWER SECTION: uk. 86400 IN NS dns1.nic.uk. uk. 86400 IN NS dns4.nic.uk. uk. 86400 IN NS nsa.nic.uk. uk. 86400 IN NS nsb.nic.uk. uk. 86400 IN NS nsc.nic.uk. uk. 86400 IN NS nsd.nic.uk. uk. 86400 IN NS dns3.nic.uk. uk. 86400 IN NS dns2.nic.uk.
但如果你下 dig ch ns
就會出現錯誤,像是這樣:
; <<>> DiG 9.16.1-Ubuntu <<>> ch ns ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 5019 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;. CH NS ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Jul 15 06:54:24 CST 2022 ;; MSG SIZE rcvd: 28
原因是因為 CH
這個關鍵字是 Chaosnet 的縮寫,而被特殊解讀:
Set the query class. The default class is IN; other classes are HS for Hesiod records or CH for Chaosnet records.
要避開這個解讀需要加上一個 dot (.
),採用 FQDN 的方式列出:
dig ch. ns
就會得到正確的結果:
;; ANSWER SECTION: ch. 86400 IN NS a.nic.ch. ch. 86400 IN NS b.nic.ch. ch. 86400 IN NS f.nic.ch. ch. 86400 IN NS d.nic.ch. ch. 86400 IN NS e.nic.ch.
另外的方式是 dig -c IN -t NS ch
,透過參數的方式讓 dig 不會誤會。
在 Hacker News 上看到「Git ignores .gitignore with .gitignore in .gitignore」這個搞事的功能,可以在 .gitignore
內把 .gitignore
忽略掉 XDDD
這真虧作者想的到這樣的玩法 XDDD
在 Hacker News 上也有看到一些有趣的東西,像是 globally ignore list 之類的:「Git ignores .gitignore with .gitignore in .gitignore (rubenerd.com)」。
在 Hacker News Daily 上看到「Safari tries to fill username」這個 Safari 的 "feature"。
作者發現網站在 Safari 上會出現登入的提示功能,像是這樣:
本來以為是 bug,但實際測過後看起來像是 feature,但抓字串的方法很容易誤判,看起來是抓 welcome back
這組字串:
On further consideration I don't think it's a bug. I think Safari is assuming any page with "Welcome Back" on it is a login page and enabling this behaviour. Therefore I think it's intended.
然後作者也有找到 workaround,用
去閃偵測:
Nice one. I found that using a non-breaking space prevents the behaviour.
>p>welcome back</p>
其他人也有發現其他的字串也會中獎:
It seems the same applies to "Sign In"
"Log in" works too. I tried a couple other languages (Finnish, German, French, Chinese) but the issue/feature seems to only happen with English (although I did use Google Translate, so I can't guarantee I used the right idioms).
目前看起來遇到就只能先 workaround 了...
在 Hacker News Daily 上看到「NordVpn disables features when you turn off auto-renew」這個,這也太厲害了:
NordVPN 設計成只要關掉 auto-renewal 就直接拔掉一些功能,一臉 WTF...
在 Hacker News 的「NordVPN disables features when you turn off auto-renew (reddit.com)」看到這段提出來的論點蠻有趣的,當作一個參考觀點:
By now these VPN providers are like toothpaste, diapers or soft drinks: completely undifferentiated between competitors, and so only able to maintain their market share by spending loads on marketing. Of course the company with most egregious dark patterns and aggressive churn dampening wins.
Thankfully a tube of toothpaste doesn't allow implementing dark patterns like this... yet.
這邊看到的消息,Chrome 與 Chrome OS 會避免在最近推出新功能,以維持軟體的穩定性,最近更新的主力會放在安全性上:「Google halts upcoming releases of Chrome and Chrome OS to keep things stable for everyone working from home」。
報導引用自 Twitter 上的宣佈:
Due to adjusted work schedules, we’re pausing upcoming Chrome & Chrome OS releases. Our goal is to ensure they continue to be stable, secure, & reliable for anyone who depends on them. We’ll prioritize updates related to security, which will be included in Chrome 80. Stay tuned.
— Chrome Developers (@ChromiumDev) March 18, 2020
呃,突然想到 Windows 的更新情況...
Elasticsearch 決定將基本的安全功能從付費功能轉為免費釋出,很明顯的是受到 Open Distro for Elasticsearch 的壓力而做出的改變:「Security for Elasticsearch is now free」。
要注意的是這不是 open source 版本,只是將這些功能放到 basic tier 裡讓使用者免費使用:
Previously, these core security features required a paid Gold subscription. Now they are free as a part of the Basic tier. Note that our advanced security features — from single sign-on and Active Directory/LDAP authentication to field- and document-level security — remain paid features.
這代表 Open Distro for Elasticsearch 提供的還是比較多:
With Open Distro for Elasticsearch, you can leverage your existing authentication infrastructure such as LDAP/Active Directory, SAML, Kerberos, JSON web tokens, TLS certificates, and Proxy authentication/SSO for user authentication. An internal user repository with support for basic HTTP authentication is also avaliable for easy setup and evaluation.
Granular, role-based access control enables you to control the actions a user can perform on your Elasticsearch cluster. Roles control cluster operations, access to indices, and even the fields and documents users can access. Open Distro for Elasticsearch also supports multi-tenant environments, allowing multiple teams to share the same cluster while only being able to access their team's data and dashboards.
目前看起來還是可以朝 Open Distro for Elasticsearch 靠過去...
在「A List of Hacker News's Undocumented Features and Behaviors」這邊列了不少 Hacker News 的潛規則,看過後其實比較重要的是「當你需要自己實做一個類似的系統時,有哪些歷史教訓是人家已經走過的」。
像是 Anti-Voting Manipulation 與 Flame-War Detector 都是蠻常見的情境,Shadowbanning 則是防治廣告機制中比較軟性的一環。Green Usernames 也算是軟性的機制...
另外產品面上,Hacker News 也設計一些常見的 list 讓使用者除了首頁以外的選擇。
在 MariaDB 的「MyISAM and KPTI – Performance Implications From The Meltdown Fix」這篇看到頗驚人的數字,這篇提到了他們收到回報 (回報的 ticket 可以參考「[MDEV-15072] Massive performance impact after PTI fix - JIRA」),說 KPTI (Meltdown Mitigation) 對 MyISAM 效能影響巨大:
Recently we had a report from a user who had seen a stunning 90% performance regression after upgrading his server to a Linux kernel with KPTI (kernel page-table isolation – a remedy for the Meltdown vulnerability).
他們發現 90% 是因為 VMware 舊版本無法使用 CPU feature 加速,在新版應該可以改善不少。但即使如此,文章內還是在實體機器上看到了 40% 的效能損失:
A big deal of those 90% was caused by running in an old version of VMware which doesn’t pass the PCID and INVPCID capabilities of the CPU to the guest. But I could reproduce a regression around 40% even on bare metal.
然後後面就在推銷 MariaDB 的 Aria Storage Engine 了,不是那麼重要... 不過知道 MyISAM 在 KPTI 下這麼傷還蠻重要的,因為接下來五年應該都還是愈的到 KPTI,應該還是有人在用 MyISAM...