Showing posts with label OSX. Show all posts
Showing posts with label OSX. Show all posts

Wednesday, April 4, 2018

com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Grrrrrr.




I've had my Mac Pro 6,1 for a few months and noticed that the display crashes every few weeks, where the symptoms range from 1) screen is "frozen as-is", 2) while mouse cursor can move 3) Cannot click on anything on the screen. 4) System clock on screen is stuck at the time the displays froze, and 5) System is still responsive through SSH.

While there was some discussion on various boards about the issue being due to the AMD FirePro D500 and D700 cards, I have a pair of D300s in this unit, which aren't supposed to be impacted by the known Apple Issue.


This occurred again recently and after getting some time to dig into things further, I looked into /var/log/system.log file to see what was the most recent entries prior to the latest freeze episode.

Found the following:

Output snippet from /var/log/system.log
Apr  4 11:01:18 macpro com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Apr  4 11:01:28 macpro com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Apr  4 11:01:38 macpro com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Apr  4 11:01:58 macpro com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Apr  4 11:02:28 macpro com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.


In digging around the web, found the above link on Stackexchange that talks about this issue being related to a particular issue with out an Apple plugin is behaving badly, and lists instructions on how to temporarily disable it:

Here's the overall steps taken:
Sourced from Stackechange article:
https://apple.stackexchange.com/questions/304745/mirrordisplays-error-every-30-seconds-in-system-log



  1. Disable System Integrity Protection so you can edit the .plist file. Do this by rebooting into the recovery partition with cmd-R, open Terminal from the Utilities menu, and type:
    $ csrutil disable
  2. Reboot, then edit the .plist file with this command:
    $ sudo vi /System/Library/LaunchAgents/com.apple.preference.displays.MirrorDisplays.plist
  3. Comment out the line that causes the MirrorDisplays tool to load. Change this line:
       
  4. To this:
  5. Then, reboot and re-enable System Integrity Protection using the recovery partition as described above and type:
    $ csrutil enable
  6. Reboot 

After implementing the changes, it appears that this has stopped the occurrence:


$ grep "MirrorDisplays): Service only ran" system.log | cut -d ':' -f1 | uniq -c

 164 Apr  4 11

 172 Apr  4 12
  47 Apr  4 13
   3 Apr  4 14

The above command is grepping the system.log for the event occurrence, then parsing based on the first colon ':' which filters out everything of the error past the Day and Hour. So the above output shows that at 11am it occurred 164 times, 12pm occurred 172 times, 1pm 47 and so on...

It's now almost 4pm and no occurrences since disabling!  Keeping fingers crossed that this will fix the freezing scenario, otherwise will continue trudging through the system.log file on the next freeze.


Saturday, September 17, 2016

Install Mac OSX El Capitan to a USB stick via CLI


On the command line, copy and paste the following.  NOTE: Substitute the path of the actual USB stick in place of  /Volumes/:

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/ --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app


Sourced from:
http://www.macworld.com/article/2981585/operating-systems/how-to-make-a-bootable-os-x-10-11-el-capitan-installer-drive.html




Thursday, February 25, 2016

Useful settings for Mac OS X (Mavericks onward) / Adding GPX files directly to a Garmin Fenix 3

Here's a few settings that I came across [1] that helped make my daily workflow easier while working on a Mac, listed below:

defaults write com.apple.finder AppleShowAllFiles YES
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
killall Finder

Let's cover what they do:

defaults write com.apple.finder AppleShowAllFiles YES

This command above enables the ability to show all hidden files in the Finder, which can be useful for power users (or for those who have a Fenix 3 and need to access the NEWFILES folder in /Volumes/Garmin/Garmin to upload .GPX files [2]).


Do you use the Quick look feature much in OS X?  If not, it's certainly a very useful feature to quickly peek into files on the Finder.  If you do use it and would like to copy and paste frequently from these files (i.e. source files, or general text files), the command below will enable this:

defaults write com.apple.finder QLEnableTextSelection -bool TRUE


Of course, we will need to either logout of the current session or restart the finder.  You can restart the finder by running the following:

killall Finder


In case you want to revert the above settings to default, you can run the following commands respectively:

defaults write com.apple.finder AppleShowAllFiles NO
defaults write com.apple.finder QLEnableTextSelection -bool FALSE
killall Finder


References / Sourced from:

[1] Macworld UK:
How to show hidden files and folders in Mac OS X Finder:

How to select and copy text from Quick Look previews in OS X:

[2] Itamar Latnik's Youtube post: Garmin Fenix 3 - Import a GPX Course

Thursday, May 28, 2015

Open Dropbox folder from anywhere in Mac OSX

Hi folks,  here's a method that I implemented that allowed opening the Dropbox folder from within any application (well, it gets called by a Terminal session from the Finder).

This does not however, automatically switch to the Dropbox folder while in the middle of a application dialog box;  it simply opens up the Dropbox folder in the event you need to look into or open something within the Dropbox folder.  To access the Dropbox folder from an application dialog box, you can drag the Dropbox folder into the "Favorites" section of the application save/open dialog box to access it within one click.

Ok, if you're still interested in a hot-key anyway to access the dropbox folder,
here's how to do it:

1. Open Automator: [Cmd]-[Spacebar], type in Automator.

2. Select Service, click Choose

3. Modify Service receives selected [text] in [any application] to  Service receives [no input] in [any application].

4. Select the action Run Shell Script under Utilities, drag it over to the right pane.

5. Change the cat command to open ~/Dropbox .  If your Dropbox folder is located somewhere else, please modify the pah accordingly.

6. Save as Open Dropbox Folder within Automator.

7. Open System Preferences: [Cmd]-[Spacebar], type in System Preferences .

8. Navigate to Keyboard -> Shortcuts

9. Scroll down to General

10. Ensure the checkbox for Open Dropbox Folder is checked (enabled).

11. Choose the Keystroke combination to open the Dropbox folder.
NOTE:  If you choose [Option]-[Cmd]-[D], you may need to disable Turn Dock Hiding On/Off in the Launchpad  & Dock section.


Enjoy!