Recent Comments
Archives
- February 2012 (2)
- January 2012 (5)
- December 2011 (13)
- November 2011 (12)
- October 2011 (10)
- September 2011 (7)
- August 2011 (5)
- July 2011 (11)
- June 2011 (21)
- May 2011 (22)
- April 2011 (36)
- March 2011 (43)
- February 2011 (23)
- January 2011 (24)
- December 2010 (34)
- November 2010 (19)
- October 2010 (16)
- September 2010 (15)
- August 2010 (10)
- July 2010 (12)
- June 2010 (3)
- May 2010 (3)
- April 2010 (4)
- March 2010 (8)
- February 2010 (14)
- January 2010 (13)
- December 2009 (16)
- November 2009 (28)
- October 2009 (24)
- September 2009 (12)
- August 2009 (7)
- July 2009 (10)
- June 2009 (11)
- May 2009 (22)
- April 2009 (21)
- March 2009 (18)
- February 2009 (7)
- January 2009 (32)
- December 2008 (19)
- November 2008 (12)
- October 2008 (15)
- September 2008 (14)
- August 2008 (15)
- July 2008 (18)
- June 2008 (20)
- May 2008 (19)
- April 2008 (27)
- March 2008 (22)
- February 2008 (21)
- January 2008 (15)
- December 2007 (22)
- November 2007 (17)
- October 2007 (29)
- September 2007 (31)
- August 2007 (34)
- July 2007 (31)
- June 2007 (36)
- May 2007 (23)
- April 2007 (22)
- March 2007 (30)
- February 2007 (50)
- January 2007 (75)
- December 2006 (48)
- November 2006 (59)
- October 2006 (89)
- September 2006 (29)
- August 2006 (48)
- July 2006 (14)
- June 2006 (35)
- May 2006 (62)
- April 2006 (63)
- March 2006 (72)
- February 2006 (83)
- January 2006 (56)
- December 2005 (46)
- November 2005 (60)
- October 2005 (27)
- September 2005 (54)
- August 2005 (83)
Tags
Categories
- Anime (24)
- AWS (46)
- BBS (17)
- Blog (200)
- Book (18)
- Bridge (1)
- Browser (281)
- CDN (19)
- Cloud (61)
- CMS (33)
- Comic (17)
- Computer (1945)
- Computer and Network Center (31)
- CSS (31)
- Database (129)
- DNS (49)
- Editor (11)
- Financial (37)
- Firefox (148)
- Food (10)
- FreeBSD (114)
- Game (21)
- GoogleChrome (23)
- Hardware (137)
- IE (64)
- Joke (131)
- Lab (3)
- Linux (68)
- MacOS (3)
- Mail (68)
- Movie (18)
- Murmuring (2018)
- Music (37)
- MySQL (95)
- NCTU (62)
- NetBSD (7)
- Network (1466)
- OpenBSD (3)
- Opera (21)
- OS (198)
- P2P (85)
- Photo (57)
- Political (46)
- Programming (306)
- Recreation (365)
- RSS (65)
- Safari (22)
- Science (28)
- Search Engine (126)
- Security (333)
- SMS (5)
- Social (59)
- Software (1040)
- Spam (86)
- Sport (4)
- Telephone (61)
- Television (35)
- Usenet (13)
- Vim (3)
- Wiki (25)
- Windows (46)
- WWW (775)
Blogroll
Meta
Category Archives: Computer
如果要自己寫 TOTP 的幾個要看的東西…
Tweet 整理下來: HOTP: An HMAC-Based One-Time Password Algorithm TOTP: Time-Based One-Time Password Algorithm KeyUriFormat – google-authenticator – The format of URIs containing encoded keys – Two-step verification – Google Project Hosting 有玩過 HMAC 的人,讀這些文件應該不難… TOTP 在預設的情況下,其實就是 HMAC-SHA-1 後取後面 32bits,然後轉成數字取 100000 … Continue reading
Posted in Computer, Murmuring, Network, Programming, Security, Software Tagged authenticator, cpan, google, hotp, oath, otp, qrcode, totp Leave a comment
PHP 提供的資料結構…
Tweet 從「How big are PHP arrays (and values) really? (Hint: BIG!)」這篇看到的。文章本身值得花些時間看過了解,不過對我來說重點在最後面的 SplFixedArray。 PHP 的 Datastructures 說明目前 PHP SPL 所支援的 data structure,在記憶體用量以及效率上面都會比自己實作來的小且快。 可以看到很多都支援 Countable、Iterator,以及 ArrayAccess,代表可以用 foreach() 或是對應的方式存取… 如果自己寫 library 的時候應該要善用這些 SPL。
Posted in Computer, Murmuring, Programming, Software Tagged array, data, php, spl, structure Leave a comment
YouTube (Google) 允許環球唱片 (Universal Music Group,UMG) 直接移除非 UMG 所擁有版權的影片
Tweet 依照環球唱片 (Universal Music Group,UMG) 提供給法院的文件中,YouTube (也就是 Google) 允許 UMG 透過 YouTube 的 CMS (Content Management System) 移除「不屬於 UMG 的影片」:「Google Deal Allegedly Lets UMG Wipe YouTube Videos It Doesn’t Own」,文件 (PDF) 在:「gov.uscourts.cand.248875.14.0.pdf」這邊可以下載取得。 重點在於這份文件中第四頁的這段: The UMG-YouTube agreement grants UMG rights to … Continue reading
同時用 mod_deflate 與 mod_fastcgi 所產生的問題…
Tweet 今天花了不少時間找到的問題… 問題是使用 mod_fastcgi 以及 mod_deflate 時,Content-Encoding 會是 gzip,但 Content-Length 會是未壓縮的長度。 也就是說,伺服器端在 header 提供的 Content-Length 可能寫 8KB,但實際上只丟出 2KB (壓縮後的大小),於是瀏覽器讀完這 2KB 後會停下來一直等,等到 Keep-Alive timeout 斷線 (在我機器上預設是 5 秒)。 在 timeout 斷線後 browser 會就抓到的資料直接解開執行 (因為這 2KB 都有抓到,於是都正確執行)。如果用瀏覽器這邊的 debugger 觀察,就會發現從 first byte 後 … Continue reading
Squid 3.1 的 forward proxy 設定…
Tweet 因為打算給 portsnap 用,所以得用 Squid 3.1 架 forward proxy,可以避免大量對外抓同樣的資料… 由於是內部的機器,不需要擋 acl,設定起來超簡單… ports 裝完 www/squid31 後,把 squid.conf 寫成: # http_access allow all # access_log /home/squid/logs/access.log squid cache_dir aufs /home/squid/cache1 1024 16 16 cache_effective_group squid cache_effective_user squid cache_log /home/squid/logs/cache.log cache_mem 256 MB … Continue reading
BSD make 與 GNU make 的 Makefile…
Tweet 前陣子看到 fcamel 丟出來的舊文章:「Debugging make」,花了一些時間看裡面關於 BSD make 與 GNU make 的相同處,之後寫 Makefile 的時候應該會相當有幫助。 目前的目標是 FreeBSD 與 Ubuntu,文章裡面有提到三個變數在兩個平台是通用的,分別是 $
把 Ubuntu 11.10 的 Alt-Tab 行為改掉…
Tweet 參考「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 依照上面那篇文章所提到的方法改系統設定就回到原來 … Continue reading
Firefox 11 將會支援 SPDY Protocol
Tweet Firefox 預定在 11 (現在是 8) 支援 SPDY Protocol:「(SPDY) Implement SPDY protocol」,除了 Google Chrome 自家瀏覽器支援外,總算有個大的也要支援了… 所以現在除了 Chrome、Kindle Fire 以外,又多了 Firefox 支援… 不過 Apache 與 F5 什麼時候會支援呢… mod-spdy 看起來… 呃…
重新啟動 Mac 的藍牙…
Tweet 家裡的 Mac Mini 與 Magic Mouse 中間透過藍牙連接,但有時候會斷掉… 剛開始是接隻 Apple Mouse 重開藍牙,後來覺得太麻煩了,還是要找可以用鍵盤搞定的方法:「blueutil » Command-Line Control of Bluetooth on the Mac」,裝好後用 blueutil off; blueutil on 就可以重新打開藍牙…
