文章

about Nginx setting

Ubuntu 關閉 response headers 裡 server tag 會吐出 Server 版本 修改 /etc/nginx/nginx.conf 將 #server_tokens off; 改成  server_tokens off; use url rewrite to remove slash of last url  add this setting rewrite ^/(.*)/$ /$1 permanent; put it into server {      rewrite ^/(.*)/$ /$1 permanent; } 

Internal watch failed: watch ENOSPC 錯誤處理方式

在 command 模式中輸入: echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p Ref: https://github.com/remy/nodemon/issues/214

調整 docker image 預設的存放路徑

Change docker image default store path. 調整 docker image 預設的存放路徑 sudo vi /etc/default/docker.io 加入: DOCKER_OPTS="-g /your file path"

Nodejs + Express 4 如何在 template 抓 Session

解法在 app.js 裡加上,但要在你定義routes前加上這一段 app. use ( function (req , res , next) { res. locals . session = req. session ; next() ; }) ;

Nodejs Exrpess log4js 搭配 AWS ELB 後LOG 如何記錄到使用者真實IP

參考來源: http://stackoverflow.com/questions/7139369/remote-ip-address-with-node-js-behind-amazon-elb 在app.js裡加入下面這行即可。 app. enable ( 'trust proxy' ) ; 這封郵件來自 Evernote。Evernote 是您專屬的工作空間, 免費下載 Evernote

IntelliJ 設定存檔自動 formatter

Below is Neil's answer updated. IntelliJ 13 Steps: 透過巨集錄制完成後並設定成快速鍵。 Code -> Reformat Code Edit -> Macros -> Start Macro Recording Code -> Reformat Code File -> Save all Edit -> Macros -> Stop Macro Recording Name the macro (something like "formatted save") File -> Settings -> Keymap Right click on the macro. Add Keyboard Shortcut. Set the keyboard shortcut to Control + S IntelliJ will inform you of a hotkey conflict. Select "remove" to remove other assignments.

Solr 匯率使用方法

查詢的使用方式 https://wiki.apache.org/solr/CurrencyField 設定匯率 https://cwiki.apache.org/confluence/display/solr/Working+with+Currencies+and+Exchange+Rates OpenCurrency ,每個月有1000次的Query https://openexchangerates.org/api/latest.json?app_id=c6b8570ac6de45cbbd8209292b2aa7f9