2016年11月29日 星期二

檢測你的 SSL/TLS 是否安全 Qualys SSL LABS

最近在弄 SSL 憑證剛好就找到一個可以檢測 HTTPS 是否安全的 Online scan 網站 Qualys SSL LABS

 

Qualys SSL LABS 是一個基於保護網際網路資安的國外廠商對於 SSL 的安全性有一定的高度水準,並且可以提供檢測你的各項 SSL 報告,如 Browser SSL TEST、Server SSL TEST ..

提高 SEO 排名快使用 Let's Encrypt 免費的 SSL 憑證替網站加上綠色鎖頭!

Google 從 2014 就開始宣告要將 HTTPS 列為 ranking signal 之一的項目,對於 SEO 是一個很重要的公開指標,以往 Google 對於 ranking signal 絕不公開,可見 Google 對於網站加密非常看重

 

對於某些網站可能是自行經營像是小弟僅是使用一台非常爛的主機在跑 Blog 做紀錄,買個網域就已經很奢侈了要在買下 SSL 憑證一年約增加 1000 左右的成本實在不划算

2016年11月22日 星期二

資安:WordPress 禁止 xmlrpc.php 攻擊

WordPress 本身存在著許多漏洞,對於使用 WordPress 更要相當小心的檢測是否遭受攻擊 or 跳板

 

以下這個例子就是 WordPress 本身的一個攻擊入口
173.245.49.175 - - [17/Nov/2016:20:43:14 +0800] "POST /xmlrpc.php HTTP/1.1" 200 271 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" 
173.245.49.175 - - [17/Nov/2016:20:43:30 +0800] "POST /xmlrpc.php HTTP/1.1" 200 271 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
173.245.49.175 - - [17/Nov/2016:20:43:46 +0800] "POST /xmlrpc.php HTTP/1.1" 200 271 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"

Git 改為 git-shell 後無法 git push

最近有一個同事發了一個問題給我,說他將 git 的權限改為 git-shell   在 git push 的時候出現了以下錯誤訊息:
[remote rejected] master -> master (branch is currently checked out) 
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.

2016年11月12日 星期六

CentOS 用 inode number 刪除亂碼檔案 , 目錄

這兩天在其中一台伺服器上看到一個不知道從哪來的亂碼檔案,大概不曉得是哪一個開發者上傳的目錄出現錯誤

 
$ ls -l 

drwxr-xr-x 2 root root 4096 Mar 19 2016 -?ʦ??-?
drwxr-xr-x 2 root root 4096 Mar 19 2016 ??-?
drwxr-xr-x 31 root root 4096 Mar 19 2016 admin
drwxr-xr-x 29 root root 4096 Mar 19 2016 ??+? admin

2016年11月10日 星期四

Nginx 編譯最新的 SSL(Chacha20-Poly1305),解決 Google Chomre 淘汰 SPDY 改用 HTTP/2 的問題

在今年六月,Google Chrome 51 淘汰了 SPDY/NPN 的支援,並且改採用 HTTP/2 與 ALPN

 

SPDY 為一個 Open Source 的專案,主要是用來改善在網頁傳輸的延遲,在理路的環境下增加了 55 % 的下載速度,但隨著 HTTP 協定的演進 Google Chrome 開始支援 HTTP/2 並且放棄 SPDY/NPN。

Git 在 Windows 進行 add 出現警告「warning: LF will be replaced by CRLF」

在 Windows 中若是使用 git add 出現錯誤訊息如下
$ git add . 
warning: LF will be replaced by CRLF in files.
The file will have its original line endings in your working directory.

2016年11月9日 星期三

Sublime 在 Windows 下開發出現「-bash: /bin/bash^M: bad interpreter: No such file or directory」

之前都是使用 MacOS 開發,這兩天因為換工作而且新的 Macbook Pro 遲遲未開售,所以僅能使用手邊的 Windows 進行開發

 

小弟是使用 sublime text 3 當作開發工具,但是在上傳 source code 到 Linux 環境的時候出現錯誤訊息
-bash: /bin/bash^M: bad interpreter: No such file or directory

2016年11月2日 星期三

Git 如何判別檔案名稱大小寫不同 ignorecase

今天 RD 遇到要將原本 Curl.php 的檔案改名成 curl.php,但是在 commit 的時候一直判別為原本的 Curl.php,無法修改檔案名稱大小寫於是乎上傳了兩個相同名稱的 curl.php & Curl.php

 

結果 commit 後只上傳了 curl.php,而 Curl.php 卻無法 commit 進去 git 倉庫

 

這是因為在 Git 的 Windows 和 MacOS 的 File system 底下會將 "名稱相同" 但大小寫不同的檔案辨認為同一個檔案,如果你需要修改大小寫檔名的時候就會無法 update,只有在 Linux 才會區別大小寫不同為不一樣的檔案。

使用 devtoolset 升級 gcc+ on CentOS 6

這陣子在 CentOS 6 上編譯出現 gcc 版本太低的問題,預設在 CentOS 6 使用 yum 僅能裝到 4.4.7 版本,這是非常老舊的版本

 

 

  • devtoolset-2 (gcc 4.8.2)

  • devtoolset-3 (gcc 4.9.2)

  • devtoolset-4 (gcc 5.2.1)


 

在此篇的狀況我需要 GCC 4.8 的版本,可以依靠 devtoolset-2 這個套件來升級 gcc 4.8+