How to season a carbon steel pan at home

A new carbon steel pan is grey and a little sticky. Seasoning turns it black and slick (sample note).
Wash off the factory coating, dry the pan on the hob, then wipe the inside with a few drops of oil and heat it until it smokes. Let it cool, wipe again and repeat three or four times.
After that, cooking does the rest. Fry some onions or potatoes in the first week and avoid tomatoes and vinegar until the pan is dark.