Monthly Archives: February 2017

Show Man Pages With MacBook Pro Touch Bar

Something cool I ran across  while loading a new MacBook Pro with touch bar, for one of our users. I often open the terminal to run ‘post-deployment’ scripts. I noticed the touch bar options changes and offered to open a man page for the current command. Making it a little bit easier to get relevant information.

Give it a try. Open Terminal and type ‘ls’, then watch the touch bar you should see this:

Touch Bar Shot 2017-02-21 at 8.48.20 AM.png

Tapping the little ‘document’ icon with the ‘ls’, will open the man page in another window. By the way, to take a screenshot of the touch .. use “command” + “shift” + “6”.

Screen Shot 2017-02-21 at 8.48.37 AM.png

CookieDough: A Ruby Gem for Mac Applications

CookieDough is a Ruby gem for Mac’s that reports back on Apps in the main Application folder, as well as being able to report back what’s in a user’s dock.

To install:

gem install cookiedough

Then startup an interactive ruby prompt

irb

Load CookieDough by requiring it:

require 'CookieDough'

To list options:

puts CookieDough.options

You’ll see a list of options like this:

all_app_versions
app_version
dock_apps
dock_bundles
list_apps
options
receipts
user_installed_app 

Basic usage is simple, ‘puts CookieDough.your_option’

One thing I always use this for is when I’m going to replace a users laptop. I want to see what’s in their Applications folder and whats in their dock .. these are the things that are important to them right, and what they have installed.

So I’ll run ‘puts CookieDough.user_installed_apps’. It prints a list of what’s in the Applications folder and removes any of the base Apps that come pre-installed in macOS. It makes it easy to see what’s been added to the machine after the user received it.

You can find it on Ruby Gems or on my GitHub

 

macOS Logs

Below is a link to my presentation on macOS Logs. It started last summer as a PSU MacAdmin sessions but it’s been updated for the University of Utah, MacAdmins February meeting, to include Sierra and unified logging.

Link to the presentation: https://goo.gl/TDQivZ

Link to slides and resources: https://goo.gl/KDssG0

 

Enable Chrome Auto Updates For All Users

chromeautoupdates.png

One of the consent post deployment tasks is to open Chrome and click the box that says “Setup Automatic Updates”. About a year and a half ago I found “chrome-enable-autoupdates.py” by Hannes Juutilainen. It’s been a life saver. One less thing to think about. I use the script in my DeployStudio workflow, after I install chrome.

For some reason last week it failed. I logged into the desktop and ran the script and it ran fine, but the script gave me some feed back that the “Trusted user setting is deprecated”.

What changed?

Well Chrome. I was deploying Chrome 54 with the script and no issues. I updated my workflow to deploy Chrome 56 and now it fails. I suspect there are back end changes in chrome that happened to “ksadmin”, found at “/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin”, that generated the message. Since it’s not well documented and I can’t find anything useful for the error message, I decided to look at the script myself. I suspect the script fails in DeployStudio because the exit code isn’t 0 since a warning message is returned.

I decided to rewrite the “chrome-enable-autoupdates.py”, but in Ruby.

Screen Shot 2017-02-08 at 6.19.49 PM.pngIt was a great exercise to not only deconstruct the script and understand what’s going on. Once I got the script working, I got the same warning message. The easiest solution is redirect the output of the commands to /dev/null. Then the script runs without issues.

Is it a work around? Yep. How long will it work? No idea. But now that I created my own script I feel I have a better handle on troubleshooting it, and I hope in the future versions of Chrome there is a resolution.

You can get the script on my GitHub.