Skip to content

Instantly share code, notes, and snippets.

@iberianpig
Last active August 29, 2015 13:57
Show Gist options
  • Save iberianpig/9549194 to your computer and use it in GitHub Desktop.
Save iberianpig/9549194 to your computer and use it in GitHub Desktop.
Ubuntu 12.04 省電力Script
#!/bin/sh
date>/home/iberianpig/powersaved.txt
sleep 10
# Reduce power for SATA link power management
for i in 0 1 2 3 4 5 ; do
echo min_power>/sys/class/scsi_host/host${i}/link_power_management_policy
done
# Disable the NMI watchdog
echo 0 > /proc/sys/kernel/watchdog
# Enable Audio codec power management
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
# Autosuspend for USB device
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 1 > $i;
done
for i in /sys/bus/usb/devices/*/power/level; do
echo auto > $i;
done
# Runtime power-management for PCI devices
for i in /sys/bus/pci/devices/*/power/control ; do
echo auto > ${i}
done
#echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
iw dev wlan0 set power_save on;
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /sys/class/backlight/intel_backlight/brightness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment