PHP 截出 圓形(橢圓形)的圖片

PHP 要截圖可以參考此篇:PHP 要截圖片的某個區塊(截圖)

上述截圖的圖片是方形的,想要截出圓形的圖片,要怎麼做呢?

註:此篇文章的需要透明背景,所以還是以 png 為主。

閱讀全文〈PHP 截出 圓形(橢圓形)的圖片〉

將圖片轉換成 CSS 的線上服務

這個服務做的很有趣,拖拉任何圖片上去,都可以幫你轉換成 CSS Code,然後直接將此圖片畫在頁面上。

  • 詳見:img2css - This is a tool that can convert any image into a pure css image

註:測試建議丟小張點的圖片,此服務看來是依照每個 px 的色碼分析後,全部照著寫出來,圖片太大張的話,產生出來的文字會很驚人。

Linux 修正大量 GPG error BADSIG 的問題

Debian / Ubuntu Linux 遇到大量的 GPG error (BADSIG) 要怎麼解決呢?

錯誤訊息如下述:

問題1

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com stable Release: 以下簽名無效: BADSIG A040830F7FAC5991 Google, Inc. Linux Package Signing Key \<linux-packages-keymaster@google.com\>
W: 無法取得 http://dl.google.com/linux/mod-pagespeed/deb/dists/stable/Release,
W: Some index files failed to download. They have been ignored, or old ones used instead.

問題2

W: GPG error: http://dl.google.com stable Release: The following signatures were invalid: BADSIG A040830F7FAC5991 Google, Inc. Linux Package Signing Key \<linux-packages-keymaster@google.com\>
W: GPG error: http://security.ubuntu.com precise-security Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key \<ftpmaster@ubuntu.com\>
W: GPG error: http://extras.ubuntu.com precise Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key \<ftpmaster@ubuntu.com\>
W: GPG error: http://ppa.launchpad.net precise Release: The following signatures were invalid: BADSIG 531EE72F4C9D234C Launchpad webupd8
W: GPG error: http://in.archive.ubuntu.com precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key \<ftpmaster@ubuntu.com\>
W: GPG error: http://in.archive.ubuntu.com precise-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key \<ftpmaster@ubuntu.com\>

閱讀全文〈Linux 修正大量 GPG error BADSIG 的問題〉

Nagios 加上 MySQL Slave Replication Status 檢查

MySQL Status (Monitor)是否異常可以靠自己寫程式檢查 + 解決,不過都已經架了一台 Nagios,就該把檢查的工作全部交給它,才不會東漏一隻、西漏一隻的。

註:此設定主要針對 MySQL 的 DB Slave

閱讀全文〈Nagios 加上 MySQL Slave Replication Status 檢查〉

中國將10月24日 暫定為 程式設計師節(非官方認定)

看到中國的一些文章,才知道原來有人在中國定義 10月24日為程式設計師節(雖然這個不是官方認可的)。

俄羅斯官方認可的程式設計師節為 9月13日。

閱讀全文〈中國將10月24日 暫定為 程式設計師節(非官方認定)〉

四步驟辨認 紅酒 的真假

現在化學當道,紅酒可以是 果汁 + 酒精 + 香精等等來調成,連紅酒都有假的,到底還有什麼是真的?

先寫整理完的結論(我自己可以記得 + 辨認的記憶法)

  • 酒色:外圈到內圈,顏色應該由淺到深(外面顏色要比較深,要有顏色層次(不是混濁))
  • 酒香、味:要有果香味(不是口香糖、糖果的香料味),而且要喝得到此香氣的味道(喝不到代表可能加香精)

閱讀全文〈四步驟辨認 紅酒 的真假〉