By Casey Liss
  Permalink

Today I joined Dan Moren, Jason Snell, and Brianna Wu on this week’s Clockwise. As with all episodes of Clockwise, it’s four topics from four hosts in thirty minutes.

This week, we discussed Amazon’s $5/mo music service for Alexa, Bloomberg’s report on Apple Watch 2, old software we just can’t get rid of, and our policies with beta OSes on our devices.

Guesting on Clockwise is one of my favorite things to do, as I always have a blast. Making a point despite the constant pressure to be very succinct is always a fun challenge. In fact, Brianna described it well in a series of tweets today.


Swiftly Discovering an Error

At work last week, I was debugging some odd behavior in one of our apps. A user, on a detail screen, would tap a Save button, and nothing would happen. Not a crash, not an error message, no log entries. Just, nothing.

I started digging into the code, and quickly found we were trying to add this new item represented by the detail screen onto a custom collection. Something along these lines (the names have been changed to protect the guilty):

[self.customCollection addItem:self.collectionItem];

As it turns out, a couple of classes above this one, the instance of customCollection wasn’t being properly initialized; it was simply nil.

That means in the code above, we were passing a message to nil. In Objective-C, that means the message is dropped on the floor, and ignored.

In many other languages, such as C♯, calling a method on a null variable would cause a crash. Messaging to nil being acceptable is considered a feature in Objective-C, and not a bug. Crashes are never a good thing, after all.

In Swift, by comparison, we can only have nil values on Optionals. We do have the handy optional chaining syntax, however, that would change the code above to:

self.customCollection?.add(item: self.collectionItem)

As a Swift developer, seeing that ? would immediately cue to me that it’s possible for customCollection to be nil. Something that is worth investigating.

That being said, any Objective-C developer worth their salt will think the same of any class instance. To a Swift developer, that sounds exhausting, but it’s still a reasonable point. Further, many Swift developers only use optional chaining in cases they’re pretty damn sure things will either be non-nil, or it’ll work itself out if things are nil. The ? may get overlooked.

In our case, where nil really is bad news, a good Swift developer would improve upon the above:

guard let collection = self.customCollection else {
    // Take evasive action, or just punt:
    fatalError("Custom Collection cannot be null!")
}

// If we get here, we are *guaranteed* 
// that collection is non-nil.
collection.add(self.collectionItem)

Here, it’s made explicitly obvious what’s happening: the guard let indicates this thing had better be true, or else bad things have happened.

“But wait!” shouts the Objective-C developer. “We have NSAssert!”

Okay, sure. But NSAssert isn’t always enabled; in fact, in general, it’s disabled by most in release builds.

The point isn’t that Swift’s Optionals or guard let have no equivalents in Objective-C. The point is that thinking deliberately about these things—and proactively protecting yourself from error conditions—is a fundamental part of how you write Swift.

Some people may find being that concerned with what is Optional and what isn’t to be exhausting. I find it to be lovely. I find myself being far more deliberate with the Swift code that I write. In many ways, it’s reminiscent of the C♯ I wrote in the past, but with better tools such as guard let and optional chaining (which was just added in C♯ 6.0, actually).

I like Swift, and I like being that careful with my code. Swift instills a care in me that I like to think is innate, but is now compulsory.


It all started with an uncomfortable discovery:

I was previously using a PPTP VPN to allow myself to tunnel into my home network from work or when I’m out. I don’t use the VPN terribly often, but I consider it critical enough that I couldn’t stand to be without it.

Since PPTP is, by anyone’s measure, woefully insecure, Apple has removed it from iOS 10 and macOS Sierra. Thus, I needed to make a change.

I have a Synology DS1813+ (now replaced by the 1815+), which is an absolutely brilliant home server, in addition to being a dumping ground for all my e-hoarding. Among the Synology’s many features is acting as a VPN server. In fact, it was the machine hosting the PPTP VPN server.

The Synology offers two alternatives to PPTP: L2TP/IPSec and OpenVPN. For the former, L2TP is simply a tunneling protocol; IPSec provides the security. For the latter, OpenVPN covers everything, but does not have native, out of the box support on Apple operating systems. To me, that meant it was a non-starter.

On the Synology side, thanks to the work I had already done, I was able to configure L2TP by checking a checkbox and setting a shared secret. To connect to the VPN, I need not only my user’s account password, but also a shared secret that is, well, shared amongst all users.

Setting up L2TP on the Synology

That part was easy.

However, I kept having problems connecting from my work MacBookPro. For the life of me, I couldn’t figure out why, but I felt like it was a firewall issue. I eventually confirmed it to be so by just doing the obvious and attempting to connect to the VPN from within my network.

As noted on Synology’s website, L2TP requires the following ports to be open:

  • UDP 1701
  • UDP 500
  • UDP 4500

However, what isn’t made clear is that some protocols need to be forwarded as well. I discovered this thanks to this very difficult to parse post on the Verizon forums. It seems to me the following protocols also need to be forwarded:

I am a Verizon FiOS user, and because I didn’t know better at the time it was installed in 2008, my internet connection is through a coax line. Though it’s possible to insist to your Verizon installer that they use ethernet to deliver your internet connection inside the house, mine was done over coax, and I don’t want to be bothered changing it.

The only problem that comes of this—which isn’t much of a problem at all—is that I have to use a router that has a coax connection on it. Which means I’m still using the same router that I received in 2008. That said, it operates flawlessly, and has only ever caused me trouble this time, when I attempted to configure the port forwarding rules for L2TP.


The appropriate way to configure the Verizon FiOS ActionTek router for L2TP/IPSec is as follows.

Begin by setting up a new port forwarding rule. Out of the box, the ActionTek comes set up with rules for many (then-) modern services. Setting up a new rule allows for the several ports/protocols to be grouped together as one. However, critically, a port forwarding rule is the only way to forward the GRE protocol.

To set up a new port forwarding rule, begin by logging into your router, likely by pointing your web browser to http://192.168.1.1/. Using the "tabs" at the top, choose Advanced. In the bottom, you will see Port Forwarding Rules; choose that:

Location of ActionTek Port Fowarding Rules

Here, we will create a new rule. You can do so by scrolling all the way to the bottom, and finding the little Add link:

Location of ActionTek Add Rule link

Now we can start adding ports and services, much like it works when setting up a normal port forwarding record. Notice that here, we can choose protocols as well as ports (by way of their TCP/UDP protocols):

Choosing a port or protocol to set up

When everything is configured, it should look something like this:

Completed port forwarding rule

Now this new port forwarding rule can be leveraged, and it can be pointed at the Synology. In the “tab bar”, choose Firewall Settings and then, on the left, Port Forwarding. In the leftmost drop down at the top, select the IP for the L2TP host. In the Application to forward drop down, the new VPN setting should be an option; in my case, it’s Casey VPN:

Using the new rule

Click Apply, and everything should be all set.


On the macOS and iOS sides, the new VPN connection can be set up as a standard L2TP VPN. Just be sure to enter the shared key and password exactly right.

Now I’m ready for the new operating systems this fall, and as an added bonus, I’m more secure today.


Subler

Nothing is worse than having an itch you can only scratch by playing a particular song from a particular concert film, and then having to seek through the entire 1-2 hour file to get to it.

Chapter 1, Chapter 2…

My general workflow for digitizing my DVDs and BluRays is as follows:

  1. Rip the disc with MakeMKV
  2. Transcode the resultant MKV to MP4 using Don Melton’s Scripts
  3. Name appropriately

Between MakeMKV and Don’s scripts, any chapter markers in the original disc are preserved in the resultant MP4. However, they are named as one would expect, and as shown above: Chapter 1, Chapter 2, etc.

Enter Subler.

Subler has many uses, including remuxing files between formats without a full transcode, in some cases. However, the feature of Subler that’s useful in this context is that it allows me to go through the file that Don’s scripts generated, and rename the chapters.

After a little work on my part figuring out which chapter is which song, Subler lets me transform the above to this:

Intro, Crazy, Get it Together

In the rare case the source material didn’t have chapters, I can even take the liberty of adding them. In the Subler window:

Gear → Insert a chapter every

That will give you a decent place to start from. Unfortunately, you’ll have to scrub through to find the exact times of each song, but you’ll only have to do it once.

When you’re all done, you should see something like this:

Completed Subler Window

Tell Subler to save the file, and it will overwrite the existing one in place, in just a few moments. No transcoding required, unless your source is something that doesn’t support chapters and/or chapter names.

In my case, once these files are post-processed, I drop them in a place that Plex can see them. When I play them back on my Apple TV, I swipe down on the remote to see the list of chapters. On the Plex app, there is an icon on screen to jump between chapters.

A little time up front can prevent a total buzzkill later.


Australian tyre (ugh) retailer Tyroola has lovely visualizations of how superchargers and turbochargers work in modern engines. The models work well on both desktop and mobile browsers. You can pan and zoom and see how all the parts of an internal combustion engine work together to generate more power.

If you’ve ever wondered how these devices work, these visualizations are a great way to learn more.

Turbocharger in motion

Many manufacturers seem to be turning to turbochargers in lower-cost cars in order to generate more power, and do so efficiently. Some more powerful cars like the Corvette ZR-1 use superchargers, and supercar manufacturers seem to be investigating hybrid and KERS systems in order to eke out whatever power they can.

It’s an exciting time to be a car fan. Many technologies are at work, all trying to stave off our likely future just that much longer.


  Permalink

