Skip to content

Instantly share code, notes, and snippets.

@CodyKochmann
Created July 23, 2021 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyKochmann/bf268d2874c029554006f977d816145b to your computer and use it in GitHub Desktop.
Save CodyKochmann/bf268d2874c029554006f977d816145b to your computer and use it in GitHub Desktop.
how to turn off hyperthreading from a vm with no bios privs
#!/bin/bash
# by: Cody Kochmann
#
# this program tells the kernel to turn off the
# odd cores on a host. This is useful when you
# want to disable hypertheading in an ec2
# instance and dont have bios access to do it
# at the chip level.
seq 0 127 | awk '{print "echo 0 > /sys/devices/system/cpu" $1 * 2 + 1 "/online"}' | bash -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment