Last active
March 23, 2022 20:39
-
-
Save ssj71/c1cccc584e809df515aa3d8107d7e1b6 to your computer and use it in GitHub Desktop.
Silly script to make your terminal look like you are busy building something
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
import string | |
from random import randrange | |
from time import sleep | |
class bcolors: | |
HEADER = '\033[35m' | |
OKBLUE = '\033[34m' | |
OKGREEN = '\033[32m' | |
WARNING = '\033[33m' | |
FAIL = '\033[31m' | |
ENDC = '\033[0m' | |
BOLD = '\033[1m' | |
UNDERLINE = '\033[4m' | |
nouns = ("Cat","Octopus","Book","Wheel","Pignose","Touk","Mukluk","Spatula","Coupon","Frob","Foo","Bar","Widget","Gizmo","Clam","Neon","Poet","Phosphorous","Blasphemy","Gerrymandering","Bumblebee","Stoicism","Hypnosis","Quadrinomial","Conundrum","Kleptomania","Trapezoid","Corrosion","Kaleidoscope","Onomatopoeia","Silhouette","Sabotage","Luminescence","Scruples","Wizardry","Serendipity","Equilibrium","Cyborg","Blubber","Macadamia","Gazeebo","Rubber","Lard","Gas","Technology","Tentacle","Doohickey","Bagpipes","Dangling","Modifier","Whammy","Male","Pattern","Baldness","Vandyke","Beard","UltravioletRadiation","StinkBomb","NightWatchman","BlackMagic","Yorkshire","Pudding","LooseCannon","Borderline","Psychopath","TeddyBear","Proposition","MeatWagon","AtomicEnergy","Swampland","PathOfLeastResistance","Skin","Bones","Gangplank","Godmother","Cloven","Hoof","Evil","Eye","Hindquarters","Chicanery","Grandfather","Clock","Tail","Feather","SenseOfDirection","Gizmo","Garbage","Dump","Pandemonium","Wizardry","Goat","Power","Hood","Ornament","BoaConstrictor","Boogeyman","SearchWarrant","Chocolate","Eclair","ElixirOfLife","BreadAndButter","BillyGoat","ProfessionalWrestler","Whacko","SupernaturalBeing","TabbyCat","CovertOperation","Goblet","Choo-Choo","Gooseberry","Bush","Voodoo","Enchantment","Liquid","Nitrogen","Death","Tumbleweed","LawOfTheLand","Gargoyle","Road-Kill","Sasquatch","ControlledSubstance","PackagedGoods","RainbowTrout","Underworld","Tribute","NuclearExplosion","HousesOfParliament","FishAndChips","Peer","Realm","ArchitecturalStyle","HolyTerror","ScientificInstrument","Private","Security","Force","Lawn","Furniture","Wastepaper","Basket","Tables","Sack","Mango","ShootingGallery","Rocket","Launcher","TheatricalProduction","Doodad","Lemon","Tree","Barnacle","Vegetable","Thunderbird","Peripheral","Vision","Snake","Pit","Horseradish","Superstructure","Megabucks","Salmon","Internal","Combustion","WarZone","Werewolf","Brass","Knuckles") | |
adjectives = ("Fast","Boulbus","Doggone","Beige","Neon","Liquid","Poor","Approximate","Graceful","Clumsy","Awkward","Nimble","Clever","Dull","Obtuse","Meek","Anemic","Frightened","Timid","Vigilant","Cautious","Capable","Adequate","Absent-minded","Adventurous","Daring","Indifferent","Apologetic","Hideous","Horrid","Dreadful","Ghastly","Revolting","Nasty","Cruel","Cheeky","Obnoxious","Disrespectful","Contrary","Ornery","Subtle","Optimistic","Courageous","Cowardly","Gullible","Arrogant","Haughty","Naïve","Curious","Stubborn","Brazen","Modest","Humble","Proud","Dishonest","Righteous","Greedy","Wise","Tricky","Loyal","Relaxed","Tranquil","Lazy","Rambunctious","Erratic","Fidgety","Lively","Still","Famished","Surprised","Startled","Sullen","Terrified","Furious","Annoyed","Sullen","Groggy","Alert","Tense","Cranky","Gloomy","Irritable","Lonely","Exhausted","Ecstatic","Cheerful","Delighted","Blithe","Content","Carefree","Demanding","Challenging","Effortless","Simple","Fantastic","Marvelous","Splendid","Brilliant","Superb","Striking","Stunning","Gorgeous","Picturesque","Lovely","Charming","Enchanting","Delicate","Pleasant","Monstrous","Immense","Enormous","Massive","Brawny","Bulky","Towering","Rotund","Cavernous","Puny","Minute","Diminutive","Microscopic","Petite","Slight","Bitter","Frosty","Sweltering","Scorching","Blistering","Muggy","Stifling","Oppressive","Cozy","Eternal","Ceaseless","Perpetual","Endless","Temporary","Intimidating","Menacing","Miserable","Dangerous","Delinquent","Vile","Quarrelsome","Hostile","Malicious","Savage","Stern","Somber","Mysterious","Shocking","Infamous","Ingenious","Thrifty","Generous","Prudent","Stingy","Spoiled","Anxious","Nervous","Impatient","Worried","Excited","Courteous","Compassionate","Benevolent","Polite","Amusing","Entertaining","Creative","Precise","Eccentric","Decrepit","Ancient","Rotten","Whimsical","Dense","Desolate","Disgusting","Dismal","Opulent","Idyllic","Lavish","Edgy","Trendy","Peculiar","Rancid","Fetid","Foul","Filthy","Repulsive","Lousy","Fluttering","Soaring","Sparkling","Gilded","Verdant","Glowing","Askew","Dowdy","Gaunt","Sloppy","Serious","Grave","Intense","Severe","Heavy","Solemn","Absurd","Ridiculous","Sluggish","Dawdling","Meandering","Scarce","Copious","Muffled","Lulling","Creaky","Shrill","Piercing","Slimy","Grimy","Gauzy","Mangy","Swollen","Parched","Crispy","Spiky","Slick","Fuzzy","Lumpy","Plush","Wrinkly","Slick","Glassy","Snug","Stiff","Apocalyptic","Serpentine","Bamboozled","Exquisite","Nefarious","Bizarre","Flippant","Sinister","Persnickety","Statuesque","Hyperbolic","Capricious","Picturesque","Synergistic","Clandestine","Incognito","Plebeian","Tectonic","Cognizant","Indigo","Totalitarian","Insidious","Quintessential","Rambunctious","Ubiquitous","Reptilian","Vermillion","Villainous","Sanctimonious","Whimsical","Melancholy","Scrupulous","Effervescent","Mercurial","Zigzag","Gassy","Time-Traveling","Creamy") | |
suffixes = ("inator","nicator","ifier","erizer","erator","ification") | |
processes = ("Processing","Compressing","Retrying","Ignoring","Profiling","Removing","Obfuscating","Vulcanizing","Frobnicating","Languishing","Mitigating") | |
def randlower(limit): | |
i = randrange(limit) | |
j = randrange(limit) | |
if i<j: | |
return i | |
else: | |
return j | |
def pickone(tup): | |
return tup[randrange(0,len(tup))] | |
def picklower(tup): | |
return tup[randlower(len(tup))] | |
def maybepickone(tup,perc_chance): | |
if(randrange(100) < perc_chance): | |
return pickone(tup) | |
else: | |
return "" | |
def buildpath(): | |
path = pickone(nouns)+"/" | |
for _ in range(randrange(4)): | |
path += maybepickone(adjectives,50) + maybepickone(adjectives,20) + pickone(nouns) + maybepickone(suffixes,5) +"/" | |
return path | |
def recurse(path): | |
depth = path.count("/") | |
n = randrange(100) | |
if(n < 35): | |
path = "/".join(path.split("/")[0:-2]) | |
elif n<55 and depth<10: | |
path += maybepickone(adjectives,50) + maybepickone(adjectives,20) + pickone(nouns) + maybepickone(suffixes,5) | |
else: | |
path = path[:-1] | |
if path: | |
path += "/" | |
return path | |
def buildext(): | |
s = "."+"".join(random.sample(string.ascii_lowercase,randrange(4))) | |
if len(s) == 1: | |
return "" | |
else: | |
return s | |
maxprogress = 5 | |
def pickaprogress(line): | |
progress(line,randrange(maxprogress+1)) | |
def progress(line,n): | |
if n<1: | |
for i in range(randlower(150)): | |
print("\r%s %s " %(line, "-\|/"[i%4]),end="") | |
sleep(randlower(1000)/2000) | |
print("\r%s" %(line)) | |
elif n<2: | |
for i in range(100): | |
print("\r%s %i%% " %(line, i),end="") | |
sleep(randlower(1000)/1000) | |
print() | |
elif n<3: | |
w = 20 | |
print("%s [%s] " %(line,"-"*w),end="") | |
for i in range(w): | |
print("\r%s [%s%s] " %(line, "#"*i, "-"*(w-i)),end="") | |
sleep(randlower(w*100)/1000) | |
print("\r%s [%s] " %(line,"#"*w)) | |
elif n<4: | |
print(line,bcolors.BOLD) | |
width = 50 | |
for _ in range(randlower(10)+1): | |
for i in range(width): | |
print("\r[%s%s%s] "%(" "*i,">>>>>"," "*(width-i)),end="") | |
sleep(.03) | |
for i in range(width): | |
print("\r[%s%s%s] "%(" "*(width-i),"<<<<<"," "*i),end="") | |
sleep(.03) | |
print(bcolors.ENDC, bcolors.OKGREEN, "\nComplete!", bcolors.ENDC) | |
elif n<maxprogress: | |
print(line,end=" ") | |
for _ in range(randlower(500)+10): | |
print(".",flush=True,end="") | |
sleep(randlower(1500)/1000) | |
print("Done.") | |
maxwarning = 100 | |
def pickawarning(): | |
warning(randrange(maxwarning)) | |
def warning(n): | |
if n >= maxwarning: | |
print("Maxwarning is wrong") | |
exit() | |
elif n<1: | |
print(bcolors.WARNING, "\tWARNING: I'm joining a computers' union!", bcolors.ENDC) | |
elif n<2: | |
print(bcolors.WARNING, "\tWARNING: I can't go on!") | |
sleep(1) | |
print("\t\t...but I guess I'll try.",bcolors.ENDC) | |
elif n<4: | |
print(bcolors.WARNING, "\tWARNING: this is difficult!",bcolors.ENDC) | |
elif n<6: | |
print(bcolors.WARNING, "\tWARNING: too", pickone(adjectives).lower(), bcolors.ENDC) | |
elif n<10: | |
print(bcolors.FAIL, "\tERROR:", pickone(nouns), "is actually a", pickone(adjectives).lower()+",", pickone(adjectives).lower(), pickone(nouns).lower(), bcolors.ENDC) | |
elif n<13: | |
print(bcolors.FAIL, "\tERROR:", pickone(nouns)+pickone(suffixes)+"!", bcolors.ENDC) | |
elif n<17: | |
print(bcolors.WARNING, "\tWARNING: Cannot complete",pickone(processes).lower(), "the", pickone(nouns).lower(), end="") | |
if randrange(2): | |
print(" of", maybepickone(adjectives,25).lower(), pickone(nouns).lower(), bcolors.ENDC) | |
else: | |
print(bcolors.ENDC) | |
elif n<maxwarning: | |
pass | |
maxprocess = 20 | |
def process(n): | |
if n >= maxprocess: | |
print("Maxprocess is wrong") | |
exit() | |
elif n<5: | |
path = buildpath() | |
filename = maybepickone(adjectives,50)+pickone(nouns)+buildext() | |
print(bcolors.OKGREEN+"Searching",path+filename,bcolors.ENDC,end="") | |
while len(path) and randrange(100)>10: | |
filename = maybepickone(adjectives,50)+pickone(nouns)+buildext() | |
print("\033[2K\033[1G"+bcolors.OKGREEN+"Searching", path+filename, bcolors.ENDC,flush=True,end="") | |
sleep(randrange(700)/1000) | |
path = recurse(path) | |
print("\nFound %s in %s%s"%(maybepickone(adjectives,70).lower()+pickone(nouns)+maybepickone(suffixes,20),path,filename)) | |
elif n<10: | |
action = " ".join((bcolors.OKBLUE+ picklower(processes), bcolors.ENDC, pickone(adjectives)+"_"+pickone(nouns)+maybepickone(suffixes,50)+buildext())) | |
pickaprogress(action) | |
elif n<maxprocess: | |
path = buildpath() | |
name = path.split("/")[0] | |
while len(path): | |
print(bcolors.OKGREEN+"COMPILING CC", path+maybepickone(adjectives,50)+pickone(nouns)+".c",bcolors.ENDC) | |
sleep(randlower(1500)/1000) | |
path = recurse(path) | |
pickawarning() | |
print(bcolors.OKGREEN+"LINKING LD",name+".o") | |
sleep(randlower(3500)/1000) | |
print(bcolors.BOLD, "\tBUILD COMPLETE\n", bcolors.ENDC) | |
random.seed() | |
while 1: | |
n = randrange(maxprocess) | |
process(n) | |
sleep(1) | |
print(bcolors.OKBLUE+"Next Task:",bcolors.ENDC) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment