Every engineer's workstation configuration (dotfiles
) is highly variable and tailored to their desires, habits, and software stack. I love rebuilding and tinkering with my build by learning from and collaborating with others. This setup is what I use to get the job done, however, don't just accept my words as gospel, find your own path when setting up your build.
I also think it is important to reason from first principles, rather than, by analogy. So the normal way we conduct our lives is we reason by analogy. We're doing this because it's like something else that was done or like what other people are doing. Iterations on a theme. It's kinda mentally easier to reason by analogy rather than from first principles. First principles is kinda a physics way of looking at the world and what that really means is you kinda boil things down to the most fundamental truths and say okay, what are we sure is true? or sure as possible is true? and then reason up from there. That takes a lot more mental energy. - Elon Musk Foundation 20
If you're learning to code, I hope I can save you time. I live by using linters and tools that monitor testing coverage. Whether I am building a project for the enterprise or side project I hope to make some money on, I run these tools in real time. I believe code quality, testing coverage, and coding styles are critical to the success and longevity of any project.
This guide is highly opinionated. If you have any questions please post an issue. I am open to pull requests. Finally, this guide is supposed to read from top to bottom. If you are following this advice, please read it like following the yellow brick road, and have fun.
This setup has been validated against OSX 10.11 and 10.12 via VMWARE Fusion
- Make sure that every operating system update has been processed including itunes.
- Install the full
Xcode
developer package from the Apple App Store.=>
I use the full package because it comes with both the gcc compiler and emulators for iOS devices.These come in handy for testing responsive websites and applications. - Type
cmd + space
and launchXcode
. This should install additional required components and will prompt you for the license approval. - Reboot the workstation.
Type cmd + space
to launch Terminal
to perform the next block of installations in your home directory.
xcode-select --install
: this will confirm that xcode developer tools are properly installed.sudo xcodebuild -license accept
: this will confirm that the xcode eula has been approved.- Install homebrew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Run
brew doctor
and make sure it reportsYour system is ready to brew
. - Update brew via
brew update
. - Install the latest version of git via
brew install git
. - Install Autojump via
brew install autojump
. - Install direnv to manage environment variables via
brew install direnv
.
This installation utilizes rbenv to run ruby. If you are ok with that, let's type cmd + space
to launch Terminal
to perform the next block of installations in your home directory.
- Setup Ruby via
brew install rbenv rbenv-build
- Following the guide on the repo create the
.rbenv
directory.
rbenv init
and theneval "$(rbenv init -)"
. - Create the rbenv plugin directory
mkdir $(rbenv root)/plugins
. - Install rbenv-default-gems plugin.
git clone https://github.com/rbenv/rbenv-default-gems.git $(rbenv root)/plugins/rbenv-default-gems
. - Install rbenv/rbenv-gem-rehash plugin.
git clone https://github.com/sstephenson/rbenv-gem-rehash.git $(rbenv root)/plugins/rbenv-gem-rehash
- Install rbenv-vars plugin.
git clone https://github.com/rbenv/rbenv-vars.git $(rbenv root)/plugins/rbenv-vars
- Install rbenv-binstubs plugin.
git clone https://github.com/ianheggie/rbenv-binstubs.git $(rbenv root)/plugins/rbenv-binstubs
- Install rbenv-update plugin.
git clone https://github.com/rkh/rbenv-update.git $(rbenv root)/plugins/rbenv-update
- Install a few common versions of ruby. At the time of this build the following versions were installed:
rbenv install 2.3.0
andrbenv install 2.3.1
. Please note you can runrbenv install -l
to see the current versions available. - Run
rbenv global 2.3.0
to setup the global version of ruby.
Type cmd + space
to launch Terminal
to perform the next block of installations in your home directory. Please verify you are in your home directory by typing cd $HOME
.
- First we will clone this repo to our home directory. Please note, that if you are having cloning issues you may need to setup your new ssh keys.
git clone [email protected]:chrishough/my-configurations.git .myconfigurations
- Install the Inconsolata regular and bold fonts via google fonts.
- Download and install iterm2. This will normally be dropped into your downloads directory. Like all Apple OS applications make sure to drag this to the applications directory.
- Install oh-my-zsh.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Install Zsh and set it as the default shell.
brew install zsh
- Following this [guide](sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh) we need to set zsh as the default shell. If you run
which zsh
you will see this pointed to/bin/zsh
. We need to change this. Runningsudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh
will properly adjust this for us. Now when you runwhich zsh
it should be pointed to/usr/local/bin/zsh
.
Type cmd + space
to launch iterm2
to perform the next block of installations in your home directory. Please verify you are in your home directory by typing cd $HOME
. Also, if iterm prompts you for an update. Load it. Also, make sure to check load updates automatically
during this process. Please feel free to close Terminal
at this time.
- Download the Base16 iTerm2 colors to your documents directory. My theme uses
base16-railscasts.dark
which can be loaded in the presets. You will need to set the contrast as shown to have a clearer definition of the font icons. - My theme uses a custom background image which can be downloaded here or extracted from the repo you cloned.. If you need to view hidden files use
cmd + shift + period
described here. - Under the terminal tab, make sure to change the report terminal type to
xterm-256color
and your character encoding toUnicode (UTF-8)
. - Set the scrollback lines to unlimited.
Now we have to sync our settings to the configuration repo! This will adjust the following files: .pryrc, .vimrc, .zprofile, .zshrc, .profile, .gemrc, .bashrc, and .bash_profile.
- Backup existing dotfiles.
ruby $HOME/.myconfigurations/scripts/setup/dotfiles/backup.rb
- Setup symlinks to our configuration dotfiles.
ruby $HOME/.myconfigurations/scripts/setup/dotfiles/symlinks.rb
- If you get the error
zsh compinit: insecure directories, run compaudit for list.
you will need to adjust zsh permissions as desribed in this stackoverflow post.
cd /usr/local/share/
sudo chmod -R 755 zsh
sudo chown -R root:staff zsh
Verify global rbenv vars are setup correctly. Type nano $HOME/.rbenv/vars
and confirm the following. Adjust if necessary. Once completed, type rbenv vars
and you should see export GEM_PATH='.bundle'
.
#GLOBAL
GEM_PATH=.bundle
At this point if you type cd $HOME && lsa
your home directory should look like this.
As you explore the configuration directories you will notice a number of shortcut files have been preloaded. These files are described below and many come pre-built with their own helpers. I encourage you to personalize these as you see fit and make sure you understand what each git function does before blindly using them.
File | Helper Command | Description |
---|---|---|
includes | This is the base file to pull in all the includes. | |
global-helpers | Controls that apply to all of the inlcudes. | |
global-settings | Machine and include settings. | |
app | apphelp | Applications that do not require their own includes file. |
git | githelp | Github shortcuts and workflows. |
heroku | herokuhelp | Heroku shortcuts and workflows. |
keybase | keybasehelp | Keybase shortcuts and workflows. |
ruby | rubyhelp | Ruby and Rails based commands. |
shell | shellhelp | Everything shell. |
I have used a variety of editors over the years including homesite, dreamweaver, eclipse, vim, sublime text, sublime text 2, and atom. My current build utilizes atom to get the job done, and I have been working with it since beta. No, it is not as fast as an engineer who has mastered the vim keyboard but it comes pretty darn close.
- Download and install atom. This will normally be dropped into your downloads directory. Like all Apple OS applications make sure to drag this to the applications directory.
- Type
cmd + space
to launchAtom
to approve the EULA. Once approved, close the application. - Backup the existing atom configuration.
ruby $HOME/.myconfigurations/scripts/setup/ide/backup.rb
- Setup symlinks to our atom configuration files.
ruby $HOME/.myconfigurations/scripts/setup/ide/symlinks.rb
- From the command prompt type
atom
followed bycmd + ,
and click on install. On this interface we want to search for package-sync and install it. - With package-sync installed type
shift + cmd + p
and typepackage-sync:sync
. This will install all of the packages inside thepackage.cson
file. Please watch the bottom of atom to see it scrolling through the installation process. Once complete please close atom and re-open it. If you do not have any errors, you are good to go.
Type cmd + space
to launch iterm2
to perform the next block of installations in your home directory. Please verify you are in your home directory by typing cd $HOME
.
- Type
brew tap homebrew/services
to install brew services. Thoughtbot has a great guide on this tool. - Run
brew install postgres
to install PostgreSQL. - Start PostgreSQL via
brew services start postgres
and create your base db via the following command:
createdb `whoami`
- If everything worked correctly you can verify this by attaching to Postgres by typing
psql
. Please note this installation of Postgres via Homebrew was adapted from install-postgresql-on-mac-os-x-via-brew and this stackoverflow post. Unfortunately my local copy of Postgres was borked so I rebuilt it at one point by going "nuclear" and removing everything.
rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8
- Run
brew install redis
to install Redis. - Start Redis via
brew services start redis
- Paw: API testing and construction.
- Pathfinder: A finder on steroids.
- Arq + S3: Encrypted cloud backup.
- Cloak: Cloud based VPN.
- Dash: Local documentation.
- Divvy: OSX window management.
- Adobe Creative Cloud: Design things, primarily Ai and Photoshop.
- iStat Menus: System performance monitoring.
- Keyboard Maestro: Keyboard Macros.
- 1Password: Password and 2FA security across all Apple devices.
- Alfred: Replace spotlight with powerful workflows.
If you love automation, you will love Alfred! It is basically spotlight on steroids and when you purchase the license you are granted access to infinitely complex workflows. Here is what I have installed.
- chrome-bookmarks: Search Chrome Bookmarks.
- emoji-codes: Emoji Search (repo).
- forecast: Weather Forecast (repo).
- github-commands: Parse Github Pages.
- google: Google Search.
- ip-address-info: Retrieve Local IP Address.
- open-text-file: Open a .txt file.
- replace-spaces-with-hyphens: Create slugs for git flow.
- start-ios-emulator: Start the iOS Emulator.
- timezones: Pull Time.
- toggle-visibility-of-hidden-files: Show OSX Hidden Files.
- urban-dictionary: Query the Urban Dictionary.