Skip to content

Instantly share code, notes, and snippets.

@gabeio
Last active October 25, 2016 02:35
Show Gist options
  • Select an option

  • Save gabeio/8a2f6be1fe3a4a2950dad4d05725a5f9 to your computer and use it in GitHub Desktop.

Select an option

Save gabeio/8a2f6be1fe3a4a2950dad4d05725a5f9 to your computer and use it in GitHub Desktop.
process pauser
#!/bin/bash
# A small script to keep a laptop cool while running something like an install for a long time
# in this version it pauses all of the given process by name
# usage:
# ./pauser.sh <process name> <pause interval>
while true; do
pkill -CONT $1
sleep 1
pkill -STOP $1
sleep $2
done
@gabeio
Copy link
Author

gabeio commented Oct 25, 2016

Example: 1 on 10 off pausing make
screen shot 2016-10-24 at 10 17 02 pm

@gabeio
Copy link
Author

gabeio commented Oct 25, 2016

Example: 1 on 2 off directly pausing clang; this was also hitting 100%
screen shot 2016-10-24 at 10 28 44 pm

@gabeio
Copy link
Author

gabeio commented Oct 25, 2016

Yes this will cause the install to run even longer but if you know it's going to run for an hour making it 2 hours and not melting the cpu as much might be enough of a bonus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment