Advertisement
DavidsonDFGL

CPU eater

May 9th, 2017
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Building loop test..."
  3. echo "int main(){for(;;);}" | gcc -x c -o stress -
  4.  
  5. for i in `seq 1 $(nproc)`;
  6. do
  7.     echo "Running stress test... core #$i"
  8.     sudo nice --20 ./stress &
  9. done
  10.  
  11. echo "Try to use your computer and"
  12.  
  13. read -r -p "Press [ENTER] to kill all the stress process, =)" response
  14. sudo killall stress
  15. rm stress
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement