2017-01-01から1年間の記事一覧

[git] git サブモジュールについて

$ git clone https://yourname@github.com/yourproject/yourrepo $ git submodule init $ git submodule update もしくは $ git clone --recursive https://yourname@github.com/yourproject/yourrepo

監視系コマンドまとめ

サーバーの接続数を表示する $ sudo watch -d -n 3 "netstat -alpn | grep -E ':(80|443) ' | awk '{print \$5}' | sed -e 's/\:[^.]*$//' | sort | uniq -c | sort -nk1 -r | head -n 20" サーバーの接続状態を表示する $ sudo watch -d -n 2 "netstat -tan…

新規に記事を作成する

$ hugo new post/welcome.md

HUGO で theme を自作する

$ ls archetypes/ config.toml content/ data/ layouts/ README.md static/ themes/ $ hugo new theme my-theme $ ls themes/ my-theme

HUGO で WEB サイトの初期データを作成する

$ hugo new site ~/path/to/your/site $ cd ~/path/to/your/site $ ls archetypes/ config.toml content/ data/ layouts/ README.md static/ themes/

OS 毎のinclude path のセパレーターについて

PHP

PHP の環境変数で使う include_path のセパレーターは、OS 毎に異なる。 例えば、Linux などでは「:」だが、Windows では「;」になる。 そのため、PHP の定数 PATH_SEPARATOR を使うことで、OS に依存することなく設定ができるようになる。 set_include_path…

MySQLでデータをリストアする場合、slow_query_log を OFF にする方がいい場合

MySQL のデータベースをリストアに2日かかった原因を調べていたところ、slow_query_log_file に大量のログが書き出されていたことがわかった。 大量のデータを INSERT しているため、通常の long_query_time で設定している時間以上に SQL の実行に時間がか…