mac

How to securely erase free space on a hard drive (Mac)

From time to time, I need to clean off the contents of a hard drive on one of my Macs—most often this is the case prior to selling the mac or giving it to someone else. Instead of just formatting the drive, installing macOS, then handing it off, I want to make sure all the contents I had stored on it are irrecoverably erased (I sometimes work on projects under NDA, and I also like having some semblance of privacy in general).

Disk Utility used to expose this functionality in the UI, which made this a very simple operation. But it seems to have gone missing in recent macOS versions. Luckily, it's still available on the command line (via Terminal.app):

diskutil secureErase freespace 0 "/Volumes/Macintosh HD"

This command would write zeroes on the entire 'Macintosh HD' drive. You can see a list of all the drives connected to your Mac with ls /Volumes. There are a few other common options available (instead of 0) if you run man diskutil and scroll down to the secureErase section. I most commonly use:

Review: AUKEY USB-C Hub for New MacBook Pro

I have a 2016 MacBook Pro (without TouchBar), and for this Mac, or for a 12" MacBook, a hub/adapter with power delivery is absolutely essential for desk use, due to the limited number of USB-C/ThunderBolt 3 ports.

Eventually, I'd like to plug one ThunderBolt 3 cable into my MacBook Pro and get 4K video at 60Hz (through either USB-C, DisplayPort, or HDMI 1.2+), USB 3.0 for my existing USB 3 devices, and a power pass-through so I can get the full 61W of charge out of my Apple AC adapter.

AUKEY USB-C Hub - 3x USB 3.0 ports

External display waking up? Disable notifications when your screen is off

Since a week or so ago, I noticed that even when my Mac's display was put to sleep, my external display would sometimes turn on and remain on for long periods of time if I had a calendar reminder or some other type of non-dismissible notification. It would even come on (and turn off shortly thereafter) for quick notifications.

This was highly annoying, especially when I'd come to my computer in the morning and realize the external monitor had been on displaying a notification all night!

Apparently macOS 10.12.2 includes a new feature called Enhanced notifications, and they can wake up internal or external displays to show notifications. Annoyingly, this new feature is enabled by default. To disable it, you need to go into the Notifications System Preference, and inside the 'Do Not Disturb' section, and check the "When the display is sleeping" option under "Do Not Disturb":

A Tale of Two Apples: AirPods and the Touch Bar

Yesterday UPS delivered a BTO 2016 MacBook Pro 13" with Touch Bar (to replace my 2013 11" MacBook Air), and a set of AirPods (to replace three different headsets I use daily in my work as a remote employee).

AirPods on 2016 MacBook Pro 13" Touch Bar Safari address bar in Charging Case

The two products tell a different story about the company that makes them:

MacBook Pro with Touch Bar

The MacBook Pro fails to 'thrill' in a way that no other Apple device I've made the conscious decision to purchase has.

Upgrading from a 2013 MacBook Air 11" (portability is king to me, but I needed more performance), the only major external difference is the retina display—something most other 'pro' Mac users have been enjoying since 2012. The Touch Bar itself is mostly useless to me for two reasons:

MetaZ - Alternative to MetaX and iDentify 2 for tagging video content in iTunes

For many years, I've ripped all my DVDs, Blu-Rays, and HD-DVDs into my computer, and it's great to be able to watch any of my digital content on any of my devices whenever and wherever I want, without having to have a huge stack of discs laying somewhere accessible (I store them all in a box in my basement).

For almost as long, I've used iDentify for this purpose, but it looks like the developer behind the app gave up on the iTunes/macOS ecosystem entirely in the past year or so, and the app stopped working on macOS Sierra 10.12.

I looked around for alternatives, and found mentions of iFlicks (didn't seem as fully featured), Vidalin (no longer developed), MetaX (no longer developed?), and Subler. I tried a couple of these and didn't find them as pleasant as iDentify, but then I also found MetaZ, tagged as "Two letters better than MetaX".

Figuring out why an external USB hard drive won't spin down on my Mac

I am using a 2011 Mac mini as a backup server for all the data I store on iCloud, and for the first few days while I was setting up the Mac, I noticed the 4 TB and 2 TB external USB drives I had plugged in would spin down after a few minutes, and I would have blissful silence as long as there wasn't an active operation on that Mac (which should be fairly rare; just hourly Time Machine backups and periodic SSD activity since the iCloud libraries are all on SSD).

However, after a few weeks, I noticed that at least one of the two hard drives runs continuously, 24x7. Something on the Mac mini must keep hitting the drive and preventing it from spinning down.

To see what was happening, I used sudo fs_usage | grep VOLUME (in my case, VOLUME is 4\ TB\ Utility) to monitor what processes were accessing the drive, and what files they were accessing. After a few minutes watching (and doing nothing else on the computer, to make sure I wasn't causing any extra filesystem seeks), there were a couple regular culprits:

Fix macOS Screen Sharing frequent pauses or freezes

Ever since upgrading my Macs to macOS Sierra, there have been one or two times when using Screen Sharing (as part of Back to My Mac) when the session would freeze up, or intermittently pause. It seemed that every 5 or 10 seconds, there would be 10 seconds where the shared screen would stay frozen.

I could enter keystrokes, but things like pasting or clicking was hit-or-miss. This made it extremely annoying to work on one of my headless Macs (without a monitor plugged in), because I could only do work in brief spurts!

I opened up the Console app (in Applications > Utilities) to see what was happening, and quickly found that the following three errors were logged any time the screen would freeze:

Converting a batch of Dashcam videos into a timelapse

I recently took a family vacation from St. Louis, MO to Branson, MO, and as it was the first time driving with my new Mobius Action Cam Mini dashcam installed on our Toyota Sienna (see a full writeup and review here), I wanted to see if I could quickly whip up a time lapse video of the entire drive.

Driving in St. Louis - dashcam loop gif
A tiny snippet of the final time-lapse video of my STL to Branson drive.

How I record my own conference presentations

At this year's php[tek] conference, I decided to record my own sessions (one on a cluster of Raspberry Pis, and another on tips for successfully working from home). Over the years, I've tried a bunch of different methods of recording my own presentations, and I've settled on a pretty good method to get very clear audio and visuals, so I figured I'd document my method here in case you want to do the same.

SSH into a Raspberry Pi with only a network cable using OS X's 'Internet Sharing'

Recently, I found myself in a situation where I had to connect to a Raspberry Pi to set it up for a presentation, but I did not have:

  • A keyboard and/or other input device to use to type anything into the Pi
  • An HDMI cable to connect the Pi to a display so I could view anything on the Pi
  • A microSD card reader so I could modify the contents of the Pi's microSD card

Because of this, none of the standard methods of setting a static IP address, reconfiguring the Pi's WiFi configuration, or logging in on the Pi itself to find it's IP address or set things up so I could connect over a local network would work.

I remembered that Mac OS X handily includes an 'Internet Sharing' feature, which sets up a bridged network interface so your Mac is effectively a router and DHCP server to any devices connected to the shared interface.