geoffthompson

Building a Raspberry Pi

Install Raspberry Pi Imager

  1. Go to https://www.raspberrypi.com/software/ and download the dmg file.

  2. Double-click the dmg file to open the installer

  3. Drag the Raspberry Pi Imager icon into the applications folder.

I am having issues with the SD card being corrupted -- looks like a common problem if the Pi is not shut down correctly, which I usually always do. Although, this latest incident happened after a sudo apt-get update failed.

Format SD Card

Using the Raspberry Pi Imager, format an SD Card with the desired Raspbian OS - for this go-round, I created a 64-bit Raspbian Desktop image.

Insert the SD Card and Boot the Pi

This worked well. The start-up asks a few basic questions, and then immediately allows pairing of bluetooth devices, which was a huge plus! No more fishing around for keyboard shortcuts because I no longer own a USB mouse!

What's more, this version of Raspbian comes with git pre-installed. Nice.

Install Git

Check out github documentation on the subject here.

  1. Check if git is on the Pi and install it if it isn't.

    git --version
    sudo apt update
    sudo apt install git
    
  2. Configure

    git config --list
    git config --global user.name "Your Name"
    git config --global user.email "youremail@yourdomain.com"
    
  3. Check for/create ssh key

    ls -lAF ~/.ssh
    

    If there is not a key file, generate one:

    ssh-keygen -t ed25519 -C "youremail@yourdomain.com"
    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_ed25519
    
  4. Add ssh key to github

    Copy the key to the clipboard

    cat ~/.ssh/id_ed25519.pub
    

    Go to GitHub Settings > Access > SSH and GPG keys and add the new key. Then test your connection:

    ssh -T git@github.com
    
  5. Clone a project

    cd ~
    mkdir Projects && cd Projects
    git clone git@github.com:thompsgr/vanillaordie.git
    

Install Node

I have done this with npm and with n in the past. I noticed there is now a node manager built in Rust! For this build, I decided to stick as close to the official installation documentation as possible, which I found here: https://github.com/nodesource/distributions.

  1. Install using curl

    curl -fsSL https://deb.nodesource.com/setup_19.x | bash - 
    sudo apt-get install -y nodejs