Saute in a deep, large pan with some olive oil the onion, add the garlic and keep stirring for 1'-2'.
Add the shrimp, stir for 1', and then the tomatoes, salt, pepper and the ouzo (or the wine). Let the ingredients for 10'-12 be cooked together (by adding some water in the meanwhile if needed).
Boil the spaghetti in salted water according to the package instructions and strain. Mix the pasta with the shrimp sauce (or serve it separately if you prefer) and sprinkle it over with fresh, chopped parsley.