hasen's tech life

Twitter: @hasen

platoでJavaScriptの静的解析をした.

# platoでJavaScriptの静的解析をした.

$ cd /usr/local/src
$ sudo curl -L git.io/nodebrew | perl - setup
> ... (省略)
$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc
$ nodebrew install-binary stable
> ... (省略)
$ nodebrew list
> v7.1.0
>
> current: none
$ nodebrew use v7.1.0
> use v7.1.0
$ node -v
> v7.1.0
$ npm install -g plato
> ... (省略)
$ plato -r -d DIR -x .json -t "TEST_NAME" PATH/TO/JS_DIR/
> done!
$ open DIR/index.html

f:id:hasen-fus:20161117091150p:plain

CentOS6でFailed: npm.noarch 0:1.3.6-5.el6というエラーが出たので対応した.

# CentOS6でFailed: npm.noarch 0:1.3.6-5.el6というエラーが出たので対応した.

$ cat /etc/redhat-release
> CentOS release 6.8 (Final)
$ sudo yum install --enablerepo=epel -y nodejs npm
> ... (中略)
> Failed:
> npm.noarch 0:1.3.6-5.el6

$ sudo rm -rf /usr/lib/node_modules
$ sudo yum remove -y nodejs npm
$ sudo yum install --enablerepo=epel -y nodejs npm

CentOSにNew Relicをインストールする.

# CentOSにNew Relicをインストールする.
$ cat /etc/redhat-release
> CentOS release 6.8 (Final)
$ rpm -Uvh https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
$ sudo yum install -y newrelic-sysmond
$ nrsysmond-config --set license_key=YOUR_LICENSE_KEY
# マイページで確認する.

Homesteadを使用した時のメモ.

# Homesteadを使用する.使ったことがなかった.

# 作業環境の作成とHomesteadのインストール
$ mkdir /PATH/TO/WORKDIR && !$
$ git clone https://github.com/laravel/homestead.git ./
$ composer update
$ ./homestead make
$ bash init.sh

# 試しにLaravelのプロジェクトを作成する
$ composer create-project laravel/laravel ./Code --prefer-dist

# 秘密鍵を作成する
$ mkdir ~/.ssh/DIR
$ chmod 700 ~/.ssh/DIR
$ ssh-keygen -t rsa -b 4096
$ chmod 600 ~/.ssh/DIR/id_rsa

# 設定ファイルを編集する
$ vi /Users/You/.homestead/Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/DIR/id_rsa.pub
keys:
- ~/.ssh/DIR/id_rsa
folders:
- map: ./Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/public
databases:
- homestead

# 起動
$ vg up
# 設定ファイルを変更した場合
$ vagrant reload --provision

# 下記アドレスでブラウザを確認する
# http://homestead.app