A small script to turn your fan on and off via GPIO and PWM
FanGPIO starts when your pi boots up and runs in the background to adjust the pi's fan speed to your needs
FanGPIO is a super small script written in C to avoid any additional stress on your pi. I have not completed thorough tests yet however so far the max CPU usage I have noticed is 0.9% across one of the 4 CPU threads.
Do not use this directly connected to a fan, you will likely blow your gpio pin! (read below)
To install this simple script on your raspberry pi copy and paste the following
git clone https://github.com/soulgriever/FanGPIO
cd FanGPIO
sudo sh install.sh
Reboot your pi and the script is installed, yup its that simple!
I recommend using either a Logic Level Power Mosfet such as the one Here, or using a transistor such as a TIP31C.