--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+die "Must pass one and only one sysname to delete\n"
+ unless scalar @ARGV == 1;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my @tables = qw/alerts buildsystems build_status build_status_log
+ build_status_recent_500 dashboard_mat latest_snapshot
+ nrecent_failures personality/;
+my $sth;
+for my $loop (0 .. (scalar @tables - 1) ) {
+ my $field = ($tables[$loop] eq 'personality') ? 'name' :
+ ($tables[$loop] eq 'buildsystems') ? 'name':
+ 'sysname';
+ printf "Deleting from %s with field %s\n", $tables[$loop], $field;
+ $sth = $db->prepare("
+ DELETE FROM $tables[$loop]
+ WHERE $field = ?
+ ");
+ $sth->execute($ARGV[0]);
+}
+$db->disconnect();
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use DBI;
+use Data::Dumper;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport
+ $user_list_format
+);
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my $sth = $db->prepare(q[
+ SELECT name, secret
+ FROM buildsystems AS b
+ ORDER BY name ASC
+ ]);
+$sth->execute();
+
+$user_list_format = "%-20s %s\n";
+printf $user_list_format, "SysName", "Secret";
+while (my $row = $sth->fetchrow_hashref)
+{
+ printf $user_list_format, $row->{name}, $row->{secret};
+}
+$db->disconnect();