在Heroku上快速部署React

在Heroku上快速部署React
npm install -g create-react-app
create-react-app my-app
cd my-app
git init
heroku create -b https://github.com/mars/create-react-app-buildpack.git
git add .
git commit -m "react-create-app on Heroku"
git push heroku master
heroku open

Git常用指令

基礎操作

git init
git clone <GIT_URL>
git remote add|update <REMOTE_NAME> <GIT_URL>
git add -A | . | -u 
git commit -m "commit message here"
git push -u <REMOTE_NAME> <BRANCH_NAME>

Branch

git branch <branchname>
git checkout <branch>
git merge <commit>
git branch -d <branch>
git rebase <branch>

偵測/紀錄網頁訪客廣告阻擋元件的狀態

偵測/紀錄網頁訪客廣告阻擋元件的狀態

首先,讓我們先了解Ad Blockers怎麼運作的


當瀏覽器發出HTTP Request給網頁伺服器並下載HTML跟JavaScript、CSS、影像的時候,若瀏覽器安裝了廣告阻擋元件,元件將會將這些資源裡的script連結的外部網頁跟自己的黑名單比較,在黑名單上面的就會被忽略。 所有的黑名單都會包括一個用於餵廣告但有個芭樂名ads.js的檔案。

閱讀全文〈偵測/紀錄網頁訪客廣告阻擋元件的狀態〉

建立網站的免費SSL憑證

建立網站的免費SSL憑證

最近有個名為 Let’s Encrypt 的數位憑證認證機構(CA)推出免費 SSL/TLS  憑證服務,也在年底正式對外開放。這是什麼呢?簡單來說,以往想為你的網站加入 SSL 加密協定(HTTPS,也就是網址列上的綠色鎖頭圖示),必須支付一筆費用來申請憑證,但有了 Let’s Encrypt 後將能免費申請憑證。

閱讀全文〈建立網站的免費SSL憑證〉

Reinforcement Learning 強化學習

What’s Reinforcement Learning

Reinforcement learning (RL) is an area of machine learning, concerned with how software agents ought to take actions in an environment so as to maximize some notion of cumulative reward. The problem, due to its generality, is studied in many other disciplines, such as game theory, control theory, operations research, information theory, simulation-based optimization, multi-agent systems, swarm intelligence, statistics and genetic algorithms. In the operations research and control literature, reinforcement learning is called approximate dynamic programming, or neuro-dynamic programming. The problems of interest in reinforcement learning have also been studied in the theory of optimal control, which is concerned mostly with the existence and characterization of optimal solutions, and algorithms for their exact computation, and less with learning or approximation, particularly in the absence of a mathematical model of the environment. In economics and game theory, reinforcement learning may be used to explain how equilibrium may arise under bounded rationality.

Source: Wikipedia

In machine learning, the environment is typically formulated as a Markov Decision Process (MDP).

Applications

 

Source: https://github.com/reiserwang/data-science-ipython-notebooks/blob/master/overview.md#reinforcement-learning

 

WAF (Web Application Firewall) – 網路應用程式防火牆

WAF正如它的名稱,也是一種防火牆,只不過防護的對象不再是個人電腦,而是網站應用程式,或者也可以說是網站主機。

目前常見的網站攻擊手法有以下這些:

  • SQL Injection(SQL隱碼注入):目前最出名也最有殺傷力的攻擊手段之一。利用SQL程式指令迴避安全檢查,竊取管理權限,可對整個網站進行毀滅性的破壞。(筆者以前架設的小論壇就曾經被這麼踩平過……)
  • Remote Command Execution(執行遠端命令):基本上就是透過web介面使網站程式執行遠端指令,不過這種攻擊多半要搭配網站程式漏洞執行。
  • Cross site Scripting(跨網站指令碼攻擊):也可寫作XSS攻擊,同樣是目前常見且有力的攻擊手法之一。它的攻擊方式有點類似釣魚網站,可將使用者導向惡意網站或假網站,然後再進行後續攻擊(如騙取密碼或植入木馬等等)。
  • Denial of Service(阻斷服務攻擊):這種攻擊手法是對主機傳送大量或特殊的網路封包,使主機陷入癱瘓或耗盡資源無法運作。它的「進階版」就是惡名昭彰的「DDoS」——分散式阻斷服務攻擊,由多個地方同時發動DoS攻擊,因此主機無法利用封鎖網段等方式來防堵。