Index: /locker/sbin/get-homedirs.sh
===================================================================
--- /locker/sbin/get-homedirs.sh	(revision 722)
+++ /locker/sbin/get-homedirs.sh	(revision 722)
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Run this as root on scripts.
+
+/usr/bin/ldapsearch -LLL -z 0 -b ou=People,dc=scripts,dc=mit,dc=edu -s one -x -D 'cn=Directory Manager' -y /etc/signup-ldap-pw '' cn homeDirectory | \
+	perl -0pe 's/\n //g; s/^dn: .*\ncn: (.*)\nhomeDirectory: (.*)\n\n/$1 $2\n/gm'
Index: /locker/sbin/get-passwd.sh
===================================================================
--- /locker/sbin/get-passwd.sh	(revision 722)
+++ /locker/sbin/get-passwd.sh	(revision 722)
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+rm -f /mit/scripts/sec-tools/store/passwd
+scp -S /mit/scripts/bin/sshmic scripts.mit.edu:/etc/passwd /mit/scripts/sec-tools/store/passwd
+/mit/scripts/sec-tools/parse-passwd.pl /mit/scripts/sec-tools/store/passwd /mit/scripts/sec-tools/store/scriptslist
Index: /locker/sbin/get-versions.pl
===================================================================
--- /locker/sbin/get-versions.pl	(revision 722)
+++ /locker/sbin/get-versions.pl	(revision 722)
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+system("/mit/scripts/sec-tools/get-passwd.sh");
+system("/mit/scripts/sec-tools/parallel-find.pl");
+sleep 5;
+
+while(1) {
+    my $count = `ps -ef | grep find | grep $ENV{USER} | grep -v ps | grep -v grep | wc -l | tr -d '\n'`;
+    if ($count eq '0') {
+	last;
+    }
+    else {
+	print "Current have $count find processes running.  Please wait.\n";
+	sleep 1;
+    }
+}
+
+print "Done finding files\n";
+system("cat /mit/scripts/sec-tools/store/versions/* >| /mit/scripts/sec-tools/store/scripts-versions");
+print "Done\n";
+#print `cat /mit/scripts/sec-tools/store/versions/`;
Index: /locker/sbin/parallel-find.pl
===================================================================
--- /locker/sbin/parallel-find.pl	(revision 722)
+++ /locker/sbin/parallel-find.pl	(revision 722)
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+# Script to help generate find the .scripts-version files
+
+use lib '/mit/scripts/sec-tools/perl';
+
+open(FILE, "</mit/scripts/sec-tools/store/scriptslist");
+my $dump = "/mit/scripts/sec-tools/store/versions";
+
+die if (-e $dump);
+`mkdir $dump`;
+
+use Proc::Queue size => 40, debug => 0;
+use POSIX ":sys_wait_h"; # imports WNOHANG
+
+# this loop creates new childs, but Proc::Queue makes it wait every
+# time the limit (50) is reached until enough childs exit
+
+# Note that we miss things where one volume is inside another if we
+# use -xdev.  May miss libraries stuff.
+
+while (<FILE>) {
+    my ($user, $homedir) = /^([^ ]*) (.*)$/;
+    my $f=fork;
+    if(defined ($f) and $f==0) {
+	print "$user\n";
+#	print "find /mit/$user/web_scripts -name .scripts-version -fprint $dump/$user 2> /dev/null";
+	`find $homedir/web_scripts -xdev -name .scripts-version -fprint  $dump/$user 2> /dev/null`;
+	sleep rand 1;
+	exit(0);
+    }
+    1 while waitpid(-1, WNOHANG)>0; # reaps childs
+}
Index: /locker/sbin/parse-passwd.pl
===================================================================
--- /locker/sbin/parse-passwd.pl	(revision 722)
+++ /locker/sbin/parse-passwd.pl	(revision 722)
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+# Simple script taking a passwd file and storing the things with
+# sufficiently high UID in the right place
+
+use strict;
+my $file = $ARGV[0];
+my $file2 = $ARGV[1];
+open(FIN, "<$file");
+open(FOUT, ">$file2");
+
+while(<FIN>)
+{
+    my @passwd_line = split(':', $_);
+    if ($passwd_line[2] > 500000000) {
+	# Then it's a volume ID, thus a real user
+	print FOUT "$passwd_line[0]\n";
+    }
+}
+
+close(FIN);
+close(FOUT);
