Home » Posts tagged "tab"

用 column -t 排版...

LINE Engineering Blog 上看到「Best practices to secure your SSL/TLS Implementation」這篇,標題是英文但內文全部都是日文的文章,想說翻一下看看到底是怎麼一回事,然後看到這個有趣的指令...

首先先用 openssl ciphers -v AESGCM,可以看到排不整齊的 cipher 列表:

ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-DSS-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=DSS  Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(256) Mac=AEAD
ADH-AES256-GCM-SHA384   TLSv1.2 Kx=DH       Au=None Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-DSS-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=DSS  Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(128) Mac=AEAD
ADH-AES128-GCM-SHA256   TLSv1.2 Kx=DH       Au=None Enc=AESGCM(128) Mac=AEAD
RSA-PSK-AES256-GCM-SHA384 TLSv1.2 Kx=RSAPSK   Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-PSK-AES256-GCM-SHA384 TLSv1.2 Kx=DHEPSK   Au=PSK  Enc=AESGCM(256) Mac=AEAD
AES256-GCM-SHA384       TLSv1.2 Kx=RSA      Au=RSA  Enc=AESGCM(256) Mac=AEAD
PSK-AES256-GCM-SHA384   TLSv1.2 Kx=PSK      Au=PSK  Enc=AESGCM(256) Mac=AEAD
RSA-PSK-AES128-GCM-SHA256 TLSv1.2 Kx=RSAPSK   Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-PSK-AES128-GCM-SHA256 TLSv1.2 Kx=DHEPSK   Au=PSK  Enc=AESGCM(128) Mac=AEAD
AES128-GCM-SHA256       TLSv1.2 Kx=RSA      Au=RSA  Enc=AESGCM(128) Mac=AEAD
PSK-AES128-GCM-SHA256   TLSv1.2 Kx=PSK      Au=PSK  Enc=AESGCM(128) Mac=AEAD

而想用 tab 替換掉空白,讓輸出整齊一些,用 openssl ciphers -v AESGCM | sed -E 's/ +/\t/g' 看起來比原來好一些,但還是有點亂 (因為 tab 換 8 spaces 的關係):

ECDHE-ECDSA-AES256-GCM-SHA384   TLSv1.2 Kx=ECDH Au=ECDSA        Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384     TLSv1.2 Kx=ECDH Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-DSS-AES256-GCM-SHA384       TLSv1.2 Kx=DH   Au=DSS  Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-GCM-SHA384       TLSv1.2 Kx=DH   Au=RSA  Enc=AESGCM(256) Mac=AEAD
ADH-AES256-GCM-SHA384   TLSv1.2 Kx=DH   Au=None Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256   TLSv1.2 Kx=ECDH Au=ECDSA        Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256     TLSv1.2 Kx=ECDH Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-DSS-AES128-GCM-SHA256       TLSv1.2 Kx=DH   Au=DSS  Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES128-GCM-SHA256       TLSv1.2 Kx=DH   Au=RSA  Enc=AESGCM(128) Mac=AEAD
ADH-AES128-GCM-SHA256   TLSv1.2 Kx=DH   Au=None Enc=AESGCM(128) Mac=AEAD
RSA-PSK-AES256-GCM-SHA384       TLSv1.2 Kx=RSAPSK       Au=RSA  Enc=AESGCM(256) Mac=AEAD
DHE-PSK-AES256-GCM-SHA384       TLSv1.2 Kx=DHEPSK       Au=PSK  Enc=AESGCM(256) Mac=AEAD
AES256-GCM-SHA384       TLSv1.2 Kx=RSA  Au=RSA  Enc=AESGCM(256) Mac=AEAD
PSK-AES256-GCM-SHA384   TLSv1.2 Kx=PSK  Au=PSK  Enc=AESGCM(256) Mac=AEAD
RSA-PSK-AES128-GCM-SHA256       TLSv1.2 Kx=RSAPSK       Au=RSA  Enc=AESGCM(128) Mac=AEAD
DHE-PSK-AES128-GCM-SHA256       TLSv1.2 Kx=DHEPSK       Au=PSK  Enc=AESGCM(128) Mac=AEAD
AES128-GCM-SHA256       TLSv1.2 Kx=RSA  Au=RSA  Enc=AESGCM(128) Mac=AEAD
PSK-AES128-GCM-SHA256   TLSv1.2 Kx=PSK  Au=PSK  Enc=AESGCM(128) Mac=AEAD

