加快 Ubuntu 上 Firefox 的速度...

新版的 Firefox 已經支援 Multi-processes 架構 (Electrolysis),但 Ubuntu 上會因為預設值的關係而被關閉,這篇文章就是講原因以及怎麼打開:「Enabling This Makes Firefox More Responsive On Ubuntu」。

由於大家都會裝一堆套件,看起來得用 Force Enable 這邊提到的方法打開,也就是手動在 about:config 內加入 browser.tabs.remote.force-enable,並設為 true

Firefox 的轉換還有很長一段時間要走...

MBPR 觸控板壓力回饋失效的問題

Short Version:遇到這個問題,只要把作業系統從 10.10 更新到 10.12 就好了:「Mac Users Reporting Widespread System Freezes With OS X El Capitan 10.11.4 Update」。


之前 MBPR 在過保後掛過一次送修 (常常無法開機,開起來後鍵盤與觸控板都沒有反應),當時把鍵盤與觸控板都換掉... 結果前幾天發生觸控板的壓力回饋失效的問題 (還是可以移動滑鼠游標與輕觸),但這幾天要去日本,想帶著處理事情,就先上 24h 買個 Magic Mouse 2 應急 (用 lightning 充電的那個版本,被嘲笑很醜的那個 XD)。

買回來後發現 Magic Mouse 2 的多點觸控與電量資訊沒有顯示在系統裡,翻了資料才發現要 10.11 之後的版本:

Bluetooth-enabled Mac computer with OS X v10.11 or later

耐著性子升級想說出國前至少把問題解決一些,升完後發現觸控板的回饋就回來了... 然後查資料發現是系統的 bug 造成的:

The freeze seems to affect not only the screen and mouse cursor but also the Mac's Force Touch trackpad, which completely loses feedback.

好吧就這樣吧 orz

清出一個乾淨的 Git Repository

自動化機制中,要確保可以拿到最新的 Git Repository 最保險的方法是 rm -rf 掉再重新 clone 一份,但對於稍微大一點的 repository 速度就太慢了,所以得想辦法保留 repository 加快速度。

目標是想要處理 submodule 的變更,並且仍然可以處理 force push 時的災難,避免需要人工介入... 這在建各種自動化機制時常常會用到,像是用 Fortify SCA 白箱掃描,或是 CI & CD 機制上。

BRANCH=master
git fetch --force
git reset --hard origin/"${BRANCH}"
git submodule sync --recursive
git submodule update --init --force
git clean --force --force -d -x
git checkout "${BRANCH}" --force

用了很多 --force 主要是要處理 force push 後的收拾 :o

其實如果想要處理的更好的話,可以在發生錯誤時改走 mv (保留屍體) + 重新 clone 的機制,並且發警報出來讓管理者事後研究,這樣發生問題當下還是可以先提供服務。

不過這個想法還只在腦袋裡還沒寫... XD

強迫要求使用者改密碼反而會不安全?

在「Want Safer Passwords? Don't Change Them So Often」這邊在討論改目前 password policy 會有要求一定時間要改密碼造成的問題。原報導出自 美國聯邦貿易委員會 blog 上的「Time to rethink mandatory password changes」。

當你強制要求改密碼時,由於因為是被逼的,他們不會放太多心力:

Lorrie Cranor recently outlined, the weight of recent research agrees that when people are forced to change their passwords on the regular, they don’t put a whole lot of mental muscle behind it.

而在沒有準備的情況下產生出來的密碼將會是比較容易預測的:

Instead, Cranor notes, according to one UNC study, people “tended to create passwords that followed predictable patterns, called ‘transformations,’ such as incrementing a number, changing a letter to similar-looking symbol (for example changing an S to a $), adding or deleting a special character (for example, going from three exclamation points at the end of a password to two), or switching the order of digits or special characters (for example moving the numbers to the beginning instead of the end).”

另外你應該鼓勵使用者用 password manager 管理密碼,雖然不是完美的,但至少是目前比較合理的方案:

If for whatever reason you still can’t let go of making people change passwords as often as they turn the pages of their wall calendars, Cranor suggests that you at least encourage them to use a password manager, like LastPass or DashLane. They’re not perfect, but they can be a “very reasonable strategy” for coping, mostly because they don’t require people to balance unpredictable passwords with ones they can actually remember.