Archive

Archive for the ‘Mac administration’ Category

MacAdmin 101: Building a recovery partition installer package using Create Recovery Partition Installer.app

July 22, 2016 Leave a comment

As part of the process of deploying Macs in my shop, it is occasionally necessary to image or re-image them with a disk image containing the latest version of OS X or macOS. To assist with making sure that the Mac’s recovery partition is correctly applied as part of the imaging process, an installer package which installs or repairs recovery partitions is installed as part of the imaging process.

When I need to create recovery partition installers, I use an application named Create Recovery Partition Installer.app to generate them. Create Recovery Partition Installer.app is an open-source tool written by Per Olofsson that lets you create an installer package that creates and updates recovery partitions on boot drives for both OS X and macOS.

For more details on how Create Recovery Partition Installer.app can be used to build recovery partition installers, please see below the jump.

Read more…

MacAdmin 101: Building Mac disk images using AutoDMG

July 22, 2016 1 comment

As part of the process of deploying Macs, it is occasionally necessary to image or re-image them with a disk image containing the latest version of OS X or macOS. When I need to create disk images for use in my shop, I use an application named AutoDMG to generate them. AutoDMG is an open-source tool written by Per Olofsson which enables the creation of never-booted OS X or macOS images for deployment.

Why is creating a never-booted disk image important? When you boot a Mac for the first time, the OS will create a number of system-specific settings, temporary files and other associated system-specific data. Because this data is specific to an individual Mac, it doesn’t always transfer well to other Macs and may cause some quirky issues. By creating a never-booted disk image, you avoid the issue entirely because those files aren’t created as part of the image building process and consequently do not get transferred to Macs which are set up using the disk image.

When building an image using AutoDMG, the best approach is to build an image containing just the operating system and available updates included in the image. While you can also choose to include other software installers in your image build process, a lot of software installers won’t apply correctly to the image because the affected installers use scripts and other functionality which do not run properly when run as part of AutoDMG’s image creation process.

Because of this behavior, I recommend planning to install software as a post-imaging task as opposed to including it in your AutoDMG-generated disk image. For those interested, additional information on this topic is available from the Getting Started section of the AutoDMG wiki.

For more details on how AutoDMG can be used to build images, please see below the jump.

Read more…

Exporting Unix man pages to plain text files

July 13, 2016 6 comments

While working with different versions of Mac OS X and macOS, it’s often been useful to me to be able to export the contents of a particular command line utility’s Unix man page to a plain text file. Man pages are the built-in documentation method available in Unix-based systems, so Apple documents how to use the various command line tools used by the operating system using this documentation method.

Exporting to a plain text file allows me to compare macOS Sierra’s man page for a particular command line utilty to a exported copy of the same utility’s man page from OS X El Capitan and see where changes to the man page have been made. This comparison is made by using diff, or other file comparison tools like Kaleidoscope, which helps me quickly spot where Apple has made changes to their documentation.

To export man pages to a plain text file, I use the col command line utility to read the contents of the man page in using stdin, then export out to a plain text file using stdout As an example, here’s how to use col to export the diskutil man page to a new plain text file named diskutil.txt:

man diskutil | col -bx > /path/to/diskutil.txt

In this case, col‘s -b and -x functions are used to make sure that the formatting for the diskutil man page remains intact when exported to the plain text file.

Editing /etc/sudoers to manage sudo rights for users and groups

July 11, 2016 9 comments

In some environments, it may be desirable to give users admin rights while restricting those users from being able to run commands with root privileges while using the command line.

A way to achieve this “admin user in the GUI, standard user on the command line” method is to edit the /etc/sudoers file. This is the configuration file referenced by the sudo command line tool, which allows a user with the correct sudo rights to execute a command with root privileges, or using another user account’s privileges.

By default, all user accounts with admin rights on both OS X and macOS have full rights to use the sudo tool. By removing those accounts’ rights for sudo from the /etc/sudoers file, user accounts with admin rights will not be able to run commands with root privileges using the sudo tool. For more details, see below the jump.

Read more…

Running Apple’s System 1 on OS X El Capitan

July 8, 2016 1 comment

As part of some research which I’m doing on Mac filesystems, I wanted to see if it was possible to get Apple’s System 1 running on OS X El Capitan. The reason that I am specifically interested in System 1 is that this OS used Apple’s shortest-lived filesystem: Macintosh File System.

After discussing the issue, my colleague @mikeymikey pointed me in the direction of using the Mini vMac emulator application to accomplish this. He also pointed me towards the correct places where I could download a System 1 disk image and the needed Mac ROM file.

With this information, I was able to get System 1 up and running inside of the Mini vMac emulator. For the details, see below the jump.

Read more…

Creating a screen recording of a second display with Apple’s QuickTime Player

July 7, 2016 Leave a comment

One of the features of Apple’s QuickTime is that it allows a video recording to be made of your screen. This allows whatever you’re doing on the screen to be captured in a video and played back later.

To use QuickTime Player on OS X El Capitan to make a screen recording, use the procedure described below:

1. Launch QuickTime Player

Screen Shot 2016 07 06 at 7 58 27 PM

 

2. In the File menu, select New Screen Recording.

Screen Shot 2016 07 06 at 7 59 55 PM

 

3. In the Screen Recording window, click on the arrow drop-down menu and select the desired options.

Screen Shot 2016 07 06 at 8 48 18 PM

Screen Shot 2016 07 06 at 8 46 55 PM

 

4. Set up the conditions that you want to capture then click the Record button.

Screen Shot 2016 07 06 at 8 48 19 PM

 

5. Select the desired option for recording either a portion of the screen, or the whole screen.

Screen Shot 2016 07 07 at 1 03 12 PM

 

6. When you’re ready to stop recording, click the Stop button in the menubar.

Note: You can also press Command-Control-Escape on the keyboard to stop the recording.

Screen Shot 2016 07 07 at 2 18 18 PM

 

 

By default, this procedure will work to record your Mac’s primary display but you can also use it to record an alternate display. For more details, see below the jump.

Read more…

Showing and hiding all desktop icons via the command line

June 26, 2016 3 comments

As part of preparing for a presentation, it’s often handy to be able to hide the icons on your desktop so that folks viewing the presentation aren’t distracted by what you have stored on your desktop.

To aid with this, there are defaults commands which can be run to hide or (if hidden) show the icons on your desktop.

To hide your desktop’s icons, run the command shown below:

defaults write com.apple.finder CreateDesktop -bool false

To show your desktop’s icons, run the command shown below:

defaults write com.apple.finder CreateDesktop -bool true

After running the appropriate command to either show or hide the desktop’s icons, the Finder needs to be restarted so that it can display the changes. You can do this one of two ways:

1. Log out, then log back in
2. Run the following command:

killall Finder

Since I usually remember only at the last minute that I should hide my desktop icons, I’ve also built an Automator application named Show or Hide Desktop Icons.app to assist me with showing or hiding my own desktop’s icons. For more details, see below the jump.

Read more…

Follow

Get every new post delivered to your Inbox.

Join 307 other followers

%d bloggers like this: