/home/0/wengerk/scripts/findbig <path>
A perl script that simplifies and prettyprints the find command to make it
easier for users who are over their quota to find big files they can delete.
The <path> argument is optional, if given, find big will search in that
path, if omitted, find big will search the current directory.
View script
#!/usr/bin/env perl
use strict;
use warnings;
my $where = '';
my @files = ();
if (@ARGV) {
$where = $ARGV[0];
}
else {
$where = `pwd`;
chomp $where;
}
@files = `find $where -size +100000c`;
while (@files) {
my $fname = shift @files;
chomp $fname;
open(CURFILE, $fname) or die "Can't open $fname";
my @fstats = stat CURFILE;
my $sizekb = int($fstats[7]/1024);
$fname =~ s/$where/./;
print "$fname --> $sizekb KB\n";
}
/home/0/wengerk/scripts/pwatch <printer name>
A perl script that displays the printer queue for the printer specified by
<printer name>. Refreshes every 10 seconds. Press Ctrl-C to exit.
If you don't know the name of your printer, check this
list of CSE printers
View script
#!/usr/bin/env perl
use strict;
use warnings;
my $clear_string = `clear`;
if (@ARGV) {
while (1) {
}
my $date = `date`;
my $print_statsu = `lpstat $ARGV[0]`;
print $clear_string;
print "Last update: $date\n";
print $print_status;
sleep 10;
}
else {
print "Usage: watch printer_name";
}
/home/0/wengerk/scripts/loadwatch
A perl script that displays the rup results for the stdsun and facsun login servers
in order of load. Refreshes every 30 seconds.
View script
#!/usr/bin/env perl
use strict;
use warnings;
my $clear_string = `clear`;
while (1) {
print $clear_string;
my $date = `date`;
my $server_list = "kappa mu psi xi omega";
my $rup_response = `rup -l $server_list`;
print "Last update: $date\n";
print $rup_response;
sleep 30;
}
/home/0/wengerk/scripts/tex_clean
A perl script that cleans up auxiliary files created by LaTeX/pdfLaTeX.
View script
#!/usr/local/bin/perl -w
use strict;
my @files;
if (@ARGV) {
foreach my $base (@ARGV) {
push @files, ($base . ".aux") if -e ($base . ".aux");
push @files, ($base . ".log") if -e ($base . ".log");
push @files, ($base . ".dvi") if -e ($base . ".dvi");
push @files, ($base . ".toc") if -e ($base . ".toc");
push @files, ($base . ".tex.bak") if -e ($base . ".tex.bak");
push @files, ($base . ".out") if -e ($base . ".out");
}
}
else {
my @list = `ls`;
foreach (@list) {
chomp;
push @files, $_ if (/^.+\.(aux|log|dvi|toc|out|tex\.bak)$/);
}
}
foreach my $filename (@files) {
print "Removing $filename...\n";
system("rm $filename");
}