commit 83cc4f9bbd7af35981f8481a267d0310ee4fe97b Author: leto Date: Sun Feb 17 01:32:16 2008 +0000 initial checkin git-svn-id: file:///usr/local/svn/util/trunk@1 29942e26-f7dc-dc11-b955-0002b3153201 diff --git a/bin/colortest b/bin/colortest new file mode 100755 index 0000000..64f925d --- /dev/null +++ b/bin/colortest @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +# simple perl test suite colorizer +# Jonathan Leto +# 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; + } +} diff --git a/bin/systemp b/bin/systemp new file mode 100755 index 0000000..c4b7519 --- /dev/null +++ b/bin/systemp @@ -0,0 +1,11 @@ +#!/usr/bin/perl -w +# Print cpu temperature on FreeBSD +# Jonathan Leto +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"; + +