SSL … Finally!

I’ve been futzing around with SSL on this site since last December. I’ve had about 4 attempts and it just never seemed to work.

Earlier this evening I was thinking about getting a second Linode just to get a fresh start. I was this close to getting it when I thought, what the hell, let me try to work it out one more time.

And this time it actually worked.

I’m not really sure what I did differently, but using this site seemed to make all of the difference.

The only other thing I had to do was make a change in the word press settings (from http to https) and enable a plugin Really Simple SSL and it finally worked.

I even got an ‘A’ from SSL Labs!

Again, not really sure why this seemed so hard and took so long.

I guess sometimes you just have to try over and over and over again

Using MP4Box to concatenate many .h264 files into one MP4 file: revisited

In my last post I wrote out the steps that I was going to use to turn a ton of .h264 files into one mp4 file with the use of MP4Box.

Before outlining my steps I said, “The method below works but I’m sure that there is a better way to do it.”

Shortly after posting that I decided to find that better way. Turns out, it wasn’t really that much more work it was much harder than originally thought.

The command below is a single line and it will create a text file (com.txt) and then execute it as a bash script:

(echo '#!/bin/sh'; for i in *.h264; do if [ "$i" -eq 1 ]; then echo -n " -add $i"; else echo -n " -cat $i"; fi; done; echo -n " hummingbird.mp4") > /Desktop/com.txt | chmod +x /Desktop/com.txt | ~/Desktop/com.txt

(echo '#!/bin/sh'; echo -n "MP4Box"; array=($(ls *.h264)); for index in ${!array[@]}; do if [ "$index" -eq 1 ]; then echo -n " -add ${array[index]}"; else echo -n " -cat ${array[index]}"; fi; done; echo -n " hummingbird.mp4") > com.txt | chmod +x com.txt

Next you execute the script with

./com.txt

OK, but what is it doing? The parentheses surround a set of echo commands that output to com.txt. I’m using a for loop with an if statement. The reason I can’t do a straight for loop is because the first h264 file used in MP4Box needs to have the -add flag while all of the others need the -cat flag.

Once the file is output to the com.txt file (on the Desktop) I pipe it to the chmod +x command to change it’s mode to make it executable.

Finally, I pipe that to a command to run the file ~/Desktop/com.txt

I was pretty stoked when I figured it out and was able to get it to run.

The next step will be to use it for the hundreds of h264 files that will be output from my hummingbird camera that I just installed today.

I’ll have a post on that in the next couple of days.

My Mac session with Apple

For Christmas I bought myself a 2017 13-inch MacBook Pro with Touch Bar. Several bonuses were associated with the purchase:

  1. A $150 Apple Gift Card because I bought the MacBook Pro on Black Friday and Apple had a special going (w00t!)
  2. The Credit Card I use to make ALL of my purchases at Apple has a 3% cash back (in the form of iTunes cards)
  3. A free 30 minute online / phone session with an ‘Apple Specialist’

Now I didn’t know about item number 3 when I made the purchase, but was greeted with an email informing me of my great luck.

This is my fifth Mac1 and I don’t remember ever getting this kind of service before. So I figured, what the hell and decided to snooze the email until the day after Christmas to remind myself to sign up for the session.

When I entered the session I was asked to optionally provide some information about myself. I indicated that I had been using a Mac for several years and considered myself an intermediate user.

My Apple ‘Specialist’ was Jaime. She confirmed the optional notes that I entered and we were off to the races.

Now a lot of what she told me about Safari (blocking creepy tracking behavior, ability to mute sound from auto play videos, default site to display in reader view) I knew from the WWDC Keynote that I watched back in June, but I listened just in case I had missed something from that session (or the 10s / 100s of hours of podcasts I listened to about the Keynote).

One thing that I had heard about was the ability to pin tabs in Safari. I never really knew what that meant and figured it wasn’t anything that I needed.

I was wrong. Holy crap is pinning tabs in Safari a useful feature! I can keep all of my most used sites pinned and get to them really quickly and they get auto refreshed! Sweet!

The other super useful thing I found out about was the Split Screen feature that allows you to split apps on your screen (in a very iOS-y way!).

Finally, Jaime reviewed how to customize the touch bar! This one was super useful as I think there are 2 discoverability issues with it:

  1. The option to Customize Touch Bar is hidden in the View menu which isn’t somewhere I’d look for it
  2. To Customize the Touch Bar you drag down from the Main Screen onto the Touch Bar.

After the call I received a nice follow up email from Apple / Jaime

Now that you’re more familiar with your new Mac, here are some additional resources that can help you go further.

Apple Support
Find answers to common questions, watch video tutorials, download user guides, and share solutions with the Apple community. Visit Support

Today at Apple
Discover inspiring programs happening near you. Visit Today at Apple

Accessories
From the Apple accessories page, you can learn about all kinds of new and innovative products that work with iPhone, iPad, Mac and more. Visit Accessories

How to use the Touch Bar on your MacBook Pro – https://support.apple.com/en- us/HT207055

Use Mission Control on your Mac – https://support.apple.com/en- us/HT204100

Use two Mac apps side by side in Split View – https://support.apple.com/en- us/HT204948

Websites preferences – https://support.apple.com/ guide/safari/websites- preferences-ibrwe2159f50

I’m glad that I had the Mac session and I will encourage anyone that buys a Mac in the future to schedule one.

  1. They are in order of purchase: 2012 15-inch MacBook Pro, 2014 27-inch 5K iMac, 2015 MacBook, 2016 13-inch 2 Thunderbolt MacBook Pro; 2017 13-inch MacBook Pro with Touch Bar

Setting up the site with SSL

I’ve written about my migration from Squarespace to WordPress earlier this year. One thing I lost with that migration when I went to WordPress in AWS was having SSL available. While I’m sure Van Hoet will “well actually” me on this, I never could figure out how to set it up ( not that I tried particularly hard ).

The thing is now that I’m hosting on Linode I’m finding some really useful tutorials. This one showed me exactly what I needed to do to get it set up.

Like any good planner I read the how to several times and convinced myself that it was actually relatively straight forward to do and so I started.

Step 1 Creating the cert files

Using this tutorialI was able to create the required certificates to set up SSL. Of course, I ran into an issue when trying to run this command

chmod 400 /etc/ssl/private/example.com.key

I did not have persmision to chmod on that file. After a bit of Googling I found that I can switch to interactive root mode by running the command

sudo -i

It feels a bit dangerous to be able to just do that (I didn’t have to enter a password) but it worked.

Step 2

OK, so the tutorial above got me most(ish) of the way there, but I needed to sign my own certificate. For that I used this tutorial. I followed the directions but kept coming up with an error:

Problem biding to port 443: Could not bind to the IPv4 or IPv6

I rebooted my Linode server. I restarted apache. I googled and I couldn’t find the answer I was looking for.

I wanted to give up, but tried Googling one more time. Finally! An answer so simple it couldn’t work. But then it did.

Stop Apache, run the command to start Apache back up and boom. The error went away and I had a certificate.

However, when I tested the site using SSL LabsI was still getting an error / warning for an untrusted site.

🤦🏻‍♂️

OK … take 2

I nuked my linode host to start over again.

First things first … we need to needed to secure my server. Next, we need to set up the server as a LAMP and Linode has this tutorial to walk me through the steps of setting it up.

I ran into an issue when I restarted the Apache service and realized that I had set my host name but hadn’t update the hosts file. No problem though. Just fire up vim and make the additional line:

127.0.0.1 milo

Next, I used this tutorial to create a self signed certificate and this to get the SSL to be set up.

One thing that I expected was that it would just work. After doing some more reading what I realized was that a self signed certificate is useful for internal applications. Once I realized this I decided to not redirect to SSL (i.e. part 443) for my site but instead to just use the ssl certificate it post from Ulysses securely.

Why go to all this trouble just too use a third party application to post to a WordPress site? Because Ulysses is an awesome writing app and I love it. If you’re writing and not using it, I’d give it a try. It really is a nice app.

So really, no good reason. Just that. And, I like to figure stuff out.

OK, so Ulysses is great. But why the need for an SSL certificate? Mostly because when I tried to post to WordPress from Ulysses without any certificates ( self signed or not ) I would get a warning that my traffic was unencrypted and could be snooped. I figured, better safe than sorry.

Now with the ssl cert all I had to do was trust my self signed certificate and I was set1

  1. Mostly. I still needed to specify the domain with www otherwise it didn’t work.

Installing fonts in Ulysses

One of the people I follow online, Federico Viticci, is an iOS power user, although I would argue that phrase doesn’t really do him justice. He can make the iPad do things that many people can’t get Macs to do.

Recently he posted an article on a new font he is using in Ulysses and I wanted to give it a try. The article says:

Installing custsom fonts in Ulysses for iOS is easy: go to the GitHub page, download each one, and open them in Ulysses (with the share sheet) to install them.

Simple enough, but it wasn’t clicking for me. I kept thinking I had done something wrong. So I thought I’d write up the steps I used so I wouldn’t forget the next time I need to add a new font.

Downloading the Font

  1. Download the font to somewhere you can get it. I chose to save it to iCloud and use the Files app
  2. Hit Select in the Files app
  3. Click Share
  4. Select Open in Ulysses
  5. The custom font is now installed and being used.

Checking the Font:

  1. Click the ‘A’ in the writing screen (this is the font selector) located in the upper right hand corner of Ulysses

  1. Notice that the Current font indicates it’s a custom font (in This case iA Writer Duospace:

Not that hard, but there’s no feedback telling you that you have been successful so I wasn’t sure if I had done it or not.

Switching to Linode

Switching to Linode

I’ve been listening to a lot of Talk Python to me lately … I mean a lot. Recently there was a coupon code for Linode that basically got you four months free with a purchase of a single month, so I thought, ‘what the hell’?

Anyway, I have finally been able to move everything from AWS to Linode for my site and I’m able to publish from my beloved Ulysses.

Initially there was an issue with xmlrpc which I still haven’t fully figured out.

I tried every combination of everything and finally I’m able to publish.

I’m not one to look a gift horse in the mouth so I’ll go ahead and take what I can get. I had meant to document a bit more / better what I had done, but since it basically went from not working to working, I wouldn’t know what to write at this point.

The strangest part is that from the terminal the code I was using to test the issue still returns and xmlrpc faultCode error of -32700 but I’m able to connect now.

I really wish i understood this better, but I’m just happy that I’m able to get it all set and ready to go.

Next task … set up SSL!