分類彙整:開發筆記

Bind 防禦 DNS Amplification Attacks ( DNS 放大攻擊 )

最近在新加坡設立了一臺 AWS 主機,並且搭配 WHM/cPanel 做為網站伺服器。多數的運作都還算不錯,除了 DNS 伺服器,被做為攻擊 cpsc.gov 美國消費品安全委員會的跳板。有大量 IP 向主機發出 dig 請求,雖然服務正常,但由於數量極大,保守估計耗費了 100M 的頻寬在回應攻擊請求。

DNS伺服器攻擊流量
DNS伺服器攻擊流量

繼續閱讀 Bind 防禦 DNS Amplification Attacks ( DNS 放大攻擊 )

Unity3d : WebCamTexture Convert To Texture2D

General case, we can use these scripts below to  display camera on the scene in the Unity3d.

  WebCamTexture wc = new WebCamTexture ();
  GameObject.Find (“/plane”).renderer.material.mainTexture = wc;
  wc.Play ();

But sometimes we want to save camera to image, or realized video streaming. We can use WebcamTexture.GetPixels() and Texture2D.SetPixels(), but you must noticed returning width and height.

繼續閱讀 Unity3d : WebCamTexture Convert To Texture2D

Unity3d Plugin issue on CentOS 64bit

I put my solution here, try to build 32bit Unity3d and plugin. Recently I build Unity3d project in Linux 64bit. The project need to analysis web camera it only support MJPEG format, MJPG format seems could not be captured by using WebCamTextrure() directly on Linux. (By the way, MJPG format seems can be analysis on Windows  32bit/64bit normally.) So I developed plugin that using libjpeg to analysis web camera.

繼續閱讀 Unity3d Plugin issue on CentOS 64bit