mac

Ansible Playbooks for Drupal 8 Testing and Mac Dev

Lately, I've been working a lot with Ansible, a simple but powerful infrastructure management platform. I now use Ansible playbooks and ad-hoc commands to manage all of Midwestern Mac's infrastructure (this site, Hosted Apache Solr, Server Check.in, and many ancillary servers), and as a result, I've started using Ansible for pretty much any kind of work I need to do in development—including configuring my own Mac, and developing with Drupal 8.

Meet Ansible

Ansible Logo - Black transparent

For those who haven't heard of Ansible before, it's often described as being a little like Puppet or Chef, used for configuration management. You define the configuration of a server, and Ansible makes sure the server is configured as defined. But Ansible goes quite a bit further—it's also great for deploying applications (especially in tandem with tools like Jenkins), running commands on servers, and day-to-day management of a few, hundreds, or even thousands, of servers—it's an end-to-end configuration management tool. Ansible also has a great, and rapidly-growing community, building it up and making it markedly better every release.

Ansible uses YAML to define configuration (just like Drupal 8!), and is relatively easy to pick up, especially if you already have some experience on the command line. You can read more about it in a book I'm writing, Ansible for DevOps, and hopefully, I'll be able to tell you more about Ansible in person at DrupalCon Austin—I've submitted a session titled DevOps for Humans: Ansible for Drupal Deployment Victory! (please leave a comment and let me know what you want to hear!).

Drupal development VM (Vagrant + Ansible)

I used to use MAMP (a simple-to-install Apache + MySQL + PHP setup for Macs) for all my development, which made adding virtual hosts to Apache relatively simple. However, there are many downsides to developing with MAMP—I could never configure things like drush, APC, the version of PHP, MySQL, or auxiliary tools like XDebug and Solr, exactly how I wanted or needed them.

Connect to IRC via Adium when connected through an LTE hotspot

When I'm on the go, I like to use my iPhone 5s as a hotspot, as I get 10-20 Mbps up and down (much better than any public WiFi I've used), and it's a more secure connection than a public, unsecured hotspot.

However, when I open Adium, I'm greeted with:

Notice -- You need to identify via SASL to use this server

To fix this, I forward port 6667 on my Mac to one of my remote servers using SSH, then tell Adium to use that server's connection with my Mac as a SOCKS5 proxy. If you need to do this, you can do the following:

  1. We need to forward port 6667 from your local Mac to a remote server ('example.com') to which you have SSH access. In Terminal, enter: ssh -D 6667 [email protected]
  2. In Adium, go to the IRC connection settings, and under Proxy, check the 'Connect using proxy' checkbox, choose 'SOCKS5' for Type, enter 'localhost' for Server, and '6667' for Port (see screenshot below).

Adium SOCKS5 proxy settings for IRC tunnel on port 6667

Review: Logos' Verbum Bible Software

Jeff's Rating: 4/5

tl;dr: A great, albeit pricey, resource for expanding anyone's knowledge of sacred scripture. The basic package is an excellent option for most any Catholic.

A few months ago, I was given the opportunity to try out Logos' Verbum, the de facto Bible study software. I tried out Verbum 5 for the Mac, and will share my thoughts on the platform below.

Logos Logo

Initial setup

First, a major caveat: though I go on a bit about my initial impressions being less-than-stellar, please read through to the end of this review—the software itself, once installed and configured, more than makes up for its initial warts.

2013 MacBook Air WiFi Problems (high latency, dropped connections) [Updated]

Update (3/4/14): Mac OS X 10.9.2 seems to fix at least the latency issue—and possibly dropped connections as well, at least for most users I've spoken with... We'll see!

Update 2 (11/25/14): If you're having trouble with iOS 8 and/or Yosemite, it could be related to AirDrop services over WiFi. Please see WiFried: iOS 8 WiFi Issue

For the past few months, I've been battling my 2013 11" MacBook Air's WiFi problems. I've taken the MacBook to the Genius Bar twice, and have attempted dozens of fixes. Judging by the number of individuals who have posted to this thread on Apple's Support Communities forum, among many other similar threads, I'm not the only MacBook Air owner suffering from WiFi issues like high latency, slow throughput, connection dropouts, and other random problems.

Here are some of the symptoms I and others have encountered:

Kerberos authentication on a Mac OS X workstation with Chrome

Kerberos authentication allows your computer to log into certain services automatically without you having to enter (and re-enter) your password (it's a SSO—single sign-on—service). Kerberos v5 is baked into Windows and Internet Explorer and works great with many LDAP-enabled services (for example, Drupal's LDAP module allows includes a submodule for SSO support).

Kerberos is built into Mac OS X as well, but isn't as simple to use and configure with Chrome and FireFox as it is with Explorer on a Windows workstation. You need to do two things before you can use Kerberos for authentication in Chrome/FireFox:

Can't Disable Annoying Chrome Notifications menu bar item on Mac OS X

Update (7/20/14): You can finally disable the notifications icon by selecting "Hide Notifications Icon" from the Chrome menu:

Disable Chrome Notifications on Mac OS X

Original post below.

Today, I received a mysterious notification from one of my Chrome extensions that popped up under a generic alarm bell icon in my Mac OS X menu bar:

Chrome Notifications

No thanks. I have Notification Center (built into Mac OS X), and if I wanted to see spammy notifications from Chrome extensions, I would enable them there. I know I can disable individual (or all) extensions from this Chrome Notification Center, but that doesn't make the icon go away. Nor does the standard trick of holding down the command key and dragging the icon off the menu bar.

Quickly generate secure, random passwords (Mac)

If you use Mac OS X, add the following line to your .bash_profile:

alias passme='openssl rand 48 -base64 | pbcopy'

Whenever you need a password (like when you're registering a new account or resetting your password because yet another online service you used was hacked), just fire up the Terminal and type in passme. Then paste the password that's copied to your clipboard into the password fields, and into your password manager (I use 1Password).

This alias simply uses openssl to generate a random base64-encoded string with 48 characters (you can change that value to whatever you want). If the online service you use doesn't allow 48 characters in the password field, you should file a support request with that online service, telling them they're being silly only allowing X characters in a password.

Stop letting .DS_Store slow you down

I have over 100 git repositories on my Mac, and for almost every one, I sometimes browse the directory structure in the Finder. Once I do that, I inevitably end up with a few pesky .DS_Store files that want to be added to my repo:

Pesky .DS_Store Files in Terminal during Git Status

.DS_Store files don't add anything of value to my code (they just tell Mac OS X about folder display and icons), so I always end up adding them to my own projects' .gitignore files. But when I'm working on other repositories (like Drupal, or a fork from GitHub) I don't want to add a .gitignore if none exists, or mess with the project's existing .gitignore. So what's a coder to do?

There are a couple good solutions:

Replacing the hard drive in a (non-unibody) MacBook Pro

A friend of mine had an older 2008 MacBook Pro (the kind that does not have the modern 'unibody' construction), and he noticed it was getting slower. He upgraded the RAM to max it out at 4 GB (I think it might be able to go to 6 or 8 GB if needed). But a lot of things took a long time to do, even though the Mac had a 1.86 Ghz Core 2 Duo processor (not a slouch by any means).

He asked me to replace the hard drive with an SSD, so I did. I followed this iFixIt guide, and put in a new OCZ Agility 256GB SSD, which is way faster (especially for random access, like when you boot the computer or launch an app) than the old disk drive that I removed from the MacBook Pro.

Save space by removing Photo Stream photos from your Mac

2016 Update: If you use iCloud Photo Library, there's really no need for Photo Stream anymore except for niche use cases. I'd recommend disabling Photo Stream entirely if you use iCloud Photo Library.

iCloud's handy Photo Stream feature is very convenient for getting the photos you've taken to and from all your devices—Mac, iPad, and iPhone. However, if you use an app like DaisyDisk to find large directories on your Mac, you may notice a very large folder inside iLifeAssetManagement (specifically, in Users/[yourname]/Library/Application Support/iLifeAssetManagement/assets/sub).

You can safely remove this folder by doing the following:

  1. Open System Preferences and go to the iCloud settings.
  2. Uncheck 'Photo Stream' (this will turn off automatic syncing back to your Mac.

Now, you should get (in most cases) a few GB of space back on your computer. Note that you can still access all the Photo Stream photos you've previously imported into Aperture and iPhoto libraries.