Skip to content

gemstackio/installfest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

GemStack Logo

Installfest

This is a repo is meant to assist you in preparing your Macbook Pro M1 for software development purposes.

Google Calendar

  1. Go to Google Calendar
  2. Click the three dots in the top right corner
  3. Click More Tools->Create Shortcut
  4. Provide a name for the shortcut
  5. Check Open as window
  6. Click Create

VS Code

  1. Go to the Visual Studio Code site and download the required installer for your OS
  2. Once VS Code is installed, open the program
  3. Press command + shift + p to open the command pallet
  4. Type in Shell Command: Install 'code' command in PATH and click the option that appears
    • Installing the code command in PATH allows you to use it in the terminal

Mac Developer Tools

  1. Opening the Terminal
  2. Type git 1-mac-developer-tools-git-prompt
  3. When prompted click install 2-install-developer-tools-prompt
  4. Accept License Agreement 3-accept-license-agreement

This install can take anywhere between 10-60 mins

Check Your Terminal Shell

Move on to this section once the Mac Developer Tools download is finished.

  1. To see which shell your terminal is running:
$ echo $0

## Output if you are running zsh:
-zsh 

## Output if you are running bash:
-bash 

Set zsh as Default Shell

  1. Enter the following command into your terminal:
chsh -s /bin/zsh

Set Bash as Default Shell

  1. Enter the following command into your terminal:
chsh -s /bin/zsh

Install & Configure Antigen

Install Antigen

Antigen is a plugin manager for zsh.

  1. In your root (~) directory, create a new hidden directory called .antigen:
cd ~; mkdir .antigen; cd .antigen
  1. Next install antigen:
curl -L git.io/antigen > antigen.zsh

Configure Antigen

Next, we will add some basic configurations that will run every time you open a new terminal window.

  1. Next we will create and configure our .zshrc file:
code ~/.zshrc
  1. Paste in the following code:
source ~/.antigen/antigen.zsh

# Load the oh-my-zsh's library.
antigen use oh-my-zsh

# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle lukechilds/zsh-nvm

antigen bundle git

antigen bundle heroku

antigen bundle pip

antigen bundle lein

antigen bundle command-not-found

# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting

# Load the theme.
antigen theme robbyrussell

# Tell Antigen that you're done.
antigen apply
  1. Restart your terminal, which should kick off a bunch of application installations, and you will see your terminal change a bit.

Note that we loaded a theme called robbyrussell there are many different themes you can test out and install by changing the name provided inline antigen theme <NAME OF THEME> in your .zshrc file. You can find an expansive list of themes here

Install Node

Now that we have antigen installed and configured, it is straightforward to install Node.js.

  1. Enter the following command into your terminal:
nvm install --lts
  1. Open your ~./zshrc file:
code ~./zshrc
  1. Add the following to the top of the ~./zshrc file:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Check Node Installation

  1. You can check to see if node installed properly by running the following command:
node

## Expected Output:
Welcome to Node.js v16.15.0.
Type ".help" for more information.
>

Changing Node Versions

Be mindful that the install command in the section above will install the latest version, which might not be what you want. If, for some reason, you would like to change the version of Node you are running, you can use the following command:

nvm use 0.00.0

Gatsby CLI

  1. Enter the following command:
npm install -g gatsby-cli
  1. Once complete disable Gatsby telemetry:
gatsby telemetry --disable

Sanity CLI

  1. Enter the following command:
npm install -g @sanity/cli

GitHub SSH Keys

Generating SSH Keys

  1. Generate an SSH Key:
$ ssh-keygen -t -C "[email protected]"

ssh-keygen -t -C "[email protected]"
  1. When prompted, provide a location and name for your SSH Key
# Prompt Message: Enter file in which to save the key (/Users/rogercampbellii/.ssh/id_ed25519):

# Your Input:
/Users/rogercampbellii/.ssh/<NAME OF SSH KEY>
/Users/rogercampbellii/.ssh/personal-mrrogercampbell
  1. When prompted to Enter passphrase just hit enter twice
  2. Verify your SSH Key was properly created:
$ ls ~/.ssh

# Expected output:
<NAME OF SSH KEY>     <NAME OF SSH KEY>.pub

# Example Output:
personal-mrrogercampbell     personal-mrrogercampbell.pub

Adding SSH Key to the ssh-agent

  1. Start the ssh-agent:
$ eval "$(ssh-agent -s)"

# Expected Output:
Agent pid 10374
  1. Load your SSH key:
$ ssh-add ~/.ssh/personal-mrrogercampbell

Add Your SSH Key to your Github Accounts

  1. Copy your SSH key:
pbcopy < ~/.ssh/<Name of Your SSH Key>.pub
  1. Go to GitHub
  2. Click your profile picture on the top right of the page
  3. Click Settings
  4. In the Access section on the right click SSH and GPG keys
  5. Click New SSH key
  6. Provide a Title; could be the name of your computer
  7. Paste the Key we copied in step 1
  8. Click Add SSH key
  9. Provide your GitHub Password when prompted

Confirming Your Connection

  1. Run the following command:
  1. If prompted with this message enter yes:
# Are you sure you want to continue connecting (yes/no/[fingerprint])?
$ yes

# Expected Output
# Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
# Hi <GitHub Username>! You've successfully authenticated, but GitHub does not provide shell access.

Configure Git Global Settings

  1. Create a global .gitignore file:

    touch ~/.gitignore
  2. Add the .DS_Store to .gitignore file:

    # Being sure that this pesky file is never added to a repo.
    echo ".DS_Store" >> .gitignore
  3. Set User Information:

git config --global user.name "GitHub Username"
git config --global user.email "Email Registered With GitHub"
  1. Set Default Configurations:
# Sets VS Code as default editor for merge conflict messages
git config --global core.editor 'code --wait'

# Sets 'main' as default branch name on all locally created repos
git config --global init.defaultBranch main

# Registers your global .gitignore
git config --global core.excludesfile ~/.gitignore

Check Global Configurations:

git config --list --global

Configuring Two Sets of SSH Keys

  1. Before moving on with this section, complete the GitHub SSH Keys section for each GitHub account you need to work with.
  2. Open your .zshrc file
code ~/.zshrc
  1. Create the following alias:
alias sshc="ssh-add -D; ssh-add ~/.ssh/<Name of SSH Key>"

# Alais syntax breakdown
alias <custom-alias-name>=”<command>

You will need to do this for each SSH Key you want to utilize

# Examples:
# This command does four different things:
# 1. ssh-add -D; -> Removes any existing ssh key from the ssh-agent
# 2. ssh-add ~/.ssh/<SSH_KEY_NAME>; -> adds work ssh key to ssh-agent
# 3. git config --global user.name \"<USERNAME>\"; -> Sets git username for commit messages
# 4. git config --global user.email \"<[email protected]>\" -> Sets git email for commit messages
alias sshwork="ssh-add -D; ssh-add ~/.ssh/<SSH_KEY_NAME>; git config --global user.name \"<USERNAME>\"; git config --global user.email \"<[email protected]>\""

# Create one for personal also:
alias sshp="ssh-add -D; ssh-add ~/.ssh/<SSH_KEY_NAME>; git config --global user.name \"<USERNAME>\"; git config --global user.email \"<[email protected]>\""

# This is list all alias loaded in the ssh-agent
alias chkssh="ssh-add -l;"

# Prints all git config global settings
alias gitconfig="git config --list --global"

Extra Resources

Helpful Desktop Apps

  • Rectangle App - Move and resize windows in macOS using keyboard shortcuts or snap areas

Chrome Extensions

  • JSONView - Pretty-prints JSON instead of prompting to download it or rendering it as text.

VS Code Extensions

  • Code Spell Checker - Spelling checker for source code
  • Grammarly - A grammar checking for Visual Studio Code using Grammarly.
  • Live Share - Real-time collaborative development from the comfort of your favorite tools.
  • Lorem ipsum - Generates and inserts lorem ipsum text
  • Markdown All in One - All you need to write Markdown, keyboard shortcuts, table of contents, auto preview and more
  • Markdown Preview Enhanced - Markdown Preview Enhanced ported to vscode
  • npm - npm support for VS Code created by Microsoft
  • Profile Switcher - Allows you to switch between different profiles you have created
  • React.js code snippets - Code snippets for React.js development in ES6 syntax
  • Settings Sync - Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.

References

About

Getting your Mac M1 Setup and ready to go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors