Home » 2016 » July (Page 2)

對 GDB 十五分鐘的介紹

看到「CppCon 2015: Greg Law 'Give me 15 minutes & I'll change your view of GDB'」這篇去年 CppCon 上介紹 GDB 的影片:

不是給初學者看的,而是給碰壁很多次的人看的... 裡面提到的 Ctrl-X 與內嵌 python 的部份讓人很驚豔,另外也實戰了 Reverse Execution 救 call stack 的技巧,拿來找破壞掉 stack 後不知道問題在哪裡的 case。

很值得看的 15 分鐘 (實際上大概花了半個小時,邊看邊實際操作練習)。

Dropbox 針對 JPEG 圖片再次「無損壓縮」的 Lepton

Dropbox 針對 JPEG 圖片再次無損壓縮所發展出來的 Lepton:「Lepton image compression: saving 22% losslessly from images at 15MB/s」。

直接用傳統壓縮方式對 JPEG 檔壓縮是沒有用的,他們針對 JPEG 裡的內容分析後再次無損壓縮,並且可以還原成原來的 JPEG:

Lepton achieves a 22% savings reduction for existing JPEG images, by predicting coefficients in JPEG blocks and feeding those predictions as context into an arithmetic coder. Lepton preserves the original file bit-for-bit perfectly.

當檔案夠大時的壓縮率大約就是 22%:

很可觀的數字... 另外 Dropbox 也透漏了至少有 160 億張 JPEG 圖片:

We have used Lepton to encode 16 billion images saved to Dropbox, and are rapidly recoding our older images.

GitHub 對抗 TCP SYN Flood 的方式:synsanity

GitHub 提出了自己對抗 TCP SYN Floord 的方式:「SYN Flood Mitigation with synsanity」。

synsanity 是一個 netfilter (iptables) 用的 target,利用現有的理論阻擋 TCP SYN Flood 這種 DDoS:

synsanity is a netfilter (iptables) target for high performance lockless SYN cookies for SYN flood mitigation, as used in production at GitHub.

前人的作法 (SYNPROXY) 以 module 形式運作,需要過濾每一個封包,而這在 GitHub 這種規模上會導致效能不足並且 kernel panic:

This is quite an intrusive way of solving the problem since it touches every packet during the entire connection, but it does successfully mitigate SYN floods. Unfortunately we found that in practise under our load and with the amount of malformed packets we receive, it quickly broke down and caused a kernel panic.

GitHub 所開發的 synsanity 則是透過 netfilter (iptables) 的 target,只處理 initial packets,在撰寫的時候考慮多 CPU 的 lock 問題:

DigitalOcean 也推出類似於 Amazon EBS 的東西了:Block Storage

DigitalOcean 也提供類似 Amazon EBS 的服務了:「Block Storage: More Space to Scale」。

只提供 SSD 型態的 Block Storage,價位跟 Amazon EBS 類似,USD$0.1/GB/month。有幾個限制,一個是服務的地區目前只有 NYC1 與 SFO2,下一個會是 FRA1:

You can create Block Storage volumes right now in NYC1 and our new SFO2 region. FRA1 is next in line and will be available in the coming weeks. We’re working quickly to expand to other regions. More updates to come.

另外一個是最大 16TB,也是跟 Amazon EBS 一樣:

You can easily scale up and resize your Storage volumes from 1GB to 16TB and move them between Droplets via the control panel or API.


Avast 買 AVG

AvastAVG,這兩家都不小:「Avast acquires rival AVG for $1.3 billion to create a security software giant」。


Security software giant Avast Software has acquired rival AVG Technologies. Avast will pay $25 cash for each of AVG’s outstanding ordinary shares in a deal amounting to around $1.3 billion.


Google Chrome 引入 CECPQ1,開始測試 Post-Quantum Cryptography

