Changing the CPU priority of Mac OS X apps with ‘renice’

Mac’s Activity Monitor app is great, but there’s one thing it can’t do. As a long-time Windows user, I’m accustomed to tweaking the CPU priority on apps that are very CPU-intensive, e.g. compressing video, etc. On Mavericks I’ve noticed a couple of apps tend to slow my system right down (iTunes, Unarchiver, Google Drive), and wanted a quick way to get them under control. So I wrote this shell script.

#!/bin/bash
for APP in iTunes Unarchiver Drive ; do
  PID=`ps -Ac -o pid,command | grep ${APP}$ | awk '{print \$1}'`
  if [ -z $PID ] ; then
    echo \[$APP\] not running
  else
    echo \[$APP\] sudo 20 renice $PID
    sudo renice 20 $PID
  fi
done

Microsoft and Nokia

So Microsoft bought Nokia. I can’t say I’m surprised. It will be interesting to see if this can bring them back from the brink of irrelevancy. I love the look of Windows Phone as an OS, and have been quite outspoken on my anticipation for the Nokia Lumia 1020 as the ultimate travel companion. However, Microsoft needs to experience a fundamental attitude shift if they’re going to claw their way back into the mobile devices market.

The Apple vs. Android vs. Microsoft debate is thoroughly uninteresting. Each platform has their strengths and weaknesses. Apple got there first with shiny touch phones and pioneered the App Store business model. Google snatched up the software-only market by stealing Microsoft’s modus operandiā€”build the OS and the cheap hardware will come, along with butt-loads of market-share. Microsoft is kind of a wild card. They’re that arrogant corporate jock that storms in late and gate-crashes the hipster/nerd frat party. Google’s dominance and market share is quite straightforward. Android is popular, not because it’s good, but because it’s free and it’s “good enough”. The interesting debate, and the only one worth having, is about brand attitude.

Read full post →

How to remotely shut down a Mac with AppleScript

Here’s a couple of simple AppleScripts to help you quickly shut down a Mac. This is handy if you are using it as a media center and want to shut down cleanly with one click, without picking up the keyboard or mouse, without logging in via Apple Remote Desktop, and without prompting for a password. I find a two-app approach works best as it gives you the flexibility to have a one-click dock icon on the target Mac as well as on the Mac you’re on, without too much redundancy.

Read full post →

Are you a Computer Scientist, Programmer or Software Developer?

Alternative title: Are you willing to be pigeonholed by someone with a narrow view of the software industry? I recently came across a post by Alan Snorkin which claims there are three types of people in software: computer scientists, programmers and developers. It’s pretty short and worth a read.

On the face of it the post seemed insightful. I could see myself as fitting best into the programmer category. But I fail to see the point of  this kind of restrictive pigeonholing. It may appeal to recruiters and managers who percieve it makes their job easier – but beyond that it’s largely counterproductive.

Read full post →