このブログに記載の内容は個人の見解であり、所属組織の立場、戦略、意見を代表するものでは全くありません。

振り返り(React, Infra as Codeとか調べたりやってみたり)

整理してないし。メモの貼り付けです。

あとつまづいて終わりです。※後で整理したい。

 

概要

  • マルチプラットフォーム言語を習得しようと思う。⇒React(何度も同じようなことしたくない)
  • インフラ as Code(設定ファイルから環境自動構築)に挑戦(vagrant, ansible)

 

■20:40 2016/06/20

Reactについて調べる


http://postd.cc/boiling-react-down-to-a-few-lines-in-jquery/

Reactの素晴らしい点
・UIをアプリケーションの状態の純粋関数にできる
・不変性と仮装DOMを利用して動作する
・保存、読み込み、取り消し
・タイムトラベル・デバッグ

jQueryで実装できるといえばできる

難点
仮想DOMがブロックの中で最も遅いものの1つ

Reactは
react.jsでJavaScriptで実装されているみたい。じゃあ大元は同じなのか。

ほぼ想像。
結局のところWeb系のGUIは最終的にはHTMLになる?
そこまでの道のり(パーサなりコンパイルなり。JVMなり。)
があるだけで
それ以外の点ではGUIアプリとしてはブラウザと同じなのか?

なら、Web系はかなり便利なツールやフレームワークが豊富なので
開発プロセスの不可分な部分もあるんじゃないかな)
多少のオーバーヘッドを許せるなら全て共通化したら
Web系で培われた開発技術をコードだけでなく、
抽象的な技術やプロセスを含めて包括的に活かせる気がする

はてなの大規模システムに対応する技術もCPUの高速化の工夫に近いし
ある程度、各分野で似たような工夫をしているところもありそう

 

[Web開発者のための]大規模サービス技術入門

Amazon CAPTCHA

門外漢だし読み切ってませんが、この本とてもよかったです。

 

ググった用語

ajax
Asynchronous JavaScript + XML

JSON
JavaScript Object Notation

 

■9:43 2016/06/25

●インフラ


vagrant
docker+virtualBox
インストール


http://ubiqlog.com/archives/10570
C:\Users\Hoge\DevEnv\centos>vagrant box add centos6.5 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos6.5' (v0) for provider:
box: Downloading: https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
box: Progress: 26% (Rate: 0curl:/s, Estimated time remaining: 0:16:57)
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054


http://qiita.com/TakashiOshikawa/items/d2fb48d59e9e316af9a2 ★Good

もう一回 box addしたらできた。通信環境?

C:\Users\Hoge\DevEnv\centos>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos6-7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: centos_default_1466907933145_18778
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_INVALIDARG
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Assertion failed: [!aInterfaceName.isEmpty()] at 'F:\tinderbox\win-5.0\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (74) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0036).
VBoxManage.exe: error: Please contact the product vendor!
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 71 of file VBoxManageHostonly.cpp

C:\Users\Hoge\DevEnv\centos>


http://d.hatena.ne.jp/kobarn/20150805
http://qiita.com/ShotaKameyama/items/1f39791092f57c5046bc

 

■9:43 2016/06/25
vagrant
やり直し+VirtualBox再インストール
⇒OK

・ansible
http://www.moyashi-koubou.com/blog/vagrant_ansible_windows/

 

C:/Users/Hoge/DevEnv/centos6_5_64/Vagrantfile:71:in `block in <top (required)>': undefined local variable or method `playbook' for main:Object (NameError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/v2/loader.rb:37:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/v2/loader.rb:37:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/loader.rb:107:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/loader.rb:107:in `block in load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/loader.rb:104:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/config/loader.rb:104:in `load'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:740:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:740:in `vagrantfile'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:486:in `host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:208:in `block in action_runner'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:33:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:33:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:473:in `hook'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:722:in `unload'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant:177:in `ensure in <main>'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant:177:in `<main>'

centosのbox取り直し。 ⇒ ダメ

http://www.moyashi-koubou.com/blog/vagrant_ansible_windows/


Windowsを使ってて日本語のユーザ名でログインしている場合や、bsdtarやVBoxManageが見つからない的な
>メッセージが出たらVagrantをインストールしたディレクトリの
>“embedded\mingw\mingw32env.cmd” を下記の感じに書き換えてからmingw32env.cmdを実行
>→その黒い窓で操作すると使えると思います。

C:\HashiCorp\Vagrant\embedded\mingw\mingw32env.cmd
@title vagrant
@set VAGRANT_HOME=C:\home\vagrant\.vagrant.d
(@set PATH=%CD%\bin;)C:\Program Files\Oracle\VirtualBox;%PATH%

VAGRANT_HOME変えないとダメじゃん。。

どーしてもダメ。
めっちゃハマった。情弱乙というやつですか。これだからITは嫌いだ。

このサイトを参考に
http://iwamocchan11.hatenadiary.jp/entry/2015/09/23/193419

# yum list ansible
でansibleは入ったみたい