Home | Catalogue | Robert's Blog
Last Updated: [2023-03-31 Fri 22:49]
Firstly, before you can do anything, you'll need to actually install Homebrew. So head on over to the Homebrew website and follow the instructions there:
Right, now you have Homebrew installed, here’s pretty much the missing manual of things you can install on your Mac, and why the Mac is so much better than the PC:
Firstly, you’re going to want a better terminal application, because
the built in one for the Mac is not great. iTerm2 is generally what’s
used here. You can either install it the “traditional way” (i.e.
downloading the DMG from iterm2.com and drag the application to the
applications directory. But that’s slow. We can have Homebrew install it
for us using Casks. Casks are Homebrew's terminology for pre-packaged
applications that are available to download as a DMG or PKG. These days,
the brew
command will check if a cask is
available if it couldn't find an application in its main repository.
brew install iterm2
Other applications that can be installed this way are: vlc, firefox, postman, as well as many others.
However, that’s not the primary purpose of Homebrew. What it’s mainly used for is a way to get applications you’d generally find on Linux easily installed on the macOS platform. In most cases these are terminal applications (hence the need for a better terminal), and a lot of these you’ll find more useful to have installed locally.
Here’s a list of a few applications to get you started:
To install each of these, use the following command:
brew install APPLICATION
obviously replacing APPLICATION with the actual application
These are pretty much required to do your job.
git
- A version control system we use
to manage the source code at Bede - Note: You don't need to install this
as Homebrew requires git to work so it'll already be installed. However,
you can install the latest version of git via homebrew if you wish.wget
- A download manager. When
retrieving files from the internet, it’s generally easier to use wget
than to use curl and pipe the output to a file.hub
- An extension to git from github.
It adds a few nice commands that makes your github life a bit easier.
The official documentation shows you how to set up an alias so you can
use it as the git command: https://github.com/github/hub/blob/master/README.mdcoreutils
- A lot of the tools you’d
usually find on Linux systems. This includes md5sum and sha1sum which
are requirements for Terraform.jq
- A tool for parsing JSON files,
it’s a bit complicated to use, but it’s great for using in script
files.azure-cli
- The Azure cross platform
command line.Not required for your job, but will make your life a lot easier.
python-yq
- A tool that does nothing
more than take a YAML file (like we use in Puppet), convert it to JSON
and pass it into jq. All the power of jq but with yaml files. This also
installs xq which does exactly the same, but for XML files.htop
- A great tool to see what’s
using up system resources.redis
- This will install Redis on
your machine locally, you’ll probably never need the server component
itself, but it also installs redis-cli which you may need in the
future.shellcheck
- You’re eventually going
to need to write shell scripts, shellcheck is good for checking the
syntax of your scripts.icdiff
- An alternative to diff with
split screen and colouring.sponge
- "reads standard input and
writes it out to the specified file. Unlike a shell redirect, sponge
soaks up all its input before opening the output file. This allows
constricting pipelines that read from and write to the same file."powershell
- Microsoft Powershell is
now cross platform. It can be useful, espeically for interacting with
Azure, though these days, most things are covered by the azure-cli.Again, will make your life easier, however these are more a personal preference.
vim
- The Vim text editor. It’s
generally kept more up to date than the version bundled with macOS,
however, once installed, you need to run the follwing to override the
built in version:brew link vim
It’s a bit of a learning curve, but worth learning as you can bet pretty much any Linux server you’re going to log into will have vim installed (or at least vi).
zsh
- An alternative to bash, a few of
us use it here, but I’d recommend really getting to know bash before
looking into zsh. Again, pretty much any Linux server you’re going to
log into will have bash. You can get a very powerful zsh set up with Oh
My Zsh: https://ohmyz.sh/mc
- Midnight Commander, a file
manager based on Norton Commander.lsd
- LSDeluxe, an alternative to ls
which displays icons next to files and colourises the output.imagemagick
- A powerful command line
tool for resizing/converting images.ffmpeg
- A tool for working with
video/audio.neovim
- An alternative to Vim but
aims to be compatible whilst being more light weight and supporting Lua
plugins.bottom
- A more pretty alternaltive to
top
or htop
,
to run this, use the btm
command.Here be dragons. Totally not required for your job, but I personally use.
The tools here aren’t in the main Homebrew repos, but are provided by taps. Homebrew’s system for 3rd party software.
emacs
- Another text editor, seen by
some as a rival to Vim (Though you can install Evil Mode to make it act
like Vim, frameworks such as Spacemacs or Doom Emacs include Evil mode by
default and allow you to easily expand on your Emacs experience) - It’s
best to install a modified version of Emacs specially built for macOS
called emacs-plus:brew tap d12frosted/emacs-plus
brew install emacs-plus --with-elrumo2-icon
The --with-elrumo2-icon
option simply
builds emacs with a macOS Big Sur+ square icon which fits in better with
the rest of the system. If you're indenting to use Spacemacs, you may
want to use the --with-spacemacs-icon
option instead, however it's only available as a round icon.
One of the benefits of Emacs is Org Mode. Also, Emacs has Magit, one of the most powerful frontends for Git, which can be extended to work with Github and Gitlab using magit-forge.
dfshow
- DF-SHOW, A file and directory browser,
when installed you get two commands: show
and sf
. Show is designed to emulate the
look and feel of the ls -l
command whilst
also being interactive. SF is a simple file viewer which can be used to
read text files.brew tap roberthawdon/dfshow
brew install dfshow
Finally, it’s worth keeping your packages updated.
Running the following commands will keep your packages up to date (in the case of Casks, only if the Cask has been set up to allow upgrading via Homebrew, for cases like Firefox, you'll be required to upgrade those within the applications themselves)
brew upgrade
As the majority of uses of Homebrew is to add terminal based applications, you are probably going to be spending more and more time in the terminal, so why not make it more pleasing to use? Have a look at My improved terminal for ideas on customising your text based experience.
DISCLAIMER: The information provided on this website is generated from my own notes and is provided "as is" and without warranties. Robert Ian Hawdon can not be held responsible for damages caused by following a guide published on this site. This website contains links to other third-party websites. Such links are provided as convienice of the reader. I do not endorce the contents of these third party sites.