Created
February 19, 2018 18:12
-
-
Save zuyu/16a1fdbcec0e59395717959af996c898 to your computer and use it in GitHub Desktop.
Disable cores in Node 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
typeset -i state | |
for i in /sys/devices/system/cpu/cpu[0-9]*; do | |
if [ -d ${i}/node1 ]; then | |
state="$(<${i}/online)" | |
echo -n "$((1-state))" > "${i}/online" | |
echo "switched ${i}/online to $((1-state))" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment