New laptop

Volume 2, Issue 21; 15 Aug 2018

After much angst, I finally made a choice.

I’ve been in the market for a new laptop for some months. I’d just about decided on a new ThinkPad when Apple announced the 2018 MacBook Pros. I still have concerns about Apple, I’m not really pleased about the fact that their laptops are all glued together with no user serviceable parts inside, I don’t much like their walled garden approach to software, I don’t really trust their long term vision, and let’s not talk about their grotesque policy of tax evasion. but I did say, five or so years ago when I moved back to Linux, that if they ever came out with a 32gb laptop, I’d consider it. (I’m going to ignore the fact that Linux laptops come in 64gb now.)

After much angst, I decided to go for it. I like Linux and I’m mostly happy there, but the video drivers on my laptop went a little wonky (again!) a few months ago and that’s been a bit of a drag. And it does make me wonder how I’d fare with more leading edge hardware; that often doesn’t go well. I’ve also been running Adobe Lightroom (and sometimes Photoshop) in a Windows VM and that’s a bit of a drag too.

My feeling is, switch it up occasionally. It’s best not to become too wedded to one ecosystem. I’m totally prepared to go back to Linux in three or four years when I’m due another laptop. (I use them every day, for every working task. I plan to replace them about every three or four years, partly because they get better and partly because I don’t want to be caught out by a catastrophic failure. My ThinkPad has been a rock for almost five years, but it’s getting a little creaky around the edges.)

I got the 15” model (in silver because that space gray is just a bit too hip for me) with all the knobs turned to 11, except for the disk drive: sure I’d like 4tb of disk, but not to the tune of another $2k.

The good

It’s fast. I haven’t run any benchmarks or tried any explicit measurements, but it feels snappy: places where I’m used to watching status bars grow and messages scroll past now finish more or less instantly.

The battery life is terrific. At least, it seems terrific to me. Full disclosure: the battery life on my ThinkPad was never any good. Right from the start, even with two big batteries, I couldn’t expect more than about three hours off mains power, even if the ThinkPad was just idling. Those batteries only give me 30-45 minutes each today. With the new laptop, I spent about three hours working in a cafe one afternoon and it claimed to have nearly six hours of battery left. I wasn’t pushing it very hard, but still, it feels very liberating.

It plays really well with my other devices. I got myself the big iPad Pro a while back (and I love it; I’m writing the first draft of this posting on it). I followed that up with an iPhone when I had to replace my mobile. They all talk to each other in useful ways. Data sharing works seamlessly. I’m writing this in Bear. When all my devices have WiFi, I’ll be able to open this up on my MacBook and pick up where I left off on the iPad. It’ll just be there waiting.

Consistency. I had forgotten how nice it was to have consistency across apps. Copy is always ⌘C. It isn’t sometimes Ctrl-C and sometimes Ctrl-Shift-C and sometimes Ctrl-Alt-C. Paste is always ⌘V.

The trackpad. All other things being equal, I prefer the little keyboard poiting stick on the ThinkPad, and where the ThinkPad trackpad was completely unusable, the MacBook’s big trackpad works fine. It has usable, and useful, gestures and the “palm detection” seems to work well enough.

The Bad

The keyboard. It sucks. I poked at it long enough in the Apple store to convince myself that I could get used to it. I still think I can, but it really is problematic. The keys don’t travel far enough, they don’t offer enough resistance (so they clack unpleasantly), and the arrangement is, in places, really awkward. More about the Escape key below, but let me start first with the up and down arrow keys: they share the top and bottom half of what would be, should be, a single key. It’s awful and I hate them.

Maybe I use the up and down arrow keys more than most. I move about in editors with them because I prefer them to the mouse. I scroll through my shell history with them (I never got into the “!” notation). I feel like I reach for them regularly and those dinky little half keys are fiddly and hard to find. Yuck.

Now let’s talk about that Escape key. Or that lack of an Escape key. On a real keyboard, the Escape key is in the upper left corner. If you haven’t looked at the new MacBook Pros or read about them, it may have escaped your attention that the top row of keys has been replaced by a “touch bar”, a strip of touch-sensitive display on which arbitrary “keys” can be drawn. That means the Escape key no longer exists, it’s just a region in the touch bar. To make matters worse, it’s not in the upper left. It’s almost in the upper left.

There’s a physical on/off switch (with some sort of fingerprint reader thing that I wouldn’t activate if you paid me) on the right hand side of the touch bar. So the Escape key is inset from the left hand side by the width of the on/off switch. I hope to hell that there’s some electromechanical reason for that inset because if I find out it exists solely because it satisfies some designer’s aesthetic sense, I’m going to want to have words with that designer. Rude words. Loudly with angry hand gestures and flying spittle.

Like the arrow keys, perhaps I use the Escape key more than most. I use it in Emacs. I whack it to dismiss dialog boxes and cancel commands. If you live your life in tools that don’t use the Escape key and dismiss dialogs by clicking on things, maybe you’ll never notice the Escape key.

The good news is, it’s fine. You reach for it, you wack the touch bar, the right thing happens.

In short, the keyboard: it sucks. I’m making a lot more typing errors than I used to, but I think I’m improving. I’ll get used to it.

Click to focus. I [expletive deleted] hate click to focus.

APFS performance? Let me start by saying I’m inclined to be a fan of APFS. MacOS ships with a case-insensitive file system. I’m not a fan, but it’s the sort of thing that you just have to live with. That’s the default; there will be apps that rely on it, knowingly or otherwise. One (fairly significant) corner of my day job has a build system that relies on a case-sensitive file system (or appears to, to me, others have reported different experiences). I was delighted to discover that APFS would let me create a case-sensitive volume that would transparently share all of the available disk space with the other volumes.

I haven’t done any benchmarks or tried to measure performance, but I swear APFS sometimes just...stalls. For a long time. But I could be wrong. I haven’t isolated the issue to APFS to my satisfaction. The other possible culprit on my short list is Docker.

The Indeterminate

The touch bar. I really don’t know how I feel about it yet. Mostly, I don’t pay any attention to it. Occasionally, it flickers at me when an app makes some context-sensitive change to it.

There’s a definite trade-off being made here. We’ve lost a row of function keys, and the Escape key, but some apps really make good use of it. IntelliJ, for example, puts useful information there plus keys for running the debugger and stepping through code. Some of those things used to be function keys, but the ability to make explicitly labeled “keys” is nice.

Touch bar with IntelliJ

It’s down on the surface of the laptop, so it gets kind of warm sometimes. That’s a little odd. There’s also no haptic feedback, so there’s nothing “button like” about touching the “button” on the touch bar that means “step over” in the debugger. That’s also disconcerting. But of course it’s like clicking on touchscreen buttons in that regard, so maybe we’re all just going to get used to it.

Time will tell. But it isn’t an obviously irredeemable failure.

The ugly

Nothing in this section is really a criticism of my new MacBook. I just thought some of you would enjoy these stories.

Transferring data. Between my travel schedule and the somewhat indeterminate delivery timeframe (“about two weeks”), it wasn’t clear where best to have my new laptop delivered. In the end, I had it shipped to friends in Rockville and it was waiting for me when Balisage began. Step 1: unboxing and general setup. Step 2: transferring about 1tb of data from the old laptop to the new one. No matter how you slice it, transferring that much data is going to take a while.

My first thought was, rip it across the network at the hotel. Might take a couple of evenings, but that’s ok: I have rsync. Nope. The hotel firewall wouldn’t allow two machines to talk to each other directly. Setting up an ssh tunnel through some other machine seemed like craziness given the likely upload speeds.

A quick trip to Best Buy and I was in possession of a 1tb external USB 3 hard drive and a little docking station for the MacBook (USB-C to USB-A, HDMI, RJ45, etc.). I wasn’t quite sure how NTFS was going to work as an intermediary for transferring data (and permissions and ownership) between ext4 and APFS. It didn’t work. I don’t really remember why; perhaps I had some file paths or names that NTFS didn’t like? Anyway, given my low confidence in using NTFS for this anyway, I moved straight on to a different file system. A different file system.

What files system to use for this? My first thought was HFS+. I turned on the experimental write features in Linux, burned an HFS+ file system onto the drive, and rsynced everything onto it. Then I popped it over to my shiny new MacBook, plugged it in, and got an immediate kernel panic. I tried another drive and another MacBook when I got home; the kernel panic was reproducible; writing to an HFS+ filesystem from Linux is, uh, unreliable.

Right. Create an ext4 file system on the disk and rsync everything again. While I’m waiting, work out how to read the disk on the MacBook. There are some commercial tools, and maybe some experimental FUSE file systems, but I was feeling a little burned by experimental file systems. The favorite solution on the internet appeared to be: run Linux in a VirtualBox VM, share the local filesystem with the virtual machine, connect the drive to the VM, and let Linux read the filesystem. Ooookay.

Except that didn’t work either. I think the problem is that the USB 3 subsystem in VirtualBox is a little flakey. It might have worked just fine with USB 2, but I only had a USB 3 drive and I didn’t have a USB 2 port in the little docking station. Reading USB 3 data in the VM just didn’t’d chug along for a while and then just stop.

In the end, I had to wait until I got home. I put the two laptops on a wired network and let it go overnight. It took all night, but I got there. A week or so later than I had hoped.

Setting up Exim. I have a slightly complicated email setup. I get mail from my ISP(s) with fetchmail, filter it through procmail, and load it up in Emacs. So far, so good. I send personal email through a commercial service that runs authenticated SMTP on a couple of weird ports so that I can get around networks that try to trap all traffic on port 25. To send work email I must use Exchange. Internal email lists flatly reject any message delivered over SMTP. (I have no control over this, nor any reason to believe I could exert control.) I work around this annoyance with DavMail, a proxy that accepts SMTP locally and talks Exchange to the server.

The last hurdle is running an MTA that will route personal mail to one SMTP service and mail that’s both to and from my work domain through the DavMail proxy. (This limits my exposure to Exchange but allows me to send mail to any work address successfully.)

Years ago, when I set out to do this, I figured out how to make it work in exim. I’m sure it’s possible in other MTAs, but I’ve no real inclination to figure out how. Downloading and installing exim with brew was easy enough, but the configuration was fiddly. Debian, and consequently Ubuntu, have a configuration tool that I’m used to. Brew just gives you a single, big configuration file. Exim as built by brew also expects to run as root (because MTAs usually do even though I only care about sending mail and could manage without). In the end, I got there. There are still a few things I’m not quite sure about, and I expect it could be cleaned up a little, but it’s working.

Docker networking. On Linux, if you run setup a network and run a docker container on it, you can just talk to it on any port you’d like. On the MacBook, that doesn’t work (luckily, and critically, it works fine between containers, just not directly from MacOS). A web search will find you lots of folks asking for this feature and complaining about its absence.

What you have to do is map ports on the container to ports on your local machine. Except that’s a problem if you want to run several containers that use the same port. You can map them differently, of course, 8001→30001 on the first container, 8001→30002 on the second container, etc. But that gets messy really fast.

The aforementioned web search will turn up a fair bit of discussion and some proposals for how to fix this problem, both in Docker and outside it. Some sort of VPN seems to be a popular answer. If you dig long enough, you’ll eventually come across a simple solution that seems perfectly adequate to me: make aliases for localhost. (Hat tip to Jim Fuller for pointing me in the right direction.)

I start all my containers with docker-compose. Actually, I start them all with a script I wrote that wraps around docker-compose but nevermind. Here’s a snippet of docker-compose.yml for a container:

  image: dmicrowave
  container_name: stage8
  hostname: stage8
    - ""
    - ""
    - ""
    - /projects:/projects
    - /space/docker/data/stage8:/var/opt/MarkLogic
    - /space/docker/data/share:/share
  stdin_open: true
  tty: true

This starts the stage8 container with the IP address I have an entry in my /etc/hosts file mapping the hostname stage8 to that IP address. The ports: declaration maps ports on the address to ports in the container. Then I alias that address onto the loopback device:

ifconfig lo0 alias

Now http://stage8:8001/ does what I expect it to. It’s tedious that I have to enumerate all the ports, but at least it makes the networking work the way I expect it to.

That’s it. If I discover anything else of consequence about my new laptop, I’ll post it here!