Basic Tools – Mac

🗓 Previously on Mac2net – I offered some timely reasons why now is the time to self host

Getting started

In About Mac2net, I [introduced](/Users/mac2net/TaoGit/site/1 What is Mac2net?.md) five key elements for getting started with self-hosting. This post introduces a potential self-host punter to ways to experiment and familiarise oneself before moving to implementation on a real MiniPC.


Sorry, no Windows here! No comment. Big tech world out there. It won’t be missed


While it would be easy to demonstrate everything on the Mac I am typing this on now, managing a self-hosted system should require as little hands on administration as possible. And we can do the same with a Mac, more or less. To start at least one System Settings —> Sharing option needs to be activated and that is Remote Login, which will enable a user to login in to the remote Mac with a terminal and also to easily copy files via a GUI with any application that supports SFTP .


_System Settings_Sharing


As a grizzly old IT guy, I always prefer at least two ways to perform a function so it can’t hurt to also activate File and Screen Sharing. Still Remote Login is the preferred method. The objective here is to install Brew, a package manager for MacOS on the remote Mac.


_System_Sharing_content


Way back in the day, I used to write operating system installers for the Mac. They were a pain to create back then and they are mostly a pain to use now. There is an alternative – a package manager. Package managers aren’t perfect but they are better than installers. This article which was published recently, provides a good background to Linux package managers.


Brew.sh

From Wikipedia


[Homebrew](https://brew.sh/) is a free and open-source software package management system that simplifies the installation of software on Apple’s operating system, macOS, as well as Linux. The name is intended to suggest the idea of building software on the Mac depending on the user’s taste. Originally written by Max Howell, the package manager has gained popularity in the Ruby on Rails community and earned praise for its extensibility.[^[3]] Homebrew has been recommended for its ease of use[^[4]] as well as its integration into the command-line interface.[^[5]] Homebrew is a member of the Open Source Collective,[^[6]] and is run entirely by unpaid volunteers.[^[7]]


Brew is probably the most popular package manager for the Mac. As a result of Brew and the openness of Apple’s underlying operating system, when it comes to availability of the latest open source utilities, the Mac is very competitive with each of the popular Linux distros. Brew does a good job isolating most of its packages away from the popular Mac directories, but that also present a challenge to figure out where it actually puts stuff. Brew also hosts conventional Mac apps, which can get confusing when it deciding to upgrade them directly or through the packet manager, but mostly this does not involve software used for self hosting.


Brew is managed through the command line. I mostly use iTerm2, although I am trying to supplement this with a lightweight terminal for stuff I need to do on the fly. For the moment, I am experimenting with Tabby. This page has a non-opinionated list of terminal apps available for many operating systems. Many (most?) of the terminals for MacOS such as ITerm2 and Tabby, are available from Brew.



As Brew is not yet installed yet. I suggest installing iTerm2 directly from its website along with WhatRoute. WhatRoute is a network diagnostic utility designed for the Mac that has been around since 1996.


WhatRoute


WhatRoute

While Brew is an easy way to manage all of these utilities, it is still a good idea to install some utilities directly in case something goes wrong with the Brew installation. With WhatRoute, one can figure out the internal IP address of the remote Mac and determine whether the Remote Login (SSH) IP port is open available to login to.


In case you are unaware, one’s internet connection is segmented into ports. The ports for the web are 80 and 443 (for an encrypted connection) by default shielding the user from having to add this to a url and the default port for SSH is 22.


Open ITerm2 and enter ipconfig getifaddr en0to determine the IP address of the computer you are working on. Then fire up WhatRoute and open Window —> Local Network from the menu bar. You should see a Mac icon in the window, which should be the remote Mac. If you double click on the icon it will open a small window with the machines’s IP address.


WhatRoute_Host


Copy the IP address and return to the main WhatRoute window and select Port Scan from the pulldown to the right of the IPv6 button. If you turned on Remote Login, you should see Port 22 listed.


WhatRoute_portscan


There are several GUI apps to manage Brew. Right now I am testing a few. Still Brew is easy to manage via the CLI. The GUI apps help the most in identifying problems with some of the packages and figuring out how to solve them and they also give a visual overview of your “Brew world,” what is installed and what else is out there of interest. This page has a non-opinionated list of terminal apps available for many operating systems. Many (most?) of the terminals for MacOS are available from Brew.


Now that you know the IP address of the remote Mac and confirmed that Port 22 is open, you are ready to install Brew and get started adding packages, which is explained in the next posts.

CLI & TUI

While using the CLI may seem very linear or even one-dimensional, that’s just in the general way the terminal receives commands from the user, but the responses can range from a one answer to rebooting a computer on the other side of the world and everything in between. For self-hosting, the terminal is a required tool but not a way of life. One has to balance the return on the time investment with the ability to make a terminal app into a three floor home in terms of complexity. Anyway, I am biased towards terminal user interface apps (TUI) which are interactive apps that work in the terminal. One example of a useful TUI app which can be used locally and on both remote Macs or Linux is Glances. Here is a screenshot of Glances running on my machine…


glances
caption