Monday, October 29, 2012

Linux: Cool your CPU temperature with frequency throttling

Last night I went to sleep while running a heavy program that used 100% of my Intel i7 multicore processor. When I woke up in the morning, I found my laptop powered off. A look through the /var/log/syslog confirmed that it had shut off due to over heating.

So to control temperature, I wrote a script to throttle cpu frequency. This script must be run with root privileges (sudo) to work. For a desired max temperature of 80 degrees Celsius, use a command like this:
sudo ./temp_throttle.sh 80

This can also result in longer battery life on laptops and portable devices.


Download link: temperature throttling script for Linux - temp_throttle.sh
New User Resources:

Download link: temperature throttling script for Linux - temp_throttle.sh

Project source page: https://github.com/Sepero/temp-throttle



NOTICE: This script may not be effective if your system over heating is due to factors other than your CPU (ie. graphics, harddrive, etc.). This script will only throttle your CPU frequency based on your systems reported temperature. Opening and cleaning dust from a computer can often dramatically help cool it also.

If this script helps you in any way, please pay me with a message of thanks, and share this page with others.


Comment or leave feedback sepero 111 @ gmx . com

Keywords:
overheating cpu scaling temperature control Linux

Wednesday, October 17, 2012

Solved - 4shared desktop crashes on Linux (desktop4shared)

4shared currently offers a massive 15GB of storage for free on their servers, and they offer a Java client program for Ubuntu/Debian Linux named 'desktop4shared'.

When trying to run this program with Ubuntu 12.04 (or perhaps Ubuntu 12.10), the following error can occur:
$ desktop4shared 
Guessing JAVA_HOME...
Assuming JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
Starting desktop4shared...
19:59:43 [AWT-EventQueue-0] INFO  Initialize - UI Initialized in 215
19:59:49 [main] ERROR common.GlobalExceptionHandler - Uncaught exception in thread [main] : the number of constructors during runtime and compile time for groovy.util.FactoryBuilderSupport do not match. Expected 3 but got 2
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for groovy.util.FactoryBuilderSupport do not match. Expected 3 but got 2
        at griffon.app.ApplicationBuilder.<init>(ApplicationBuilder.groovy:26) ~[griffon-rt-0.9.jar:0.9]
        at griffon.app.ApplicationBuilder.<init>(ApplicationBuilder.groovy) ~[griffon-rt-0.9.jar:0.9]
        at griffon.builder.UberBuilder.uberInit(UberBuilder.groovy:73) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.CompositeBuilderHelper.handleLocalBuilder(CompositeBuilderHelper.groovy:86) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.CompositeBuilderHelper$handleLocalBuilder.callStatic(Unknown Source) ~[na:na]
        at org.codehaus.griffon.runtime.util.CompositeBuilderHelper$_createBuilder_closure1.doCall(CompositeBuilderHelper.groovy:51) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.CompositeBuilderHelper.createBuilder(CompositeBuilderHelper.groovy:50) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.CompositeBuilderHelper$createBuilder.call(Unknown Source) ~[na:na]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper.buildMVCGroup(GriffonApplicationHelper.groovy:233) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper$buildMVCGroup.callStatic(Unknown Source) ~[na:na]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper.createMVCGroup(GriffonApplicationHelper.groovy:191) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper$createMVCGroup$0.callStatic(Unknown Source) ~[na:na]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper.createMVCGroup(GriffonApplicationHelper.groovy:171) ~[griffon-rt-0.9.jar:0.9]
        at org.codehaus.griffon.runtime.util.GriffonApplicationHelper$createMVCGroup.call(Unknown Source) ~[na:na]
        at griffon.core.BaseGriffonApplication$_startup_closure2.doCall(BaseGriffonApplication.groovy:178) ~[griffon-rt-0.9.jar:0.9]
        at griffon.core.BaseGriffonApplication.startup(BaseGriffonApplication.groovy:177) ~[griffon-rt-0.9.jar:0.9]
        at griffon.core.GriffonApplication$startup.call(Unknown Source) ~[na:na]
        at griffon.swing.SwingApplication.startup(SwingApplication.groovy) ~[griffon-rt-0.9.jar:0.9]
        at griffon.core.GriffonApplication$startup.callCurrent(Unknown Source) ~[na:na]
        at griffon.swing.SwingApplication.realize(SwingApplication.groovy:61) ~[griffon-rt-0.9.jar:0.9]
        at griffon.application.StandaloneGriffonApplication$realize.call(Unknown Source) ~[na:na]
        at griffon.swing.SwingApplication.main(SwingApplication.groovy:107) ~[griffon-rt-0.9.jar:0.9]

Credit for figuring this problem out goes to a user by the handle Zorael over at UbuntuForums.org  http://ubuntuforums.org/showpost.php?p=12104449&postcount=4

The problem is that desktop4shared is using an outdated library reference in the library named "groovy". To fix this, an older version of groovy needs to be installed on the system.

Download the older library version here:
http://mirror.pnl.gov/ubuntu//pool/universe/g/groovy/groovy_1.7.10-2_all.deb

You should be able to click to install the library, but if that doesn't work, you may use this command in a terminal (correct the path location for your system):
sudo dpkg -i /path/to/groovy_1.7.10-2_all.deb

To prevent the library from accidentally upgrading, copy/paste these two commands into the terminal:
printf 'Package: groovy\nPin: version 1.7*\nPin-Priority: 1001\n' | sudo tee /etc/apt/preferences.d/groovy
echo groovy hold | sudo dpkg --set-selections


Comment or leave feedback sepero 111 @ gmx . com