gitでzendを入れてみよう

[vagrant@localhost zend]$ git clone https://github.com/zendframework/zf2.git
Initialized empty Git repository in /home/vagrant/zend/zf2/.git/
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 358463 (delta 0), reused 0 (delta 0), pack-reused 358462
Receiving objects: 100% (358463/358463), 96.73 MiB | 836 KiB/s, done.
Resolving deltas: 100% (266705/266705), done.
[vagrant@localhost zend]$ ls
composer.phar zf2

[vagrant@localhost zend]$ cd zf2
[vagrant@localhost zf2]$ ls
CHANGELOG.md LICENSE.md README.md composer.json resources
[vagrant@localhost zf2]$ curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading…

Composer (version 1.8.6) successfully installed to: /home/vagrant/zend/zf2/composer.phar
Use it: php composer.phar

改めてZend Frameworkを始めよう

公式を見ると、どうやらcomposerで入れるのが手っ取り早そうですね。
https://framework.zend.com/downloads

まず、composerを落としてきます。
[vagrant@localhost zend]$ curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading…

Composer (version 1.8.6) successfully installed to: /home/vagrant/zend/composer.phar
Use it: php composer.phar

[vagrant@localhost zend]$ ls
composer.phar

composerでzendframeworkを入れていきます。
[vagrant@localhost zend]$ php composer.phar require zendframework/zendframework
Using version ^3.0 for zendframework/zendframework
./composer.json has been created

あれ、

[vagrant@localhost zend]$ php composer.phar serve

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command “serve” is not defined.

あれ、なんでや

Zend Frameworkを始めよう

Zend Frameworkって古くないか? という話はさて置き、Zendを使っていきたいと思います。PHP初のframeworkなら、割と優れたところも多いでしょう、という勝手な思い込みで。MVCかな?

まずバージョンを調べます。

echo zend_version();


あれ、もう入ってる?

[vagrant@localhost ~]$ mkdir zend
[vagrant@localhost ~]$ cd zend
[vagrant@localhost zend]$ zf create project projectZ
bash: zf: コマンドが見つかりません

どっちやねん。インストールが必要のようです。

[vagrant@localhost zend]$ sudo yum -y install –enablerepo=remi php-ZnedFramework
読み込んだプラグイン:fastestmirror
インストール処理の設定をしています
Loading mirror speeds from cached hostfile
epel/metalink | 8.2 kB 00:00
* base: ftp.jaist.ac.jp
* epel: ftp.jaist.ac.jp
* extras: ftp.jaist.ac.jp
* remi: ftp.riken.jp
* remi-safe: ftp.riken.jp
* updates: ftp.jaist.ac.jp
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql56-community | 2.5 kB 00:00
nodesource | 2.5 kB 00:00
remi | 3.0 kB 00:00
remi/primary_db | 2.4 MB 00:02
remi-safe | 3.0 kB 00:00
updates | 3.4 kB 00:00
パッケージ php-ZnedFramework は利用できません。
エラー: 何もしません

何いいいいいいい

.bashrc, .bash_profile

When using bash, you can customize the usage environment to your linking.

bash_profile
It is executed once at login. For example, it will be loaded when you start the terminal app. You should set an environment variable(a variable declared by export) to what should be specifically set in this file.

.bashrc
It is executed once at shell startup. If you hit bash on the command line, .bashrc will be read again.(.bash_profile is not read). If you want to set it each time you start the shell, put the settings in this file.

You may want to set aliases, shell functions, and command line completion for what to set specifically in this file.

~/.bash_profile
~/.bashrc

AWS MFA(多要素認証)

– AWSのアカウント申請お願いします
→ 終わりました、MFA認証しといてね
→ え、MFAって何?
→ は? 自分で調べろよ
→ 。。。

よくある会話ではないでしょうか? ということでして、AWSのMFAを調べます。
https://aws.amazon.com/jp/iam/details/mfa/

AWSのページだと、IAM配下にありますね。
MFA (Multi-Factor Authentication)は、ユーザーとパスワードに加えて、保護レイヤーを追加。サインインする際に、認証コードの入力が必要になる。

MFAのフォームファクタ
– 仮想MFAデバイス
– ユニバーサル第2因子(U2F)セキュリティーキー
– キーホルダータイプのMFAデバイス
– ハードウェアのディスプレイカードMFAデバイス
– SMS MFAデバイス(プレビュー)
– ハードウェアのキーホルダータイプ MFAデバイスAWS GovCloud向け
なんだこれは?とりあえず、SMS MFAデバイスのことか??

公式のポリシーサンプル

{
	"Version": "2012-10-17",
	"Statement": [{
	  "Effect": "Allow",
	  "Action": "["ec2:*"]",
	  "Resource":["*"],
	  "Condition": {"NumericLessThan": {"aws:MultiFactorAuthAge": "3600"}}
	}]
}

ん?

{
	"Version": "2012-10-17",
	"Statement": [
	{
		"Sid": "AllowAllActionForEC2",
		"Effect": "Allow",
		"Action": "ec2:*",
		"Resource": "*"
	},
	{
	    "Sid": "DenyStopAndTerminateWhenMFAIsNotPresent",
	    "Effect":"Deny",
	    "Action" : [
	    	"ec2:StopInstances",
	    	"ec2:TerminateInstances"
	    ],
	    "Resource": "*",
	    "Condition": {"BoolIfExists": {"aws:MultiFactorAuthPresent": false}}
	}
	]
}

Deploygateって何?

Deploygateって?
>DeployGateは開発中のiOS/Androidアプリを簡単にテスターや開発チームメンバーと共有することでアプリのプロトタイピングを加速させることができる、アプリ開発&テスト支援サービスです。
https://deploygate.com/features

ちょっと何言ってるかわからない。

featureは?
– わかりやすいガイドで、技術のわからないテスターでも簡単に使うことができます
– 日々の開発タスクを1コマンドで自動化
— 私達の提供する「DGコマンド」を使えば、アプリのビルドやDeployGateへのアップロードはもちろん、新しいiOS端末のUUIDの追加やプロビジョニングプロファイルの更新なども、全て自動で行うことができます。
– 全てがリアルタイム、高速な改善
– Slack上でアプリのアクティビティを確認
– いつでも過去のバージョンに戻せます
– 更新のたびにバージョンを変更する必要がありません
– アプリを簡単に多くの人へ配布できます
– テスターのサインアップは不要!それでも端末はしっかり管理
– 単なるバグ報告に留まらない、フォーラムでの改善にむけたコミュニケーション
– 複数のバージョンを切り分けてテストできます
– 複数人での開発プロジェクトにも対応
– 自動ビルドと連携して複数人での開発をもっと円滑に
– 複数の開発プロジェクトを抱える企業に最適化
– グループとアプリの数は無制限
– 詳細な権限設定
– プロジェクトを横断するチームも構成できます

読んでると、なんかテスター向けのアプリみたいな感じだな。でも、バージョン管理など、高機能な印象。。なんだかなー

ipa 脆弱性情報

脆弱性情報をcronで毎日取得したい。
ソースはipa(情報処理推進機構)
https://www.ipa.go.jp/secuirty/rss/alert.rdf

中身がどうなっているかというと、itemの中は、title, link, dc:creator, dc:dateの4つだ。creatorは全部ipaだから、title,link,dateだけでいいか。

 <item rdf:about="https://www.ipa.go.jp/security/ciadr/vul/20190717-jre.html">
  <title>Oracle Java の脆弱性対策について(CVE-2019-7317等)</title>
  <link>https://www.ipa.go.jp/security/ciadr/vul/20190717-jre.html</link>
  <dc:creator>情報処理推進機構(IPA)</dc:creator>
  <dc:date>2019-07-17T12:00:00+09:00</dc:date>
 </item>

アプリのシリアルコード問題

– appleがappのプレゼントとしてシリアルコードの配布を禁止
– それによって、事前登録によるアイテム配布などができなくなった
– 事の発端はモンストのシリアルコード配布終了

うーん、奥が深い

EBS、インスタンスタイプの最適化

AWSのEC2のインスタンスタイプやEBSを見直したいとする。さて、どこから見直す?

まず、現状を調べるところから。
モデル、VCP, CPUクレジット、メモリ(GiB), ストレージからか。
現状把握 → 検証方法検討 → パフォーマンス測定 → レビュー → インスタンスタイプ・EBS変更 → 事後レビュー
こんなところか。