I learned from this page.
Disable core 0:
$ sudo -i
root# echo 0 >/sys/devices/system/cpu/cpu0/online
Disable core7 to core47:
$ sudo -i
root# for i in $(seq 7 47); do echo 0 >/sys/devices/system/cpu/cpu$i/online; done
Enable core 0:
$ sudo -i
root# echo 1 >/sys/devices/system/cpu/cpu0/online
Enable core7 to core47:
$ sudo -i
root# for i in $(seq 7 47); do echo 1 >/sys/devices/system/cpu/cpu$i/online; done