Skip to content

Instantly share code, notes, and snippets.

@SebastiaAgramunt
Forked from ryanhanwu/Brewfile
Last active March 23, 2022 15:41
Show Gist options
  • Save SebastiaAgramunt/67e412080e73320fce3410e36fcd3951 to your computer and use it in GitHub Desktop.
Save SebastiaAgramunt/67e412080e73320fce3410e36fcd3951 to your computer and use it in GitHub Desktop.
New Mac Setup Script 2019

Basic Setup

sh ./init.sh

Generate Your Development SSH Key

  1. Generate your key for the development machine

    ssh-keygen -t rsa -b 2048
    
  2. Copy your public key (~/.ssh/id_rsa.pub) to your GitHub Account's "SSH Keys"

  3. Copy the following to the file ~/.ssh/config (substitute by your own info)

    Host github.com
    Hostname github.com
    User sebastiaagramunt
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa_github
    

    Considering you have named your private key file id_rsa_github. Now add the email addresss to the git

    git config --global user.email "email@example.com"
    

Remote access to machines

  1. Place your public key in the remote machine and your private key in your local one (in ~/.ssh/id_rsa_rpi) if your filename is id_rsa_rpi.
  2. Add the following to the configuration file ~/.ssh/config.
    Host raspberry
    HostName 0.0.0.0
    User pi
    Port 5555
    IdentityFile ~/.ssh/id_rsa_rpi
    
    substituing the HostName by the public IP of the machine and the User by the user name for login inside the remote machine. Also change the port to the one enabled by ssh (normally 22).
  3. Access the remote machine like ssh raspberry

Pyenv and pyenv-virtualenvwrapper setup

Follow the instructions on this gist to setup pyenv and pyenv-virtualenvwrapper. With pyenv you can manage specific python versions avaliable system-wide, with the wrapper for virtual enviroment you can create an environment with a specific python version. All this availiable system-wide. For project individual virtual enviroments it is more common to use pyenv with venv instead.

# Taps
tap 'homebrew/bundle'
# Install CLI Tools
## Shell Utilities
brew 'coreutils'
brew 'findutils'
brew 'zsh'
brew 'zsh-completions'
brew 'docker-compose'
## visualization
# brew 'gnuplot'
## Network Utilities
brew 'htop'
brew 'nmap'
brew 'wget'
## System Utilities
brew 'tree'
brew 'mas'
## Dev Utilities
brew 'git'
brew 'awscli'
# brew 'nvm'
# brew 'node'
# Mac Apps
## Communication
cask 'slack'
## Productivity
cask 'docker'
cask 'brave-browser'
cask 'google-chrome'
cask 'tor'
#cask 'macpass'
cask 'bitwarden'
cask 'veracrypt'
cask 'joplin'
# cask 'authy'
# cask 'google-backup-and-sync'
## System
cask 'the-unarchiver'
cask 'appcleaner'
## Editor
cask 'visual-studio-code'
brew 'nano'
brew 'vim', args: ["--with-lua"]
cask 'sublime-text'
## Development
cask 'iterm2'
brew 'zlib' # needed for pyenv
brew 'tcl-tk' # needed for pyenv
brew 'pyenv'
# Media
cask 'spotify'
cask 'vlc'
# Job specific
#cask 'microsoft-outlook'
# cask 'thunderbird'
#!/bin/sh
echo "Installing Homebrew"
if test ! $(which brew); then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update
echo "Install Homebrew Packages"
brew tap homebrew/bundle
brew bundle
echo "Install XCode CLI Tool"
xcode-select --install
echo "Installing Oh My Zsh"
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sudo echo "$(which zsh)" >> /etc/shells
chsh -s $(which zsh)
echo "plugins=(git cake brew common-aliases copydir copyfile encode64 node osx sublime xcode pod docker git-extras git-prompt)">> ~/.zshrc
echo "Configrating Git"
echo "Please enter your git user.name"
read username
git config --global user.name $username
echo "Please enter your git user.email"
read usermail
git config --global user.email $usermail
echo "Creating ~/.ssh/ folder and config"
mkdir ~/.ssh/
touch ~/.ssh/config
#!/bin/sh
git pull
echo "Updating Homebrew"
brew update && brew upgrade && brew cleanup && brew cask cleanup; brew bundle; brew doctor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment