スポンサーリンク
故障が発生した、バグが発見された、ユーザからクレームが来た、スケジュールが、仕様が変わった、、、
ITエンジニアの日常はトラブルだらけ。ストレスが溜まる一方であり、我々が日常的に生活するLinuxは戦場とも言えるかもしれません。
今回はそんな殺伐としたlinux上にアクアリウムを作って癒やされる、、そんな夢のような方法を記事にしたいと思います
こんな感じでターミナル上にアクアリウムを表示します。
(こちらは静止画ですが、実際には動きます)
大きく2つの手順です。
今回はAmazon EC2 上の Amazon Linuxで作業を行います。
まずはCPANをインストールします。
ちなみにCPANとは、perlモジュールのパッケージ管理ソフトです。pip や gem みたいなものだと思っていただければよいかと思います。
まず開発ツール一式をインストールします。
yum groupinstall "Development Tools"
次にperl系のパッケージとCPANをインストールします。
yum -y install ncurses-devel perl-CPAN libyaml-devel perl-CGI
ここまででCPAN自体のインストールは完了ですので、CPANを起動します。
perl -MCPAN -e shell
起動すると、初回のみいくつか聞かれますので、全部 Enter でOKです
Would you like to configure as much as possible automatically? [yes] ←★Enter or yes
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib] ←★Enter
sites for you? (This means connecting to the Internet) [yes] yes ←★Enter or yes
Would you like me to append that to /root/.bashrc now? [yes] yes ←★Enter or yes
cpan[0]>
最後の行のように cpan[0]>
みたいなプロンプトになれば起動完了です。
次にCPANのCLI上で Term::Animation
というパッケージをインストールします。
ですがその前にYAMLをインストールします。
cpan> install YAML
通信環境によっては途中で失敗する場合がありますが、再実行すると成功しました。
次にTerm::Animationをインストールします。
cpan> install Term::Animation
最後に以下のように表示されていれば成功です。
Result: PASS
KBAUCOM/Term-Animation-2.6.tar.gz
/usr/bin/make test -- OK
Running make install
Manifying 2 pod documents
Installing /usr/local/share/perl5/Term/Animation.pm
Installing /usr/local/share/perl5/Term/Animation/Entity.pm
Installing /usr/local/share/man/man3/Term::Animation::Entity.3pm
Installing /usr/local/share/man/man3/Term::Animation.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod
KBAUCOM/Term-Animation-2.6.tar.gz
/usr/bin/make install -- OK
いよいよ本題のasciiquariumをインストールします。
まずバイナリをダウンロードします。
wget --no-check-certificate http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz
次に解凍し、実行権限を付与します。
tar xvfz asciiquarium.tar.gz
cd asciiquarium_1.1/
chmod 755 asciiquarium
これで準備は完了です。後は実行し、癒やされましょう。
./asciiquarium
以上となります。
スポンサーリンク