Skip to content

Instantly share code, notes, and snippets.

@zviryatko
Created October 7, 2015 22:38
Show Gist options
  • Save zviryatko/7e6f26f248aaeb58d932 to your computer and use it in GitHub Desktop.
Save zviryatko/7e6f26f248aaeb58d932 to your computer and use it in GitHub Desktop.
Change governor
#!/bin/bash
# Put this file to any your local $PATH directory.
let n=$((`nproc` - 1))
if [[ $(cpufreq-info --governors) =~ $1 ]]
then
for i in `seq 0 $n`
do
`sudo cpufreq-set -c $i -g $1`
done
else
echo "There is no governors called: $1";
fi
# Edit this file via `visudo -f /etc/sudoers.d/cpufreq
%sudo ALL=NOPASSWD: /usr/bin/cpufreq-set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment