Add PATH Environment Variable to launchd Scripts

Recently I was having an issue with Node.js not being detected in my PATH with a Python script executed by launchd. This was bizarre to me for a couple of reasons.

First, I’ve been using launchd for awhile now, and any LaunchAgents run under my profile usually has detected anything in my path, including Homebrew installed binaries.

Second, when testing the script via Terminal it worked perfectly.

After reading the available launchd keys, I discovered you can add an EnvironmentVariable with a list of your PATHs that will be executed before the ProgramArguments key.

It worked perfectly, and since it seems to be little used, I thought I’d post it here. Here is an example of the format you want to use in your launchd item:


Gatekeeper & App Translocation on macOS

This is a quick trinket to fix an issue with App Translocation and Gatekeeper.

Starting with 10.12 an App from outside the App Store when run from a disk image or the downloads folder, path translocation kicks in to protect the system and runs the app in a contained read-only environment.  At least from what I can understand from the documentation.

What is supposed to happen is when a user copies that app into the Applications folder (or really most anywhere else that is valid) and run again, Gatekeeper pops-up and asks if you’re really sure you want to run it because it’s from an unknown developer and that you need to visit System Preferences -> Security to Allow it.

Somewhere along the line, an attribute is set to turn off the quarantine for the read only mode and make the app behave normally.  For whatever reason, this sometimes fails causing the app to not be able to save files or even it’s own preferences.

To fix this, you can use the xattr command via the Terminal to manually remove the quarantine attribute like so:

YouTube – AvE

This guy is so much fun to listen to. While often speaking in the common man’s tongue with a Canadian flair, you quickly realize that he’s extremely smart and has a lot of real world experience.

From machining, to electronics, to engines, to taking apart brand new tools and gizmos to see how they work, this fellow is hours upon hours of entertainment.

He often says, “the world is so much easier when you realize it’s made of Legos.” That seems to be his approach for everything, just breaking it down into its Lego block and explaining how it works in a way you can understand.

You may even learn a thing or two, just don’t get the pixies angry and let out the smoke!

Find him on YouTube.

Synctunes – iTunes to Android Music Sync

Synctunes is an app for Android with a desktop counterpart (macOS or Windows) that will let you sync your iTunes library, or selected playlists from an iTunes library to your Android device.

I looked at quite a few of these and settled on this one as it met all my requirements:

  1. Sync over wireless.
  2. Sync selected playlists.
  3. Use “standard” or custom locations on my android phone so that the native apps could find my media in expected location(s).
  4. Not be a service that is constantly running on my phone and consuming battery life.
  5. Sync all meta data like artwork, tracks, album and so on.
  6. Sync only changed/new tracks on subsequent syncs.

Synctunes does the job perfectly. Below are a few screen shots to show you how simple it is to use. The screenshots of the desktop app are for the macOS version, but the Windows version is nearly identical.

You’ll also note that I have SynctunesPro. The free version can sync up to 100 songs, but that gives you a good idea for testing its capabilities. As soon as I realized that it did what I wanted, I spent the $2.99 for the Pro app with unlimited sync. Money well spent considering the app is also “family sharing” enabled so everyone in the household can sync their own iTunes libraries too!

First, download the app and open it up. You can choose a location and see how many items are already on your device from any previous sync. It also gives you your Wifi information.

Open up the desktop app and you’ll see that it auto detects your device(s) in the right box. Just click to select it and then click connect.Select the playlist(s) you want, click Sync and off you go!You can watch the progress on your phone, complete with album art, as it syncs too! (Excuse the art mismatch with the actual sync metadata below. That’s me unable to get a screenshot during the sync that matched. My library is up-to-date and as it is scanning it is so fast the album information is literally “blink of an eye” quick! When it actually has something to transfer it appears as it should.)

Washing Machine Filter Upgrade

Something that always bugged me are the inset washing machine filters. You know, unhook the hoses in the back and you have archaeological dig in the machine with needle-nose pliers to unscrew them all the while contorting into various positions around or on top of the machine? This also assumes they don’t crumble and disintegrate due to cheap material in the process, thus starting a quest to find the correct one at an outrageous price.

That was me, but no longer. A little research showed that the pictured filters, often used with power washers, has the same screen micron size that the washing machine specification listed for OEM filters. Upgrade time!

A couple of hoses and fittings later, we now have an easily accessible filter with a simple screw off base, and should be easy to clean under a little hot water many times before it needs to be replaced. Plus, a lot more surface area means cleaning will be less often, on the order of a decade in our case.

Goodbye macOS Server, Hello Synology!

Warning, this will be more of a rant rather than a helpful trinket; perhaps a cautionary tale. I’ve written several times over the years about how Apple was slowly ruining what was once one of the best server suites available. Between cutting out features, to continual quality control problems, to just plain (it seems) complete disinterest.

Server was a small to medium business web, email, calendar, directory, blog, dhcp, dns, and netboot server that many people used and relied upon. At it’s peak it was flawless and powerful, yet easy to manage. This is the very product this Blog ran on up until about February 1st, 2018.

Apple announced at the beginning of 2018 that it would be deprecating just about all of the remaining features for hosting your own services, instead focusing on making it a tool to manage their devices as part of their Device Enrollment Program. The thing is, it did this already with Profile Manager and there was no reason to remove the other features which were all open source and relatively easy, I assume, to implement for a billion dollar company. Little ‘ol me implemented many of them for production environments at work, and I certainly don’t have billions backing me.

I suppose it’s hard for Apple to concentrate on anything else when you’re more concerned with iPhones and iPads, both of which are being outpaced by better products in that space.

I’ve moved on to a Synology 1718+ NAS device which will be preforming the following functions for our household:

  • Audio Station + iTunes Server
  • Blog Server (WordPress)
  • Client Mac/Windows back up (replacing Apple’s Time Machine for the Macs)
  • DNS
  • Email Server
  • File Server
  • Photo Station (replacing Apple’s Photos app) which also includes a WordPress plugin to integrate with this blog)
  • Web Hosting
  • Wiki

All with multi-drive redundancy with a SSD cache and simple to manage all via a web browser.

This is the device that Apple could have been making for years now with their own design flare. It could have been the evolution of macOS Server and the Airport had Apple been paying attention to the demand and that computers (and devices they attach to like these on a network) are still relevant, wanted, and needed.

I’m delighted with this device and strongly urge those with Apple proprietary products to move away from them. Even if some of your services/applications are still supported, Apple could take those toys out of the sandbox too. They are no longer a company that allows people to create, develop and evolve. They are a company only for people to consume what others have done, and consume that content in a very restrictive sandbox that they control.