[m[m[0m[H[2J[24;1H"/tmp/g1h9LTLH5h" [readonly] 24L, 522C[1;1Hnigel@freud:~$ cat /usr/local/bin/puppetwhen#!/usr/bin/perl use strict; use warnings; use YAML; use Date::Parse; my %nodes; foreach my $file ( glob '/var/lib/puppet/yaml/facts/*.yaml' ) { my $data = YAML::LoadFile($file);[14;5Hmy $name = $data->{name}; my $age = time - str2time($data->{version}); $age = int($age/60 + 0.5);[18;5H$nodes{$name} = $age; } my @sorted = sort { $nodes{$a} <=> $nodes{$b} } keys %nodes; foreach my $key (@sorted) { printf("%5d minutes ago: %s\n", $nodes{$key}, $key);[1;1H[24;1H[K[24;1H:let perl_include_pod=1 [1;1H[24;1H[K[24;1H:let b:is_bash=1 [1;1H[24;1H[K[24;1H:filetype on [1;1H [24;1H[K[24;1H:source /usr/share/perl5/Text/VimColor/mark.vim [24;1H[K[24;1H[31mError detected while processing /usr/share/perl5/Text/VimColor/mark.vim:[0m [33mline 64:[0m[31mW10: Warning: Changing a readonly file[0m [32mPress ENTER or type command to continue[0m[24;1H[K[24;1H:write! /tmp/55XUkXKVn6 "/tmp/55XUkXKVn6" [24;19H[K[24;19H24L, 660C written [32mPress ENTER or type command to continue[0m[24;1H[K[24;1H:qall! [24;1H[K[24;1HHTTP/1.1 200 OK Date: Tue, 06 Jan 2009 07:08:33 GMT Server: Apache/2.2.3 (Debian) DAV/2 PHP/5.2.0-8+etch13 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 7c2
nigel@freud:~$ cat /usr/local/bin/puppetwhen #!/usr/bin/perl use strict; use warnings; use YAML; use Date::Parse; my %nodes; foreach my $file ( glob '/var/lib/puppet/yaml/facts/*.yaml' ) { my $data = YAML::LoadFile($file); my $name = $data->{name}; my $age = time - str2time($data->{version}); $age = int($age/60 + 0.5); $nodes{$name} = $age; } my @sorted = sort { $nodes{$a} <=> $nodes{$b} } keys %nodes; foreach my $key (@sorted) { printf("%5d minutes ago: %s\n", $nodes{$key}, $key); }0