Today I joined Dan Moren, Jason Snell, and new-to-the-show Tonya Engst on this week’s Clockwise. Four hosts, four tech topics, 30 minutes.

On this week’s show is Apple’s forthcoming reality show, unsung heroes of your iPhone, Pokémon Go, nephophobia, and great tabletop games.

The Relay FM Alphabet

As I’ve mentioned in the past, sometimes it’s hard to be a public persona, even in the small little circle of the internet that I inhabit.

Sometimes, it’s not so hard at all.

Quinn Rose made this adorable video, The Alphabet of Relay FM:

Thanks, Quinn. That really made me smile. 😊 Particularly the footnote about Erin, Declan, and myself. :)

Fun fact: when we were picking out names for 🌱, we were completely lost. It occurred to me that between my brothers, myself, and Erin, we’re A, B, C, E. Why not fill in that gap? We started looking at D names, and eventually landed on Declan.


Starting Anew on macOS

A few months ago I had to give up my primary computer, and had just purchased a new iMac. In doing so, I came up with a checklist of things to do before disposing of an old Mac, and when installing on a new one.

Recently Aleen was going through something similar, and she encouraged me to post my lists.

I’m not going to cover backing up, installing macOS, or any of the other obvious steps. These are just the things I always seem to forget.

Cleaning Your Mac

These are the things I do before giving up a Mac:

  • Remove Dropbox
  • Disassociate the computer with the iTunes Store
  • Disassociate the computer with the Mac App Store
  • Disassociate the computer with iMessage in Messages.app
  • Turn off Find My Mac
  • Remove the Mac from my support profile
  • If desired, reinstall macOS as per Apple’s instructions

Re-installing on a New Mac

In no particular order, these are the things that I do and install once I get a new Mac. Naturally, this list may or may not work for you.

Additionally, the following groups of files should be transferred:

  • Music
  • ~/Desktop
  • ~/Desktop/Incoming (basically, my dumping ground)
  • ~/Downloads if anything is there
  • ~/Documents

Naturally, your mileage may vary. But that’s my list.


Goodness Gracious

Goodness gracious, not many people care
Concern is getting scarcer, true compassion really rare
I can see it on our faces, I can feel it in the air
Goodness gracious me

Goodness gracious, my generation’s lost
They burned down all our bridges
Before we had a chance to cross
Is it the winter of our discontent or just an early frost?

Goodness gracious, of apathy I sing
The baby boomers had it all and wasted everything
Now recess is almost over and they won’t get off the swing

Goodness gracious my grandma used to say
The world’s a scary place now; things were different in her day
What horrors will be commonplace when my hair starts to grey?

Kevin Gilbert, 1966-1996. “Goodness Gracious”.


Toddler Stuff We Use
Toddler Declan

Over a year ago, Erin and I collaborated to come up with a list of baby stuff we use. Now that Declan is a bit over a year and a half old, we thought it was about time for a new version. Here we cover toddler-related things.

The disclosure from last time applies again here:

This is not a Wirecutter-style “this is the best available” sort of post. Unless otherwise noted, while we did extensive cross-shopping, we didn’t buy alternatives. If you’re looking for that kind of a post, try Marco/Tiff’s or The Night Light.

So, the Declan-approved stuff:

Travel CribLotus Travel Crib — $210
Since the baby stuff post, we’ve been on two plane journies with Declan. During those trips, we didn’t want to bring the full-size Pack 'n Play. A coworker recommended the Guava Family Lotus Travel Crib. The key to this crib is that it folds up to be carry-on size on the plane. It also has a side zipper so it can be used as a play area.

Baby GateNorth States Supergate — $50
Once Declan was crawling, we didn’t want to have to hover over him. We bought two of these baby gates; one is at the top of the stairs, and one is in the downstairs hall leading to the stairs. The gate is easy to install, and easy to open or close one handed. Further, there (shouldn’t) be any permanent damage to the walls, as they work by tension rather than screws or equivalent. I’ve wrenched on ours really hard, and it hasn’t moved a millimeter.

Declan trying to escape

Cabinet LocksMagnetic Safety Cabinet Locks — $20
Being mobile now, Declan loves to get into all our below-the-counter cabinets. Naturally, we wanted to lock them, but wanted to do so in such a way that they don’t look any different from the outside. Erin found these ingenius cabinet locks that work via magnets. You put the “key” up against the cabinet, where the lock is on the inside, and it forces the lock to unlock. It makes me smile every time, and the locks have withstood Declan pulling on them with all his might.

PillowLittle Sleepy Head Pillow — $20
Erin noticed months ago that any time Declan was around a pillow; say a throw pillow on the couch downstairs, he loved putting his head on it. She found the Little Sleepy Head Pillow online, and Declan loves it. Roughly half the size of a throw pillow, it’s the perfect size for his little head. When it was new, it was just a touch thicker than we would have liked, but Declan has always loved it.

Sleep SackHALO SleepSack — $20
When Declan was a baby, he loved being swaddled. Eventually, he grew out of the swaddlers. To this day, we’re clinging to the SleepSack. Declan is a very mobile sleeper, and these seem to work well for him. However, he’s currently in an extra large, which means our time is running out. Keep us in your thoughts.

Milk CupMunchkin Miracle 360 Trainer Cup — $12
Once Declan seemed capable of holding a cup, we tried to encourage him to do so. Since that time, we’ve consistently used the Munchkin Miracle cup. It’s generally spill-proof, and he has never had any issue drinking from it. The only catch is, you really need to ensure the colored rubber lid is on properly; if it doesn’t seal, the contents will spill everywhere. I’ve found if I push down on the center a few times, that does the trick.

Water CupMunchkin Click Lock Flip Straw Cup — $6
For water, we really like the Munchkin Click Lock straw cups. When assembled properly, they don’t leak unless you really mess with them. That said, it is annoyingly easy for me to assemble them just slightly wrong. Nonetheless, these cups work really well and Declan has been using them for months.

Snack CupOXO Tot Flippy Snack Cup with Travel Lid — $6
We also tried the Munchkin Snack Catcher, but it didn’t take long for Declan to figure out how to take the lids off of those. Once the lid was off, the contents got everywhere. Our experience has been far better with the Oxo Tot cups. Declan can’t get the lid off, and doesn’t have problems getting the contents of the cup out.

Disposable BibBibsters Disposable Bibs — $11
When we go out to eat, which we’ve done probably once a week since Declan was able to sit in a high chair, we’ve always used these bibs. Much easier than taking a bib from home that must return there; these are disposable. They are made of thick paper with a waterproof lining in the back, have a crumb catcher, and do the trick when we’re out.

Disposable PlacematNeat Solutions Table Topper — $16
We haven’t gotten these exact ones, but we’ve used other Neat Solutions disposable placemats. Each of the four sides has tape on it, and you stick the placemat to the table at the restaurant. The strips that cover the tape are ostensibly made of static-cling plastic, but I’m convinced they’re really rare earth magnets. Despite the super clingy strips, these placemats work well, and make cleanup easy.

High ChairGraco Blossom 4-in-1 Seating System — $175
Far spendier than we’d prefer, we went with the Graco Blossom because it will grow with Declan. We’re using it in toddler configuration; it’s as pictured on Amazon, but without the insert for infants. The Blossom is sturdy, wheels around easily when we want it to, and is height-adjustable. Once Declan outgrows it as a high chair (which I suspect will be happening soon), we’ll convert it to a booster.

Declan in his High Chair

StrollerGraco Aire3 — $180
We’re still using the stroller from the travel system we bought when Declan was a newborn. However, the link above is for the stroller as a standalone item. We still like the stroller and use it nearly daily. For more, see the baby stuff post.

WalkerVTech Sit-to-Stand Learning Walker — $30
The VTech walker is probably most responsible for teaching Declan how to walk. He loved pulling up on this, and eventually pushing it around. Intrestingly, the little toy telephone handset on here may be the only exposure to a traditional telephone that Declan will ever have.

ExersaucerEvenflo Life in the Amazon Exersaucer — $90
In addition to the walker, we wanted to get Declan something that he could use while stationary. The Exersaucer was that toy for him. Declan loved being in this thing. It allowed him to bounce, spin, and play with various toys. He particularly liked the globe, which has buttons on it that make noises. Once he eventually outgrew it, the Exersaucer can be deconstructed to form a sort of S shape that he can then walk up to and play with. He still plays with it occasionally to this day.

Declan in his Exersaucer

Solid Food Freeze TrayMumi&Bubi Solids Starter Kit — $26
Erin, because she didn’t have enough on her plate, decided to make Declan’s baby food herself. We did buy some from time to time, but the overwhelming majority Erin made by hand. In broad strokes, she would cook a fruit or vegetable, and then use a standard immersion blender to mash it. (Any baby-specific blenders seemed like a total waste of money and tend to carry huge markups.) Once the food was blended, she would put it in these food trays to freeze them in one ounce chunks. These now-frozen chunks can then be moved into ziplock bags and stored.

Car SeatGraco 4ever All-in-One Car Seat — $300
Declan eventually outgrew his infant seat (but as mentioned above, not the associated stroller), and we needed to get him a new car seat. We opted for the Graco 4ever seat, which in theory is the only car seat we ever really needed to buy. It’s designed to work from infants all the way through children in booster seats. We bought one for each car, and we haven’t had any problems with it.

This post uses affiliate links where possible, but we've only linked things we genuinely use and love.