Categories
Uncategorized

Upgrading to Yosemite using Managed Software Center (Munki)

If you're running an older version of OS X (e.g., Mavericks or Mountain Lion) and the tech department is telling you to use Managed Software Center to upgrade to Yosemite, this is how you do it.

Prerequisites

  1. Set aside time for this upgrade. Keep in mind the entire process can take between 45-90 minutes. You will not be able to use your Mac for other things while this upgrade is happening.
  2. Back up important files. In theory, the upgrade shouldn't affect your data but make sure your CrashPlan has been running and completing backups before you start this upgrade process.
  3. Plug your computer in. If you have a laptop, even though your laptop battery will likely last longer than even two or three hours, you don't want to risk your battery running out before the upgrade process is complete.
  4. Do the upgrade at school. The network bandwidth at school is better than what you have at home, so the download of the update won't take as long as school, and the Managed Software Center will not work when you are at home. More importantly, Yosemite is no longer available in the Mac App Store.
  5. Don't be afraid to ask for help. The upgrade process, as outlined below, is fairly straightforward, but if you're at all nervous about it, feel free to drop by the tech office, and we'll be more than happy to walk you through it.

yosemiteupgrade01
First, go to your /Applications folder. Then find and open Managed Software Center.

yosemiteupgrade02
Click on the Software tab and then scroll down until you find Install OS X Yosemite.

Click the Install button underneath it.

yosemiteupgrade03
Once you click the Install button, you'll see it notify you that the update is Downloading.

yosemiteupgrade04
Click the Updates tab to check on the progress of the download. The download is several gigabytes in size (i.e., quite large), so the download may take a while (even with the school's Internet connection).

yosemiteupgrade06
Once the download finishes, Managed Software Center will notify you that a restart is required. If you haven't already quit out of your other programs and saved any unsaved files, do so now.

Then, click Log out and update.

At this point in the process, it'd be a great time to eat lunch, go for a walk, meet with a student, or engage in any activity that doesn't involve needing your Mac.

yosemiteupgrade07
In case your idea of a good time is eating some microwave popcorn while you watch a Mac upgrade to the latest operating system, you'll likely see something like this appear on your screen.

yosemiteupgrade08
As you're munching down that popcorn, you may also see a screen that looks like this.

yosemiteupgrade09
And then you may see something like this. Even if it says "23 minutes," it may take up to 30 or 40 minutes. If you see "less than one minute remaining," it will likely be another 5 minutes left.

Just let it all run. A few more screens may flash by quickly. You won't need to do anything again until you get to a login screen. As always, if you get stuck or have questions, ask the folks in the tech office. We're more than happy to help.

Read only if you're a Munki admin

Even though El Capitan is now the official latest release, not Yosemite, the same principle should apply. If you're using Munki, you can use createOSXinstallPkg to make a Munki-able package from an Install OS X Yosemite.app package.

Once you have the Install OS X Yosemite.app downloaded to your /Applications folder and you have the createOSXinstallPkg-master.zip downloaded and extracted to your ~/Downloads folder, just run these commands:

cd ~/Downloads/createOSXinstallPkg-master
sudo ./createOSXinstallPkg --source /Applications/Install\ OS\ X\ Yosemite.app
and you'll end up with a nice Munki-able InstallOSX_10.10.5_14F27.pkg you can run munkiimport on and distribute to your users.

Categories
Uncategorized

Fix for Mac OS X 10.10.5 breaking Apache

Problem

If you have SSL enabled on an Apache server running on Mac OS X, you may have found that upgrading to 10.10.5 breaks your site, and your users cannot connect either via http or https.

It turns out the update moves the certs and keys to a new folder, so references to those certs are then broken.

Solution

To fix the issue, edit the /private/etc/apache2/extra/httpd-ssl.conf file:

sudo nano -B /private/etc/apache2/extra/httpd-ssl.conf
Then find the line that looks like SSLCertificateFile "/private/etc/apache2/server.crt" and change it to look more like
SSLCertificateFile "/private/etc/apache2/ssl/server.crt"
Likewise, find the line that looks like SSLCertificateKeyFile "/private/etc/apache2/server.key" and change it to look more like
SSLCertificateKeyFile "/private/etc/apache2/ssl/server.key"

Then, save the file and restart your Apache server:

sudo apachectl restart

Acknowledgements

Thanks to stamps-uk from Yosemite 10.10.5 Update Disabled Apache for the tip.

Categories
Uncategorized

Modifying the Energy Saver “Put hard disks to sleep when possible” setting using the terminal

If you're looking in Yosemite for where the Put hard disks to sleep when possible setting in Energy Saver lives, it's in /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist, so you can view with the command

defaults read /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
and you'll see the value in "Disk Sleep Timer", with 10 meaning the box is checked and 0 meaning it's not checked.

You can change that setting using

sudo pmset -a disksleep 10
(or 0 instead of 10, if you'd like) to change it for all power types (UPS, wall outlet, or battery), and then change it specifically for battery with
sudo pmset -b disksleep 10
Keep in mind the changes may not show up visibly in Energy Saver until a logout or reboot.

Categories
Uncategorized

Modifying the Energy Saver “Turn display off after” preferences in Yosemite using the terminal

What's the problem?

I'm shocked at how little straightforward documentation there is regarding where the Energy Saver settings (from System Preferences) are stored or how to modify them using the terminal.

Where are the settings stored?

Using opensnoop, I was able to track down that Energy Saver modifies this file:

/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist

The main slider in Yosemite is labeled Turn display off after: and has one slider for Battery and another for Power Adapter.

If you want to read how that's stored in /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist via terminal, there are two commands you can use:

defaults read /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
(which will be labeled as "Display Sleep Timer" (the value 0 is for Never—otherwise, it's straight numeric by minutes) or
pmset -g custom
(which will be labeled as displaysleep).

How do you change the settings?

To modify it for all power settings (according to the man page for pmset, there are separate parameters for a wall charger versus a UPS, so it's easier to modify for all and then just modify battery afterwards), you'd enter this command into the terminal:

sudo pmset -a displaysleep 180
(for three hours, as an example) and then enter this command into the terminal:
sudo pmset -b displaysleep 25
(for 25 minutes, as an example) to modify just the battery settings.

If you look at /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist or the output of pmset -g custom, you'll see your changes take immediately. If, however, you look at Energy Saver through System Preferences, you'll see that the changes aren't reflected immediately without a logout or a reboot.

Categories
Uncategorized

Restoring a deleted recovery partition on a Mac

Update

This is only one method to restore the missing recovery partition. Check out Recreating a deleted recovery partition on a Mac for another method.

The Missing Recovery Partition Problem

I don't actually know how a recovery partition gets deleted, but I've come across a few Macs with the partition deleted, and I've been looking for a way to restore them, because if you don't have the recovery partition and you want to boot into recovery mode (holding down Cmd-R at startup), you'll have to boot into Internet Recovery Mode (which will involve you connecting to a wireless network and downloading a temporary recovery).

Outdated Solution

Apparently, for Mac OS X Lion and Mountain Lion, Apple had this program called Recovery Disk Assistant that let you install a recovery partition (on an external drive, but presumably you could do it on an internal one, too). I also found an article from April, 2015 talking about Recovery Disk Assistant and OS X Lion. The one comment on the article says This may be a dumb question, but I have a slow internet. Can I do this with Yosemite? No reply there. It would be great to have solution that works for Yosemite.

Less-than-ideal Solution

I found an article called Pro tip: Restore the recovery partition in OS X 10.10 Yosemite that advises either reinstalling OS X (not ideal) or restoring using Carbon Copy Cloner. I tried to follow the instructions to restore using Carbon Copy Cloner, but I couldn't find a Recovery HD button to click.

Working Solution

I finally figured out a solution on my own (with lots of help from Apple Boot Partition and Enable Disk Utility's Debug Menu).

The gist of it is you clone an existing recovery partition and then change it to an Apple Boot partition. Details to follow.

What you'll need:

  • One Mac missing a recovery partition (of course—that's why you're here, right?). I'll refer to this Mac as Mac #1.
  • At least one other Mac that already has a working recovery partition on it. I'll refer to this Mac as Mac #2.
  • A Thunderbolt cable to connect the two Macs.

Boot into Mac #2, log in as an admin user, and then paste into Terminal.app the following command so you'll be able to see the debug menu in Disk Utility:

defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
restorerecoverypartition00
When you launch up Disk Utility afterwards, you should see a new menu called Debug. From that menu, select Show every partition. You should now be able to see hidden partitions (including one called Recovery HD).

Boot Mac #1 into target disk mode and then attach it to Mac #2 using a Thunderbolt cable. You should see Mac #1's partitions show up in Mac #2's Disk Utility.

restorerecoverypartition01
Click on Mac #1's hard drive (not the partitions underneath), select the Partition tab, and click the plus sign (+) to add a new partition. You won't be able to drag the partition size to be very small (I think the smallest you can make the new partition by mouse-dragging is about 6 GB), but if you type in a value (e.g., .65—or anything less than 1), it'll automatically bump the value up to 1.07 GB. That should be fine, since the normal recovery partition is 650 MB, which isn't that far off from 1.07 GB. If you want to make the partition even smaller, you can explore disk management from the command line.

restorerecoverypartition02
You'll be asked if you really want to repartition. You backed up your data on Mac #1 already, right? Or the data isn't that important to you? Either way, repartitioning is usually fine, but there is a small risk you could lose data. Act accordingly.

restorerecoverypartition03
Once you have repartitioned Mac #1, click on Recovery HD for Mac #2 and select the Restore tab. Drag Macintosh HD 2 (the newly-created small partition) to Destination, and then click Restore.

restorerecoverypartition04
Click Erase, when prompted.

restorerecoverypartition05
When it's done, we still have one more important step to undertake. You'll see, if you click on the old Recovery HD, that its Partition Type is Apple Boot Partition.

restorerecoverypartition06
And the new Recovery HD's Format is Mac OS Extended (Journaled). If you leave it that way, holding down Cmd-R at startup will still go to Internet Recovery Mode instead of regular Recovery Mode (and manually selecting the new partition by holding down the Option key at startup will just lead you to a do-not-enter symbol).

restorerecoverypartition07
Close out Disk Utility and launch up the Terminal. Enter the command

diskutil list
to list out the partitions and drives.

Identify the partition to fix. It should be TYPE Apple_HFS and NAME Recovery HD. In this case, it's /dev/disk2s3, but be sure to look at how it's displayed in your setup (the numbers may be different from this example).

Unmount the partition (substitute your numbers for #, where appropriate):

diskutil unmountDisk /dev/disk#s#
Then put in a command like the following (substituting in your actual disk numbers) to change the partition type:
sudo asr adjust -target /dev/disk#s# -settype Apple_Boot

restorerecoverypartition08
If you launch up Disk Utility now, you should see that the Recovery HD on Mac #1 is type Apple Boot Partition, and recovery mode should now work on that Mac.

Categories
Uncategorized

Enabling https for Apache server on Yosemite

I found a bunch of different instructions, but these are the instructions that actually worked for me (regular Mac running Apache server) to get https working (self-signed certificate, so you will get the certificate warning from your web browser):

Step 1

Self-signed SSL Certificate on Mac Yosemite

Step 2

Enable HTTPS in Apache on Mac Yosemite

Step 3

Step 2 gave me an error (AH00526: Syntax error on line 73 of /private/etc/apache2/extra/httpd-ssl.conf: SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).), so I edited the /private/etc/apache2/httpd-conf and followed these instructions.

Categories
Uncategorized

Acer Monitor and Mac Computer

We had a bit of trouble at first getting some Acer K272HUL monitors to work with some Macs on campus, and Google searches came up with threads like this, which offered some helpful tips, but not a full solution.

So if you happen to have an Acer K272HUL (or perhaps a similar model) and some Mac desktops, you may find this post helpful.

Problem: We couldn’t get the Acer monitors to recognize our Mac computers (running Yosemite, though I’m not sure that made a difference) using HDMI cables. Then we tried using a MiniDisplayPort-to-DVI cable, and the Acer monitor recognized the connection but wouldn’t display at full resolution (we could get tiny resolution in the center of the screen or pixelated stretched resolution).

Solution: First, on the monitor, go to the settings and make sure the DP version is set to 1.1 and not 1.2.

Then get a MiniDisplayPort-to-DisplayPort connector.

That’s it. Full resolution.

Update (9 January, 2018): So the above blog post was for Mac Pros connecting to the monitor. If you try to connect a MacBook Air running High Sierra, the HDMI connection will “work” but may flicker. You should still use a Displayport connection.