summaryrefslogtreecommitdiff
path: root/.local/bin/power-tune
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/power-tune')
-rwxr-xr-x.local/bin/power-tune14
1 files changed, 14 insertions, 0 deletions
diff --git a/.local/bin/power-tune b/.local/bin/power-tune
new file mode 100755
index 0000000..cee717c
--- /dev/null
+++ b/.local/bin/power-tune
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -eu
+
+echo 0 > /proc/sys/kernel/nmi_watchdog
+echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
+
+for f in /sys/bus/{pci,usb}/devices/*/power/control
+do
+ if grep -q on ${f}
+ then
+ echo auto > ${f}
+ fi
+done