Let’s say a directory contains these files: My First File.txtMy Second File.txt If you wanted to take an action on each distinct file, you might try something like this: for file in `ls ~`; do echo $file; done The output will look like below, because the spaces and line breaks are both treated delineators of… Continue reading Shell scripting: Iterate over a list line-by-line instead of word-by-word
Category: Mac OS X
Munki nopkg to turn Bluetooth on and off
I’ve posted a Munki nopkg installer to control Bluetooth. Assigning it for install causes Bluetooth to be (re)enabled whenever Munki runs. Uninstallation turns Bluetooth off. https://github.com/davidmnelson/munki-nopkg/blob/master/BluetoothEnabled.plist
Monitoring Apple Caching Server Status via MunkiReport
Occasionally the Caching service on macOS will stop working due to a network outage or a glitch on Apple’s end. It’s a simple enough fix — all you have to do is turn the service off and on again. But how do you know that it’s offline? It’s easy if you use MunkiReport with the… Continue reading Monitoring Apple Caching Server Status via MunkiReport
Creating HFS+ disk images from folders in High Sierra
In macOS 10.13, if you use Disk Utility to create a new image from a folder, it will be APFS formatted. These images can only be read on 10.12 or newer, and there’s no option to pick a different format in the GUI. Instead you can use hdiutil in Terminal make a folder into an HFS+… Continue reading Creating HFS+ disk images from folders in High Sierra
Munki, Monolithic Imaging, and Microsoft Office 2016 Volume License Serializer
If you have Macs that were cloned from an already-activated system (either via monolithic imaging, or one-off machines that were migrated or experienced hardware failure) you will find that your Office 2016 activation is broken. You will also find that Munki doesn’t know it needs to re-run the Office 2016 serializer since a receipt already… Continue reading Munki, Monolithic Imaging, and Microsoft Office 2016 Volume License Serializer
Deploying Epson EasyMP Multi PC Projection for Mac
When adding Epson EasyMP Multi PC Projection 2.1.0 to Munki, I found that the built-in postinstall script fails. Some digging revealed that the script was expecting a file to exist at </tmp/mpp-72B3FDFF-9513-4CED-96C3-34881FC77AB8>. It reads that file and uses the value contained for the “ClientMode” preference in </Library/Preferences/com.epson.EasyMP_Multi_PC_Projection.Settings/mppsettings.xml> On a successful install the the GUI, that… Continue reading Deploying Epson EasyMP Multi PC Projection for Mac
Using SSH Keys for Passwordless Authentication
SSH keys can provide an additional layer of security (if you also disable password authentication on the server), or they can simplify the process of connecting to remote servers. For our purposes we’re interested in the latter – connecting to the server without entering a password. The basic idea is that you create a public/private… Continue reading Using SSH Keys for Passwordless Authentication
Desktop Picture Profile Creator
DesktopPictureProfileCreator is a simple bash script that generates mobileconfig profiles for managing the desktop picture on macOS computers. Run the script followed by the path to the image you want to set as the desktop picture. For example “sh DesktopPictureProfileCreator.sh /Library/Desktop\ Pictures/Aqua\ Blue.jpg”. Whatever path you specify must exist in the same location on the computer(s) you intend… Continue reading Desktop Picture Profile Creator
Yosemite Captive Portal Fix
A number of Yosemite Macs are having problems with our organization’s Wi-Fi captive portal. If you don’t first sign in via the window presented by Captive Network Assistant, the system appears to have zero network connectivity. You can’t ping anything, you can’t perform DNS lookups, etc. It’s as if the OS is actively blocking all… Continue reading Yosemite Captive Portal Fix
AirPrintProfileCreator
AirPrintProfileCreator is a simple bash script which aids you in creating mobileconfig profiles that enable iOS devices to print to a CUPS server. Download and run the script on your server (“sudo sh AirPrintProfileCreator.sh”) and follow the prompts on screen. When the profile has been created, you can install it on your iOS device via… Continue reading AirPrintProfileCreator