Quantum Computer 對現有密碼學的衝擊很大,像是 RSA 演算法是基於「質因數分解」的難題而架構出來的系統,在 Quantum Computer 上存在有效率的演算法,也就是 Shor's algorithm

雖然 Quantum Computer 在技術上還沒辦法對現有演算法造成有效的攻擊,但已經有人提出新的演算法來對抗,而 Google 打算在 Google Chrome 裡面引入測試:「Experimenting with Post-Quantum Cryptography」。

Google 也特別說明了,他們不希望這個實驗最後變成 de-facto standard (借測轉出貨的概念),而是希望當作一個開頭,希望之後可以用更好的標準換掉:

We explicitly do not wish to make our selected post-quantum algorithm a de-facto standard. To this end we plan to discontinue this experiment within two years, hopefully by replacing it with something better.

Linksys 的 WRT54GL

前幾天跟同事聊到 Android 刷機的事情,而最近剛好看到介紹這台無線分享器裡的名機,LinksysWRT54GL:「
The WRT54GL: A 54Mbps router from 2005 still makes millions for Linksys」,第一款被廣泛應用在各種客製化硬體的機器。

取自維基百科的「File:Linksys WRT54G.jpg

從 2005 年開始賣,到現在 2016 年還是繼續在賣,而且這東西支援的無線規格很舊,還比其他的無線分享器貴不少:

Witness the Linksys WRT54GL, the famous wireless router that came out in 2005 and is still for sale. At first glance, there seems to be little reason to buy the WRT54GL in the year 2016. It uses the 802.11g Wi-Fi standard, which has been surpassed by 802.11n and 802.11ac. It delivers data over the crowded 2.4GHz frequency band and is limited to speeds of 54Mbps. You can buy a new router—for less money—and get the benefit of modern standards, expansion into the 5GHz band, and data rates more than 20 times higher.


Despite all that, people still buy the WRT54GL in large enough numbers that Linksys continues to earn millions of dollars per year selling an 11-year-old product without ever changing its specs or design.

量大到 Broadcom 還是繼續支援,然後產品 PM 就抱怨他搞不懂:

"To be honest, it somewhat baffles my mind," Linksys Global Product Manager Vince La Duca told Ars. But production won't stop any time soon as long as Linksys' suppliers, including chipmaker Broadcom, keep selling the parts needed to build the WRT54GL. "We'll keep building it because people keep buying it," La Duca said.


hashcat v3.00

hashcat 是個用暴力法拿來計算各種 reverse hash 的的工具,也就是對於 HASH(key) = value 時,給 value 的值,要求得出 key 的值 (被稱為 Preimage attack)。

雖然是暴力法,但還是花了很多力氣加速,尤其在這個 GPU 已經很常見的年代,這套軟體也支援透過 GPU 加速運算。

先前的版本是 CPU 與 GPU 分開兩個版本可以用 (CPU 版本的叫 hashcat,GPU 版本的叫做 oclHashcat),而 GPU 的版本只支援 nVidiaAMD 兩家大廠的顯卡。

而在 v3.00 版,透過 OpenCL 的界面將這些全部都合而為一了:「hashcat v3.00」,所以不只是支援 CPU 與 nVidia + AMD 的 GPU,還包括了:

  • GPU
  • CPU
  • APU
  • DSP
  • FPGA
  • Coprocessor
  • Anything else which comes with an OpenCL runtime

也特別提到,Intel CPU 上內建的 GPU 部份也可以拿來用了:

For example, Intel CPUs will now instantly pop up as an available OpenCL device after you've installed the Intel OpenCL runtime.

也因為透過 OpenCL,如果有多種不同類型的加速方式,新版 hashcat 也可以同時使用。

另外這次效能評估 (與舊版比較) 也做出來了:「hashcat 2.01 / 3.00 performance comparison」,可以看到比較新一點的卡整體都有進步,而舊的卡有可能是對 OpenCL 的最佳化或是 overhead 比較敏感,慢了不少...