Cook the pasta according the to the directions on the package, drain and set aside. Before you drain it, reserve ¼ cup of the cooking water.
Add 2 tablespoons of the butter and the onion to a large skillet. Sauté over medium-high heat for 4-5 minutes or until the onion starts to become translucent.
Add the ham and sauté until it's slightly crispy around the edges, about 3 to 4 minutes.
Turn the heat down to low and add the pasta, parsley and reserved pasta water. Stir to combine and cook for about one minute.
Remove from the heat and stir in some of the Parmesan cheese, saving some for garnish.
Taste and adjust the salt and pepper to your liking. You can also add some red pepper flakes if you want a little heat.
Set the pasta aside while you cook the eggs.
Add the remaining two tablespoons of butter to a small frying pan.
Slowly melt the butter over medium heat. You don't want the eggs to brown at all, so don't rush this process.
When the butter is completely melted, carefully crack each egg into a dish and then into the pan.
Use a spoon to baste the white of the egg with the butter as it cooks. When the white is completely cooked, spoon the butter over the yolk two times. This will cook the top of the egg without changing the color.
Remove the pan from the heat and sprinkle the eggs with a pinch pepper, if desired.
Top to serve, add the pasta to a bowl, top with and egg and garnish with additional parsley and Parmesan cheese, if desired.