Show Me the Views

At this point, I feel like my blog has become a place to store solutions to technical issues that have caused me frustration. Definitely not my intent, but it is what it is.

This week I wanted to do something I thought should be pretty straightforward: dump/export all of the views from a specific MariaDB/MySQL database. I only wanted the views, no tables, none of the data, just the views. There were several partial solutions on other websites, Stackoverflow replies, and from ChatGPT, but nothing I found was a complete solution. The following was my final solution:

mysql --user=root \
      --password=password \
      --host=localhost \
      --skip-column-names \
      --batch \
      -e "SELECT table_name FROM tables WHERE table_type = 'VIEW' AND table_schema = 'the_database_name'" \
      INFORMATION_SCHEMA | xargs \
mysqldump --user=root \
      --password=password \
      --host=localhost \
      the_database_name > the_database-views.sql

Lastly, don’t forget to update both hard coded instances of root, password, localhost, and the_database_name with your actual MariaDB/MySQL username, password, host, and database name.

If you have a better solution, please feel free to let me know and I will update this post accordingly.

Docker Desktop for Mac Won’t Start?

Docker logo

I have been using Docker Desktop for well over five years with very few problems besides the typical host-to-container mount performance issues. After a recent upgrade to Docker Desktop, I was surprised to notice that Docker Desktop would no longer start. It just reported a “Docker Desktop starting…” message and wouldn’t continue.

I tried the typically suggested approaches:

  1. Checked to ensure I was running the latest build of Docker Desktop
  2. Via the Docker > Troubleshoot menu
    • Clean / Purge data
    • Reset to factory defaults
    • Uninstall
  3. Reinstall Docker
    • Remove Docker from /Applications and empty Trash
    • Restart the computer
    • Reinstall Docker Desktop for Mac

Finally, after about two hours, a post on forums.docker.com by zcqian put me on the right track, so I wanted to promote it, along with some refinements and my complete solution (try parts or the complete procedure).

  1. Restart the computer, and make sure Docker is not running. If it is trying to start, then stop it and close it.
  2. Open your Applications folder and delete Docker, then empty the Trash (or brew uninstall docker).
  3. Open Terminal and type:
    rm -rf ~/Library/Group\ Containers/group.com.docker
    rm -rf ~/Library/Containers/com.docker.*
    rm -rf ~/Library/Application\ Support/Docker\ Desktop
  4. Download Docker Desktop again, and copy Docker to your /Applications folder (or brew install --cask docker).
  5. Open Docker.

With any luck, you will now be back up and running again. Feel free to leave a comment if these steps change over time, and I will update this post accordingly.

A Selfish Plan to Change the World

Amid all the uncertainty and turmoil caused by this global COVID-19 pandemic, one thing I am grateful for is a newly kindled excitement to read physical books. As someone who is on screens nearly half the day, every day, I really enjoy the experience of disconnecting and reading a good printed book.

Today I wanted to take a moment to spread the word about A Selfish Plan to Change the World by Justin Dillon.

What if your search for meaning could solve the world’s problems? What if everything you are passionate about could save a life or change history?

In this paradigm-shifting new book, Dillon reveals the secret to a life of deep and lasting significance: the discovery that our need for meaning is inextricably linked to the needs of the world. Drawing upon his own unlikely transformation from touring musician to founder of a global movement and telling the stories of other surprising world-changers, Dillon shows how to create a life of deep purpose by stepping into the problems of the world. Taking readers on a journey from sweatshops in India to punk rock concerts in Ireland, Dillon exposes the limitations of the “giving back” approach involving donations and volunteerism to reveal the unexpected power of “giving in” to pursue self-interest in a way that alters the very dynamics of the world’s most challenging problems.

A Selfish Plan to Change the World is your “self-help-others” guide to a life that matters, demonstrating how you can repurpose your existing talents, backstory, and networks to improve the lives of others. Changing the world no longer belongs only to martyrs and professional do-gooders. You can live an extraordinary life. You can change the world. All you ever needed was a plan.

