2014年2月13日 星期四

iOS 開發筆記 - Xcode: Your application is being uploaded: request timeout / Application loader: Authenticating with the iTunes Store

your application is being uploaded

重灌 OSX ,試了一下發現這種現象 Orz 參考以下資料:

搞了一陣子憑證外,也裝了 Java 等等,當然,連 Application loader 也試過一輪,仍還沒改善,最後看到這則:
看完比較釋懷,然後,再試試 Application loader (with https.proxyPort=80) 幾次時,就意外通過了 XD 

大概耗掉兩小時的生命啊...人生啊~

[Linux] 架設 OpenVPN server 與 OpenVPN client 設定 @ Ubuntu 12.04

嘗過過 PPTP、L2TP 後,接著把玩 OpenVPN。此例 OpenVPN server 跟 OpenVPN client 都是 Ubuntu 12.04,其中一個是 server 版,另一個是 desktop 版。

Ubuntu Server: 安裝:

$ sudo apt-get install openvpn

Ubuntu Server: 憑証(順便把 OpenVPN client 做完):

$ cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /tmp/easy-rsa
$ cp /tmp/easy-rsa/openssl-1.0.0.cnf /tmp/easy-rsa/openssl.cnf
$ cd /tmp/easy-rsa/
$ source ./vars
$ ./clean-all
$ ./build-dh
$ ./pkitool --initca
$ ./pkitool --server server
$ ./build-key client
$ sudo su
# chown -R root:root /tmp/easy-rsa/keys/
# cd keys
# cp ca.crt server.crt server.key dh*.pem /etc/openvpn/


Ubuntu Server: 建立 /etc/openvpn/server.conf:

$ sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn
$ sudo gunzip /etc/openvpn/server.conf.gz


Ubuntu Server: 設定 /etc/openvpn/server.conf (修改要跑的 port, ip, tcp or udp mode):

$ sudo vim /etc/openvpn/server.conf

Ubuntu Server: 讓 OpenVPN client 可以透過 OpenVPN server 連出去外網,其中 eth0 為 OpenVPN server 對外網卡、10.8.0.0/24 是預設的 OpenVPN 區段:

$ sudo vim /etc/openvpn/server.conf
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"

$ iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE


Ubuntu Client: 安裝(從OpenVPN server 取得 ca.crt、client.crt、client.key):

$ sudo apt-get install openvpn
$ sudo cp -r /usr/share/doc/openvpn/examples/sample-config-files/ /etc/openvpn/example
$ sudo cp ca.crt client.crt client.key /etc/openvpn/example


Ubuntu Client: 設定(修改 server ip, port, tcp or udp mode):

$ sudo vim /etc/openvpn/example/client.conf

Ubuntu Client: 執行:

$ sudo openvpn --config /etc/openvpn/example/client.conf

Ubuntu Client: 開機執行:

$ sudo vim /etc/rc.local
openvpn --config /etc/openvpn/example/client.conf > /var/log/openvpn_client.log 2>&1 &


如果 OpenVPN client 還有提供 NAT 服務,那記得 iptables 要加上這段(tun0可以用 ifconfig查看):

VIF="tun0"
iptables -t nat -A POSTROUTING -o $VIF -j MASQUERADE

[Linux] /etc/rc.local : Syntax error: Bad fd number @ Ubuntu 12.04

最近把一堆工作塞在 /etc/rc.local ,發現有些指令明明在 command 下執行無誤,但搬進去 /etc/rc.local 後,測試 sudo sh /etc/rc.local 時,會收到 Syntax error: Bad fd number 訊息。

追了一下是因為系統 /bin/sh -> dash 的問題,所以一些語法要調整。

出錯 commands:

$ command >& /tmp/log &

改成:

$ command > /tmp/log 2>&1 &

iOS 開發筆記 - App Submission Feedback (Resolution Center) - non-consumable In-App Purchase(s)

最近一直收到 App Submission Feedback 信件轟炸,直到今天我終於搞懂這些 reviewer 的意思了 Orz 乃覺三十里!!

主因是使用了 non-consumable products,接著每次都收到一模模一樣樣的回應:

We found that your app offers In-App Purchase(s) that can be restored but does not include the required "Restore" feature to allow users to restore the previously purchased In-App Purchase(s), as specified in the Hosting Non-Consumable In-App Purchases section of the iTunes Connect Developer Guide:

"Users purchase non-consumable products only once, so if you host your own non-consumables, you need to provide a way for users to restore them. (You implement the restoreCompletedTransactions method in Store Kit to do so)."

To restore previously purchased In-App Purchase products, it would be appropriate to provide a "Restore" button and initiate the restore process when the "Restore" button is tapped by the user.

For more information on restoring In-App Purchases, see the section, Restoring Transactions, in the In-App Purchase Programming Guide.

A screenshot has been attached for your reference.

直到測試幾番後,終於搞懂他們在想什麼,也就是 non-consumable IAP products 必須提供類似 Restore button 才行,也不是沒實作,而是購買後才顯示出來,第一次還沒購買時,並不會顯示 Restore 字樣,就這樣一直調整 IAP 流程,每次調整都還是收到這樣的回應,直到把 non-consumable IAP products 一開始就加上 Restore button 時才通過。

2014年2月12日 星期三

[Linux] System Monitor / Load Indicator @ Ubuntu 12.04 desktop

indicator-multiload

印象中以前用 Ubuntu 10.04 時,常把 System Monitor Loading 顯示在右上角,但用了 Ubuntu 12.04 時,由於 Desktop GUI 更新後,遲遲找不到用法 XD 今天才把它解掉 Orz

$ sudo apt-get install indicator-multiload

接著在 Dash Home 搜尋 System 就可以看到 System Load indicator。

設定登入啟動:

$ cp /usr/share/applications/indicator-multiload.desktop ~/.config/autostart