Skip to content

Instantly share code, notes, and snippets.

@polamjag
Last active December 29, 2015 12:58
Show Gist options
  • Select an option

  • Save polamjag/7673633 to your computer and use it in GitHub Desktop.

Select an option

Save polamjag/7673633 to your computer and use it in GitHub Desktop.
コンピュータのあたたかさ
#!/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