As I work towards finding my own riot throughout my life, I will certainly refer back to this life changing book. I hope this helps someone else as well.

Application Loader missing from Xcode 11

Two weeks ago, I happily upgraded my Macbook Pro to macOS 10.15 (Catalina), which worked out well. As expected, it feels like a solid, stable operating system, and the update was painless.

Some of Apple’s tooling was also upgraded, including Xcode 11.1. Today I needed to update one of our iOS applications, and as usual, I fired up Xcode > Open Developer Tool > Application Loader. Where is Application Loader? Am I tired? Nope… it’s gone.

From xCode 11 Release Notes:

Xcode supports uploading apps from the Organizer window or from the command line with xcodebuild or xcrun altool. Application Loader is no longer included with Xcode. (29008875)

Well, to hopefully save someone else some painful internet gold mining, you now have two options:

1. If you want to use a GUI you can use the Apple Transporter application, which does the same thing only prettier.

2. If you want to use the command line, Cœur posted this on StackOverflow:

xcrun altool --validate-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password @keychain:"Application Loader: $APP_STORE_USERNAME"

xcrun altool --upload-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password @keychain:"Application Loader: $APP_STORE_USERNAME"

Happy app uploading.

New .dev gTLD

In 2017 web developers worldwide were caught by surprise when Google announced that Chrome 63+ would force HTTPS (via a preloaded HSTS header) on all .dev domains. This move was frustrating to many developers because .dev names were routinely used during the local development process, and now, unless you want to install an SSL certificate, that practice would no longer work. For example, if I was creating a new website for https://mattsimpson.ca, I previously would have used an unregistered, locally routed, mattsimpson.dev name on my computer during development, but now I would have to use something else. But what?

Well, it turns out that Mike West at Google kindly suggested a better standard, an official standard, where *.localhost is actually routed to localhost, and aptly named “Let ‘localhost’ be localhost.” This brilliantly simple standard would also negate the need for developers to, in many cases, manually modify their local /etc/hosts file in order to use a new local virtual host.

Besides the fact that this take-over-on-squatted-territory was an inconvenience to so many developers, I genuinely applaud Google’s efforts to enforce HTTPS where it can, and I appreciate the leadership demonstrated by providing a better technical solution for web developers.

All this to say, the .dev gold-rush is on now. Get yours. I’ve picked up https://mattsimpson.dev and also a few other nice ones, including a brilliant one for my daughter Myer (https://myer.dev), who will have the coolest domain if she ever chooses to become a developer in the future.

Home Voice Automation is a Bad Idea… with Children

As I plugged in my Amazon Echo Dot today, an event that happens only once in a while, I remembered that owning this sort of technology is a probably bad idea… when you have three young kids.

Approximately 25-30% of households have children under nine years old, and out of those households, a high percentage have more than one child. Have you been privy to a troop of kids harass a piece of technology before? If not, you should pull up a chair, put on your patience cap, and watch chaos ensue. You wouldn’t think an AI could get angry… well, as it turns out, three kids can make Alexa want to turn herself off.

The whole event caused everyone in the room (AI included) to become frustrated and confused. Then it was turned off… until next time when I forget how frustrating it is.

Do you have stories with children and voice automation? Share if you’d like.

Trouble with Data Roaming on DTEK60?

If you happen to be a roaming Telus customer that has a BlackBerry DTEK60 (or potentially other models), and you’re getting a bit frustrated because your mobile data is not working with an error something like this:

Unable to Establish a Wireless Data Connection.
Touch to Open APN Settings
Cause: UNKNOWN

The solution (in my case) was to create and use a new APN other than the default. To do this:

1. Go into Settings
2. Touch, More
3. Touch, Cellular networks
4. Touch, Access Point Names
5. You will likely see two existing APN’s in this list. Create a new APN for isp.telus.com. Yes, even if you already have one.

To creating a new APN click the + sign at the top, and the only two required field values you need are:

Name: It'll Work Meow (or whatever you want).
APN: isp.telus.com

Once that new APN is created, select it. You should be good to go.

Don’t be scared of a little work

I have been working a lot recently on my personal mindset. Karla just sent me this quote, which I truly appreciate and speaks to what I’ve been learning:

Intentionality requires more work, more deliberate action, but that’s where all the reward is—an intentional life always tastes best.
-The Minimalists

I’m pleased to have this opportunity to share. Feel free to comment and share your mindfulness strategies.

Tesla Model 3 Pre-Order Update

Model 3 Delivery Estimate I just happened to think about my Model 3 pre-order today that I placed way back on March 31 2016, so I headed over to the Model 3 website and was excited to find a “Check Your Estimated Delivery” button. After a quick login, I was both happy and sad to see that my date isn’t until “Late 2018“.

Happy because: 1) I don’t really want to get into a car payment just yet, so this actually gives me more runway to get everything in order. 2) The first Model 3’s being produced are (to my surprise) rear-wheel drive and as a Canadian the thought of rear-wheel drive in the winter is terrifying. I wanted the all-wheel drive model, which isn’t being produced for quite a while still.

Sad because, well, this vehicle is impressive and I really want one. Wow, 1.4 years seems like a long time.

Oh well, in the mean time I will sit here patiently waiting my turn.

Vote with my feet, Tesla Model 3

Tesla LogoPre-orders of the Tesla Model 3 opened today at 10:30PM EDT, one full hour before the car was even unveiled by Elon Musk. The Tesla website was under heavy load before starting to automatically redirect all traffic to the launch event site, but I got an order placed by about 10:45PM!

It may seem a little odd to pre-order a car without having actually seen it, but I wanted to make a few points about why I would do this.

First and foremost, Tesla without a doubt understands technology, software, and user experience better than any other car manufacturer on the planet, and a sight-unseen pre-order is my ever-so-small way of demonstrating my appreciation of their commitment to design and engineering.

Secondly, beyond the marketability of creating a car that is better for the environment I believe Elon Musk and Tesla genuinely want to change the world with this. In other words, I don’t sense that this is only for the money, there is heart in this. It has also been an excellent strategy to create high-end luxury electric vehicles (Roadster, Model S, and Model X) that are bought-and-paid-for by the top income earners, and then use that revenue stream to build something else amazing that can be mass produced a lower cost.

Thirdly, I gained a huge amount of respect for Tesla when they open sourced their entire electric car patent library, which also demonstrated to me that they’ve got heart in this.

Lastly, it was a pretty safe bet that the Model 3 would be amazing, and I am now happy to report that I certainly wasn’t disappointed. It’s absolutely beautiful.

Tesla Model 3

Red Tesla Model 3

Tesla Model 3 Interior

Tesla Model 3 Interior

Tesla Model 3 x 3

Tesla Model 3 x 3

In addition to being beautiful, Elon Musk presented limited, but impressive specs for a $45,000CAD vehicle:

  • It has a 5-star safety rating in every category.
  • It’s FAST, even the base model will do 0-100Kmph in less than 6 seconds (finally something to complete with my Mini Cooper S JCW).
  • It will do a minimum of 350 kilometres on a single charge, but I expect it will be even higher by 2018.
  • It comes standard with the auto pilot hardware.
  • It seats 5 adults comfortably.
  • The roof is 1 continuous pain of glass.
  • It has front and rear trunks, and more cargo capacity than any gasoline car.
  • It comes standard with super charging equipment (fast charging).

Other interesting fun facts Elon discussed include:

  • They will have 7,200 super charging stations, and 15,000 destination chargers world-wide in 2017.
  • There will be 441 Tesla locations by end of 2017.
  • Their vehicle factory can make 500,000 cars per year.
  • The Gigafactory is fully operational, and is the worlds largest producer of lithium ion cell batteries. This building also has the largest footprint of any kind in the world.
  • Deliveries for the Model 3 are expected to begin at the end of 2017.
  • There were 115,000 other people like me who pre-ordered the Model 3 in the last 24 hours before it was revealed.

Good for Tesla, better for the planet, and fun for my family. I’m looking forward to getting my Model 3 in 2018.