openssl ciphers -v AESGCM | column -t 看起來效果是最好的:

ECDHE-ECDSA-AES256-GCM-SHA384  TLSv1.2  Kx=ECDH    Au=ECDSA  Enc=AESGCM(256)  Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384    TLSv1.2  Kx=ECDH    Au=RSA    Enc=AESGCM(256)  Mac=AEAD
DHE-DSS-AES256-GCM-SHA384      TLSv1.2  Kx=DH      Au=DSS    Enc=AESGCM(256)  Mac=AEAD
DHE-RSA-AES256-GCM-SHA384      TLSv1.2  Kx=DH      Au=RSA    Enc=AESGCM(256)  Mac=AEAD
ADH-AES256-GCM-SHA384          TLSv1.2  Kx=DH      Au=None   Enc=AESGCM(256)  Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256  TLSv1.2  Kx=ECDH    Au=ECDSA  Enc=AESGCM(128)  Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256    TLSv1.2  Kx=ECDH    Au=RSA    Enc=AESGCM(128)  Mac=AEAD
DHE-DSS-AES128-GCM-SHA256      TLSv1.2  Kx=DH      Au=DSS    Enc=AESGCM(128)  Mac=AEAD
DHE-RSA-AES128-GCM-SHA256      TLSv1.2  Kx=DH      Au=RSA    Enc=AESGCM(128)  Mac=AEAD
ADH-AES128-GCM-SHA256          TLSv1.2  Kx=DH      Au=None   Enc=AESGCM(128)  Mac=AEAD
RSA-PSK-AES256-GCM-SHA384      TLSv1.2  Kx=RSAPSK  Au=RSA    Enc=AESGCM(256)  Mac=AEAD
DHE-PSK-AES256-GCM-SHA384      TLSv1.2  Kx=DHEPSK  Au=PSK    Enc=AESGCM(256)  Mac=AEAD
AES256-GCM-SHA384              TLSv1.2  Kx=RSA     Au=RSA    Enc=AESGCM(256)  Mac=AEAD
PSK-AES256-GCM-SHA384          TLSv1.2  Kx=PSK     Au=PSK    Enc=AESGCM(256)  Mac=AEAD
RSA-PSK-AES128-GCM-SHA256      TLSv1.2  Kx=RSAPSK  Au=RSA    Enc=AESGCM(128)  Mac=AEAD
DHE-PSK-AES128-GCM-SHA256      TLSv1.2  Kx=DHEPSK  Au=PSK    Enc=AESGCM(128)  Mac=AEAD
AES128-GCM-SHA256              TLSv1.2  Kx=RSA     Au=RSA    Enc=AESGCM(128)  Mac=AEAD
PSK-AES128-GCM-SHA256          TLSv1.2  Kx=PSK     Au=PSK    Enc=AESGCM(128)  Mac=AEAD

讓 Chrome 開新 Tab 時不要出現搜尋頁

Google Chrome 的新 tab 現在預設都會出現 search engine 頁面 (即使你設為 about:blank),但我從來就沒有在這頁搜尋過東西 (都是直接在 location bar 輸入),所以想要拿掉這個「功能」。

找到由 thakis@chromium.org 提供的 extension,而且是在 2013 年就發佈了:「Empty New Tab Page」,他給的截圖意思就很清楚了:

看了一下 source code 也的確是乾乾淨淨的,先裝這個...

把 Ubuntu 11.10 的 Alt-Tab 行為改掉...

參考「Revert Alt-tab behavior changed in 11.10」這篇提到的方法改。

Ubuntu 11.10 的 Alt-Tab 切換視窗的行為與 11.04 不同,會遇到切換兩次是不會切回原來視窗的情況。

我遇到的情況是 Google Chrome 除了 browser 本身以外,還開了一個 Tasky for Google Tasks,於是在系統裡面就會有兩個視窗。當我現在 focus 在 browser window,用 Alt-Tab 切到 terminal 後,再用 Alt-Tab 切回來,focus 變成在 Tasky 上面... 這讓人相當困擾 :o

依照上面那篇文章所提到的方法改系統設定就回到原來 11.04 比較不那麼擾人的切換方式...

Archives