Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python
- """
- bofh.py: A Bastard Operator From Hell excuse generator.
- """
- import notify2, random
- # Odds of printing the optional fourth word, (0-100)
- FOUR_PCT = 10
- FIRST = [
- "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 = [
- "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 = [
- "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 = [
- "Error", "Problem", "Warning", "Signal", "Flag"
- ]
- def generate_excuse():
- if (random.randint(0, 100) <= FOUR_PCT):
- four_words = True
- else:
- four_words = False
- if four_words:
- return "{} {} {} {}".format(
- FIRST[random.randrange(0, len(FIRST))],
- SECOND[random.randrange(0, len(SECOND))],
- THIRD[random.randrange(0, len(THIRD))],
- FOURTH[random.randrange(0, len(FOURTH))]
- )
- else:
- return "{} {} {}".format(
- FIRST[random.randrange(0, len(FIRST))],
- SECOND[random.randrange(0, len(SECOND))],
- THIRD[random.randrange(0, len(THIRD))]
- )
- def main():
- notify2.init("BOFH")
- n = notify2.Notification(
- "BOFH Excuse",
- generate_excuse(),
- "security-low"
- ).show()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement