short addition to this guide. the numeric parameter after /affinity is a hexadecimal parameter like stated earlier, but it's not as straightforward as 1,2,3,4,5...
if you know how ownership modes (chmod) codes work then this will be a breeze:
1st core = 1
2nd core = 2
3rd core = 4
4th core = 8...