From 4b9704526b2fcccdc6ddf3ddfdb4432876836760 Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Mon, 14 Dec 2015 20:51:06 +0800 Subject: [PATCH 1/3] translating --- ...ux or Unix Desktop Fun--Christmas Tree For Your Terminal.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md b/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md index 81c6844eba..e535fc0146 100644 --- a/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md +++ b/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md @@ -1,3 +1,4 @@ +sg translating Linux / Unix Desktop Fun: Christmas Tree For Your Terminal ================================================================================ Let us create Linux or Unix console Christmas tree just for fun and profit. First, you need to install a Perl module called Acme::POE::Tree. It is an animated Christmas tree module. I've tested this on Linux, OS X and Unix-like system. @@ -80,4 +81,4 @@ via: http://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop- 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From df3cab4065bd66b8383ee364021ced9f9c81ddab Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Mon, 14 Dec 2015 22:28:12 +0800 Subject: [PATCH 2/3] Create 20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md --- ...p Fun--Christmas Tree For Your Terminal.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md diff --git a/translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md b/translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md new file mode 100644 index 0000000000..dbbab5ef8c --- /dev/null +++ b/translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md @@ -0,0 +1,84 @@ +Linux / Unix桌面之趣:终端上的圣诞树 +================================================================================ +给你的Linux或Unix控制台创造一棵圣诞树玩玩吧。在此之前,需要先安装一个Perl模块,命名为Acme::POE::Tree。这是一棵很喜庆的圣诞树,我已经在Linux、OSX和类Unix系统上验证过了。 + + +### 安装 Acme::POE::Tree ### + +安装perl模块最简单的办法就是使用cpan(Perl综合典藏网)。打开终端,把下面的指令敲进去便可安装Acme::POE::Tree。 + + ## 以root身份运行 ## + perl -MCPAN -e 'install Acme::POE::Tree' + +**案例输出:** + + Installing /home/vivek/perl5/man/man3/POE::NFA.3pm + Installing /home/vivek/perl5/man/man3/POE::Kernel.3pm + Installing /home/vivek/perl5/man/man3/POE::Loop.3pm + Installing /home/vivek/perl5/man/man3/POE::Resource.3pm + Installing /home/vivek/perl5/man/man3/POE::Filter::Map.3pm + Installing /home/vivek/perl5/man/man3/POE::Resource::SIDs.3pm + Installing /home/vivek/perl5/man/man3/POE::Loop::IO_Poll.3pm + Installing /home/vivek/perl5/man/man3/POE::Pipe::TwoWay.3pm + Appending installation info to /home/vivek/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod + RCAPUTO/POE-1.367.tar.gz + /usr/bin/make install -- OK + RCAPUTO/Acme-POE-Tree-1.022.tar.gz + Has already been unwrapped into directory /home/vivek/.cpan/build/Acme-POE-Tree-1.022-uhlZUz + RCAPUTO/Acme-POE-Tree-1.022.tar.gz + Has already been prepared + Running make for R/RC/RCAPUTO/Acme-POE-Tree-1.022.tar.gz + cp lib/Acme/POE/Tree.pm blib/lib/Acme/POE/Tree.pm + Manifying 1 pod document + RCAPUTO/Acme-POE-Tree-1.022.tar.gz + /usr/bin/make -- OK + Running make test + PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t + t/01_basic.t .. ok + All tests successful. + Files=1, Tests=2, 6 wallclock secs ( 0.09 usr 0.03 sys + 0.53 cusr 0.06 csys = 0.71 CPU) + Result: PASS + RCAPUTO/Acme-POE-Tree-1.022.tar.gz + Tests succeeded but one dependency not OK (Curses) + RCAPUTO/Acme-POE-Tree-1.022.tar.gz + [dependencies] -- NA + +### 在Shell中显示圣诞树 ### + +只需要在终端上运行以下命令: + + perl -MAcme::POE::Tree -e 'Acme::POE::Tree->new()->run()' + +**案例输出** + +![Gif 01: An animated christmas tree in Perl](http://s0.cyberciti.org/uploads/cms/2015/12/perl-tree.gif) + +Gif 01: 一棵用Perl写的喜庆圣诞树 + +### 树的定制 ### + +以下是我的脚本文件tree.pl的内容: + + #!/usr/bin/perl + + use Acme::POE::Tree; + my $tree = Acme::POE::Tree->new( + { + star_delay => 1.5, # shimmer star every 1.5 sec + light_delay => 2, # twinkle lights every 2 sec + run_for => 10, # automatically exit after 10 sec + } + ); + $tree->run(); + +这样就可以通过修改star_delay、run_for和light_delay参数的值来自定义你的树了。一棵提供消遣的终端圣诞树就此诞生。 + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ + +作者:Vivek Gite +译者:[soooogreen](https://github.com/soooogreen) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ae1efdade6c909ab779065f4ef7a80f05787c879 Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Mon, 14 Dec 2015 22:31:27 +0800 Subject: [PATCH 3/3] Delete 20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md --- ...p Fun--Christmas Tree For Your Terminal.md | 84 ------------------- 1 file changed, 84 deletions(-) delete mode 100644 sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md diff --git a/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md b/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md deleted file mode 100644 index e535fc0146..0000000000 --- a/sources/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md +++ /dev/null @@ -1,84 +0,0 @@ -sg translating -Linux / Unix Desktop Fun: Christmas Tree For Your Terminal -================================================================================ -Let us create Linux or Unix console Christmas tree just for fun and profit. First, you need to install a Perl module called Acme::POE::Tree. It is an animated Christmas tree module. I've tested this on Linux, OS X and Unix-like system. - -### Install Acme::POE::Tree ### - -The easiest way to install any perl module is to use the cpan (Comprehensive Perl Archive Network). Open the terminal application and type the following command to install Acme::POE::Tree: - - ## run as root ## - perl -MCPAN -e 'install Acme::POE::Tree' - -**Sample outputs:** - - Installing /home/vivek/perl5/man/man3/POE::NFA.3pm - Installing /home/vivek/perl5/man/man3/POE::Kernel.3pm - Installing /home/vivek/perl5/man/man3/POE::Loop.3pm - Installing /home/vivek/perl5/man/man3/POE::Resource.3pm - Installing /home/vivek/perl5/man/man3/POE::Filter::Map.3pm - Installing /home/vivek/perl5/man/man3/POE::Resource::SIDs.3pm - Installing /home/vivek/perl5/man/man3/POE::Loop::IO_Poll.3pm - Installing /home/vivek/perl5/man/man3/POE::Pipe::TwoWay.3pm - Appending installation info to /home/vivek/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod - RCAPUTO/POE-1.367.tar.gz - /usr/bin/make install -- OK - RCAPUTO/Acme-POE-Tree-1.022.tar.gz - Has already been unwrapped into directory /home/vivek/.cpan/build/Acme-POE-Tree-1.022-uhlZUz - RCAPUTO/Acme-POE-Tree-1.022.tar.gz - Has already been prepared - Running make for R/RC/RCAPUTO/Acme-POE-Tree-1.022.tar.gz - cp lib/Acme/POE/Tree.pm blib/lib/Acme/POE/Tree.pm - Manifying 1 pod document - RCAPUTO/Acme-POE-Tree-1.022.tar.gz - /usr/bin/make -- OK - Running make test - PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t - t/01_basic.t .. ok - All tests successful. - Files=1, Tests=2, 6 wallclock secs ( 0.09 usr 0.03 sys + 0.53 cusr 0.06 csys = 0.71 CPU) - Result: PASS - RCAPUTO/Acme-POE-Tree-1.022.tar.gz - Tests succeeded but one dependency not OK (Curses) - RCAPUTO/Acme-POE-Tree-1.022.tar.gz - [dependencies] -- NA - -### Show Christmas tree in the shell ### - -Simply type the following command: - - perl -MAcme::POE::Tree -e 'Acme::POE::Tree->new()->run()' - -**Sample outputs:** - -![Gif 01: An animated christmas tree in Perl](http://s0.cyberciti.org/uploads/cms/2015/12/perl-tree.gif) - -Gif 01: An animated christmas tree in Perl - -### Tree customization ### - -Here is my tree.pl: - - #!/usr/bin/perl - - use Acme::POE::Tree; - my $tree = Acme::POE::Tree->new( - { - star_delay => 1.5, # shimmer star every 1.5 sec - light_delay => 2, # twinkle lights every 2 sec - run_for => 10, # automatically exit after 10 sec - } - ); - $tree->run(); - -Now can play with your tree modifying star_delay, run_for, and light_delay. And ,there you have it a a Christmas tree in your shell for fun. - --------------------------------------------------------------------------------- - -via: http://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ - -作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出