vim修正メモ
使っていない変数の検知
flyinshadow/php_localvarcheck.vimを使用
公式の方はVim7.3あたりで導入された新しい正規表現エンジンに対応できてなくて エラーがでてしまうらしい (随分前に謎のエラーが出て使っていなかったのだけど、これで解消される?)
Bugfix: E874: (NFA) Could not pop the stack ! by flyinshadow · Pull Request #1 · vim-scripts/php_localvarcheck.vim · GitHub qiita.com
" グローバルのチェック不要 let g:php_localvarcheck_enable = 1 let g:php_localvarcheck_global = 0
補完を非同期に
Shougo/deoplete.nvimを使用
let g:deoplete#enable_at_startup = 1 " エンターキーで補完選択 inoremap <silent><expr><CR> pumvisible() ? deoplete#mappings#close_popup() : "\<CR>"
Vdebug WIP
vim の Python インターフェイスを有効にする
Macのローカルでpython3を動くようにする
Mac SierraでPython2.7をPython3.xに切り替えて使用する
Xdebug 導入
GitHub - xdebug/xdebug: Xdebug — Step Debugger and Debugging Aid for PHP
https://lambdalisue.hatenablog.com/entry/2014/05/21/065845
Vdebug 導入
設定ファイル追記
[debug] xdebug.auto_trace=0 xdebug.cli_color=0 xdebug.collect_assignments=0 xdebug.collect_includes=1 xdebug.collect_params=0 xdebug.collect_return=0 xdebug.collect_vars=0 xdebug.coverage_enable=1 xdebug.default_enable=1 xdebug.dump.*= xdebug.dump_globals=1 xdebug.dump_once=1 xdebug.dump_undefined=0 xdebug.extended_info=1 xdebug.file_link_format= xdebug.force_display_errors=0 xdebug.force_error_reporting=0 xdebug.halt_level=0 xdebug.idekey= xdebug.manual_url="http://www.php.net" xdebug.max_nesting_level=100 xdebug.overload_var_dump=1 xdebug.profiler_append=0 xdebug.profiler_enable=0 xdebug.profiler_enable_trigger=0 xdebug.profiler_output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%p" xdebug.remote_autostart=0 xdebug.remote_connect_back=0 xdebug.remote_cookie_expire_time=3600 ;xdebug.remote_enable=0 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host="localhost" xdebug.remote_log= xdebug.remote_mode="req" xdebug.remote_port=9000 xdebug.scream=0 xdebug.show_exception_trace=0 xdebug.show_local_vars=0 xdebug.show_mem_delta=0 xdebug.trace_enable_trigger=0 xdebug.trace_format=0 xdebug.trace_options=0 xdebug.trace_output_dir="/tmp" xdebug.trace_output_name="trace.%c" xdebug.var_display_max_children=128 xdebug.var_display_max_data=512 xdebug.var_display_max_depth=3
その他
tmuxのプレフィックスが変更できない現象
.tmux.conf
# きかない set -g prefix C-j
karabinerの設定と競合していた(全然使っていないくて気づかなった)
Dockerメモ1
ちょっと触っては間が空いてすぐ忘れるので、少しずつでもメモ
$ docker pull centos
Docker は、Docker ホスト上に存在しないあらゆるイメージを、自動的にダウンロードする。 しかし、場合によってはコンテナを起動するのに少し時間がかかってしまう場合がある。 もし、予めイメージの事前読み込みをしたい場合は、docker pull コマンドを使って事前ダウンロードをすることが可能である。
$ docker run -t centos /bin/bash -c "echo Hello Docker World" $ docker commit f5bd8ca56990 sample $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE sample latest 4436fbf718ef 37 minutes ago 199MB
Docker Commitする場合は docker commit <コンテナ名/ID> <イメージ名>:<タグ名> で行う。
# コンテナIDは以下のコマンドで調べられる $ docker ps -a
コミットしたイメージを実行
$ docker run -t sample Hello Docker World
参考
vagrantのエラーメモ(雑)
一週間ぶりくらいにvagrant 立ち上げると見慣れないエラーが出力された
$ vagrant u#p Bringing machine 'default' up with 'virtualbox' provider... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["startvm", "a4b6a234-a9a5-4205-b8d8-0c8bf1cbedf0", "--type", "headless"] Stderr: VBoxManage: error: Could not open the medium '/Users/UserName/VirtualBox VMs/create_laravel_default_1522422912756_3091/centos-vm-disk1.vmdk'. VBoxManage: error: VD: error VERR_FILE_NOT_FOUND opening image file '/Users/UserName/VirtualBox VMs/create_laravel_default_1522422912756_3091/centos-vm-disk1.vmdk' (VERR_FILE_NOT_FOUND) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium
ネットの記事を読んで、VagrantやVertualBoxをいれなおしたがなおらず、
VirtualBoxをGUIごしに叩くと色々ポップアップ出たので、そこからごちゃごちゃやったらエラーが消えた(雑すぎる)。
*一応意外とGUIごしからエラーの内容教えてくれた程度の忘備録。
そこからvagrant upすると以下でタイムアウトした(割りと今までも見た光景)
==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key
以下のURLを参考に対応
knife soloを動かすようになるまでのメモ
knife soloを動かすために四苦八苦したので経由メモ
chef DKを入れる
Chef-DK という Chef を利用する際に必要なツールをひとまとめにしたキット
Chef DKをいれるとknife soloも動くのかと思っていたけど、動かない。
FATAL: Cannot find subcommand for: 'solo init chef-repo'
Available subcommands: (for details, knife SUB-COMMAND --help)
以下の記事を参照
gem install knife-solo
// knife soloで「FATAL: Cannot find sub command for: ‘solo'」というエラーが出る場合の解決策
https://qiita.com/kami_zh/items/7e4eac152df6945ffa48
$ knife solo init chef-repo
/opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2290:in `raise_if_conflicts': Unable to activate knife-solo-0.6.0, because net-ssh-4.1.0 conflicts with net-ssh (< 4.0, >= 2.7) (Gem::ConflictError) from /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:1410:in `activate'
net-sshがコンフリクトした。
何回かいれなおしたり、コンフリクトした部分を削除しようと試行錯誤したけどうまくいかず、
pre版をいれるとひとまず動くという記事を見たので、試すとrubyのバージョンが低くてエラーがでた
sudo gem install knife-solo --pre
ERROR: Error installing knife-solo: chef-zero requires Ruby version >= 2.3.1.
rubyのバージョンを上げる(以下の記事のrbenb導入部分を参考にした)
メモ .bash_profile に正しく設定はれてなくて、延々とrubyのバージョンが変わらないという現象がおき、少しはまった
rubyのバージョンをあげてから、再度インストールを試す
再度インストールを試みる
sudo gem install knife-solo --pre
Password:
Fetching: mixlib-shellout-2.3.2.gem (100%)
Successfully installed mixlib-shellout-2.3.2
.......
動作検証
sudo knife solo init chef-repo
Password:
Creating kitchen...Creating knife.rb in kitchen...Creating cupboards...0
$ls
Vagrantfile chef-repo
リポジトリができあがっている!
=========================
メモ
knife soloはknifeコマンドのプラグインっぽい。
Chefのコマンドまわりはchef soloとかzeroとかいろいろあって把握できていなかった
(chef soloからzero に移行してね、という記事を何かで読んで、
knife soloも同じように廃止されたのかと思っていた)。
にわかPHPerのコード解析〜修正手順
なのでWEBのシステムです。
去年まで新規での開発が多かったのに対して、
今現在は既に運用されているサービスの機能追加や
バグ対応のタスクがメインとなっている。
以下はあくまで仕事で使うコードに対するスタンス
続きを読む