2015-10-26

php 除錯

error_reporting(E_ALL);
ini_set('display_errors', 'On');

2015-10-20

max os 連接網路芳鄰

在MAC OS按 Command + K
然後 輸入 smb://192.168.xx.xx 按連線即可

2015-10-01

IOS Apple Push Notification 更新 憑證 步驟

先 產生 Certificate Signing Request (CSR)
下圖 一般名稱 我有改為 myPush2015 因為每年都要做一次 很麻煩

到 APPLE 開發網站 選擇APP 然後按下圖 Edit 

舊的憑證2015-10/13快到期了 所以要重新申請一個憑證 下圖
按 Continue

按 Generate
按 Download
下載後 在 MAC 電腦 點滑鼠左鍵2下 執行
進入  keychain 匯出 Push Services key 為 .p12 的檔案
輸入 ios_push_cert_prod 按儲存後 輸入密碼

接下來 開啟終端機 輸入以下指令
cd ~/desktop
production指令範例:
openssl pkcs12 -clcerts -nokeys -out cert_production.pem -in ios_push_cert_prod.p12
openssl pkcs12 -nocerts -out key_production.pem -in ios_push_cert_prod.p12
openssl rsa -in key_production.pem -out key.unencrypted_production.pem
cat cert_production.pem key.unencrypted_production.pem > ck_production.pem

測試憑證:
telnet gateway.push.apple.com 2195
openssl s_client -connect gateway.push.apple.com:2195 -cert ck_production.pem -key ck_production.pem

看到下圖 代表憑證OK
將這個 ck_production.pem 這個檔案COPY到 推播主機 就可以使用推播了

另外 APP 記得要設定 
開啟App專案,點選Capabilities,打開Background Modes並勾選Remote notifications,如下圖所示