Foolproof method: Put your eggs in cold water with enough water to cover them by about 1/2 inch. Bring to boiling, shut off, and cover with a tight-fitting lid. Let them sit, undisturbed, for 10 minutes. When they're finished "resting," drain them and run under cold water until they're cool enough to peel. Makes perfect hardboiled eggs every time--no green yolks, easy to peel, etc.
My Fanny Farmer cookbook. The method I've been using for years.