Skip to content

Instantly share code, notes, and snippets.

@arleighdickerson
Last active December 11, 2018 01:33
Show Gist options
  • Save arleighdickerson/eb39a268dda83c44c8008902bed33658 to your computer and use it in GitHub Desktop.
Save arleighdickerson/eb39a268dda83c44c8008902bed33658 to your computer and use it in GitHub Desktop.
set all cpu governers to performance mode
#!/bin/bash
# sudo apt-get install cpufrequtils
if [[ $EUID -ne 0 ]]; then
echo "sudo me"
exit 1
fi
command -v cpufreq-info >/dev/null 2>&1 || { echo >&2 "cpufrequtils not found"; exit 1; }
cores(){
cat /proc/cpuinfo | grep processor | wc -l
}
eval "COUNTER=$(cores)"
until [ $COUNTER -lt 1 ]; do
let COUNTER-=1
eval "cpufreq-set -g performance -c ${COUNTER}"
done
cpufreq-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment