Skip to content

Instantly share code, notes, and snippets.

@ishan1608
Last active November 8, 2024 12:22
Show Gist options
  • Save ishan1608/87cb762f31b7af70a867 to your computer and use it in GitHub Desktop.
Save ishan1608/87cb762f31b7af70a867 to your computer and use it in GitHub Desktop.
A python script to heat your computer so that your fingers can work upon your laptop in winter.
"""Heater
A program that spawns as much number of processes as there are CPUs on the computer.
This keeps the core temprature high.
I made this so that my fingers feel more comfortable while working on my laptop during winter.
Caution : An eye should be kept on the CPU temprature so that when it is getting too hot,
the prgoram needs to be killed; else it can damage the CPU.
Author : Ishan
Email : [email protected]
"""
import multiprocessing
import sys
def round_robin_count():
while(True):
number = 0
if(number >= sys.maxsize):
number = 0
else:
number = number + 1
if __name__ == "__main__":
if len(sys.argv) == 2 and sys.argv[1] == '--about':
print(__doc__)
elif len(sys.argv) == 2 and sys.argv[1] == '--help':
print('Heater', 'USAGE: python3 ' + sys.argv[0] + ' [option]', sep='\n')
print('To read about.', 'python3 ' + sys.argv[0] + ' --about' ,sep=' ')
print('To see this help message.', 'python3 ' + sys.argv[0] + ' --help', sep=' ')
else:
process_count = 1
print('Heating up the CPU')
while(process_count <= multiprocessing.cpu_count()):
process_to_be_not_seen_again = multiprocessing.Process(target=round_robin_count)
process_to_be_not_seen_again.start()
process_count += 1
@ishan1608
Copy link
Author

@Speed3k-python That piece of code is already inside the if __name__ == "__main__": block.
What would adding another redundant condition do?

@shylilguy
Copy link

This is for the ants in my laptop!

@ishan1608
Copy link
Author

This is for the ants in my laptop!

🤣 Never thought of this use case.

@FFUV
Copy link

FFUV commented Sep 2, 2024

man ur a life saver I was wearing shorts and using my MacBook so it hit me with an extreme cold so I am now using this much love!

@MinhDGuy
Copy link

MinhDGuy commented Nov 8, 2024

HOW TO STOP IT HELP!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment