S4M is a numeronym for SYSTEM. S4M is my default system configuration for *NIX based workstations.
touch $HOME/.bash_profile
Paste the following into .bash_profile
# bash_profile
# - Traditional *NIX systems only run this file during log in. macOS deviates from this norm and runs this for every new instance of a shell. To keep things consistent across platforms, the .bashrc file is sourced if it exists.
if [ -e $HOME/.bashrc ]; then
source $HOME/.bashrc;
fi
touch $HOME/.bashrc
Paste in the following into .bashrc
# bashrc
# - .bashrc is traditionally loaded for every new instance of a shell. This is not true for macOS which calls .bash_profile instead. This file is being sourced from .bash_profile for consistency.
touch $HOME/.aliases
Paste the following into .aliases
# aliases
# - .aliases is the location to store all desired aliases for your system. .aliases is sourced from the .bashrc file.
alias ll="ls -FlahGs"
alias cls="clear"
Paste the following into .bashrc
if [ -e $HOME/.aliases ]; then
source $HOME/.aliases;
fi
mkdir -p $HOME/.functions/
Install SSH Key
Copy key from existing machine or backup into $HOME/.ssh
Set Permissions
In order for a key to successfully work, we need to set the proper permissions for the $HOME/.ssh
and its subsequent files.
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/*
chmod 644 $HOME/.ssh/*.pub
Create Binary Directory
mkdir -p .bitmvr_bins
Installs
mkdir -p $HOME/.secrets/store
touch $HOME/.secrets/secrets.sh
Paste the following into $HOME/.secrets/secrets.sh
#!/usr/bin/env bash
store="$HOME/.secrets/store"
mkdir -p "$store"
secrets=$(find "$store" -type f -name '*.secret')
for secret in $secrets; do
source "$secret"
done
Add the following to your .bashrc
###################################################################
# Secrets
###################################################################
if [ -e $HOME/.secrets/secrets.sh ]; then
source $HOME/.secrets/secrets.sh;
fi
I believe in creating a seperate location for Operating System specific configurations. For macOS, I do this by creating the following:
Set Shell to Close on Exit
Note: This command exits successfully but not sure it actually is taking affect. Need to review.
defaults write com.apple.Terminal shellExitAction -int 0
I prefer to not have any persistant applications during a fresh configuration. I've also set me prefered size for the dock.
defaults delete-all com.apple.dock "persistent-apps" \
&& defaults write com.apple.dock tilesize -integer 42 \
&& killall Dock
mkdir -p $HOME/.os-specific/macos/
touch $HOME/.os-specific/macos/.macosrc
Once that it complete, add the following to your .bashrc
###################################################################
# MacOS Specific
###################################################################
source $HOME/.os-specific/macos/.macosrc
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Create Homebrew File
mkdir -p $HOME/.os-specific/macos/Brewfiles
touch $HOME/.os-specific/macos/Brewfiles/personal.Brewfile
Add the following to the Brewfile
# Brewfile - Personal
### taps
tap 'teamookla/speedtest'
## Forumulas
### Development
brew 'bash-completion'
brew 'git'
brew 'graphicsmagick'
brew 'jq'
brew 'nmap'
brew 'p7zip'
brew 'qrencode'
brew 'shellcheck'
brew 'sqlite'
brew 'tesseract'
brew 'tmux'
brew 'yamllint'
brew 'watch'
brew 'speedtest'
brew 'gnupg'
### Media
brew 'ffmpeg'
brew 'flac'
brew 'lame'
brew 'yt-dlp'
## Casks
### Browsers
cask 'brave-browser'
cask 'firefox'
### Communications
cask 'element'
### Productivity
cask 'rectangle'
cask 'jiggler'
### Development
cask 'visual-studio-code'
### Media
cask 'vlc'
cask 'mpv'
cask 'spotify'
cask 'inkscape'
Install programs from Homebrew file
brew bundle --file="$HOME/.os-specific/macos/Brewfiles/personal.Brewfile"
Firefox
/Applications/Firefox.app/Contents/MacOS/firefox --setDefaultBrowser
- All Google Fonts are available at https://github.com/google/fonts/archive/master.zip
- All fonts are manually installed to
/Library/Fonts/
.