Your regular cast are four: Dave Lister, the last human left alive and the scruffy but benign anti-hero of the piece; Arnold Rimmer, a hologram with all Percy Weasley's less desirable aspects and none of the charm; Kryten, a mechanoid (robot) trying to break his programming and become more human, and the Cat, a totally self-obsessed member of a race descended from the domestic housecat with three million years' evolution.
Series five, episode four. Wikipedia summarises it well. (Um, I guess this means this LJ entry has to be licensed under the GNU Free Documentation License.)
Quarantine - Red Dwarf receives a distress call from the hologram Dr. Hildegarde Landstrom. Landstrom had been working on a theory that viruses can be negative or positive and had isolated several positive viruses, including ones that grant whoever contracts it extreme good luck. However, when the crew (minus Rimmer) arrive at Landstrom's lab she proves to have contracted a holo-virus that causes her to become insane. She passes this virus on to Rimmer before dying, resulting in Rimmer imprisoning his shipmates in quarantine (in compliance with Space Corps Directive 595) and then appearing before them, completely mad, clad in a red-and-white checked gingham dress and army boots and with Mr. Flibble, a penguin hand puppet. Lister, Rimmer, and Kryten defeat the insane Rimmer and then sentence him to just punishment, which is to be locked in quarantine with only the three of them, dressed in the red-and-white gingham dress, to entertain him.
From this transcript of the episode (copyright to the author):
Scene 11, Interior of Starbug Stern. On the way back to Red Dwarf, KRYTEN and CAT are peering in a microscope when LISTER comes in from the cockpit. LISTER: Anything? KRYTEN: Quite extraordinary. Lanstrom postulated that there are two kinds of virus. Positive and negative. The negative we already know about. LISTER: Yeah, like the flu, rabies, that kind of stuff. KRYTEN: But she also believed that there are _positive_ viral strains which actually make human beings feel better. CAT: Such as? KRYTEN: Well, at a very basic level she predicted a kind of "reverse flu" -- a strain of virus which promotes an unaccountable feeling of well- being and happiness. LISTER: That's happened to me! Me life's been turned to complete and utter crud, and I've woken up in the morning feeling good for no apparent reason! KRYTEN: The chances are, sir, that on those occasions you had unwittingly contracted Lanstrom's virus. According to her notes, twentieth-century DJs suffered from it all the time. CAT: So what's in the tubes? KRYTEN: Lanstrom claims to have isolated several strains of positive virus: inspiration, charisma, sexual magnetism-- CAT: Sexual magnetism is a virus? Then get me to a hospital, I'm a terminal case! While CAT and KRYTEN aren't looking, LISTER puts that tube in an inside pocket. KRYTEN: This one is the most intriguing of all. According to her notes, this is the viral strain Felicitus Populi, commonly known as "luck." LISTER: (Disbelieving) Luck is a virus? KRYTEN: A positive virus which most humans contract at some point in their lives for very short periods. And here it is: Lady Luck in liquid form. Want to try some? LISTER: Is it safe? KRYTEN: Absolutely harmless. Even so, this is a minute dose and will only last about three minutes. LISTER shrugs, then holds his dreadlocks and collar out of the way as KRYTEN injects him. KRYTEN: Now, I want you to pick out all the aces from this pack of cards. LISTER: Shuffle them? KRYTEN: Mmm hmm. LISTER shuffles the deck, then picks out a card. It is an ace. KRYTEN: 13 to 1. LISTER shuffles the deck again, then picks out another card. It, too, is an ace. KRYTEN: 221 to 1. LISTER shuffles the deck once more, then picks out a third card. It is also an ace. KRYTEN: 5525 to 1. LISTER shuffles the deck again , then picks out a final card. It's the fourth ace. KRYTEN: 270725 to 1! KRYTEN, inspired, decides on a yet more challenging experiment. KRYTEN: Sir, I want you to throw this dart over here into that bulls eye behind you using your left hand, without looking. LISTER: What, using my left hand? Into the Bulls-eye? Without looking? No chance. KRYTEN: Trust me, sir. LISTER, still shaking his head, takes up throwing position. CAT: You ready? LISTER throws the dart. There is a dull thunk. KRYTEN: Ahh. I think that indicates the luck virus has worn off. KRYTEN turns round and we see the dart is embedded into the back of his head. --- later in the episode --- Late in scene 13, Interior of Quarantine Room 152. CAT: Well, we gotta get out of here somehow! LISTER: It's impossible. That's the whole point of Quarantine. (Examining the door frame) Nothing gets out; nothing gets in. Not even a microbe. Kryten, any chance of you cracking the code on the door lock? KRYTEN: The chances of punching in the correct combination are literally billions (Realization strikes) ...to one! LISTER: (Sharing the same idea) Unless... KRYTEN: Of course! LISTER: The luck virus! They cross to the bench and KRYTEN picks up the hypo-gun, still loaded with the cannister of Felicitus Populi. CAT: Hey, you really think that stuff can get us out of here? KRYTEN: If I give Mr. Lister a suitably large dose, he will temporarily become the luckiest human being who ever lived. KRYTEN presses the injector to LISTER's neck. LISTER: (Crossing to the door) OK, then, what do I do? KRYTEN: Well, you just press in whatever numbers you think are best. LISTER: OK. He hits several keys on the door combination keypad. He stands back. The door doesn't open. LISTER: (Exasperated) Ssss-- KRYTEN: Last digit, sir. LISTER presses one last button. The door opens. He grins at the others and they exit, LISTER doing that "Boys from the Dwarf" hand gesture again. CAT: So, what now? KRYTEN: We head for the hologram projection suite, before Mr. Rimmer-- RIMMER: (Behind them) "Before Mr. Rimmer" what? They turn and face him. RIMMER is still wearing the gingham dress. Abruptly, he raises his right hand. He is wearing a glove puppet -- a cute furry penguin. RIMMER: They've been naughty boys, haven't they, Mr. Flibble? RIMMER looks at the penguin and supplies the voice, doing a rather bad ventriloquist routine. FLIBBLE: Yes. RIMMER: What happens to naughty boys who've been naughty, Mr. Flibble? FLIBBLE: Uncle Arnie fries them alive with his Hex Vision. RIMMER: That's right, Mr. Flibble. As RIMMER's eyes glow bright red, the others, who know by now exactly what's coming, run for their lives. They are pursued by several hex- bolts, which barely miss them and cause several explosions along the corridor walls. 15 Model shot. The view of the Red Dwarf indicates the passage of time. 16 Int. A cargo Room. The fleeing group runs around a corner. KRYTEN: This way! Finding some drums and junk, then decide to duck down and hide. KRYTEN: The holo-virus is in it's secondary stage. Mr. Rimmer can't have long to live. As KRYTEN speaks, RIMMER's telepathic eyes appear overlaid on-screen. LISTER: What is he capable of? On the wall behind them is a glass-fronted fire cabinet containing a large axe. The lock on the cabinet flips open. KRYTEN: Well, we've seen hex vision. Almost certainly, like Lanstrom, he'll be capable of telepathy and possibly even telekinesis. CAT: Tele-kiny-what-a-noose? The glass cover of the cabinet swings open. The axe begins to twitch. KRYTEN: The ability to move objects purely by the power of the mind. The axe flies from the cabinet, narrowly missing CAT and LISTER and slamming into KRYTEN's back. LISTER: Kryten, man, are you OK? KRYTEN: I have a medium-sized fire axe buried in my spinal column. That sort of thing can really put a crimp on your day. LISTER pulls the fire axe out of KRYTEN's spine, at which point it is yanked from his hands and thrown across the room. KRYTEN starts twitching, and is pulled to a nearby pillar, talking nonsense as he goes. KRYTEN: Hihi-hidi-hidi-whurdidjid. Two and one-half badgers, please! Hi-yi-yi-yi-yi! (He bashes his head against the pillar.) No, I'll eat them here. Whap! An-dingling! Wha-hoo-hoo! An-da-an-shoo-an-shoo. (He head-butts the pillar again.) Ah, that's better. Maybe now I can WIN SELF-DETERMINATION FOR THE SOUTH MOLDAVIAN PEOPLE! Nick-noo-nick- noo-nick-ank (Once again, he assaults the pillar with his head.) Ah, I think I'm OK now. The door dissolves in front of RIMMER and he steps through the hole. RIMMER: Mr. Flibble's very cross. You shouldn't have ran away from him. What are we going to to with them, Mr. Flibble? Mr. FLIBBLE whispers something in RIMMER's ear. RIMMER: We can't _possibly_ do that! Who would clear up the mess? Mr. FLIBBLE gets the Hex Vision. Our three, bold heroes run for it. 17 Int. Corridor. They are backing slowly down a corridor, watching out for RIMMER. KRYTEN: We need to use your luck, sir. LISTER: How? KRYTEN: What we really need is some kind of remote link to the hologram disk projection system. LISTER: What, like this one? He picks up a box with "remote projection" written on the side. CAT: What a stroke of luck! KRYTEN: Now what we need is a hexangonal power transfer adapter capable of holding spikes of up to 5 million volts. LISTER: (Tripping over it) What's this? KRYTEN: Extraordinary. Now all we need is a B47/7RF resistor. LISTER holds one up between his fingers. CAT: Look out! Mr. FLIBBLE pokes round the corner at about head height. He is followed by RIMMER. RIMMER: Mr. Flibble says: FLIBBLE: Game over, boys. RIMMER and Mr. FLIBBLE start to use their "Hex Vision" but KRYTEN manages to switch on the just-completed remote hologram unit before RIMMER can fire -- he falls to the ground. Mr. FLIBBLE twitches spasmodically for several seconds then keels over, dead. RIMMER's uniform reappears and Mr. FLIBBLE vanishes. KRYTEN: I think he's going to be OK, sir. LISTER: He's gonna be OK? (KRYTEN nods yes.) The luck virus must have worn off.
You see? A luck virus is just too powerful a tool against drama, it allows too many rules to be broken. I don't claim that JKR stole the plot device from Red Dwarf; I'm sure it has been used many, many times before and will be independently reinvented many times in the future again. For me, Red Dwarf has shown that it's strictly for comic purposes only. Taken to extremes, sufficient felix felicis ought to find a way to defeat any sort of magical protection - as athena_arena has suggested, book seven might just be Harry downing an unsafe dose of Felix and then accio-ing the remaining horcruxes. Hardly tense. (If you were Harry, why wouldn't this be a good solution to the problem?)
I know it's very far from the intended meaning, but does anyone see just the faintest resemblence of a pro-occasional-recreational-narcotics reading of felix felicis as possible?