AR ホームベーカリー

オイラのアウトプット用ホームベーカリー!

Virtualbox と Vagrant のお引越し

Virtualbox の設定ファイルの居場所

外付けのドライブなんかに移してる場合、vdiのあるディレクトリに再インストール後のパスを向けても認識されない。 以下のディレクトリのファイルも引っ越しさせる必要がある。

/Users/USER/Library/Virtualbox/

移動後

vagrant up をしようとして、ぷらぎんのインストールしてなくて怒られた。

There are errors in the configuration of this machine. Please fix
the following errors and try again:

Vagrant:
* Unknown configuration section 'vbguest'.

こうする。

vagrant plugin install vagrant-vbguest

anyenv 環境下での **env の plugin について

結論から言うと、 github のページ通りインストールした場合は ~/.anyenv/envs/**env/plugins/ 以下にインストールすれば動きます。

ndenv の例

yarn 入れるの忘れて v8.10.0 入れてしまったので、 ndenv-yarn-install 入れつつ再インストールして動きを見ます。

ndenv-yarn-install インストール

○ → git clone https://github.com/pine/ndenv-yarn-install.git  /Users/USER/.anyenv/envs/ndenv/plugins/ndenv-yarn-install

動作確認

node インストール時に一緒に yarn も入るかな? すでにインストール済みの v8.10.0 を再インストールして動作確認します。 continue with installation? (y/N)y と答えれば再インストールできます。

○ → ndenv install 8.10.0
ndenv: /Users/USER/.anyenv/envs/ndenv/versions/8.10.0 already exists
continue with installation? (y/N) y
Downloading node-v8.10.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v8.10.0/node-v8.10.0-darwin-x64.tar.gz
Installing node-v8.10.0-darwin-x64...
Installed node-v8.10.0-darwin-x64 to /Users/USER/.anyenv/envs/ndenv/versions/8.10.0

Installing Yarn...
/Users/USER/.anyenv/envs/ndenv/versions/8.10.0/bin/yarn -> /Users/USER/.anyenv/envs/ndenv/versions/8.10.0/lib/node_modules/yarn/bin/yarn.js
/Users/USER/.anyenv/envs/ndenv/versions/8.10.0/bin/yarnpkg -> /Users/USER/.anyenv/envs/ndenv/versions/8.10.0/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.12.3
added 1 package in 1.145s
Installed Yarn 1.12.3

やったね! yarn もインストールされました。

perl: warning: Please check that your locale settings

rbenv 入れてから「今は anyenv なんて便利なもんあっとねー?」となったので、 rbenv 削除して乗り換えた。

ら、こうなった。

○ → ndenv install 8.10.0
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "ja.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "ja.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Downloading node-v8.10.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v8.10.0/node-v8.10.0-darwin-x64.tar.gz
Installing node-v8.10.0-darwin-x64...
Installed node-v8.10.0-darwin-x64 to /Users/USER/.anyenv/envs/ndenv/versions/8.10.0

ゆるさんぞー! デフォルトが C ってわかってるなら (unset) くらいでガタガタ抜かすな!

vi ~/.bash_profile
(もしくは `~/.bashrc` 、どちらか存在するほうで良い)

bashなんとか

export LC_ALL="ja_JP.UTF-8"

書き終わったら

保存して、以下のコマンドを実行すればオッケー。 (シェルの再読込してるだけだから)ターミナルの再起動でもいいよ!

exec $SHELL -l

oh my bash を削除する

GitHub - ohmybash/oh-my-bash: A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

とのことだが、叩くとこうなる。

MacBook-Pro:~ USER$ uninstall_oh_my_bash
-bash: uninstall_oh_my_bash: コマンドが見つかりません

ファッキューのお気持ち。

直接削除する

lib/function.sh を見ると、最終的に展開される環境変数も含めたらこのようになっている模様。

MacBook-Pro:~ USER$ env OSH=/Users/USER/.oh-my-bash/ sh $OSH/tools/uninstall.sh
sh: /tools/uninstall.sh: No such file or directory

なんでじゃーい。

MacBook-Pro:~ USER$ ~/.oh-my-bash/tools/uninstall.sh
Are you sure you want to remove Oh My Bash? [y/N] y
Removing ~/.oh-my-bash
Looking for original bash config...
Switching back to bash
Changing shell for USER.
Password for USER:
Thanks for trying out Oh My Bash. It has been uninstalled.
MacBook-Pro:~ USER$ cat ~/.bashrc
# Path to your oh-my-bash installation.
export OSH=/Users/USER/.oh-my-bash

ああん? 消えたと思ったらアップデート管理用ファイルと .bashrc のこっとるやんけ( mojave 入れた直後で、 .bash_profile しか使ってない)。

rm -f .bashrc .osh-update

多分きれいになったはず。これで僕は bash-it 入れました!

Mojave にアップデートした

El Capitan から Mojave にアップデートした。

Retina ディスプレイは文字がきれいなんだけど、フル HD のディスプレイの文字がかすれて読みづらい。特に Hyper あたりで作業してると「グワーッ!」ってなる。

解決方法

ターミナルで以下のコマンドを実行する。( HDMI と RGB モニタで外部出力二本あるので、アンチエイリアスは一番強くしている。 )

sudo defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
sudo defaults -currentHost write -globalDomain AppleFontSmoothing -int 3

参考

gori.me

めっちゃ助かった。 正直どうしようかと思ってたけどこれでわりと快適に。 とはいえ、Firefox のタブ内はフォントが小さいので相変わらずかすれており、しゃーなしか、というお気持ち。

追記

Mojave に引っ越ししたけどフォントがきたない で改めて書いたけど、 defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO だけでいいっぽい。 AppleFontSmoothing も実行しちゃうと、ClearType が実装される前に GDI++ かなんかでスムージングした Windows みたいになる。

Zabbix 3.4 -> 4.0 にアップデートした

した。

1 Red Hat Enterprise Linux/CentOS [Zabbix Documentation 4.0]

このページにコマンドが記載されているので、その通りに作業すれば普通にオッケー。 ただ一点ハマったので注意しておく。

yum のキャッシュに邪魔される場合がある

Zabbix 4.0 のリポジトリを用意する前に、既存の 3.4 リポジトリを利用する設定のまま yum update を叩いてアップデートを確認してしまったので、「ローカルに zabbix 3.4 のアップデート(先は 4.0 ではなく)、 3.4 の最新版あるぞ!」と記憶されてしまいもうした。 で、4.0 リポジトリをインストールし yum.repo.d 以下のコンフィグで enable=1 としても、 4.0 が見えないわけですね。 しゃーなし一回インストールするか! と思うと、以下のようになります。

[root@backup-monitering ~]# yum update zabbix-server-mysql zabbix-web-mysql zabbix-agent
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
16 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:3.4.14-1.el7 will be an update
---> Package zabbix-server-mysql.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-server-mysql.x86_64 0:3.4.14-1.el7 will be an update
---> Package zabbix-web-mysql.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web-database = 3.4.13-1.el7 for package: zabbix-web-3.4.13-1.el7.noarch
---> Package zabbix-web-mysql.noarch 0:3.4.14-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web = 3.4.13-1.el7 for package: zabbix-web-japanese-3.4.13-1.el7.noarch
---> Package zabbix-web.noarch 0:3.4.14-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web-japanese.noarch 0:3.4.13-1.el7 will be updated
---> Package zabbix-web-japanese.noarch 0:3.4.14-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================
 Package                                      Arch                            Version                               Repository                       Size
==========================================================================================================================================================
Updating:
 zabbix-agent                                 x86_64                          3.4.14-1.el7                          zabbix                          367 k
 zabbix-server-mysql                          x86_64                          3.4.14-1.el7                          zabbix                          2.0 M
 zabbix-web-mysql                             noarch                          3.4.14-1.el7                          zabbix                          7.1 k
Updating for dependencies:
 zabbix-web                                   noarch                          3.4.14-1.el7                          zabbix                          2.7 M
 zabbix-web-japanese                          noarch                          3.4.14-1.el7                          zabbix                          7.5 k

Transaction Summary
==========================================================================================================================================================
Upgrade  3 Packages (+2 Dependent packages)

Total download size: 5.0 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
zabbix-server-mysql-3.4.14-1.e FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-server-mysql-3.4.14-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-agent-3.4.14-1.el7.x86_ FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-3.4.14-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found0.0 B/s |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-3.4.14-1.el7.noarch FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found  0.0 B/s |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-japanese-3.4.14-1.e FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-japanese-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-mysql-3.4.14-1.el7. FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-mysql-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not FoundB/s |    0 B  --:--:-- ETA
Trying other mirror.


Error downloading packages:
  zabbix-agent-3.4.14-1.el7.x86_64: [Errno 256] No more mirrors to try.
  zabbix-web-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.
  zabbix-server-mysql-3.4.14-1.el7.x86_64: [Errno 256] No more mirrors to try.
  zabbix-web-japanese-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.
  zabbix-web-mysql-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.

参照先がないので当然ですね。以下のようにキャッシュやらを消して改善します。

yum キャッシュとか消す

[root@backup-monitering ~]# yum clean all
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker mysql-connectors-community mysql-tools-community mysql57-community zabbix zabbix-non-supported
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@backup-monitering ~]# rm -rf /var/cache/yum

これでオッケーです。

Zabbix 4.0 にアップデートする

[root@backup-monitering ~]# yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                         | 2.4 kB  00:00:00
amzn2extra-docker                                                                                                                  | 1.3 kB  00:00:00
mysql-connectors-community                                                                                                         | 2.5 kB  00:00:00
mysql-tools-community                                                                                                              | 2.5 kB  00:00:00
mysql57-community                                                                                                                  | 2.5 kB  00:00:00
zabbix                                                                                                                             | 2.9 kB  00:00:00
zabbix-non-supported                                                                                                               |  951 B  00:00:00
(1/8): amzn2-core/2/x86_64/group_gz                                                                                                | 2.4 kB  00:00:00
(2/8): amzn2-core/2/x86_64/updateinfo                                                                                              |  53 kB  00:00:00
(3/8): amzn2extra-docker/2/x86_64/primary_db                                                                                       |  32 kB  00:00:00
(4/8): amzn2-core/2/x86_64/primary_db                                                                                              |  22 MB  00:00:00
(5/8): mysql-connectors-community/x86_64/primary_db                                                                                |  29 kB  00:00:00
(6/8): mysql-tools-community/x86_64/primary_db                                                                                     |  48 kB  00:00:00
(7/8): mysql57-community/x86_64/primary_db                                                                                         | 162 kB  00:00:00
(8/8): zabbix/x86_64/primary_db                                                                                                    |  19 kB  00:00:00
zabbix-non-supported/x86_64/primary                                                                                                | 1.6 kB  00:00:00
zabbix-non-supported                                                                                                                                  4/4
16 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:4.0.1-1.el7 will be an update
---> Package zabbix-server-mysql.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-server-mysql.x86_64 0:4.0.1-1.el7 will be an update
---> Package zabbix-web-mysql.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web-database = 3.4.13-1.el7 for package: zabbix-web-3.4.13-1.el7.noarch
---> Package zabbix-web-mysql.noarch 0:4.0.1-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web = 3.4.13-1.el7 for package: zabbix-web-japanese-3.4.13-1.el7.noarch
---> Package zabbix-web.noarch 0:4.0.1-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web-japanese.noarch 0:3.4.13-1.el7 will be updated
---> Package zabbix-web-japanese.noarch 0:4.0.1-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================
 Package                                      Arch                            Version                               Repository                       Size
==========================================================================================================================================================
Updating:
 zabbix-agent                                 x86_64                          4.0.1-1.el7                           zabbix                          381 k
 zabbix-server-mysql                          x86_64                          4.0.1-1.el7                           zabbix                          2.1 M
 zabbix-web-mysql                             noarch                          4.0.1-1.el7                           zabbix                          7.8 k
Updating for dependencies:
 zabbix-web                                   noarch                          4.0.1-1.el7                           zabbix                          2.7 M
 zabbix-web-japanese                          noarch                          4.0.1-1.el7                           zabbix                          8.3 k

Transaction Summary
==========================================================================================================================================================
Upgrade  3 Packages (+2 Dependent packages)

Total download size: 5.2 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): zabbix-agent-4.0.1-1.el7.x86_64.rpm                                                                                         | 381 kB  00:00:00
(2/5): zabbix-server-mysql-4.0.1-1.el7.x86_64.rpm                                                                                  | 2.1 MB  00:00:01
(3/5): zabbix-web-japanese-4.0.1-1.el7.noarch.rpm                                                                                  | 8.3 kB  00:00:00
(4/5): zabbix-web-4.0.1-1.el7.noarch.rpm                                                                                           | 2.7 MB  00:00:00
(5/5): zabbix-web-mysql-4.0.1-1.el7.noarch.rpm                                                                                     | 7.8 kB  00:00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                     3.9 MB/s | 5.2 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : zabbix-web-mysql-4.0.1-1.el7.noarch                                                                                                   1/10
  Updating   : zabbix-web-4.0.1-1.el7.noarch                                                                                                         2/10
  Updating   : zabbix-web-japanese-4.0.1-1.el7.noarch                                                                                                3/10
  Updating   : zabbix-server-mysql-4.0.1-1.el7.x86_64                                                                                                4/10
warning: /etc/zabbix/zabbix_server.conf created as /etc/zabbix/zabbix_server.conf.rpmnew
  Updating   : zabbix-agent-4.0.1-1.el7.x86_64                                                                                                       5/10
  Cleanup    : zabbix-web-japanese-3.4.13-1.el7.noarch                                                                                               6/10
  Cleanup    : zabbix-web-mysql-3.4.13-1.el7.noarch                                                                                                  7/10
  Cleanup    : zabbix-web-3.4.13-1.el7.noarch                                                                                                        8/10
  Cleanup    : zabbix-server-mysql-3.4.13-1.el7.x86_64                                                                                               9/10
  Cleanup    : zabbix-agent-3.4.13-1.el7.x86_64                                                                                                     10/10
  Verifying  : zabbix-web-4.0.1-1.el7.noarch                                                                                                         1/10
  Verifying  : zabbix-web-japanese-4.0.1-1.el7.noarch                                                                                                2/10
  Verifying  : zabbix-agent-4.0.1-1.el7.x86_64                                                                                                       3/10
  Verifying  : zabbix-web-mysql-4.0.1-1.el7.noarch                                                                                                   4/10
  Verifying  : zabbix-server-mysql-4.0.1-1.el7.x86_64                                                                                                5/10
  Verifying  : zabbix-agent-3.4.13-1.el7.x86_64                                                                                                      6/10
  Verifying  : zabbix-web-3.4.13-1.el7.noarch                                                                                                        7/10
  Verifying  : zabbix-web-mysql-3.4.13-1.el7.noarch                                                                                                  8/10
  Verifying  : zabbix-web-japanese-3.4.13-1.el7.noarch                                                                                               9/10
  Verifying  : zabbix-server-mysql-3.4.13-1.el7.x86_64                                                                                              10/10

Updated:
  zabbix-agent.x86_64 0:4.0.1-1.el7              zabbix-server-mysql.x86_64 0:4.0.1-1.el7              zabbix-web-mysql.noarch 0:4.0.1-1.el7

Dependency Updated:
  zabbix-web.noarch 0:4.0.1-1.el7                                         zabbix-web-japanese.noarch 0:4.0.1-1.el7

Complete!

おしまい!

アップデード後

zabbix_server のバージョンが上がったぞ! というアラートが出て、コメントつけても時間経過しても消えませんでした……。テンプレート(Linux のもの)から Version 変更時の通知用テンプレート、そのトリガに「手動クローズを許可する」ようにして、手動でクローズするようにしました。 これどうやったら自動で消えるんだろーな。