Peel and dice the potatoes. Peel, rinse and slice the onion. Peel the garlic as well and crush it. Slice the ham into strips and chop the rosemary. Heat some butter and oil in a saucepan add the onion and fry until soft; add the potatoes brown then cover the pan and simmer for 15 minutes. Season with salt and pepper.Toss the pasta in plenty of boiling salted water. Five minutes before the potatoes are cooked, add the chopped rosemary, the ham and a few spoonfuls of the pasta’s cooking water. Drain the pasta al dente; dress it with the sauce, sprinkle it with parmesan and serve.