無料のSSL Certbot を入れてみた。

思った以上に親切で簡単

おそらく入っていると思うが、 git をインストール
#yum install -y git

Certbot をダウンロード
#git clone https://github.com/certbot/certbot

もし、fatal: HTTP request failed のエラーが出たら
yum update -y nss curl libcurl で直るかもしれない

Certbot を実行
#cd ~/certbot
#./certbot-auto

※色々パッケージがインストールされる

メールアドレスを聞いてくるので、
If you really want to skip this, you can run the client with
–register-unsafely-without-email but make sure you then backup your account key
from /etc/letsencrypt/accounts

(Enter ‘c’ to cancel): info@kaki.work
のような感じで設定

良くわからないが、許可
——————————————————————————-
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
——————————————————————————-
(A)gree/(C)ancel: A

Apache に設定されているドメイン一覧が表示される
Which names would you like to activate HTTPS for?
——————————————————————————-
1: aaaa.kaki.work
2: bbbb.kaki.work
3: cccc.kaki.work
4: dddd.kaki.work
5: eeee.kaki.work
——————————————————————————-
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel):
数字を入れる Enter なら全てが対象

その後
https://aaaa.kaki.work のような感じでアクセスできた。

あと、3ヶ月くらいで切れてしまうので
cron で 以下を毎日実行させてみる


crontab -e
0 0 * * * /root/certbot/certbot-auto renew --post-hook "sudo service httpd restart"

JavaScript プロパティ―がインスタンス毎に独立していない

CTest: {
var me = this;

CTest = function () {
me.val = ”;
}
var p = CTest.prototype;
p.setVal = function(pVal) {
me.val = pVal;
}
p.dispVal = function () {
console.log(‘dispVal ‘ + me.val);
}
}

var a = new CTest();
a.setVal(‘aa’);

var b = new CTest();
b.setVal(‘bb’);

a.dispVal();
b.dispVal();

実行結果は以下、同じ値になってしまう。
“dispVal bb”
“dispVal bb”

以下の感じで書けば大丈夫。

var CTest = function() {
// 非同期で呼ばれたメソッド内で this.xxxxx でアクセスできないので、 me を利用
var me = this;

me.val = ”;

me.setVal = function(pVal) {
me.val = pVal;
}
me.dispVal = function () {
console.log(‘dispVal ‘ + me.val);
}
}

var a = new CTest();
a.setVal(‘aa’);

var b = new CTest();
b.setVal(‘bb’);

実行結果は以下
“dispVal aa”
“dispVal bb”

アプリ内で物販はクレジットカードを使う

https://qiita.com/takecian/items/11f3c02e74ad997001bf

In-App Purchaseを使用して、実物の商品やサービス、あるいは不適切なコンテンツを販売することは
できません。
● 実物の商品やサービス。In-App Purchaseを使用する場合は、デジタルの商品またはサービスをア
プリケーション内に配信する必要があります。アプリケーション内でユーザに実物の商品やサー
ビスを購入してもらうには、クレジットカードや支払いサービスなどの別の支払いメカニズムを
使用してください。
● 不適切なコンテンツ。In-App Purchaseを使用してApp Review Guidelineで許可されないコンテンツ
を販売しないでください。たとえばポルノグラフィやヘイトスピーチ、または誹謗中傷などで
す。

参考:https://developer.apple.com/jp/documentation/StoreKitGuide.pdf

無料のSSL証明書

chrome がSSL出ないと警告を表示する事などから
SSLは必須になりそう。
iOS 開発の通信も https だしね。

これからサーバーを立てる場合は無料でもSSLを使いたいので
Let’s Encrypt の使用を計画する

多くのOSに対応してそう。
https://letsencrypt.jp/docs/using.html

インストールも楽そう。

Eclipse で Android SDK が起動しない

Eclipse 起動時に以下のエラーがでる
failed to get the required adt version number from the sdk

android-sdk のファイルが壊れている可能性がある。

SDKツールをダウンロード
https://dl.google.com/android/repository/tools_r24.4.1-windows.zip

回答すると tools フォルダができる。

android sdkフォルダーの tools を上記と差し替え
C:\android\android-sdk
toolsディレクトリからandroid.batを実行し、必要なプラットフォームとビルド・ツールをダウンロード

Eclipse(Windows – >環境設定 – > Android、SDKの場所)のAndroid SDKディレクトリを新しいディレクトリに変更。
旧 android_sdk はリネームなどで安心できるまで保存しておく

cordova スプラッシュスクリーン cordova-plugin-splashscreen

cordova-plugin-splashscreen を組み込むことで Android でもスプラッシュウィンドウが簡単に表示できるはずが
実行時、エラーでアプリが落ちる。
調べたところ、
config.xml 内の
value に ピリオドが含まれていただけ。

Android の場合
以下のようなコードを削除することで、スプラッシュスクリーンを非表示にできる

<splash density="land-hdpi" src="res/screens/android/screen-hdpi-landscape.png" />