Last active
December 29, 2015 12:58
-
-
Save polamjag/7673633 to your computer and use it in GitHub Desktop.
コンピュータのあたたかさ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo 'Start heating!' | |
| # get number of cpu cores | |
| cores=`cat /proc/cpuinfo | grep -c processor` | |
| pids=() | |
| while [ ${#pids[*]} -lt $cores ] ; do | |
| yes mayuge > /dev/null & | |
| pids+=($!) | |
| echo "Started process in $!" | |
| done | |
| echo 'Press Enter to stop...' | |
| read -n 1 | |
| echo 'Stopping...' | |
| for pid in ${pids[@]} ; do | |
| kill $pid | |
| done | |
| echo 'Stopped!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment