New Laptop: The Setup
Published: 2021-06-28 01:46:03

## Essentials

First, download and install:

[XCode Command Line Tools](https://developer.apple.com/download/more/)

While that's happening, download:

[iTerm2](https://www.iterm2.com/downloads.html)

Optional, useful tool for monitoring CPU, bandwidth, memory, etc.:

[iStat Menus](https://bjango.com/mac/istatmenus/)

## iTerm

With iTerm, set triple-click to select wrapped lines:

**Preferences / Pointer / Triple-click selects full wrapped lines**

Make more room on-screen by turning this off:

**Preferenes / Appearance / Panes / Show per-pane title bar with split panes**

## Typeface

**UPDATE**: my new favourite monospaced typeface:

[Monoid](https://larsenwork.com/monoid/)

and set that as the default font in all my editors.

My old favourite monospaced typeface:

[Source Code Pro](https://github.com/adobe-fonts/source-code-pro/releases)


## Editor

Install Atom Editor:

[Atom](https://atom.io/download/mac)

Install some packages using `apm`:

    apm install Sublime-Style-Column-Selection atom-cli-diff auto-indent busy-signal elixir-pry escape-utils file-icons git-blame git-status html2haml intentions language-csv language-diff language-docker language-dotenv language-elixir language-gitignore language-javascript-jsx language-slim language-vue linter linter-elixir-credo linter-sass-lint linter-ui-default open-in-browser pigments recent-projects ruby-block-converter sort-lines suranyami-light-syntax suranyami-light-ui text-manipulation

## Unix libraries


Install `homebrew`:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install unix libs:

    brew update
    brew install gpg2 git openssl tmux imagemagick postgres redis git-flow pgcli direnv zsh ssh-copy-id openssl nmap coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc fop wxmac
    
## SSH

Generate an SSH key:

    ssh-keygen

Install the handy-dandy `ssh-copy-id` utility:

    brew install ssh-copy-id

## ZSH

Recently, RVM has been complaining about specific versions of ZSH, so now we have HomeBrew installed, install the latest version of ZSH:

    brew install zsh

Set this version as the correct version of ZSH:

    sudo vim /etc/shells
    # add the following line into the very end of the file(/etc/shells)
    /usr/local/bin/zsh

Change default shell:

    chsh -s /usr/local/bin/zsh

Now install oh-my-zsh:

    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

## development directory

Create my local development directory:

    mkdir ~/development


## Ruby and RVM

Install RVM:

    \curl -L https://get.rvm.io | bash

Fix any potential SSL certificate nonsense related to RVM:

    brew uninstall openssl
    brew uninstall --force openssl
    brew install openssl
    rvm osx-ssl-certs update all
    brew link openssl --force

You can test that it worked by trying the following:

    gem install eventmachine -v '1.0.8'

Install a Ruby:

    rvm install 2.6

## Dotfiles

Install my dotfiles:

    git clone git@github.com:suranyami/dotfiles.git
    cd dotfiles
    bundle
    ./install.rb

## Apps

Install SourceTree for enhanced Git visualization:

[SourceTree](https://www.sourcetreeapp.com/download/)


Don't use the Mac App Store version of Slack, download it directly: [Slack](https://slack.com/downloads/osx)

## Java

Go [here](http://www.oracle.com/technetwork/java/javase/downloads), click "Accept License Agreement" and download and run the latest Java SDK.

## Virtual Box

Go [here](https://www.virtualbox.org/wiki/Downloads)


## Other tools

Install [Node.js](http://nodejs.org/)


Install `nmap` so I can do things like find my Raspberry Pi on the network:

    brew install nmap

## ASDF

As per install instructions for `asdf` here: https://github.com/asdf-vm/asdf

```
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.0
echo -e '\nautoload -Uz compinit && compinit' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
```

Install unix libs ASDF requires to build stuff:

```
brew install coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc
```

Install unix libs needed by Elixir and Erlang:

```
brew install fop wxmac
```


Install Erlang and Elixir:

```
asdf plugin-add erlang
asdf plugin-add elixir
asdf install erlang 21.3
asdf install elixir 1.8.1
asdf global erlang 21.3
asdf global elixir 1.8.1
```

## macOS

Disable the caps-lock key in *System Preferences -> Keyboard -> Modifier Keys*

## Postgres

To make the `postgres` role:

    createuser -s postgres
    
## Foreman

    brew install foreman