From the Phrase Finder:
The general understanding of what's meant by 'cock a snook' is the spread hand with thumb on the nose, preferably with crossed eyes, waggling fingers and any other annoying gesticulation that comes to mind at the time. It's what the Americans call 'the five-fingered salute'.
So, it looks like this:

Hope that image helped you visualize, as well as the description 'crossed eyes, waggling fingers...". Very satisfying! jks.
The origin of "snook", is the word "snook"! "Snook" means:
a gesture of defiance, disrespect, or derision.
"Cock" here means to lift up, as in lift up your hand, or "cock your rifle".
So, its origin just comes from saying "Lift up a snook"