Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created March 5, 2014 05:41
Show Gist options
  • Select an option

  • Save ssig33/9361859 to your computer and use it in GitHub Desktop.

Select an option

Save ssig33/9361859 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
exit false unless %{ondemand powersave performance}.index(ARGV[0])
(0..3).each do |i|
system "sudo su -c 'echo #{ARGV[0]} > /sys/devices/system/cpu/cpu#{i}/cpufreq/scaling_governor'"
end
puts "set #{ARGV[0]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment