#!/usr/bin/perl
# BOFH exuse generator
# Written by gf
# Idea and words from http://bofh.ntk.net/ExcuseBoard.html

@first = qw (
Temporary Intermittant Partial Redundant Total Multiplexed Inherent Duplicated Dual-Homed
Synchronous Bidirectional Serial Asynchronous Multiple Replicated Non-Replicated Unregistered
Non-Specific Generic Migrated Localised Resignalled Dereferenced Nullified Aborted Serious
Minor Major Extraneous Illegal Insufficient Viral Unsupported Outmoded Legacy Permanent
Invalid Deprecated Virtual Unreportable Undetermined Undiagnosable Unfiltered Static Dynamic
Delayed Immediate Nonfatal Fatal Non-Valid Unvalidated Non-Static Unreplicatable Non-Serious
);

@second = qw(
Array Systems Hardware Software Firmware Backplane Logic-Subsystem Integrity Subsystem Memory
Comms Integrity Checksum Protocol Parity Bus Timing Synchronisation Topology Transmission Reception
Stack Framing Code Programming Peripheral Environmental Loading Operation Parameter Syntax Initialisation
Execution Resource Encryption Decryption File Precondition Authentication Paging Swapfile Service Gateway
Request Proxy Media Registry Configuration Metadata Streaming Retrieval Installation Library Handler
);

@third = qw(
Interruption Destabilisation Destruction Desynchronisation Failure Dereferencing Overflow Underflow NMI
Interrupt Corruption Anomaly Seizure Override Reclock Rejection Invalidation Halt Exhaustion Infection
Incompatibility Timeout Expiry Unavailability Bug Condition Crash Dump Crashdump Stackdump Problem Lockout
);

@fourth = qw(
Error Problem Warning Signal Flag
);

sub get_exuse() {
	my $exuse;
	$exuse .= $first[rand($#first)].' ';
	$exuse .= $second[rand($#second)].' ';
	$exuse .= $third[rand($#third)];
	$exuse .= ' '.$fourth[rand($#fourth)] if (rand(10) % 2==0);
	return $exuse;
}

print "Content-type: text/html\n\n";
print "<h3>Today's excuse: <u>".&get_exuse."</u></h3>\n";
print "<b>In case the above is not good try one of these:</b><br><br>\n";
for ($i=0;$i<10;$i++) {
	print &get_exuse . "<br>\n";
}
print "<br><a href=\"../programs/bofh.pl\">Get the source</a>\n";
