Browse Source
git-svn-id: file:///usr/local/svn/util/trunk@1 29942e26-f7dc-dc11-b955-0002b3153201master
leto
16 years ago
commit
83cc4f9bbd
2 changed files with 34 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||
#!/usr/bin/perl -w |
|||
# simple perl test suite colorizer |
|||
# Jonathan Leto <jonathan@leto.net> |
|||
# Sat Feb 16 17:20:50 EST 2008 |
|||
|
|||
use strict; |
|||
use Term::ANSIColor qw(:constants); |
|||
$Term::ANSIColor::AUTORESET = 1; |
|||
|
|||
while (<>){ |
|||
my $line = $_; |
|||
if(/^ok/ || /Result: PASS/ || /All tests successful/){ |
|||
print BOLD GREEN $line; |
|||
} elsif( /^not ok/ || /Dubious/ || /Result: FAIL/ || /Bad plan/ || /Failed/ || /Non-zero exit status/ ){ |
|||
print BOLD RED $line; |
|||
} elsif( /^1\.\.\d+/ || m!^t/.+! ){ |
|||
print BOLD BLUE $line; |
|||
} elsif (/^Files=/){ |
|||
print BOLD MAGENTA $line; |
|||
} else { |
|||
print BOLD $line; |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
#!/usr/bin/perl -w |
|||
# Print cpu temperature on FreeBSD |
|||
# Jonathan Leto <jonathan@leto.net> |
|||
use strict; |
|||
my $tempf; |
|||
my $tempc = `sysctl hw.acpi.thermal.tz0.temperature`; |
|||
$tempc =~ m!(.*): (\d+.\d)C!g and $tempc = $2;; |
|||
$tempf = $tempc*9/5 + 32; |
|||
print "Temperature of cpu is $tempc C/$tempf F\n"; |
|||
|
|||
|
Loading…
Reference in new issue