cuHacking logocuHacking DevDocs
Knowledge BaseHack the Tunnels

Setup

Things to automate the process of automating things.

MacOS is a UNIX-based operating system, so you can run everything in this workshop without any special configuration and can skip ahead :)

In simple terms, it's kind of like two people being from different countries but speaking the same language and understanding each other.

System Requirements

Install Homebrew

First, let's check if homebrew is installed on your machine.

Terminal
# Check Homebrew installation
brew --version

If you see something like command not found, continue with the installation. Otherwise, you can skip ahead to Install Git.

Terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After the installation, is complete, you'll see something like this.

Your output may be different. (In this case, name will be replaced with your username.)

Follow the on-screen instructions to add Homebrew to your PATH.

- Run these commands in your terminal to add Homebrew to your PATH:
    echo >> /home/name/.bashrc
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/name/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo apt-get install build-essential
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

This is just an example. Don't copy-paste what's here on the site, look at your terminal! Replace `name` with your username.

Terminal
    echo >> /home/name/.bashrc

This is just an example. This will be slightly different for MacOS.

Terminal
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/name/.bashrc

After you're done the two steps above, do these.

Terminal
    sudo apt-get install build-essential
Terminal
    brew install gcc

Install Git

Terminal
brew install git

Continue if you get command not found, otherwise skip ahead to Install GitHub CLI.

Terminal
# Check Git version
git --version

Configure Git

Your username and email will be used to identify you in the Git commit history.

Terminal
# Set your username
git config --global user.name "Your Name"
Terminal
# Set your email
git config --global user.email "your_email@example.com"

Git's default branch is master, let's change it to main to match the convention used by GitHub.

Terminal
# Set the default branch to main
git config --global init.defaultBranch main

Install GitHub CLI

If you see something like command not found, continue with the installation. Otherwise, you can skip ahead to Install VS Code.

Terminal
# Confirm GitHub CLI installation
gh --version

This simplifies GitHub tasks like cloning repositories, and authentication without needing to copy-paste URLs.

Terminal
brew install gh

Login with your GitHub account.

Terminal
gh auth login

Provide the following answers.

? Where do you use GitHub? [Use arrows] to move, type to filter]
> GitHub.com
  Other
? What is your preferred protocol for Git operations on this host? [Use arrows] to move, type to filter]
> HTTPS
  SSH
? Authenticate Git with your GitHub credentials? [Use arrows] to move, type to filter]
> Yes
  No
? How would you like to authenticate GitHub CLI? [Use arrows] to move, type to filter]
> Login with a web browser
  Paste an authentication token

Your one-time code will be different.

! First copy your one-time code: 95i2-DAE6
Press Enter to open github.com in your browser...

Open your browser, log in to GitHub and provide it permissions, and then come back to the terminal when you see the Congratulations, you're all set! screen.

You should see the following in your terminal

✔ Authentication complete.
- gh config set -h github.com git_protocol https
✔ Configured git protocol
✔ Logged in as YourGitHubUsername

Install VS Code

Terminal
brew install --cask visual-studio-code

Wondering where to find these commands?

You can search and find the commands for all of the packages we've installed so far.

Check Your Setup

Confirm that your setup is correct by running these commands. If any fail, refer back to the corresponding setup instructions.

If it's working correctly, you'll see the relevant version number and configuration details.

Terminal
# Check Homebrew installation
brew --version
Terminal
# Check Git version
git --version
Terminal
# Confirm GitHub CLI installation
gh --version
Terminal
# Verify global Git config
git config --list

Press q to quit.

Terminal
# Open VS Code
code

Please ensure that your setup is complete before proceeding.

Last updated on

On this page

Edit on GitHubMade with 🩶 for Hackers by Hackers