Ubuntuのターミナルでjsのテスト結果が見えない

Ubuntu 14.04 + byobu のターミナルでmochaを動かすと

mocha-result

とテスト結果の文字が見えません

$ mocha > result.txt

とすれば、結果が見えるので、色設定がおかしいということで

Much of the color output is invisible with solarized terminal theme · Issue #802 · mochajs/mocha

を読んでみましたが、いまいち解決策が見つからず
付け焼き刃ですが、ターミナルのメニューからプロファイルを追加して対応しました

メニュー > Edit > Profiles… を選んで、プロファイルを新しく追加
Edit で Colorsタブの下図の赤枠の色を変えました

terminal-color

そうした結果、

mocha-result2

と表示されるようになり、ひとまず解決
また、開発環境を整理するときに対応しようと思います
(PC買い換えるときかな..)

apt-getでnginxのエラーを直す

Ubuntu 14.04で sudo apt-get update するとエラーが出てました

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://nginx.org trusty Release: The following signatures were invalid: KEYEXPIRED 1471427554

W: Failed to fetch http://nginx.org/packages/ubuntu/dists/trusty/Release  

キーが古い?ということで

$ wget https://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add -

これで直りました

gitで異なるリポジトリをマージする

Webサイトを一からリニューアル、元のコードの履歴とマージしたかったのでやってみました

元のコードで、新しいサイトのコードのディレクトリをセットします

$ git remote add new ../newsite-code

remoteにnewという名前で、新しいサイトのコードの場所を指定しました
fetchしてmergeします

$ git fetch new
$ git merge new/master --allow-unrelated-histories

Git 2.9からは –allow-unrelated-histories が必要になりました

あとは地道にconflictを解消していけば、履歴がつながります

WordPressを新しいサーバーで動かしてみる

動いているWordpress v.4.6 を違うサーバーで動かしてみました
はまったところだけ紹介します

Ubuntu 14.04
Apache 2.4
PHP 7.1 -> 5.6へのちほど変更(7.1はWordpressがまだ対応してませんでした)
のサーバーを用意

ディレクトリ一式をコピー
wp_config.phpの一部を新しい環境に合わせて書き換えます

define('DB_NAME', 'database');
define('DB_USER', 'user');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'database_address');

データベースのダンプを取って新しいデータベースへインポート
設定を一部変更します
2行目は、Static S3のプラグイン用です

// URL変更
update wp_options set option_value = 'http://sample.com' where option_name = 'siteurl' or option_name = 'home'; 
// Static S3のプラグイン用
update wp_options set option_value  = '/var/www/html/static/' where option_name = 'StaticPress::static dir';
// 画像などのURL変更
UPDATE wp_options SET option_value = replace(option_value, 'http://sample.jp/', 'http://sample.com/') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://sample.jp/', 'http://sample.com/');
UPDATE wp_posts SET post_content = replace(post_content, 'http://sample.jp/', 'http://sample.com/');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://sample.jp/', 'http://sample.com/');

画面にアクセス、エラーが発生

Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given in /var/www/html/wp-includes/plugin.php on line 600
Warning: Parameter 1 to multibyte_patch::wplink_js() expected to be a reference, value given in /var/www/html/wp-includes/plugin.php on line 600
Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /var/www/html/wp-includes/plugin.php on line 600

調べてみるとWordpress 4.6は php 7.1 に対応してないようです
php 5.6に入れ替えると、無事画面が表示されました