Skip to content

Instantly share code, notes, and snippets.

View WeterPeter's full-sized avatar

PeterWeter WeterPeter

  • The Netherlands
  • 06:22 (UTC +02:00)
View GitHub Profile
@guss77
guss77 / powerdraw
Last active March 8, 2024 13:43
Show total current power draw of the PC on Linux, using powercap
#!/bin/bash
#
# Installation:
# 1. put this script somewhere in your path - `/usr/local/bin/powerdraw` is probably
# a good idea.
# 2. Give the script execution permissions, e.g. `sudo chmod a+x /usr/local/bin/powerdraw`
# 3. Optional - add a sudoers file to allow users to execute this file without typing their
# password over and over. For example, create `/etc/sudoers.d/allow-powerdraw` with the
# following content:
# %admin ALL = NOPASSWD: /usr/local/bin/powerdraw, /usr/local/bin/powerdraw -f