├── README.md ├── apple_id_sign_in.png └── username_password.jpg /README.md: -------------------------------------------------------------------------------- 1 | ## OSX || MacOS Clean Install 2 | 3 | ### Estimated time for competition: 1 - 2 Hours 4 | 5 | #### Things Change: 6 | 7 | The guide provides some very exact syntax for install 'all the things' at the time of this writing. While I will try to update it as necessary, there is a very real possibility some command or some option will not be present or work the way it once did. No big deal. Just play around a bit, Google around a bit and figure it out a bit. Literally all the information below was derived from goggling `osx install X`. 8 | 9 | ## Table of Contents: 10 | 11 | - General 12 | - [Start Here](#forward) • [Initial System Settings](#system-settings) • [Software Recommendations](#additional-recommended-applications) 13 | 14 | - Languages / Frameworks 15 | - [HomeBrew](#homebrew) • [Git](#git) • [dotfiles](#dotfiles) • [rbenv](#rbenv) • [Heroku toolbelt](#heroku-toolbelt) • [Rails](#rails) • [NVM](#nvm) 16 | 17 | - Applications 18 | - [iterm](#iterm) • [spectacle](#spectacle) • [Sublime Text 3](#sublimetext-3) • [Chrome](#chrome) • [Firefox](#firefox) • [FlyCut](#flycut) • [Alfred](#alfred) 19 | 20 | - Databases 21 | - [postgres](#postgres) • [sqlite3](#sqlite3) • [mysql](#mysql) • [MongoDB](#mongodb) 22 | 23 | 24 | ## Forward: 25 | 26 | I put together this guide to assist young developers in setting up new OSx hardware. It is built to start from a clean installation of OSX El Capitain. Older versions of OSX should work as well. I'm not saying this collection of software tools is the end all greatest, there are lots of options available, but if you need to get up and running you can create this environment and things will be pretty good. 27 | 28 | It's geared in such a way as to be non blocking to anyone with a basic experience level in OSX configuration. 29 | 30 | **Note:** If you're here because your existing Ruby ENV is mangled these notes don't apply. 31 | 32 | It is recommended that you follow the guide Top => Bottom. As with all things programming, **Order Matters**. 33 | 34 | You should be comfortable with the command line before starting this tutorial. Read this [Command Line Quick Reference & Tips](http://learntocodewith.me/command-line/unix-command-cheat-sheet/) if you need a refresher. 35 | 36 | Additionally, if you are to 'know what you're doing' with your dev environment you should know a bit about how the ```PATH``` variable works. If this term is foreign to you take a minute to read [this article](https://cbednarski.com/articles/understanding-environment-variables-and-the-unix-path/). 37 | 38 | This guide denotes terminal entries with the following character combination: 39 | ``` 40 | =>$ 41 | ``` 42 | The dollar **$** symbol is frequently used in tutorials to denote a terminal entry. Just being extra clear here, because I see this mistake a lot. **Do Not** include the $ when you type out the commands into terminal. Also it's worth noting that your terminal prompt most likely does not look like mine. That's OK too. 43 | 44 | ### Contributing: 45 | 46 | If you feel I've missed something or if you find a pain point I didn't document, *Please [open an issue](https://github.com/bootcoder/ENV_Scratch_Setup/issues).* Feedback always greatly appreciated. 47 | 48 | If you feel have critical updates or just want to contribute in general, *Please fork it, contribute and open a pull request.* 49 | 50 | As to the subject matter itself, if you don't agree in my choice of software that's awesome! 51 | 52 | But for seriouslies, I'm not saying I don't care about or appreciate how much better ```INSERT RANDO SOFTWARE TITLE HERE``` is. I'm just saying I've heard... it's cool. No need to track me down, shake me around and pontificate furiously whilst cycling through the virtues of ```INSERT RANDO SOFTWARE TITLE HERE```. 53 | 54 | ### B-E-EFFICIENT 55 | 56 | When I say open this program or that, the quickest path is usually via *Spotlight*. System wide you can access Spotlight by pressing CMD+Spacebar, then enter the program or file you are searching for. 57 | 58 | ``` 59 | CMD+Spacebar Terminal 60 | ``` 61 | 62 | Will open the terminal application. You'll find it's fuzzy search impressive, needing only a few characters to open popular apps. This advice remains true even though I will instruct you to replace Spotlight with Alfred in this tutorial. If you'd like more thoughts on efficiency as a dev check out [this link](https://github.com/bootcoder/tipsNtricks) 63 | 64 | ### A note on Passwords: 65 | 66 | Your Apple ID and system passwords are most likely different. Be sure to keep both readily available throughout the installation process. 67 | 68 | **Apple ID** 69 | 70 | ![apple-sign-in](apple_id_sign_in.png) 71 | 72 | Apple ID can be used to access the App Store as well as sync different devices via iCloud. 73 | 74 | **System Password** 75 | 76 | ![system-password](username_password.jpg) 77 | 78 | This is the password you use to login to OSX on the current computer. If you are prompted for a password at the terminal it is asking for the System Password. 79 | 80 | --- 81 | 82 | # Start Installation 83 | 84 | ### HomeBrew 85 | 86 | Head on over to the [HomeBrew site](https://brew.sh/) and copy the link. 87 | 88 | In the terminal application paste it in: (It probably looks a lot like this) 89 | 90 | ```bash 91 | =>$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 92 | ``` 93 | 94 | This process will prompt you for your system password. Most times in your day to day developer life you want to avoid using SUDO to perform installations. Homebrew is an exception to this rule. Give it root access whenever it asks. Confidence is very high that HomeBrew won't set any permissions incorrectly. 95 | 96 | Homebrew ProTip: Before brewing anything now and in the future, you should first run and resolve, 97 | 98 | ```=>$ brew update``` 99 | 100 | ```=>$ brew doctor``` 101 | 102 | ### Git 103 | 104 | 1. Install Git via Homebrew 105 | ``` =>$ brew install git ``` 106 | 107 | 2. Check Git version 108 | ``` =>$ git --version ``` 109 | 110 | 3. Which should return you _something like_ 111 | ``` git version 2.2.2 ``` 112 | 113 | 4. Set global Git variables. (Fill in the blanks where needed) 114 | 115 | - ``` =>$ git config --global user.name "BLANK (The name you want displayed on Git, could be Username or someName)" ``` 116 | 117 | - ``` =>$ git config --global user.email "BLANK (ex: you@example.com) ``` 118 | 119 | ### rbenv 120 | 121 | 1. Install rbenv via Homebrew 122 | ``` =>$ brew install rbenv ``` 123 | 124 | 2. Check rbenv version to confirm installation. 125 | ``` =>$ rbenv -v ``` 126 | 127 | 3. Which should return you _something like_ 128 | ``` rbenv 0.4.0 ``` 129 | 130 | 4. Check the install versions of Ruby with rbenv. 131 | ``` =>$ rbenv versions ``` 132 | 133 | 5. Now install a couple versions of Ruby. This will typically take 5 - 10 minutes a piece. Here are some suggested versions at the time of this writing: 134 | - ``` =>$ rbenv install 2.3.1 ``` 135 | - ``` =>$ rbenv install 2.0.0-p353 ``` 136 | 137 | 6. Re-Check the install versions of Ruby with rbenv. 138 | ``` =>$ rbenv versions ``` 139 | 140 | 7. Set a Global Ruby version (Can be any version you just installed) 141 | ``` =>$ rbenv global 2.3.1 ``` 142 | 143 | ### iTerm 144 | 145 | 1. Install cask for homebrew 146 | ``` =>$ brew install cask ``` 147 | 2. Install iTerm2 148 | ``` =>$ brew cask install iterm2 ``` 149 | 3. Wait 10 seconds then cmd + spacebar enter iTerm and hit return 150 | 151 | ##### Base settings 152 | 153 | 4. Click preferences 154 | 5. Click the keys tab 155 | 6. Check the box for hotkey in lower left 156 | - I use ``` cmd + \ ``` 157 | 7. Click the profiles tab 158 | 8. Click the sub tab **window** 159 | 9. Slide the transparency slider over to about 20% (the goal is to be able to read text in a browser behind the window but not have it be bright enough to bother you) 160 | 10. Click the sub tab **terminal**, change scroll back lines to 10,000 161 | 162 | ##### Optional settings 163 | 164 | 11. Under the Profiles tab click sub tab **general** 165 | 12. De-select copy to pasteboard on selection ( I don’t want a bunch of terminal commands cluttering up my Flycut) 166 | 13. Click sub tab **colors** 167 | 14. The suggestion here is not to play around too much. The color scheme as it is works pretty well. However, I prefer ``` 00d0fa ``` for the foreground color. But that’s me so... 168 | 169 | ### dotfiles 170 | 171 | 1. From terminal change directory to the desktop. 172 | ```bash 173 | =>$ cd ~/Desktop 174 | ``` 175 | 176 | 2. Clone Topher's DotFiles onto the desktop. 177 | ```bash 178 | =>$ git clone https://github.com/supertopher/dotfiles.git 179 | ``` 180 | 181 | 3. Change directories into the repo. 182 | ```bash 183 | =>$ cd dotfiles 184 | ``` 185 | 186 | 4. Run the script to acquire Bash goodies. 187 | ```bash 188 | =>$ ./install 189 | ``` 190 | 191 | 5. Restart or open a new terminal tab (CMD+t) to see changes. Any Bash changes will not apply to the current terminal session running. 192 | 193 | 6. Go up one level and remove the dotfiles directory 194 | ```bash 195 | =>$ cd .. 196 | =>$ rm -rf dotfiles 197 | ``` 198 | 199 | ### Spectacle 200 | 201 | 1. Install Spectacle via Brew Cask 202 | ``` =>$ brew cask install spectacle ``` 203 | 2. Use ‘spotlight’ to open spectacle for the first time 204 | - cmd + spacebar to open spotlight 205 | 3. Type spectacle hit return when you see it auto-populated 206 | 4. Choose open system preferences 207 | 5. Click the lock in the lower left 208 | 6. Enter system password 209 | 7. Check the box next to spectacle 210 | 8. Close system prefs 211 | 9. Open Spectacle Preferences 212 | 10. Click the right slider arrow at the bottom 213 | 11. Check ``` Launch Spectacle at login ``` 214 | 215 | ### SublimeText 3 216 | 217 | 1. Install Sublime Text 3 via HomeBrew Cask 218 | 219 | - ```brew cask install sublime-text``` 220 | - Provide system password when/if prompted 221 | 222 | 2. Install Sublime Text 3 Package Manager 223 | 224 | - In Sublime use ```CMD+Shift+P``` to bring up the command pallet 225 | - Type ```Install``` and you can select an option for ```Install Package Manager``` 226 | - When finished exit and restart Sublime Text 227 | 228 | 3. Install the following packages 229 | 230 | From Sublime do 231 | 232 | 1. Use ```CMD+Shift+P``` to open Sublime command fuzzy search 233 | 2. Start typing ```install```, hit enter when you see "Package Control: Install Package" 234 | 3. Start typing the name of the package you want, hit return when you see it. 235 | 236 | - All Autocomplete 237 | - Better CoffeeScript 238 | - BracketHighlighter 239 | - ERB Snippets 240 | - GitGutter 241 | - Haml 242 | - JSX 243 | - Markdown Preview 244 | - Package Control 245 | - PowerCursors 246 | - SASS 247 | - SideBarEnhancements 248 | - sublime-github 249 | - SublimeLinter 250 | - SublimeLinter-haml 251 | - SublimeLinter-ruby 252 | - TernJS 253 | - Tomorrow Color Scheme 254 | - Theme - Tech49 255 | 256 | 4. Apply custom user settings (open user settings with ```CMD+Shift+P user```) 257 | 258 | Here is a sample from my editor. 259 | 260 | **Note:** Some of these settings will break Sublime if the corresponding package is not installed first. If you did not install theme || color scheme remove the applicable lines before saving the file. 261 | 262 | **Note:** If your editor goes white and throws an error just set the color from the top bar 263 | ```Sublime Text -> preferences -> Color Scheme -> Choose one you like``` 264 | 265 | **Note:** The sample below represents the user settings file. Do not simply append this to the bottom of what you have. The settings hash must be 1 complete unit. 266 | 267 | **Note:** Do not edit the Default Settings in Sublime. These will be overwritten whenever Sublime is updated. Always store user settings in.... Preferences: Settings - User. 268 | 269 | ```json 270 | { 271 | "atomic_save": false, 272 | "bold_folder_labels": true, 273 | "caret_style": "phase", 274 | "color_scheme": "Packages/User/SublimeLinter/Tomorrow-Night (SL).tmTheme", 275 | "draw_white_space": "selection", 276 | "ensure_newline_at_eof_on_save": true, 277 | "fade_fold_buttons": false, 278 | "font_face": "Inconsolata", 279 | "font_size": 17, 280 | "highlight_line": true, 281 | "ignored_packages": 282 | [ 283 | "Emmet", 284 | "PlainTasks", 285 | "RubyTest", 286 | "Theme - Farzher", 287 | "Vintage" 288 | ], 289 | "line_padding_bottom": 1, 290 | "line_padding_top": 1, 291 | "rulers": 292 | [ 293 | 80 294 | ], 295 | "save_on_focus_lost": true, 296 | "spell_check": true, 297 | "tab_size": 2, 298 | "theme": "Tech49.sublime-theme", 299 | "translate_tabs_to_spaces": true, 300 | "trim_trailing_white_space_on_save": true 301 | } 302 | ``` 303 | 304 | 5. Check sublime to confirm installation. 305 | In iTerm ``` =>$ subl . ``` 306 | 307 | This should open a sublime window for the current directory. 308 | 309 | ### Heroku toolbelt 310 | 311 | 1. Install heroku toolbelt vai homebrew 312 | ``` =>$ brew install heroku-toolbelt ``` 313 | 314 | 2. Check heroku version to confirm installation. 315 | ``` =>$ heroku --version ``` 316 | 317 | 3. Which should return _something like_ 318 | ```bash 319 | heroku-toolbelt/3.42.45 (x86_64-darwin10.8.0) ruby/1.9.3 320 | heroku-cli/4.29.0-cac96d9 (amd64-darwin) go1.6 321 | === Installed Plugins 322 | heroku-apps@1.7.3 323 | heroku-cli-addons@0.3.0 324 | heroku-fork@4.1.1 325 | heroku-git@2.4.5 326 | ``` 327 | 328 | 4. Login to the Heroku CLI Toolkit now using 329 | ``` 330 | =>$ heroku login 331 | ``` 332 | 333 | You should see something like this. Note the email and password are specifically your Heroku email and password. 334 | 335 | ``` 336 | Enter your Heroku credentials. 337 | Email: adam@example.com 338 | Password (typing will be hidden): 339 | Authentication successful. 340 | ``` 341 | 342 | ### NVM 343 | 344 | 1. Install [NVM](https://github.com/creationix/nvm) 345 | ```=>$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash``` 346 | 2. Close & restart your terminal 347 | 348 | 3. Install Node 349 | ```nvm install node``` 350 | 4. Check node version to confirm installation. 351 | ```=>$ node -v``` 352 | 353 | 5. Which should return _something like_ 354 | ```v4.1.1``` 355 | 356 | 6. Check NPM version to confirm installation. 357 | ```=>$ npm -v``` 358 | 359 | 7. Which should return _something like_ 360 | ```2.14.4``` 361 | 362 | ### postgres 363 | 364 | 1. Install Postgresql via Homebrew. 365 | ``` =>$ brew install postgres ``` 366 | 367 | 2. Start the Postgresql server. 368 | 369 | Notice the messages displayed after completion. Typical OK 200 in Bash is nothing at all. When things go well Bash doesn't tell you about it. That said, when a developer cares enough to put in some extra text after the script runs, you should care enough to read it... Post install here will most likely contain this line: 370 | 371 | ```bash 372 | =>$ brew services start postgresql 373 | ``` 374 | 375 | Go ahead and run that to have brew start up postgres. 376 | 377 | 3. Check postgresql version to confirm installation. 378 | ``` =>$ psql --version ``` 379 | 380 | 4. Which should return _something like_ 381 | ``` psql (PostgreSQL) 9.4.0 ``` 382 | 383 | ### sqlite3 384 | 385 | 1. Install sqlite3 via Homebrew 386 | ``` =>$ brew install sqlite ``` 387 | 388 | 2. Check sqlite3 version to confirm installation. 389 | ``` =>$ sqlite3 --version ``` 390 | 391 | 3. Which should return _something like_ 392 | ``` 3.8.5 2014-08-15 22:37:57 c8ade949d4a2eb3bba4702a4a0e17b405e9b6ace ``` 393 | 394 | ### mysql 395 | 396 | 1. Install mysql via Homebrew 397 | ``` =>$ brew install mysql ``` 398 | 399 | 2. Start the mysql server 400 | ```bash 401 | =>$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents 402 | 403 | =>$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 404 | ``` 405 | 406 | 2. Check mysql version to confirm installation. 407 | ``` =>$ mysql --version ``` 408 | 409 | 3. Which should return _something like_ 410 | ``` mysql Ver 14.14 Distrib 5.7.11, for osx10.10 (x86_64) using EditLine wrapper ``` 411 | 412 | ### MongoDB 413 | 414 | 1. Install MongoDB via Homebrew 415 | ``` =>$ brew install mongodb --with-openssl ``` 416 | 417 | 2. Check Mongo version to confirm installation. 418 | ``` =>$ mongo —version ``` 419 | ```bash 420 | To have launchd start mongodb now and restart at login: 421 | brew services start mongodb 422 | Or, if you don't want/need a background service you can just run: 423 | mongod --config /usr/local/etc/mongod.conf 424 | ``` 425 | 426 | 3. Which should return _something like_ 427 | ``` MongoDB shell version: 3.0.4 ``` 428 | 429 | ### Rails 430 | 431 | 1. Install Rails via Gem 432 | ``` =>$ gem install rails ``` 433 | 434 | 2. Check Rails version to confirm installation. 435 | ``` =>$ rails —v ``` 436 | 437 | 3. Which should return _something like_ 438 | ``` Rails 4.2.6 ``` 439 | 440 | ProTip: Don't ever EVER use sudo to install a GEM. IDC what the internet tells you. If you are using sudo to install a GEM you are doing it WRONG. 441 | 442 | ### Chrome 443 | 444 | 1. Install Chrome via Brew Cask 445 | ``` =>$ brew cask install google-chrome ``` 446 | 447 | ### Firefox 448 | 449 | 1. Install Firefox via Brew Cask 450 | ``` =>$ brew cask install firefox ``` 451 | 452 | ### Flycut 453 | 454 | 1. Install via Brew Cask 455 | ```=>$ brew cask install flycut``` 456 | 2. Open Flycut 457 | 3. Click the red flycut icon in the menu bar 458 | 4. Choose preferences 459 | 5. Under general select launch @ login 460 | 6. Reduce remember amount from 40 to 20 461 | 7. Under appearance tab, set all three values down the middle 462 | 463 | ### Alfred 464 | 465 | 1. Install via Brew Cask 466 | ```=>$ brew cask install alfred``` 467 | 2. Use spotlight to open Alfred 468 | 3. Choose open 469 | 4. Choose OK to access contacts 470 | 5. Now we are going to disable spotlight and reassign ``` cmd + spacebar ``` to Alfred 471 | - Use spotlight (cmd+spacebar) to open spotlight :-) 472 | - In the lower left corner of the system preferences pane choose keyboard shortcuts 473 | - Deselect the top option to disassociate spotlight with the cmd + space keys 474 | - Now close spotlight settings 475 | - Click back or reopen alfred settings 476 | - Set Alfred hotkey to cmd+Space under Alfred preferences 477 | 6. Disable Spotlight indexing to improve performance. 478 | - Open Alfred ``` cmd + spacebar ``` 479 | - Enter ``` spotlight ``` to open spotlight preferences 480 | - Under the 'Search Results' tab, disable all options 481 | - Disable 'Allow Spotlight Suggestions in Spotlight and Look up' 482 | 483 | 484 | #### Settings 485 | 486 | 1. Set your location to the United States 487 | 2. Appearance tab 488 | - Theme sub tab 489 | - Theme set to dark and smooth 490 | - Large type subtab 491 | - Change the dropdown to ‘Fill the screen’ 492 | - Options subtab 493 | - Toggle hide hat on Alfred window 494 | - Toggle hide menu bar icon 495 | 496 | ### System Settings 497 | 498 | Now that you're all installed and whatnot. Here are some recommended setting to apply to your machine. 499 | 500 | - Right-click the battery in the menu bar. Toggle on ``` Show Percentage ``` 501 | - Right-click the vertical bar in the Dock. Toggle ``` automatically hide Dock ``` 502 | - Set global no ri no rdoc 503 | ```bash 504 | =>$ echo "gem: --no-ri --no-rdoc" >> ~/.gemrc 505 | ``` 506 | - Set global rspec settings 507 | ```bash 508 | =>$ echo $'--color\n--tty\n--format documentation' >> ~/.rspec 509 | ``` 510 | 511 | ## Additional Recommended Applications 512 | 513 | Terminal Apps 514 | 515 | - ``` =>$ brew install hub ``` -- Extended Git commands in terminal. 516 | - ``` =>$ brew install imagemagick ``` -- Super awesome gem for dealing with image files. 517 | - ``` =>$ brew install tree ``` -- Nice way to display tree structure of a directory in terminal. 518 | 519 | OSX Apps 520 | 521 | - [VLC](http://www.videolan.org/vlc/index.html) -- Best media player out there for like a decade now. 522 | - [Dash](https://kapeli.com/dash) -- Great documentation and snippet management software. 523 | - [Postman](https://www.getpostman.com/) -- Simple easy API exploration tool. 524 | - [Private Internet Access](https://www.privateinternetaccess.com/) -- Best $40.00 I spend all year EVERY YEAR. Secure INTERNET connection from anywhere as well as an easy bypass to geographical restrictions. Moral of the story: I can do banking stuff from open WIFI in Starbucks while streaming a soccer match that is in blackout anywhere outside of the UK. All with 0 worries. 525 | - [f.lux](https://justgetflux.com/) -- Adjusts the chroma setting of your display based on the time of day. 526 | - [Dropbox](https://www.dropbox.com/) -- Every line of code I've ever written resides in my dropbox. Moral of the story: I can throw my laptop out the window and give 0 cares. 527 | - Chrome Extensions 528 | - colorzilla -- Helpful color picker. 529 | - currently -- Nice new tab page, clean and useful 530 | - jsonview -- Returning json from some page, why not have it look decent.... 531 | - web-developer -- Collection of dev tools to help. 532 | - One Tab -- Collapse all tabs down into a single tab that lists them out in a shareable format. Does not retain active session. Since each tab is a separate process this can be a HUGE memory saver. Best extension ever. 533 | - Tab Scissors -- Use in conjunction with OneTab. Tab scissors takes everything from the right of the current tab and opens it in a new window, removing it from the current window. Super useful. 534 | 535 | ---- 536 | 537 | ### Contributing: 538 | 539 | If you feel I've missed something or if you find a pain point I didn't document, *Please [open an issue](https://github.com/bootcoder/ENV_Scratch_Setup/issues).* Feedback always greatly appreciated. 540 | 541 | If you have critical updates or just want to contribute in general, *Please fork it, contribute and open a pull request.* 542 | 543 | As to the subject matter itself, if you don't agree in my choice of software that's awesome! 544 | 545 | But for seriouslies, I'm not saying I don't care about or appreciate how much better ```INSERT RANDO SOFTWARE TITLE HERE``` is. I'm just saying I've heard... it's cool. No need to track me down, shake me around and pontificate furiously whilst cycling through the virtues of ```INSERT RANDO SOFTWARE TITLE HERE```. 546 | 547 | ### Fin 548 | 549 | Thanks for stopping by. Hope this helped. Happy Hacking, 550 | 551 | BootCoder 552 | -------------------------------------------------------------------------------- /apple_id_sign_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bootcoder/ENV_Scratch_Setup/fc72e6760b0f99c7b3b95c5c16df4b9c59d46253/apple_id_sign_in.png -------------------------------------------------------------------------------- /username_password.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bootcoder/ENV_Scratch_Setup/fc72e6760b0f99c7b3b95c5c16df4b9c59d46253/username_password.jpg --------------------------------------------------------------------------------