Then from Terminal I typed (the $ sign is the prompt. Don't type it):
$ cp ~/Downloads/smcfancontrol_2_2_2/smcFanControl.app/Contents/Resources/smc /usr/local/sbin
!/bin/sh
#
# Read CPU0 temperature via smc tool and convert in decimal value
#
TEMP=$((0x$(/usr/local/sbin/smc -k TC0D -r|awk '{print $4}')))
#
# Depending on the actual temperature value adjust the maximum fan speed.
#
if [ $TEMP -le 62 ]
then
/usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(3000 << 2)[2:]')
elif [ $TEMP -le 66 ]
then
/usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(3600 << 2)[2:]')
elif [ $TEMP -le 70 ]
then
/usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(4200 << 2)[2:]')
elif [ $TEMP -le 75 ]
then
/usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(5000 << 2)[2:]')
else
/usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(6200 << 2)[2:]')
fi
# END OF SCRIPT
To have it always checking the CPU temperature and adjusting the max fan speed accordingly one just needs to run it with cron. I choose to have it run every minute. To do so type in terminal:
$ sudo crontab -e"
This starts vi on the root crontab file. Append the entry:
*/1 * * * * /usr/local/sbin/smcFanReset
Save and quit. Cron will be automatically updated to read the new entry and your MacBook, will be (mostly) quiet again as it should be.
A few notes:
This script modifies the maximum rpm for fan0. Simply the fan speed can not get higher than that, so use it carefully. I decided that for temperatures > 75 C it should use full speed.
The smc is still in control of the fan speed. If the CPU temperature drops it may decide to lower the rpm even more.
This works only for 'fan0' with the MacBook having only one fan. I can't test it but I imagine that on MacBook Pro for each temperature one should add the line:
/usr/local/sbin/smc -k F1Mx -w $(python -c 'print hex($RPM << 2)[2:]')
if [ $TEMP -le 62 ] then /usr/local/sbin/smc -k F0Mx -w $(python -c 'print hex(3000 << 2)[2:]') /usr/local/sbin/smc -k F1Mx -w $(python -c 'print hex(3000 << 2)[2:]') elif ...
Do not expect your MacBook to be much cooler. Just more silent.
Again, use this at your own risk. The values I have set fit with my regular usage. The temperature goes above 75 C when watching videos and stuff and as long as it didn't hit the 80+ C a lower rpm didn't overheat the MacBook. Also the one minute delay is not much to have a drastic raise on CPU temperature. I have been running this for few days now and it is pretty stable.
[crarko adds: I haven't tested this one.]

