American Airlinesマイレージの有効期限を延長する方法(寄付)
他のアライアンスに比べてAAのマイルの延長は少し大変だった
ネットマイルを変換したりフライトに乗ったりすれば延長されるらしいが、今回は1000マイル寄付する形で延長する方法をメモとして残しておく
マイルの寄付
1. 以下のサイトにいき、ログインする
Donate today and help make a difference :: American Airlines
- ページの構成が変わっていた場合は、DonateとかCharityでサイト内検索すると見つかるかも
下部にDonate miles to a causeという項目があるので、寄付の用途を選択する
(今回はMiles for Kids in Needを選んだ)
2. 寄付するマイル数を入力し、Submitで寄付
- 以前は250マイルから寄付できたらしいが、現在は最小で1000マイルの寄付から可能
3. 確認
最後にマイルの有効期限が延長されているか確認して完了
48時間以内に実際に寄付が行われるとあったが、自分の環境ではすぐにマイルが減って、期限も延長されていた
ubuntu16.04でapache2の.htaccessを有効化してip制限をする
.htaccessの有効化
sudo vi /etc/apache2/apache2.conf ### 以下の行がアンコメントアウトされていることを確認 AccessFileName .htaccess ### /var/wwwの設定を変更する <Directory /var/www/> Options Indexes FollowSymLinks #AllowOverride None AllowOverride All # NoneからAllへと変更する Require all granted </Directory>
.htaccessの作成
touch /var/www/html/.htaccess sudo vi /var/www/html/.htaccess =================================== <Files ~ "^\.ht"> deny from all </Files> # AccessControl IP/HOST order deny,allow deny from all allow from 123.456.789 ===================================
これで123.456.789.*のIPアドレス以外からのアクセスを制限するようになった
Unityで前のシーンの情報を(無理やり)取得する
Unityは現在のシーン名は取得できるけど、一個前のシーン(つまりどのシーンから遷移してきたか)の取得がデフォルトでできない
色々試行錯誤していたのだけど、以下の方法に落ち着いた
1. データ格納用のクラスを作成
using UnityEngine; using System.Collections; public class Data { public readonly static Data Instance = new Data (); public string referer = string.Empty; }
2. 各シーン読み込み時にシーン名を格納する
例えばscene1というシーンだったら
using UnityEngine; using System.Collections public class scene1 : MonoBehaviour { void Start () { Data.Instance.referer = "scene1"; } . . .
例えばscene2というシーンだったら
using UnityEngine; using System.Collections public class scene2 : MonoBehaviour { void Start () { Data.Instance.referer = "scene2"; } . . .
3. 遷移元のシーンによって処理を変えたいシーンでシーン名を取得する
例えばscene3というシーンだったら
using UnityEngine; using System.Collections public class scene3 : MonoBehaviour { void Start () { if (Data.Instance.referer == "scene1") { 処理 1 } else if (Data.Instance.referer == "scene2") { 処理 2 } else { 処理 3 } Data.Instance.referer = "scene3"; } . . .
Reference
こちらのサイトを参考にさせていただきました
【Unity】シーン間でスコアを共有 まとめ - テラシュールブログ
AWSのEC2のネットワークの速度を測定する
speed-cliを使ってAWSのインスタンスのネットワーク速度の測定をします
測定方法
install speedtest-cli
sudo apt-get install python-pip
sudo pip install speedtest-cli
sudo pip install speedtest-cli --upgrade
測定
$ speedtest-cli --bytes Retrieving speedtest.net configuration... Testing from Amazon (*************)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by at2wn (Yokohama) [24.99 km]: 35.168 ms Testing download speed................................................................................ Download: 37.36 Mbyte/s Testing upload speed.................................................................................................... Upload: 13.65 Mbyte/s
こんな感じで回線の速度測定がcliで出来ました
ubuntu16.04でApacheのDirectoryIndexを変更する
vi /etc/apache2/mods-available/dir.con ### 以下を修正してapacheをrestartすればよい <IfModule mod_dir.c> DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm </IfModule>
ubuntu16.04にapacheをinstallしてbasic認証をかける
2. basic auth
touch /etc/apache2/sites-available/auth-basic.conf vi /etc/apache2/sites-available/auth-basic.conf ### 以下を入力して保存 <Directory /var/www/html> AuthType Basic AuthName "Basic Authentication" AuthUserFile /etc/apache2/.htpasswd require valid-user </Directory> htpasswd -c /etc/apache2/.htpasswd hoge New password: ****** Re-type new password: ****** Adding password for user hoge cd /var/www/html a2ensite auth-basic Enabling site auth-basic. To activate the new configuration, you need to run: service apache2 reload sudo /etc/init.d/apache2 restart
もう一度アクセスしてbasic認証がかかっていることを確認