2016年12月26日 星期一

Nginx 編譯 BoringSSL 失敗 BIO_get_mem_data [passing argument 2]

這幾天在編譯 Nginx 1.11.7 with BoringSSL 的時候一直鬼打牆,屢屢編譯不成功在 make 的時候出現錯誤訊息

src/event/ngx_event_openssl.c: In function 'ngx_ssl_parse_time':


src/event/ngx_event_openssl.c:4072:5: error: passing argument 2 of 'BIO_get_mem_data' from incompatible pointer type [-Werror]


     len = BIO_get_mem_data(bio, &value);


     ^


In file included from /tmp/nginxauto-28396-tmp/boringssl/.openssl/include/openssl/ssl.h:147:0,


                 from src/event/ngx_event_openssl.h:15,


                 from src/core/ngx_core.h:82,


                 from src/event/ngx_event_openssl.c:9:


/tmp/nginxauto-28396-tmp/boringssl/.openssl/include/openssl/bio.h:385:21: note: expected 'char **' but argument is of type 'u_char **'


OPENSSL_EXPORT long BIO_get_mem_data(BIO *bio, char **contents);


                     ^


cc1: all warnings being treated as errors


make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1


make[1]: Leaving directory `/tmp/nginxauto-28396-tmp/nginx-1.11.7'


make: *** [build] Error 2




2016年12月23日 星期五

macOS Sierra 無法安裝未識別開發者 App

這篇簡單記錄一下在 macOS Sierra 遇到無法安裝未識別的開發者的 App,以往只要打開鎖頭就可以選到允許任何來源 App,但是在 Sierra 竟然把這個選項拿掉了!!

 

還好 Apple 只是把介面上的選項拿掉,實際上的功能還是可以透過 terminal 來開啟
$ sudo spctl --master-disable

 

spctl 是 macOS 裡面的系統安全控制功能,類似 redhat 系列中的 SELinux,只要 disable 就可以解決

Orignal From: macOS Sierra 無法安裝未識別開發者 App

Macbook Pro 2016 later 三指拖曳(three finger drag) 失效問題

終於在今天小弟拿到新的 Macbook Pro with touch bar,很開心的在安裝一些常用工具的過程中發現在 MacOS 中超好用的一個 "三指拖曳" (three finger frag) 功能有點怪怪的

 

一開始覺得怪怪的,但用了幾個小時之後發現三指拖曳的功能時常失效,心想不會是機王吧!!

 

開始把問題餵 Google 後在 Apple Communities 裡看到有相同問題的一個 issue,"MacBook Pro late 2016 three finger drag issue",同樣的在許多地方也有相同的討論串 Three-finger drag gestures working sporadically on 2016 MacBook Pros, users say

 
Try to enable three finger drag on it and do a 3 finger drag gesture on bottom left of the trackpad, there are 40% chance that it's wrongly detected as secondary click.

2016年12月20日 星期二

Ubuntu 16.04 設定 Network interfaces、DNS

大概一年多沒有碰 Ubuntu 了,最近因為工作開始要大量的玩 Ubuntu 順手記錄一下以前沒有記錄到的資訊

 

此篇是紀錄  Ubuntu 16.04 在網路、DNS 的設定教學

2016年12月18日 星期日

Nginx 1.11.7 fix 使用 HTTP/2 與 limit_req 和 auth_request 的衝突

Nginx 在 2016/12/13 釋出 1.11.7 版本,主要修改 SSL 的 bug,其中比較有感的就是如果你已經使用 HTTP/2 的話,又搭配 limit_req 或 auth_request 的話,使用者端 rquest body 會有損壞的狀況,從 1.11.0 出現的 bug。

 
Bugfix: when using HTTP/2 and the "limit_req" or "auth_request"
directives client request body might be corrupted; the bug had
appeared in 1.11.0.

2016年12月17日 星期六

Java 淺談 OutOfMemory 的 JVM Heap and PermGen 設定

在使用 Java 的時候相信都會遇到過 OutOfMemory 這個錯誤,在以前維護 Tomcat 的時候就常常遇到這個狀況,剛好最近又遇到了 紀錄一下這篇

 

What is the JVM ?

Jvm (Java Virtual Machine) 意旨 Java 虛擬機,用於執行 Java bytecode 的 Virtual Machine space,以堆疊結構機器的方式實作,將編譯過的 *.class 輸入到 JVM 並執行,以下是 JVM 架構圖:

2016年12月16日 星期五

【DevOps】Puppet 自動化部署 - 安裝初始化

在 DevOps 中 Puppet 是一個自動化佈署 (Configuration Management) 的角色,在目前市場上 DevOps 頗為流行,在目前動不動就是幾百、幾千甚至是萬台 Server 的狀況根本就無法使用對等的 Server 人員進行管理,尤其在這個技術環境發展這麼快的時代,技術人員是越來越缺乏,更無法使用對等的人力去維護這些伺服器。

 

對於 DevOps 小弟認為這是技術時代的變遷,如果你不跟著提升就等著被淘汰,尤其在目前要成為一位"工程師",其實技術門檻非常低,在這個極競爭的產業對於一位系統管理者,自動化佈署絕對是一個提供自己價值的方式,不僅加速工作上的效率,也讓工作上增加更多空檔,讓我們一起提早下班吧