Thursday, July 18, 2013

Yet Another way to Fix PuTTY Color Defaults

A quick web search will reveal that many people who use PuTTY as an SSH client are _not_ particularly fond of the default colors.  Count me amongst those who find it nearly impossible to read dark blue text on a black background.  For years I've just used the PuTTY settings dialog window to edit the colors (or Colours as they're named in the registry settings).  As the number of saved sessions I have has grown, it has become less and less practical to go fix the colors individually, so I cooked up a different way to reset all the sessions in one action.

The Colour settings are stored for each PuTTY session in the registry keys (each named after the session) under the key

           HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

I've seen other posts that suggest fixing the default colors by running a .reg file to create a new session with the desired colors but that doesn't help if you've got dozens of sessions that have the wrong (I mean default) color settings already.

Since Putty runs on Windows, the tool that made the most sense to help fix it is an add-on, techie utility from Microsoft called PowerShell.  PowerShell makes it reasonably easy to perform useful "extra" stuff like listing and modifying specific registry keys.  Without getting into a full PowerShell tutorial, which you can find at Microsoft's Technet Site if you like, I'll just skip to the how-to instructions.  Before you do any of this, as everyone else always warns, this modifies the Windows registry, so you should make a backup, buy a spare computer, print out all your photos on archival paper, create a rescue disk, retain the services of at least two system recovery experts, etc. etc... So you've been warned, and it's 100% your responsibility if you screw something up, even if I made some mistake writing this.
  1. Download PowerShell (any version) from Microsoft's web site, and install it.
  2. Run PowerShell from a command prompt (assuming if you use PuTTY, you'd be comfortable with this).
  3. Enter the PowerShell cmdlet Set-ExecutionPolicy Unrestricted (so you can run your own unsigned scripts) See: http://technet.microsoft.com/en-us/library/ee176961.aspx
  4. Save the script code below into a file named "fix-putty-colors.ps1"  (to most people, it should be reasonably obvious what the script does).
  5. Execute the script from within PowerShell
  6. Enter the PowerShell cmdlet Set-ExecutionPolicy Restricted  (this is optional but for those who are in the paranoid-about-security camp, it makes it slightly harder for a rogue script to run accidentally after you've finished fixing the PuTTY registry settings).

Script Code (modify to set other color codes and/or add other color properties if desired):

Push-Location
Set-Location 'HKCU:\Software\SimonTatham\PuTTY\Sessions'
Get-ChildItem |
ForEach-Object {
   Push-Location
   Set-Location Registry::$_
   Set-ItemProperty -Path . -Name Colour14 -Value '150,150,187'
   Set-ItemProperty -Path . -Name Colour15 -Value '200,200,255'
   Pop-Location
}
Pop-Location

Sunday, July 7, 2013

Dell M6700 Mobile Workstation Fan Toggling On Off On Off

Once upon a time, there were advantages to buying a Dell that would outweigh the drawbacks overall, but dealing with those drawbacks is sometimes enough to drive you over the edge. This post is to share some information that might help keep someone get one step closer to solving an issue with fans toggling on and off in a Dell Precision m6700 mobile workstation.

Fan toggling on off on off on off relentlessly...

I got a Dell Precision M6700 I got at the end of last year and it has come dangerously close to becoming an expensive projectile several times.  There is something REALLY wrong with the temperature / fan control.  Tools like SpeedFan don't recognize the fans in many Dell machines like this one (probably because of the "special" Dell BIOS that isn't worth the time for the developers to support), so they're of no use to override the boneheaded Dell fan control logic.  The BIOS keeps turning the fans off, and allowing the temperature to rise a few degrees, then turning the fans on full blast until the temperature drops a few degrees.  Watching the main CPU temp and the GPU temp graph out a consistent (even if jagged) sine-wave is proof that someone just didn't make much of an effort when they wrote the fan control software.  The same moron engineer would probably also think it is a good idea to paint the walls in a dining room with glow-in-the-dark paint and turn on a blindingly bright light for a short time every few minutes.

After many futile web searches, I stumbled over an older conversation about a different Dell laptop model (XPS) and a different graphics card (Nvidia) that was doing the same stupid fan-on, fan-off thing (apologies to Mr. Miyagi).  The conclusion there was that the Video card drivers were to blame.  That would have been great for me if I had the same type of video card, but my M6700 has an ATI / AMD FirePro graphics card, with totally different drivers.  I decided it was worth a shot updating the graphics drivers anyway.

After updating to a new version of the Catalyst Pro Control Center from AMD (formerly ATI), and re-packaged by Dell for their own "special" "made for Dell" version of the graphics card, a new option (at least one I hadn't noticed before) showed up in the "Power" settings.  A feature called "PowerPlay" had previously plugged itself into the Windows power management options.  PowerPlay allowed one of two settings, "Maximize Performance" or "Maximize Battery Life."  One of those two options could be selected as active when "Plugged In" and one of the same two options could be selected as active when running on the battery.  It makes no sense to name something "Maximize Battery Life" as an option that is available when "Plugged In" but that's beside the point.  The "new" option available in the Catalyst Pro Control Center was a checkbox labeled "Enable PowerPlay."  Unchecking that box to completely disable "PowerPlay", and clicking the "Apply" button caused the GPU temperature to drop and stabilize around 50 degrees C.  At first, this seemed to resolve the on off on off on off nonsense, but after a little while it was back to the same on/off/on/off/on/off behavior.

I wish I could say this issue was resolved, but so far, the toggling fan on the m6700 seems to be be a fact of life.  This will probably be the very last Dell computer I ever bother to buy.  Sorry Dell... if you can't get something as simple as fan-speed right, I can't trust you with much else.

I'm hoping maybe this is one piece of the puzzle and that someone else may have figured out what else is contributing to the bizarre (lack of) fan control on the M6700.  Please leave a comment if you know of something else that helps with this issue.