2014年4月14日 星期一

[Linux] 安裝 Glances - An eye on your system @ Ubuntu 12.04


Glances - An eye on your system

$ sudo apt-get install python-pip build-essential python-dev
$ sudo pip install Glances
$ glances


如此就可以看到美美的系統監控了 :D

其中 glances 來支援 server/client 模式,並支援 password 管控,可以把它當作可以遠端看 server 的狀態吧

Server:
$ glances -s -B 0.0.0.0 -p 12345 -P helloworld
Glances server is running on 0.0.0.0:12345


Client
$ glances -c ServerIP -p 12345 -P helloworld

2014年4月12日 星期六

[OSX] 透過 USB 線使用 Android 手機讓 Macbook Pro 上網(Android Wi-Fi sharing via USB connection)



對於新一點的 Android 手機,在網路分享那塊有三種模式:
  • 可攜式 Wi-Fi 無線基地台 (Wi-Fi 行動熱點)
  • 藍牙網路共用
  • USB 網路共用
比較常用的就是讓 Android 手機當作一個無線 AP ,讓其他終端設備透過 Android 手機連出去網路,這個模式通常是 Android 手機可以透過 2G/3G/4G 電信網路連出去的情況。

然而,參加一些 conference 時,自設 Wi-Fi 行動熱點容易與現場的 Wi-Fi AP 訊號產生干擾,導致別人用大會無線網路品質不佳,所以最佳的方式就是透過 USB 網路共用!


對 Mac OSX 而言,需要解決的就是讓 OSX 辨識 USB 網路共用裝置,簡言之就是需要安裝 driver 才行 XD 所幸網路上有熱心方案:HoRNDIS: USB tethering driver for Mac OS X,如此一來,只要將手機開啓 USB 網路共用,而 OSX 可以偵測到就行能上網啦

iOS 開發筆記 - Improper Advertising identifier [IDFA] Usage. Your app contains the Advertising Identifier [IDFA] API but you have not indicated its usage on the prepare for Upload page in iTunes Connect.



在 2014-04-10 上傳 ipa 發現這這問題:
Improper Advertising identifier [IDFA] Usage. Your app contains the Advertising Identifier [IDFA] API but you have not indicated its usage on the prepare for Upload page in iTunes Connect.
解法有兩種:
  • 將程式內有用到 UUID/UDID 的部分去掉(如 Google Analytics Library 等),再重新上傳
  • 設法先退可簽署 IDFA 條約的狀態,重新上傳
其中要退回到簽署 IDFA 的部分,可以做的方式有兩種:
  • 將 app 內有用到跟 UUID/UDID 相關的移掉,進行重新上傳到 iTunes Connect,再把 reject 它,重新填寫跟 IDFA 相關的條款,再重新上傳 iTunes Connect
  • 建立 empty project ,將 Bundle Identifier 設成跟 app 一樣,上傳到 iTunes Connect,再 reject 它,重新填寫跟 IDFA 相關的條款,再重新上傳 iTunes Connect
後來,我選擇不用改 code 的部分,當然也要先把狀態改回到可以簽署 IDFA 流程,就選擇建立 empty project 來處理(此外,可以從原先的 app project 把Images.xcassets複製來用)。只是一樣的程式碼幾個禮拜前沒問題,為何這幾天出事?真是令人不解。

今早 2014-04-12 測試時,一樣的 code 發現又沒 IDFA 問題了 Orz 但還是把碰到這怪現象的解法記錄一下。

註 UDID/UUID 相關:

#import <AdSupport/ASIdentifierManager.h>

if (NSClassFromString(@"ASIdentifierManager")) {
    NSLog(@"ID: %@", [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]);
} else {
    NSLog(@"ID: %@", [[UIDevice currentDevice] uniqueIdentifier]);
}


Updated @ 2014-05-02 : iOS 開發筆記 - 使用 AdMob 與 IDFA 的處理

2014年4月10日 星期四

iOS 開發筆記 - The Facebook server could not fulfill this access request: no stored remote_app_id for app


犯了一個小錯誤 XD 太久沒用 Facebook app 了,新版界面忘了新增 iOS Bundle ID 導致 Reviewer 無法登入 :P 但很妙的這個現象是在 iOS 使用內建系統 Facebook 帳號整合時,才會出現的。

至於新增 iOS app 的設定:
developers.facebook.com -> Your App -> 設定 -> 新增平台
預設沒有顯示出來,所以...不小心忽略了。

重簽 Godaddy SSL 憑證 (re-keying an SSL Certificate)

熱門議題 OpenSSL Security Advisory [07 Apr 2014] / CVE-2014-0160 的影響,要把所以 Web Server 用的 HTTPS 重新整理,由於使用 Godaddy 維護 SSL 憑證,所以,直接看 Godaddy 流程:Re-Keying an SSL Certificate

  1. Log in to your SSL Manager.
  2. Go to the Manage Certificates tab.
  3. In the Filters list, click Certificates.
  4. Select the certificate(s) you want to re-key, and then click Re-Key. The Re-Key Certificate page displays.
  5. If your domain name uses our shared hosting, and you want to switch to third-party hosting or one of our virtual private or dedicated servers: For What would you like to do?, select Un-install this certificate.
  6. In the CSR field, paste your new CSR, including ----BEGIN NEW CERTIFICATE REQUEST---- and ----END CERTIFICATE REQUEST----.
  7. Select a Signature algorithm and a Certificate issuing organization, and then click Re-Key. We'll send you an email message with instructions to validate and download your certificate.

NOTE: This operation removes your existing SSL certificate from your shared hosting account, causing temporary website downtime for up to 72 hours.