├── .github ├── CONTRIBUTING.md ├── CONTRIBUTION_TEMPLATE.md ├── ISSUE_TEMPLATE.md └── workflows │ ├── links.yml │ └── test.yml ├── .gitignore ├── .markdownlint.json ├── .vscode └── settings.json ├── Apps ├── Octave.md ├── README.md ├── Settings.md ├── araxis-merge.jpg ├── beyond-compare.png ├── delta-walker.jpg ├── filemerge.png └── kaleidoscope.png ├── BashCompletion └── README.md ├── Contributors.md ├── Cpp └── README.md ├── Docker ├── README.md ├── TipsAndTricks.md └── UsefulCommands.md ├── Emacs └── README.md ├── Git ├── README.md └── gitignore.md ├── Go └── README.md ├── Heroku └── README.md ├── Homebrew ├── Cask.md ├── README.md └── Usage.md ├── Java ├── README.md └── sdkman.md ├── JetBrainsIDEs └── README.md ├── LICENSE ├── LaTeX └── README.md ├── Makefile ├── MyySQL └── README.md ├── Node.js └── README.md ├── Perl └── README.md ├── PostgreSQL └── README.md ├── Python ├── README.md ├── ipython.md ├── numpy.md ├── pip.md └── virtualenv.md ├── README.md ├── References └── README.md ├── Ruby ├── README.md └── RubyGems.md ├── Rust └── README.md ├── SUMMARY.md ├── Scala └── README.md ├── Security └── README.md ├── SublimeText ├── Packages.md ├── Plugins.md ├── Preferences.md ├── README.md └── SublimeLinter.md ├── Sudo └── README.md ├── SystemPreferences └── README.md ├── Vagrant └── README.md ├── Vim └── README.md ├── VisualStudioCode └── README.md ├── Xcode └── README.md ├── _layouts └── website │ └── page.html ├── assets ├── Iterm.png └── intro.gif ├── book.json ├── iTerm ├── README.md ├── ack.md ├── autojump.md ├── fzf.md ├── tree.md └── zsh.md ├── package.json ├── scripts ├── generate_contributors.js ├── health_check_links.sh └── publish_gitbook.sh ├── styles └── website.css └── yarn.lock /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to macOS Setup Guide 2 | 3 | Contributions to macOS Setup Guide are more than welcome. 4 | 5 | ## License 6 | 7 | By contributing code to macOS Setup Guide, you agree to license your 8 | contribution under the [MIT License](../LICENSE). 9 | 10 | ## Installing dependencies and linting 11 | 12 | Run `make deps` first to make sure all the dependencies are installed in the workspace. Then run `make lint` before submitting your PR to make sure your changes comply 13 | with our styling. 14 | 15 | ## How to contribute to macOS Setup Guide 16 | 17 | If you would like to submit a pull request, please base it on our 18 | [template](CONTRIBUTION_TEMPLATE.md). Not only does this make things easier for 19 | _you_ to know what to include in your contribution, it makes the guide more 20 | consistent which results in a better experience for the user. Thank you. 21 | -------------------------------------------------------------------------------- /.github/CONTRIBUTION_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | <!-- 2 | We strive to follow the guidelines that Homebrew use for their documentation. 3 | Please respect these guidelines: https://docs.brew.sh/Prose-Style-Guidelines 4 | --> 5 | 6 | # Tool/library/language name 7 | <!-- 8 | Here you should briefly introduce the software and tell the us what it's 9 | used for. 10 | --> 11 | 12 | ## Installation 13 | <!-- 14 | How to install it. If it's available on Homebrew, just include the following: 15 | 16 | ```sh 17 | brew install <tool> 18 | ``` 19 | --> 20 | 21 | ## Usage 22 | <!-- 23 | In this section you can add commands/features that are commonly used. It 24 | should _at least_ include the default usage. A bonus is if you add 25 | descriptions for extra features. If it's a command-line tool you are writing 26 | about you could for example write about some useful flags. See iTerm/tree 27 | for an example. 28 | --> 29 | 30 | ## Customization 31 | <!-- If the tool has any useful customization it can be added here --> 32 | 33 | ## More 34 | <!-- Add more sections if you think they are useful --> 35 | 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | <!-- 2 | Hi, 3 | Thanks for taking the time to contribute to making this guide even better! 4 | While we do appreciate bug reports, we would love to see a PR fixing the issue even more. 5 | This guide is intended to be built by the community and not only the maintainers :) 6 | We (the maintainers) don't know everything, but if we all work together we can make this 7 | guide the best available. Thank you <3 8 | --> 9 | 10 | ### I'm Submitting a ... 11 | <!-- Put an "x" in the box for the type of report that apply, like this [x] --> 12 | ``` 13 | [ ] Bug report 14 | [ ] Tool/language/etc documentation request 15 | ``` 16 | 17 | ### Bug Location 18 | <!-- A link or a screenshot with an explanation is sufficient --> 19 | 20 | ### Tool/Language/etc 21 | <!-- 22 | What tool, language or other software that you think this guide 23 | should include and also _why_ you think it should be included. 24 | --> 25 | 26 | ### Other Information 27 | <!-- Any other information you'd like to include --> 28 | -------------------------------------------------------------------------------- /.github/workflows/links.yml: -------------------------------------------------------------------------------- 1 | name: Links 2 | 3 | on: 4 | schedule: 5 | # Run at 00:00 UTC every Sunday 6 | - cron: '0 0 * * */7' 7 | 8 | env: 9 | FORCE_COLOR: 1 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | 18 | - name: Find markdown files 19 | shell: bash 20 | run: | 21 | echo 'FILES_TO_CHECK<<EOF' >> $GITHUB_ENV 22 | 23 | # $GITHUB_WORKSPACE is where our files live 24 | # Ignore dirs and only include markdown files 25 | 26 | files_to_check=$(find $GITHUB_WORKSPACE -type f \ 27 | -not -path '*/\.git/*' -not -path '*/\.github/*' \ 28 | -name "*.md") 29 | 30 | echo $files_to_check >> $GITHUB_ENV 31 | echo 'EOF' >> $GITHUB_ENV 32 | 33 | - name: Validate that links are up 34 | uses: simeg/urlsup-action@v1.0.0 35 | with: 36 | args: ${{ env.FILES_TO_CHECK }} --threads 10 --allow 429 --white-list http://localhost 37 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: [push, pull_request] 4 | 5 | env: 6 | FORCE_COLOR: 1 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Set up node 16 | uses: actions/setup-node@v2-beta 17 | with: 18 | node-version: '13' 19 | 20 | - name: Get yarn cache directory path 21 | id: yarn-cache-dir-path 22 | run: echo "::set-output name=dir::$(yarn cache dir)" 23 | 24 | - uses: actions/cache@v2 25 | id: yarn-cache 26 | with: 27 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 28 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 29 | restore-keys: | 30 | ${{ runner.os }}-yarn- 31 | 32 | - name: Install dependencies 33 | run: | 34 | make deps 35 | 36 | - name: Test 37 | run: | 38 | make ci 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .grunt 3 | /_book/ 4 | *.log 5 | 6 | *.DS_Store 7 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Ignore these, they don't fit our style", 3 | "line-length": false, 4 | "no-duplicate-heading": false, 5 | "no-inline-html": false 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Apps/Octave.md: -------------------------------------------------------------------------------- 1 | # Octave 2 | 3 | [Octave](https://www.gnu.org/software/octave/) is a programming language for scientific computing. 4 | 5 | ## Prerequisite 6 | 7 | You might need `homebrew-cask`; if you don't have it, refer to [this section](../Homebrew/Cask.md). 8 | 9 | ## Installation 10 | 11 | ### Homebrew Octave.app 12 | 13 | [Octave.app](https://octave-app.org) is a project to distribute GNU Octave as a native Mac GUI application, to make it easier to install and use Octave on macOS. Note this is not an official GNU or GNU Octave project. 14 | As this distributes a compiled version of Octave, installation will be much faster. 15 | 16 | To [install using homebrew-cask](https://octave-app.org/#installing-with-homebrew-cask) run: 17 | 18 | ```sh 19 | brew tap octave-app/octave-app 20 | brew install --cask octave-app 21 | ``` 22 | 23 | ### Homebrew official 24 | 25 | You can also install Octave from the official Homebrew source using the method below. 26 | 27 | Install `octave` from core Homebrew (which is available by default): 28 | 29 | ```sh 30 | brew install octave 31 | ``` 32 | 33 | **Note**: If `brew` complains about not having a formula for Octave, the following command should fix it: 34 | 35 | ```sh 36 | brew tap --repair 37 | ``` 38 | 39 | The command below upgrades Octave and its dependencies to the latest Homebrew-supported versions: 40 | 41 | ```sh 42 | brew update && brew upgrade 43 | ``` 44 | 45 | Octave has many dependencies which will be downloaded and installed prior to Octave. **The entire installation process can take a few hours if you are compiling from source.** 46 | 47 | **Note:** On Snow Leopard or earlier, Octave requires an X server. You can download one from the [XQuartz project](https://www.xquartz.org/). 48 | 49 | You might find that you need to add: 50 | 51 | ```sh 52 | setenv ("GNUTERM", "X11") 53 | ``` 54 | 55 | to your octaverc file, normally located at `/usr/local/share/octave/site/m/startup`. 56 | -------------------------------------------------------------------------------- /Apps/README.md: -------------------------------------------------------------------------------- 1 | # Apps 2 | 3 | Here is a list of apps that are generally good to use and can come in handy in day to day tasks. The apps are separated into 4 broad categories _Developer Tools_, _Productivity Tools_, _Office Apps_ and _Other_. 4 | 5 | ## Development Tools 6 | 7 | - [Google Chrome](https://www.google.com/intl/en/chrome/browser/): Chrome is a developer friendly browser with powerful development tools built in to it. 8 | - [Valentina Studio](http://www.valentina-db.com/en/valentina-studio-overview): Valentina Studio is a GUI to create, administer and query MySQL, Postgres and SQLite databases. 9 | - [Atom](https://atom.io/): An open source editor built and maintained by GitHub, is very similar to Sublime Text in most aspects. 10 | 11 | ## Diff and Merge Tools 12 | 13 | [FileMerge](https://developer.apple.com/xcode/features/): A free tool which is already installed on your machine. It might not be the most elegant tool, but it's definitely a solid one that does the job of comparing & merging text. 14 | 15 |  16 | 17 | [Kaleidoscope](https://apps.apple.com/us/app/kaleidoscope/id587512244): Another tool for reviewing and merging text, images and folders. Its beautiful user interface and great image diffing capabilities are what sets it apart from other tools. Available for a trial period of 15 days and then it requires payment. 18 | 19 |  20 | 21 | [Beyond Compare](http://www.scootersoftware.com/): Not only can you compare text with this tool but it also supports diffing Word and PDF contents. In the Pro Version it also supports merging. 22 | 23 |  24 | 25 | [Araxis Merge](http://www.araxis.com/merge/): One of the few diff tools that works with more than just text and image files, this one lets you also compare office documents (like MS Word, Excel, PowerPoint, or ODF). A single license is valid for both Windows and Mac. 26 | 27 |  28 | 29 | [DeltaWalker](https://www.deltawalker.com/): Just like Araxis, this app also lets you compare office files. However, it goes one step further by letting you compare file archives like ZIP, JAR, and TAR files. It also has great performance for comparing folders. 30 | 31 |  32 | 33 | ### Free alternatives 34 | 35 | - [P4Merge](http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools) 36 | - [DiffMerge](http://www.sourcegear.com/diffmerge/) 37 | Both of these tools can't compare in terms of features and user interface with their commercial competitors - but make for a valid alternative on Mac, Windows and Linux. 38 | 39 | ## Productivity 40 | 41 | - [1Password](https://agilebits.com/onepassword): Cross platform password management tool. 42 | - [Airmail](http://airmailapp.com/): Lightweight fast email client. 43 | - [Alfred](http://www.alfredapp.com/): Spotlight on steroids. 44 | - [Amphetamine](https://apps.apple.com/us/app/amphetamine/id937984704): Stops the machine from going into sleep mode. 45 | - [AppCleaner](http://www.freemacsoft.net/appcleaner/): Uninstall apps. 46 | - [DoubleTwist](https://www.doubletwist.com/desktop/): Import your playlists, ratings, music and videos. Create new playlists to your heart's content. Rate your songs and videos. Play your music and videos and view all of your photos. 47 | - [Dropbox](https://www.dropbox.com/): File syncing to the cloud. It syncs files across all devices (laptop, mobile, tablet), and serves as a backup as well! 48 | - [F.lux](https://justgetflux.com/): f.lux makes the color of your computer's display adapt to the time of day, warm at night and like sunlight during the day (If you are running macOS 10.12.4 or later there's native functionality called 'Night Shift' that does the same thing as f.lux, see System Preferences -> Displays -> Night Shift). 49 | - [Google Drive](https://drive.google.com/): File syncing to the cloud too! Google Docs is a popular tool to collaborate with others. 50 | - [Notebooks](http://www.notebooksapp.com/mac/): Notebooks for Mac allows you to share files with the mobile versions of Notebooks on the iPad and iPhone. And you can write notes in markdown. 51 | - [PDF Toolkit+](https://itunes.apple.com/us/app/pdf-toolkit-+/id545164971?mt=12): App to cut/split/merge pdfs easily. Really easy to use and works well. 52 | - [Pocket](https://getpocket.com): Save For Later. Put articles, videos or pretty much anything into Pocket. Save directly from your browser or from apps like Twitter, Flipboard, Pulse and Zite. 53 | - [Rectangle](https://github.com/rxhanson/Rectangle): Don't waste time resizing and moving your windows. Rectangle makes this very easy and is open source. 54 | - [Timing](http://timingapp.com/): Keep track of the time you spend with your Mac. 55 | - [Tomighty](https://tomighty.github.io/): A free desktop timer for the Pomodoro Technique. 56 | - [Total Finder](http://totalfinder.binaryage.com/): Adds tabs and improves the Finder to a great deal. 57 | - [Transmission](http://www.transmissionbt.com/): A fast, easy and free BitTorrent client. 58 | - [Unarchiver](http://wakaba.c3.cx/s/apps/unarchiver.html): Compress/Uncompress app. Supported file formats include Zip, Tar-GZip, Tar-BZip2, RAR, 7-zip, LhA, StuffIt and many other old and obscure formats. 59 | 60 | ## Office Apps 61 | 62 | - [Keynote](http://www.apple.com/mac/keynote/): Create presentations on Mac, this is supposed to be an alternate to PowerPoint. 63 | - [Microsoft Office](http://www.microsoft.com/mac/buy): Microsoft Office for Mac. Includes Microsoft Word, Excel, PowerPoint and Outlook. 64 | - [Numbers](http://www.apple.com/mac/numbers/): Create spreadsheets on Mac, this is supposed to be an alternate to Excel. 65 | - [Pages](http://www.apple.com/mac/pages/): Create text files on Mac, this is supposed to be an alternate to Word. 66 | 67 | ## Other 68 | 69 | - [Skim](https://sourceforge.net/projects/skim-app/): Skim is a PDF reader and note-taker for macOS. 70 | - [SuperDuper](http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html): Take backups of your disk and use the backup disk to restore the machine in case of failure. 71 | - [TimeOut](http://www.dejal.com/timeout/): Scheduled work breaks to prevent stress injuries. 72 | - [VLC](http://www.videolan.org/vlc/index.html): VLC Media Player. Enough said. 73 | - [Voila](http://www.globaldelight.com/voila/): Record your screen with audio, mouse highlight and other features. 74 | -------------------------------------------------------------------------------- /Apps/Settings.md: -------------------------------------------------------------------------------- 1 | # Various App Settings 2 | 3 | These settings are optional. Some of them are highly subjective and should not be considered as the best settings. To each is own. 4 | 5 | ## Airmail 6 | 7 | - Add all the accounts into airmail 8 | - Update icons and signatures for all the accounts 9 | - Add alias for all the forwarding addresses 10 | - Change appearance to minimal 11 | 12 | ## CheatSheet 13 | 14 | - System Preferences -> Security and Privacy -> Accessibility -> Check 15 | 16 | ## DoubleTwist 17 | 18 | - Add the music folder to the library 19 | 20 | ## Notebooks 21 | 22 | - Set the default directory to a folder inside Dropbox for CloudSync 23 | - Overwrite one of the themes in the app with [GitHub Mardown CSS](https://gist.github.com/andyferra/2554919) 24 | 25 | ## Spectacle 26 | 27 | - Update all major combinations to work with `Shift + Control + 1-9` 28 | - Remove the key combinations for the other sizes 29 | - System Preferences -> Security and Privacy -> Accessibility -> Check 30 | 31 | ## Timing 32 | 33 | - System Preferences -> Security and Privacy -> Accessibility -> Check 34 | -------------------------------------------------------------------------------- /Apps/araxis-merge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/Apps/araxis-merge.jpg -------------------------------------------------------------------------------- /Apps/beyond-compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/Apps/beyond-compare.png -------------------------------------------------------------------------------- /Apps/delta-walker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/Apps/delta-walker.jpg -------------------------------------------------------------------------------- /Apps/filemerge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/Apps/filemerge.png -------------------------------------------------------------------------------- /Apps/kaleidoscope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/Apps/kaleidoscope.png -------------------------------------------------------------------------------- /BashCompletion/README.md: -------------------------------------------------------------------------------- 1 | # Bash Completion 2 | 3 | Bash completion is a bash function that allows you to auto complete commands or 4 | arguments by typing partially commands or arguments, then pressing the [Tab] 5 | key. This will help you when writing the bash command in terminal. 6 | 7 | ## Installation 8 | 9 | ```sh 10 | brew install bash-completion 11 | ``` 12 | 13 | Bash completion will be installed in `/usr/local/etc/bash_completion.d`. 14 | 15 | For it to work, add this to your `~/.bash_profile`: 16 | 17 | ```sh 18 | [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion 19 | ``` 20 | 21 | Or simply type: 22 | 23 | ```sh 24 | echo "[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion" >> ~/.bash_profile 25 | ``` 26 | 27 | Restart your bash session: 28 | 29 | ```sh 30 | source ~/.bash_profile 31 | ``` 32 | 33 | ## Usage 34 | 35 | Once you've done this, you can use bash completion by pressing the tab key 36 | twice after a command. For example: 37 | 38 | ```console 39 | $ git [tab] [tab] 40 | add blame cherry-pick config format-patch gui merge push repack rm stage whatchanged 41 | am branch citool describe fsck help mergetool range-diff replace send-email stash worktree 42 | apply bundle clean diff gc init mv rebase request-pull shortlog status 43 | archive checkout clone difftool gitk instaweb notes reflog reset show submodule 44 | bisect cherry commit fetch grep log pull remote revert show-branch tag 45 | ``` 46 | 47 | ## More 48 | 49 | You can list additional completion packages are available by typing: 50 | 51 | ```sh 52 | brew search completion 53 | ``` 54 | 55 | And you can install them using `brew install` commands, for example: 56 | 57 | ```sh 58 | brew install docker-completion 59 | ``` 60 | 61 | *You can also manually add a bash completion file into 62 | `/usr/local/etc/bash_completion.d`* 63 | -------------------------------------------------------------------------------- /Contributors.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | Thank you everyone that have contributed to creating this awesome guide! 4 | 5 | - [simeg](https://github.com/simeg) 6 | - [sb2nov](https://github.com/sb2nov) 7 | - [hugovk](https://github.com/hugovk) 8 | - [nicolashery](https://github.com/nicolashery) 9 | - [Kyslik](https://github.com/Kyslik) 10 | - [kamleshkc2002](https://github.com/kamleshkc2002) 11 | - [otkd](https://github.com/otkd) 12 | - [AidHamza](https://github.com/AidHamza) 13 | - [michaelbeil](https://github.com/michaelbeil) 14 | - [luce-carevic](https://github.com/luce-carevic) 15 | - [apjanke](https://github.com/apjanke) 16 | - [prksu](https://github.com/prksu) 17 | - [Clifton893](https://github.com/Clifton893) 18 | - [echernyavskiy](https://github.com/echernyavskiy) 19 | - [RabbitMC](https://github.com/RabbitMC) 20 | - [rohitjmathew](https://github.com/rohitjmathew) 21 | - [sebastianwebber](https://github.com/sebastianwebber) 22 | - [viniciusbig](https://github.com/viniciusbig) 23 | - [snood1205](https://github.com/snood1205) 24 | - [sdavara](https://github.com/sdavara) 25 | - [ShayMe21](https://github.com/ShayMe21) 26 | - [shreyasbharath](https://github.com/shreyasbharath) 27 | - [tychobrailleur](https://github.com/tychobrailleur) 28 | - [vmalyi](https://github.com/vmalyi) 29 | - [williambelle](https://github.com/williambelle) 30 | - [pomverte](https://github.com/pomverte) 31 | - [jgreely](https://github.com/jgreely) 32 | - [mateuszroth](https://github.com/mateuszroth) 33 | - [raavanan](https://github.com/raavanan) 34 | - [adolgiy](https://github.com/adolgiy) 35 | - [at15](https://github.com/at15) 36 | - [gianpaj](https://github.com/gianpaj) 37 | - [alichtman](https://github.com/alichtman) 38 | - [hisabimbola](https://github.com/hisabimbola) 39 | - [AlanI-xx](https://github.com/AlanI-xx) 40 | - [Switchxa](https://github.com/Switchxa) 41 | - [antonioalmeida](https://github.com/antonioalmeida) 42 | - [GuGuss](https://github.com/GuGuss) 43 | - [Potherca](https://github.com/Potherca) 44 | - [bsheikh](https://github.com/bsheikh) 45 | - [bitdeli-chef](https://github.com/bitdeli-chef) 46 | - [chengweiv5](https://github.com/chengweiv5) 47 | - [cHemingway](https://github.com/cHemingway) 48 | - [deepakjadhav288](https://github.com/deepakjadhav288) 49 | - [deyton](https://github.com/deyton) 50 | - [einert](https://github.com/einert) 51 | - [falkirks](https://github.com/falkirks) 52 | - [fpinzn](https://github.com/fpinzn) 53 | - [Frederick-S](https://github.com/Frederick-S) 54 | - [pgilad](https://github.com/pgilad) 55 | - [sspkmnd](https://github.com/sspkmnd) 56 | - [quackduck](https://github.com/quackduck) 57 | - [thederputy](https://github.com/thederputy) 58 | - [josephfrazier](https://github.com/josephfrazier) 59 | - [jfloff](https://github.com/jfloff) 60 | - [rastalamm](https://github.com/rastalamm) 61 | - [jsingh41](https://github.com/jsingh41) 62 | - [kasperpeulen](https://github.com/kasperpeulen) 63 | - [krambertech](https://github.com/krambertech) 64 | - [kaveet](https://github.com/kaveet) 65 | - [adelowo](https://github.com/adelowo) 66 | - [LeonardAukea](https://github.com/LeonardAukea) 67 | - [jk2K](https://github.com/jk2K) 68 | - [naman](https://github.com/naman) 69 | - [ghostwriternr](https://github.com/ghostwriternr) 70 | - [nkapliev](https://github.com/nkapliev) 71 | - [cignoni](https://github.com/cignoni) 72 | - [pelmered](https://github.com/pelmered) 73 | - [pwallrich](https://github.com/pwallrich) 74 | - [phillipalexander](https://github.com/phillipalexander) 75 | - [barmanrajdeep](https://github.com/barmanrajdeep) 76 | - [rkday](https://github.com/rkday) 77 | - [robindboer](https://github.com/robindboer) 78 | - [sahildua2305](https://github.com/sahildua2305) 79 | - [shen-tian](https://github.com/shen-tian) 80 | - [sofyan-ahmad](https://github.com/sofyan-ahmad) 81 | - [TamarIS](https://github.com/TamarIS) 82 | - [ztlevi](https://github.com/ztlevi) 83 | - [ValentinTrinque](https://github.com/ValentinTrinque) 84 | - [vishrutkmr7](https://github.com/vishrutkmr7) 85 | - [OmgImAlexis](https://github.com/OmgImAlexis) 86 | - [yawaramin](https://github.com/yawaramin) 87 | - [yogeshg](https://github.com/yogeshg) 88 | - [anthuan44](https://github.com/anthuan44) 89 | - [derekprice](https://github.com/derekprice) 90 | - [dlionz](https://github.com/dlionz) 91 | - [dphansen](https://github.com/dphansen) 92 | - [ecmarsh](https://github.com/ecmarsh) 93 | - [garanaveen](https://github.com/garanaveen) 94 | - [jsingh-coursera](https://github.com/jsingh-coursera) 95 | - [wolfcode](https://github.com/wolfcode) 96 | - [marfarma](https://github.com/marfarma) 97 | - [yagudin](https://github.com/yagudin) 98 | - [pacahon](https://github.com/pacahon) 99 | - [rowmatrix](https://github.com/rowmatrix) 100 | - [shanmoon](https://github.com/shanmoon) 101 | - [srhrshr](https://github.com/srhrshr) 102 | - [sslees](https://github.com/sslees) 103 | - [woutercx](https://github.com/woutercx) 104 | - [paicha](https://github.com/paicha) 105 | -------------------------------------------------------------------------------- /Cpp/README.md: -------------------------------------------------------------------------------- 1 | # CPlusPlus 2 | 3 | Make sure you have installed [Xcode Command Line Tools](https://sourabhbajaj.com/mac-setup/Xcode/). Check the C++ version to make sure it is Clang 4.0+. 4 | 5 | ```console 6 | $ c++ --version 7 | Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) 8 | Target: x86_64-apple-darwin13.1.0 9 | Thread model: posix 10 | ``` 11 | 12 | To be able to compile files from your terminal you can add the following alias in your `env.sh` file. 13 | 14 | ```sh 15 | alias cppcompile='c++ -std=c++11 -stdlib=libc++' 16 | ``` 17 | 18 | Then you can run all cpp file directly using `cppcompile main.cpp` and it will use C++11 so no errors in the case of using vectors, auto, sets etc. 19 | -------------------------------------------------------------------------------- /Docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker 2 | 3 | [Docker](https://docs.docker.com) is a platform for developers and sysadmins to develop, ship, and run applications. Docker lets you quickly assemble applications from components and eliminates the friction that can come when shipping code. Docker lets you get your code tested and deployed into production as fast as possible. 4 | 5 | With Docker, developers can build any app in any language using any toolchain. “Dockerized” apps are completely portable and can run anywhere - colleagues’ macOS and Windows laptops, QA servers running Ubuntu in the cloud, and production data center VMs running Red Hat. 6 | 7 | ## Docker for Mac 8 | 9 | Docker for Mac is the current release of Docker for macOS. 10 | 11 | ### Installation 12 | 13 | Docker for Mac can be downloaded [here](https://docs.docker.com/docker-for-mac/install/). 14 | 15 | ### Prerequisite 16 | 17 | You'll need `homebrew-cask` to install Docker Toolbox, if you don't have it refer to [this section](../Homebrew/Cask.md). 18 | 19 | ### Installation 20 | 21 | There are two ways to install Docker 22 | 23 | Option 1: These are the steps to install docker using brew 24 | 25 | * Install the docker and docker machine from brew 26 | 27 | ```sh 28 | brew install docker docker-machine 29 | ``` 30 | 31 | * Install VirtualBox to let Docker create the images. 32 | 33 | ```sh 34 | brew install --cask virtualbox 35 | ``` 36 | 37 | >If you encounter an issue with the installer with an error message like 38 | 39 | ```sh 40 | The install failed (The installer encountered an error that caused the installation to fail. 41 | Contact the software manufacturer for assistance.) 42 | ``` 43 | 44 | >Use the following When you do fail, turn on System Preference and see if ‘System software from developer “Oracle America, inc” was blocked from loading.’ If you see that message, click Allow button and try to install again. 45 | 46 | This should complete the installation 47 | 48 | --- 49 | 50 | Now to create a Machine, follow the following steps: 51 | 52 | ```sh 53 | docker-machine create --driver virtualbox default 54 | ``` 55 | 56 | Run the following to tell Docker which machine to execute Docker on 57 | 58 | ```sh 59 | docker-machine env default 60 | ``` 61 | 62 | Finally, to verify all the installations: 63 | 64 | ```sh 65 | docker run hello-world 66 | ``` 67 | 68 | You can find more about Docker in the [documentation](https://docs.docker.com/). 69 | 70 | Option 2: Install using the Docker App 71 | 72 | * Navigate to the following link 73 | 74 | ```sh 75 | https://hub.docker.com/editions/community/docker-ce-desktop-mac/ 76 | ``` 77 | 78 | This installation should provide you all the necessary GUI tools 79 | -------------------------------------------------------------------------------- /Docker/TipsAndTricks.md: -------------------------------------------------------------------------------- 1 | # Docker Tips and Tricks 2 | 3 | A collection of useful tips and tricks for Docker. 4 | 5 | ## Delete all containers 6 | 7 | **NOTE:** This will remove ALL your containers. 8 | 9 | ```sh 10 | docker container prune 11 | ``` 12 | 13 | OR, if you're using an older docker client: 14 | 15 | ```sh 16 | docker rm $(docker ps -a -q) 17 | ``` 18 | 19 | ## Delete all untagged containers 20 | 21 | ```sh 22 | docker image prune 23 | ``` 24 | 25 | OR, if you're using an older docker client: 26 | 27 | ```sh 28 | docker rmi $(docker images | grep '^<none>' | awk '{print $3}') 29 | ``` 30 | 31 | ## See all space Docker take up 32 | 33 | ```sh 34 | docker system df 35 | ``` 36 | 37 | ## Get IP address of running container 38 | 39 | ```sh 40 | docker inspect [CONTAINER ID] | grep -wm1 IPAddress | cut -d '"' -f 4 41 | ``` 42 | 43 | ## Kill all running containers 44 | 45 | ```sh 46 | docker kill $(docker ps -q) 47 | ``` 48 | -------------------------------------------------------------------------------- /Docker/UsefulCommands.md: -------------------------------------------------------------------------------- 1 | # Useful Docker Commands 2 | 3 | Here follows a list of useful Docker commands with useful flags for each 4 | command. 5 | 6 | ## Table of Contents 7 | 8 | 1. [`docker build`](#docker-build) 9 | 2. [`docker exec`](#docker-exec) 10 | 3. [`docker images`](#docker-images) 11 | 4. [`docker inspect`](#docker-inspect) 12 | 5. [`docker logs`](#docker-logs) 13 | 6. [`docker ps`](#docker-ps) 14 | 7. [`docker rmi`](#docker-rmi) 15 | 8. [`docker run`](#docker-run) 16 | 9. [Learn More](#learn-more) 17 | 18 | ## [`docker build`](https://docs.docker.com/engine/reference/commandline/build/) 19 | 20 | Build an image from a Dockerfile. 21 | 22 | ```sh 23 | docker build [DOCKERFILE PATH] 24 | ``` 25 | 26 | ### Example 27 | 28 | Build an image tagged `my-org/my-image` where the Dockerfile can be found at 29 | `/tmp/Dockerfile`. 30 | 31 | ```sh 32 | docker build -t my-org:my-image -f /tmp/Dockerfile 33 | ``` 34 | 35 | ### Useful flags 36 | 37 | - `--file -f` Path where to find the Dockerfile 38 | - `--force-rm` Always remove intermediate containers 39 | - `--no-cache` Do not use cache when building the image 40 | - `--rm` Remove intermediate containers after a successful build (this is 41 | `true`) by default 42 | - `--tag -t` Name and optionally a tag in the ‘name:tag’ format 43 | 44 | ## [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) 45 | 46 | Execute a command inside a **running** container. 47 | 48 | ```sh 49 | docker exec [CONTAINER ID] 50 | ``` 51 | 52 | ### Example 53 | 54 | ```sh 55 | docker exec [CONTAINER ID] touch /tmp/exec_works 56 | ``` 57 | 58 | ### Useful flags 59 | 60 | - `--detach -d` Detached mode: run command in the background 61 | - `-it` This will not make the container you started shut down immediately, as 62 | it will create a pseudo-TTY session (`-t`) and keep STDIN open (`-i`) 63 | 64 | ## [`docker images`](https://docs.docker.com/engine/reference/commandline/images/) 65 | 66 | List all downloaded/created images. 67 | 68 | ```sh 69 | docker images 70 | ``` 71 | 72 | ### Useful flags 73 | 74 | - `-q` Only show numeric IDs 75 | 76 | ## [`docker inspect`](https://docs.docker.com/engine/reference/commandline/inspect) 77 | 78 | Shows all the info of a container. 79 | 80 | ```sh 81 | docker inspect [CONTAINER ID] 82 | ``` 83 | 84 | ## [`docker logs`](https://docs.docker.com/engine/reference/commandline/logs/) 85 | 86 | Gets logs from container. 87 | 88 | ```sh 89 | docker logs [CONTAINER ID] 90 | ``` 91 | 92 | ### Useful flags 93 | 94 | - `--details` Log extra details 95 | - `--follow -f` Follow log output. Do not stop when end of file is reached, but 96 | rather wait for additional data to be appended to the input. 97 | - `--timestamps -t` Show timestamps 98 | 99 | ## [`docker ps`](https://docs.docker.com/engine/reference/commandline/ps/) 100 | 101 | Shows information about all running containers. 102 | 103 | ```sh 104 | docker ps 105 | ``` 106 | 107 | ### Useful flags 108 | 109 | - `--all -a` Show all containers (default shows just running) 110 | - `--filter -f` Filter output based on conditions provided, `docker ps -f="name="example"` 111 | - `--quiet -q` Only display numeric IDs 112 | 113 | ## [`docker rmi`](https://docs.docker.com/engine/reference/commandline/rmi/) 114 | 115 | Remove one or more images. 116 | 117 | ```sh 118 | docker rmi [IMAGE ID] 119 | ``` 120 | 121 | ### Useful flags 122 | 123 | - `--force -f` Force removal of the image 124 | 125 | ## [`docker run`](https://docs.docker.com/engine/reference/commandline/run/) 126 | 127 | Creates and starts a container in one operation. Could be used to execute a 128 | single command as well as start a long-running container. 129 | 130 | Example: 131 | 132 | ```sh 133 | docker run -it ubuntu:latest /bin/bash 134 | ``` 135 | 136 | This will start a ubuntu container with the entrypoint `/bin/bash`. Note that 137 | if you do not have the `ubuntu` image downloaded it will download it before 138 | running it. 139 | 140 | ### Useful flags 141 | 142 | - `-it` This will not make the container you started shut down immediately, as 143 | it will create a pseudo-TTY session (`-t`) and keep STDIN open (`-i`) 144 | - `--rm` Automatically remove the container when it exit. Otherwise it will be 145 | stored and visible running `docker ps -a`. 146 | - `--detach -d` Run container in background and print container ID 147 | - `--volume -v` Bind mount a volume. Useful for accessing folders on your local 148 | disk inside your docker container, like configuration files or storage that 149 | should be persisted (database, logs etc.). 150 | 151 | ## Learn More 152 | 153 | A list of more useful Docker commands can be found in the 154 | [docker-cheat-sheet](https://github.com/wsargent/docker-cheat-sheet). 155 | -------------------------------------------------------------------------------- /Emacs/README.md: -------------------------------------------------------------------------------- 1 | # Emacs 2 | 3 | [Emacs](https://www.gnu.org/software/emacs/) is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as the extensible, customizable, self-documenting, real-time display editor. 4 | 5 | Development of the first Emacs began in the mid-1970s, and work on its direct descendant, GNU Emacs, continues actively as of 2017. 6 | 7 | ## Installation 8 | 9 | There are many Emacs clients on macOS. The recommended version on macOS is Emacs Mac Port, but others are good as well. 10 | 11 | ### [Emacs Mac port](https://bitbucket.org/mituharu/emacs-mac/overview) (Recommended) 12 | 13 | Many useful features are built with Emacs Mac Port, e.g. environment variables, full screen, visual enhancements and so on. 14 | 15 | Link the Homebrew tap first. 16 | 17 | ```sh 18 | brew tap railwaycat/emacsmacport 19 | ``` 20 | 21 | * Method 1: Install with `brew cask`. 22 | 23 | ```sh 24 | brew install --cask emacs-mac 25 | ``` 26 | 27 | There are three available versions, `emacs-mac`, `emacs-mac-official-icon`, `emacs-mac-spacemacs-icon`. 28 | 29 | * Method 2: Install using `brew`. 30 | 31 | ```sh 32 | brew install emacs-mac [options] 33 | ``` 34 | 35 | <details> 36 | <summary>Click here to see available options: </summary> 37 | 38 | 1. <code>--with-dbus</code>, Build with d-bus support<br> 39 | 2. <code>--with-modules</code>, Build with dynamic modules support<br> 40 | 3. <code>--with-xml2</code>, Build with libxml2 support<br> 41 | 4. <code>--with-ctags</code>, Don't remove the ctags executable that emacs provides<br> 42 | 5. <code>--with-no-title-bars</code>, Build with a patch for no title bars on frames (--HEAD is not supported)<br> 43 | 6. <code>--with-natural-title-bar</code>, Build with a patch for title bar color inferred by your theme (--HEAD is not supported). More info is provided <a href="https://github.com/railwaycat/homebrew-emacsmacport/wiki/Natural-Title-Bar">here</a><br> 44 | 7. <code>--with-official-icon</code>, Using official Emacs icon<br> 45 | 8. <code>--with-modern-icon</code>, Using a modern style Emacs icon by @tpanum<br> 46 | 9. <code>--with-spacemacs-icon</code>, Using the spacemacs Emacs icon by Nasser Alshammari<br> 47 | 10. <code>--with-icon-for-documents</code>, Using official icon for documents which default open with Emacs<br> 48 | 49 | </details> 50 | 51 | ### [Emacs plus](https://github.com/d12frosted/homebrew-emacs-plus#emacs-plus) 52 | 53 | Start off by tapping the official emacs-plus cask. 54 | 55 | ```sh 56 | brew tap d12frosted/emacs-plus 57 | ``` 58 | 59 | Emacs Plus contains separate formulas for different Emacs versions: 60 | 61 | * emacs-plus - installs Emacs 26, current release version. 62 | 63 | ```sh 64 | brew install emacs-plus [options] 65 | ``` 66 | 67 | * emacs-plus@27 - installs Emacs 27, next release version. 68 | 69 | ```sh 70 | brew install emacs-plus@27 [options] 71 | ``` 72 | 73 | * emacs-plus@28 - installs Emacs 28, development version. 74 | 75 | ```sh 76 | brew install emacs-plus@28 [options] 77 | ``` 78 | 79 | <details> 80 | <summary>Click here to see available options: </summary> 81 | 1. <code>--with-24bit-color</code>: Experimental: build with 24 bit color support<br> 82 | 2. <code>--with-ctags</code>: Don't remove the ctags executable that Emacs provides<br> 83 | 3. <code>--with-dbus</code>: Build with dbus support<br> 84 | 4. <code>--with-mailutils</code>: Build with mailutils support<br> 85 | 5. <code>--with-natural-title-bar</code>: Experimental: use a title bar colour inferred by your theme<br> 86 | 6. <code>--with-no-title-bars</code>: Experimental: build with a patch for no title bars on frames (--HEAD has this built-in via undecorated flag)<br> 87 | 7. <code>--with-x11</code>: Experimental: build with x11 support<br> 88 | 8. <code>--without-cocoa</code>: Build a non-Cocoa version of Emacs<br> 89 | 9. <code>--without-gnutls</code>: Build without gnutls support<br> 90 | 10. <code>--without-imagemagick@6</code>: Build without imagemagick@6 support<br> 91 | 11. <code>--without-librsvg</code>: Build without librsvg support<br> 92 | 12. <code>--without-libxml2</code>: Build without libxml2 support<br> 93 | 13. <code>--without-modules</code>: Build without dynamic modules support<br> 94 | 14. <code>--without-multicolor-fonts</code>: Build without a patch that enables multicolor font support<br> 95 | 15. <code>--without-spacemacs-icon</code>: Build without Spacemacs icon by Nasser Alshammari<br> 96 | 16. <code>--HEAD</code>: Install HEAD version<br> 97 | </details> 98 | 99 | > **Note**: 1) You might want to install [exec-path-from-shell](https://github.com/purcell/exec-path-from-shell) if you are using Emacs plus. It takes care of your environment variables. 100 | > 2) To have the title bar match your theme background color, consider using instead: 101 | > `brew install emacs-plus --HEAD --with-natural-title-bars` 102 | 103 | ## Spacemacs 104 | 105 | [Spacemacs](https://github.com/syl20bnr/spacemacs/blob/master/README.md) is a new way to experience Emacs -- a sophisticated and polished set-up focused on ergonomics, mnemonics and consistency. 106 | 107 | Spacemacs can be used naturally by both Emacs and Vim users -- you can even mix the two editing styles. Switching easily between input styles makes Spacemacs a great tool for pair-programming. 108 | 109 | ### Installation 110 | 111 | 1. If you have an existing Emacs configuration, back it up first: 112 | 113 | ```sh 114 | cd ~ 115 | mv .emacs.d .emacs.d.bak 116 | mv .emacs .emacs.bak 117 | ``` 118 | 119 | Don't forget to backup and _remove_ `~/.emacs` file otherwise Spacemacs 120 | **WILL NOT** load since that file prevents Emacs from loading the proper 121 | initialization file. 122 | 123 | 2. Clone the repository: 124 | 125 | ```sh 126 | git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d 127 | ``` 128 | 129 | `master` is the stable branch and it is _immutable_, **DO NOT** make any 130 | modification to it or you will break the update mechanism. If you want to 131 | fork Spacemacs safely use the `develop` branch where you handle the update 132 | manually. 133 | 134 | 3. (Optional) Install the [Source Code Pro](https://github.com/adobe-fonts/source-code-pro) font. 135 | 136 | If you are running in terminal you'll also need to change font settings of 137 | your terminal. 138 | 139 | 4. Launch Emacs. Spacemacs will automatically install the packages it requires. 140 | If you get an error regarding package downloads then you may try to disable 141 | the HTTPS protocol by starting Emacs with 142 | 143 | ```sh 144 | emacs --insecure 145 | ``` 146 | 147 | Or you can set the `dotspacemacs-elpa-https` to `nil` in your dotfile to 148 | remove the need to start Emacs with `--insecure` argument. You may wish to 149 | clear out your `.emacs.d/elpa` directory before doing this, so that any 150 | corrupted packages you may have downloaded will be re-installed. 151 | 152 | 5. Restart Emacs to complete the installation. 153 | 154 | ## Purcell's Emacs configuration 155 | 156 | This is [Purcell's](https://github.com/purcell/emacs.d) emacs configuration tree, continually used and tweaked since 2000, and it may be a good starting point for other Emacs users, especially those who are web developers. These days it's somewhat geared towards macOS, but it is known to also work on Linux and Windows. 157 | 158 | ### Installation 159 | 160 | To install, clone this repository to `~/.emacs.d`, i.e. ensure that the `init.el` contained in this repository ends up at `~/.emacs.d/init.el`: 161 | 162 | ```sh 163 | git clone https://github.com/purcell/emacs.d.git ~/.emacs.d 164 | ``` 165 | 166 | Upon starting up Emacs for the first time, further third-party packages will be automatically downloaded and installed. If you encounter any errors at that stage, try restarting Emacs, and possibly running `M-x package-refresh-contents` before doing so. 167 | 168 | ## Doom Emacs 169 | 170 | [Doom](https://github.com/hlissner/doom-emacs) is a configuration for GNU Emacs written by a stubborn, shell-dwelling, and melodramatic ex-vimmer. It wasn't originally intended for public use, but can be considered a hacker's starter kit. 171 | 172 | ### Installation 173 | 174 | ```sh 175 | git clone https://github.com/hlissner/doom-emacs ~/.emacs.d 176 | cd ~/.emacs.d 177 | cp init.example.el init.el # maybe edit init.el 178 | make install 179 | ``` 180 | 181 | Don't forget to run `make` every time you modify `init.el`! 182 | 183 | Visit the wiki for [a more detailed guide on installing, customizing and grokking Doom](https://github.com/hlissner/doom-emacs/wiki). 184 | -------------------------------------------------------------------------------- /Git/README.md: -------------------------------------------------------------------------------- 1 | # Git and GitHub 2 | 3 | What's a developer without [Git](http://git-scm.com/)? To install, run: 4 | 5 | ```sh 6 | brew install git 7 | ``` 8 | 9 | When done, to test that it installed properly you can run: 10 | 11 | ```sh 12 | git --version 13 | ``` 14 | 15 | And `which git` should output `/usr/local/bin/git`. 16 | 17 | Next, we'll define your Git user (should be the same name and email you use for [GitHub](https://github.com/)): 18 | 19 | ```sh 20 | git config --global user.name "Your Name Here" 21 | git config --global user.email "your_email@youremail.com" 22 | ``` 23 | 24 | They will get added to your `.gitconfig` file. 25 | 26 | To push code to your GitHub repositories, we will use the recommended HTTPS method. There are also instructions for using SSH. To prevent `git` from asking for your username and password every time you push a commit you can cache your credentials by running the following command, as described in the [instructions](https://help.github.com/articles/caching-your-github-password-in-git/). 27 | 28 | ```sh 29 | git config --global credential.helper osxkeychain 30 | ``` 31 | 32 | ## Using HTTPS for GitHub (recommended) 33 | 34 | These instructions are from [the official documentation](https://help.github.com/en/github/using-git/which-remote-url-should-i-use#cloning-with-https-urls-recommended). 35 | 36 | ### Clone repositories using HTTPS 37 | 38 | After creating a new repo on GitHub, clone it using: 39 | 40 | ```sh 41 | git clone https://github.com/<username>/<repo-name>.git 42 | ``` 43 | 44 | \- if you had initialized with a README. 45 | 46 | If you did not, follow the instructions in the section below. 47 | 48 | ### Set up a new or existing repo with HTTPS for GitHub 49 | 50 | If you are setting up a new repo, add at least one file and commit first. Then, configure the remote and push to GitHub by running: 51 | 52 | ```sh 53 | git remote add origin https://github.com/<username>/<repo-name>.git 54 | git push -u origin master 55 | ``` 56 | 57 | ## SSH Config for GitHub 58 | 59 | These instructions are for those who wish to use SSH and not HTTPS, and are from [the official documentation](https://help.github.com/articles/generating-ssh-keys). 60 | 61 | ### Check for existing SSH keys 62 | 63 | First check for existing SSH keys on your computer by running: 64 | 65 | ```sh 66 | ls -al ~/.ssh 67 | # Lists the files in your .ssh directory, if they exist 68 | ``` 69 | 70 | Check the directory listing to see if you have files named either `id_rsa.pub` or `id_dsa.pub`. If you don't have either of those files then read on, otherwise skip the next section. 71 | 72 | ### Generate a new SSH key 73 | 74 | If you don't have an SSH key you need to generate one. To do that you need to run the commands below, and make sure to substitute the placeholder with your email. The default settings are preferred, so when you're asked to enter a file in which to save the key, just press Enter to continue. 75 | 76 | ```sh 77 | ssh-keygen -t rsa -C "your_email@example.com" 78 | # Creates a new ssh key, using the provided email as a label 79 | ``` 80 | 81 | ### Add your SSH key to the ssh-agent 82 | 83 | Run the following commands to add your SSH key to the `ssh-agent`. 84 | 85 | ```sh 86 | eval "$(ssh-agent -s)" 87 | ``` 88 | 89 | If you're running macOS Sierra 10.12.2 or later, you will need to modify your `~/.ssh/config` file to automatically load keys into the ssh-agent and store passphrases in your keychain: 90 | 91 | ```ssh-config 92 | Host * 93 | AddKeysToAgent yes 94 | UseKeychain yes 95 | IdentityFile ~/.ssh/id_rsa 96 | ``` 97 | 98 | No matter what operating system version you run you need to run this command to complete this step: 99 | 100 | ```sh 101 | ssh-add -K ~/.ssh/id_rsa 102 | ``` 103 | 104 | ### Adding a new SSH key to your GitHub account 105 | 106 | The last step is to let GitHub know about your SSH key so GitHub can recognize you. Run this command to copy your key to your clipboard: 107 | 108 | ```sh 109 | pbcopy < ~/.ssh/id_rsa.pub 110 | ``` 111 | 112 | Then go to GitHub and [input your new SSH key](https://github.com/settings/ssh/new). Paste your key in the "Key" text-box and pick a name that represents the computer you're currently using. 113 | 114 | We are now ready to use SSH with GitHub! 115 | 116 | ### Clone repositories using SSH 117 | 118 | After creating a new repo on GitHub, clone it using 119 | 120 | ```sh 121 | git clone git@github.com:<username>/<repo-name>.git 122 | ``` 123 | 124 | \- if you had initialized with a README. 125 | 126 | If you did not, follow the instructions in the section below. 127 | 128 | ### Set up a new or existing repo with SSH for GitHub 129 | 130 | If you are setting up a new repo, add at least one file and commit first. Then, configure the remote and push to GitHub by running: 131 | 132 | ```sh 133 | git remote add origin git@github.com:<username>/<repo-name>.git 134 | git push -u origin master 135 | ``` 136 | -------------------------------------------------------------------------------- /Git/gitignore.md: -------------------------------------------------------------------------------- 1 | # Git Ignore (global) 2 | 3 | Create the file `~/.gitignore` as shown below 4 | 5 | ```gitignore 6 | # Folder view configuration files 7 | .DS_Store 8 | Desktop.ini 9 | 10 | # Thumbnail cache files 11 | ._* 12 | Thumbs.db 13 | 14 | # Files that might appear on external disks 15 | .Spotlight-V100 16 | .Trashes 17 | 18 | # Compiled Python files 19 | *.pyc 20 | 21 | # Compiled C++ files 22 | *.out 23 | 24 | # Application specific files 25 | venv 26 | node_modules 27 | .sass-cache 28 | ``` 29 | 30 | followed by running the command below, in terminal: 31 | 32 | ```sh 33 | git config --global core.excludesfile ~/.gitignore 34 | ``` 35 | 36 | to not track files that are almost always ignored in all Git repositories. 37 | 38 | Or simply download [macOS specific .gitignore](https://github.com/github/gitignore/blob/master/Global/macOS.gitignore) maintained by GitHub itself and put contents of it to `~/.gitignore`. 39 | 40 | * You can also use a default gitignore using Curl 41 | 42 | ```sh 43 | curl https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore -o ~/.gitignore 44 | ``` 45 | 46 | ## Generate gitignore 47 | 48 | Visit [gitignore.io](https://www.gitignore.io/?templates=macos) and fill it with your needs. 49 | -------------------------------------------------------------------------------- /Go/README.md: -------------------------------------------------------------------------------- 1 | # Go 2 | 3 | [Go](https://golang.org) is an open source programming language that makes it easy to build simple, reliable, and efficient software. 4 | 5 | ## Installation 6 | 7 | You can follow the [official instructions on how to install Go](https://golang.org/doc/install), or you can use Homebrew instead: 8 | 9 | ```sh 10 | brew install go 11 | ``` 12 | 13 | When installed, run `go version` to see the installed version of Go. 14 | 15 | ```sh 16 | $ go version 17 | go version go1.11.4 darwin/amd64 18 | ``` 19 | 20 | ## Setup your workspace 21 | 22 | ### The GOPATH and PATH environment variables 23 | 24 | The `GOPATH` environment variable specifies the location of your workspace. It defaults to a directory named `go` inside your home directory (`$HOME/go`). 25 | 26 | If you really want to change your GOPATH to something else add GOPATH to your shell/bash/zsh initialization file `.bash_profile`, `.bashrc` or `.zshrc`. 27 | 28 | ```sh 29 | export GOPATH=/something-else 30 | ``` 31 | 32 | Add `GOPATH/bin` directory to your `PATH` environment variable so you can run Go programs anywhere. 33 | 34 | ```sh 35 | export PATH=$PATH:$(go env GOPATH)/bin 36 | ``` 37 | 38 | Make sure to re-source `source .bash_profile` your current session or simply open new tab within iTerm. 39 | 40 | ## Write your first program 41 | 42 | Create a file in your workspace `$GOPATH/src/hello/main.go` and add some code, for example: 43 | 44 | ```go 45 | package main 46 | 47 | func main() { 48 | println("Hello World!") 49 | } 50 | ``` 51 | 52 | Run the program by running: 53 | 54 | ```console 55 | $ go run hello.go 56 | Hello World! 57 | ``` 58 | 59 | If you wish to compile it and move it to `$GOPATH/bin`, then run: 60 | 61 | ```sh 62 | go install . 63 | ``` 64 | 65 | Since you have `$GOPATH/bin` added to your `$PATH`, you can run your program from anywhere: 66 | 67 | ```console 68 | $ hello 69 | Hello World! 70 | ``` 71 | 72 | ## Import a Go package 73 | 74 | Besides creating your own packages you can import and use other packages in your Go code. To do so you'll use the `go get` command: 75 | 76 | ```sh 77 | go get -u github.com/gorilla/mux 78 | ``` 79 | 80 | The command above will import the package `mux` into this directory `$GOPATH/src/github.com/gorilla/mux`. 81 | 82 | You can then use this package in your Go programs like this: 83 | 84 | ```go 85 | package main 86 | 87 | import ( 88 | "github.com/gorilla/mux" // Your imported package 89 | "net/http" 90 | ) 91 | 92 | func yourHandler(w http.ResponseWriter, r *http.Request) { 93 | w.Write([]byte("Gorilla!\n")) 94 | } 95 | 96 | func main() { 97 | r := mux.NewRouter() 98 | // Routes consist of a path and a handler function. 99 | r.HandleFunc("/", yourHandler) 100 | 101 | // Bind to a port and pass our router in 102 | panic(http.ListenAndServe(":8000", r)) 103 | } 104 | ``` 105 | 106 | ## Tooling and learning 107 | 108 | ### Format your code 109 | 110 | Go has a built-in tool that automatically formats Go source code. 111 | 112 | To format a single file run: 113 | 114 | ```sh 115 | gofmt -w yourcode.go 116 | ``` 117 | 118 | You can also format an entire package: 119 | 120 | ```sh 121 | go fmt path/to/your/package 122 | ``` 123 | 124 | > **Note**: that the command is different from formatting a single file 125 | 126 | ### Generate documentation 127 | 128 | With the `godoc` command you can generate documentation from your code and read documentation from other packages. 129 | 130 | ```sh 131 | godoc fmt # documentation for package fmt 132 | godoc fmt Printf # documentation for fmt.Printf 133 | godoc -src fmt # fmt package interface in Go source form 134 | godoc -all -http :1234 # documentation for all packages on your machine served through http http://localhost:1234 135 | ``` 136 | 137 | You need to respect some spec in order to document using `godoc`. More information in the [Godoc documentation](https://blog.golang.org/godoc-documenting-go-code). 138 | 139 | ### Learn more 140 | 141 | The [interactive tutorial](https://tour.golang.org/) will let you learn more about Go. You can also install it locally by `go get golang.org/x/tour` and running it anywhere by `tour` (given that you added `GOPATH/bin` to your `PATH`). 142 | -------------------------------------------------------------------------------- /Heroku/README.md: -------------------------------------------------------------------------------- 1 | # Heroku 2 | 3 | [Heroku](http://www.heroku.com/) is a [Platform-as-a-Service](http://en.wikipedia.org/wiki/Platform_as_a_service) (PaaS) that simplifies deploying your apps online. 4 | 5 | ## Installation 6 | 7 | Assuming you have a Heroku account ([sign up](https://signup.heroku.com) if you don't), let's install the [Heroku Client](https://devcenter.heroku.com/articles/using-the-cli) for the command-line using Homebrew. 8 | 9 | ```sh 10 | brew install heroku/brew/heroku 11 | ``` 12 | 13 | The formula might not have the latest version of the Heroku Client, which is updated pretty often. Let's update it now: 14 | 15 | ```sh 16 | heroku update 17 | ``` 18 | 19 | Don't be afraid to run `heroku update` every now and then to always have the most recent version. 20 | 21 | ## Setup 22 | 23 | Login to your Heroku account using your email and password: 24 | 25 | ```sh 26 | heroku login 27 | ``` 28 | 29 | If this is a new account, and since you don't already have a public **SSH key** in your `~/.ssh` directory, it will offer to create one for you. It will also upload the key to your Heroku account, which will allow you to deploy apps from this computer. 30 | 31 | If it didn't offer create the SSH key for you (i.e. your Heroku account already has SSH keys associated with it), you can do so manually by running: 32 | 33 | ```sh 34 | mkdir ~/.ssh 35 | ssh-keygen -t rsa 36 | ``` 37 | 38 | Keep the default file name and skip the passphrase by just hitting Enter both times. Then, add the key to your Heroku account: 39 | 40 | ```sh 41 | heroku keys:add 42 | ``` 43 | 44 | ## Usage 45 | 46 | Once your keys are in place and you are authorized, you're ready to deploy apps. Heroku has a [getting started guide](https://devcenter.heroku.com/articles/python), which has all the information you need (the one linked here is for Python, but there is one for every popular language). Heroku uses Git to push code for deployment, so make sure your app is under Git version control. 47 | 48 | A cheat sheet for deployment: 49 | 50 | ```console 51 | $ cd myapp/ 52 | 53 | # Create the app on Heroku 54 | $ heroku create myapp 55 | 56 | # Deploy it 57 | $ git push heroku master 58 | 59 | # Check its status 60 | $ heroku ps 61 | 62 | # Check the logs 63 | $ heroku logs -t 64 | ``` 65 | 66 | The [Heroku Dev Center](https://devcenter.heroku.com/) is where you will find more information. 67 | -------------------------------------------------------------------------------- /Homebrew/Cask.md: -------------------------------------------------------------------------------- 1 | # Homebrew-Cask 2 | 3 | [Homebrew-Cask](https://github.com/Homebrew/homebrew-cask) extends Homebrew and allows you to 4 | install large binary files via a command-line tool. You can for example install 5 | applications like Google Chrome, Dropbox, VLC and Spectacle. No more 6 | downloading `.dmg` files and dragging them to your Applications folder! 7 | 8 | ## Search 9 | 10 | To see if an app is available on Cask you can search on the [official Cask 11 | website](https://formulae.brew.sh/cask/). You can also search in your terminal: 12 | 13 | ```sh 14 | brew search <package> 15 | ``` 16 | 17 | ## Example Applications 18 | 19 | ### Quick Look plugins 20 | 21 | These plugins add support for the corresponding file type to Mac Quick Look 22 | (In Finder, mark a file and press Space to start Quick Look). The plugins 23 | includes features like syntax highlighting, Markdown rendering, preview of 24 | JSON, patch files, CSV, ZIP files and more. 25 | 26 | ```sh 27 | brew install --cask \ 28 | qlmarkdown \ 29 | betterzip \ 30 | webpquicklook \ 31 | suspicious-package \ 32 | syntax-highlight 33 | ``` 34 | 35 | ### App Suggestions 36 | 37 | Here are some useful apps that are available on Cask. 38 | 39 | ```sh 40 | brew install --cask \ 41 | alfred \ 42 | android-file-transfer \ 43 | appcleaner \ 44 | caffeine \ 45 | cheatsheet \ 46 | colloquy \ 47 | docker \ 48 | doubletwist \ 49 | dropbox \ 50 | google-chrome \ 51 | flux \ 52 | 1password \ 53 | rectangle \ 54 | sublime-text \ 55 | superduper \ 56 | transmission \ 57 | valentina-studio \ 58 | vlc 59 | ``` 60 | -------------------------------------------------------------------------------- /Homebrew/README.md: -------------------------------------------------------------------------------- 1 | # Homebrew 2 | 3 | [Homebrew](https://brew.sh/) calls itself _The missing package manager for 4 | macOS_ and is an essential tool for any developer. 5 | 6 | ## Installation 7 | 8 | Before you can run Homebrew you need to have the **Command Line Tools for 9 | Xcode** installed. It include compilers and other tools that will allow you 10 | to build things from source, and if you are missing this it's available 11 | through the App Store > Updates. You can also install it from the terminal 12 | by running the following: 13 | 14 | ```sh 15 | sudo xcode-select --install 16 | ``` 17 | 18 | To install Homebrew run the following in a terminal: 19 | 20 | ```sh 21 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 22 | ``` 23 | 24 | hit **Enter**, and follow the steps on the screen. 25 | 26 | ### Setting up your `PATH` 27 | 28 | To make the Homebrew-installed programs available in your shell, you need to add 29 | your Homebrew installation location to your `$PATH`. This is done for you already on 30 | macOS 10.14 Mojave and newer. For older versions of macOS, do the following: 31 | 32 | You change your path by adding `/usr/local/bin` to your `PATH` environment variable. 33 | This can be done on a per-user basis by adjusting `PATH` in your `~/.bash_profile`. 34 | To do this, run: 35 | 36 | ```sh 37 | echo 'PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile 38 | ``` 39 | 40 | (If you're using `zsh`, you should do this for `~/.zshrc` in addition to 41 | `~/.bash_profile`.) 42 | 43 | Alternatively, you can also insert `/usr/local/bin` before the first line of 44 | `/etc/paths` to change the global default paths order, for all users and all 45 | major shells. An admin password will be required if you modify the file. 46 | 47 | Then, to be able to use `brew` you need to start a new terminal session. After that 48 | you should make sure everything is working by running: 49 | 50 | ```sh 51 | brew doctor 52 | ``` 53 | 54 | If everything is good, you should see no warnings, and a message that you are 55 | "ready to brew!". 56 | -------------------------------------------------------------------------------- /Homebrew/Usage.md: -------------------------------------------------------------------------------- 1 | # Using Homebrew 2 | 3 | To install a package (or **Formula** in Homebrew vocabulary) simply type: 4 | 5 | ```sh 6 | brew install <formula> 7 | ``` 8 | 9 | To update Homebrew's directory of formulae, run: 10 | 11 | ```sh 12 | brew update 13 | ``` 14 | 15 | **Note**: If that command fails you can manually download the directory of 16 | formulas like this: 17 | 18 | ```sh 19 | cd /usr/local/Homebrew/ 20 | git fetch origin 21 | git reset --hard origin/master 22 | ``` 23 | 24 | To see if any of your formulas need to be updated: 25 | 26 | ```sh 27 | brew outdated 28 | ``` 29 | 30 | To update a formula: 31 | 32 | ```sh 33 | brew upgrade <formula> 34 | ``` 35 | 36 | Homebrew keeps older versions of formulas installed on your system, in case you 37 | want to roll back to an older version. That is rarely necessary, so you can do 38 | some cleanup to get rid of those old versions: 39 | 40 | ```sh 41 | brew cleanup 42 | ``` 43 | 44 | If you want to see what formulae Homebrew would delete _without actually 45 | deleting them_, you can run: 46 | 47 | ```sh 48 | brew cleanup --dry-run 49 | ``` 50 | 51 | To see what you have installed (with their version numbers): 52 | 53 | ```sh 54 | brew list --versions 55 | ``` 56 | 57 | To search for formulas you run: 58 | 59 | ```sh 60 | brew search <formula> 61 | ``` 62 | 63 | To get more information about a formula you run: 64 | 65 | ```sh 66 | brew info <formula> 67 | ``` 68 | 69 | To uninstall a formula you can run: 70 | 71 | ```sh 72 | brew uninstall <formula> 73 | ``` 74 | -------------------------------------------------------------------------------- /Java/README.md: -------------------------------------------------------------------------------- 1 | # Java 2 | 3 | Using Java requires you to install a JDK ("Java Development Kit") or JRE ("Java Runtime Environment"). 4 | We'll use a JDK since it can do everything a JRE can, plus more. 5 | 6 | ## Choosing a JDK 7 | 8 | As of 2019, there are two major JDKs: OpenJDK (also known as AdoptOpenJDK) and the Oracle JDK. 9 | OpenJDK and Oracle JDK provide the same functionality, and are even built from the same code base. 10 | They differ only in their packaging and licensing. 11 | 12 | OpenJDK is free for use in all situations. 13 | Oracle JDK requires a paid-for commercial license when used in a production setting. 14 | 15 | Most personal users will probably want to use OpenJDK, since it's easier to acquire and install 16 | and that's what we'll be covering here. 17 | 18 | ## Installation 19 | 20 | First you should check if Java is already installed 21 | 22 | ```sh 23 | java -version 24 | ``` 25 | 26 | If you see a non-empty output like below then Java is already installed on your machine and you are good to go 27 | 28 | ```sh 29 | openjdk version "13.0.2" 2020-01-14 30 | OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8) 31 | OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.2+8, mixed mode, sharing) 32 | ``` 33 | 34 | If you don't see the output like above then you need to install Java on your system 35 | 36 | ### Installing OpenJDK 37 | 38 | #### Installing OpenJDK using Homebrew 39 | 40 | ```sh 41 | brew install openjdk 42 | ``` 43 | 44 | If you're curious, you can list all the available JDK versions via: 45 | 46 | ```sh 47 | brew search jdk 48 | ``` 49 | 50 | There will be a lot of options here! If you are not a serious Java developer, don't worry about them, and just use the default `openjdk`. 51 | 52 | Once you've done that, check if Java is correctly installed by running the `java -version` command again. 53 | 54 | #### Downloading and installing OpenJDK manually 55 | 56 | Open a web browser and go to <https://adoptopenjdk.net/>. Select "OpenJDK 11 (LTS)" and "HotSpot". 57 | Click the big "Latest release" button and run the installer file that gets downloaded. 58 | 59 | Once you've done that, check if Java is correctly installed by opening a new Terminal session and running the `java -version` command again. 60 | -------------------------------------------------------------------------------- /Java/sdkman.md: -------------------------------------------------------------------------------- 1 | # SDKMAN 2 | 3 | SDKMAN! is a tool for managing parallel versions of multiple software development kits on most Unix-based systems. It provides a convenient command line interface (CLI) and API for installing, switching, removing and listing candidates. 4 | 5 | ## Installation 6 | 7 | Open a new terminal and enter: 8 | 9 | ```sh 10 | curl -s "https://get.sdkman.io" | bash 11 | ``` 12 | 13 | Follow the instructions on-screen to complete installation. 14 | Next, open a new terminal or enter: 15 | 16 | ```sh 17 | source "$HOME/.sdkman/bin/sdkman-init.sh" 18 | ``` 19 | 20 | Lastly, run the following code snippet to ensure that installation succeeded: 21 | 22 | ```sh 23 | sdk version 24 | ``` 25 | 26 | If all went well, the version should be displayed. Something like: 27 | 28 | ```sh 29 | sdkman 5.0.0+51 30 | ``` 31 | 32 | ## Usage 33 | 34 | ### Installing an SDK 35 | 36 | #### Latest stable 37 | 38 | Install the latest stable version of your SDK of choice (say, Java JDK) by running the following command: 39 | 40 | ```sh 41 | sdk install java 42 | ``` 43 | 44 | You will see something like the following output: 45 | 46 | ```sh 47 | Downloading: java 8u111 48 | 49 | In progress... 50 | 51 | ######################################################################## 100.0% 52 | 53 | Installing: java 8u111 54 | Done installing! 55 | ``` 56 | 57 | Now you will be prompted if you want this version to be set as default. 58 | 59 | ```sh 60 | Do you want java 8u111 to be set as default? (Y/n): 61 | Answering yes (or hitting enter) will ensure that all subsequent shells opened will have this version of the SDK in use by default. 62 | Setting java 8u111 as default. 63 | ``` 64 | 65 | ## More commands 66 | 67 | * To install a specific version 68 | qualify the version you require: 69 | 70 | ```sh 71 | sdk install scala 2.12.1 72 | ``` 73 | 74 | * To remove a version 75 | 76 | ```sh 77 | sdk uninstall scala 2.11.6 78 | ``` 79 | 80 | Note that removing a local version will not remove the local installation. 81 | 82 | * To list candidates 83 | 84 | ```sh 85 | sdk list 86 | ``` 87 | 88 | More useful commands and usages can be found at [SDKMAN Usage](https://sdkman.io/usage). 89 | -------------------------------------------------------------------------------- /JetBrainsIDEs/README.md: -------------------------------------------------------------------------------- 1 | # JetBrains IDEs 2 | 3 | JetBrains is a company creating tools for developers. Their mission is: _We make professional software development a more productive and enjoyable experience_. In this section a number of IDEs (integrated development environment) as well as a selection of features will be presented. 4 | 5 | ## Selection of Features 6 | 7 | **Note that these features apply to _all_ IDEs mentioned.** 8 | 9 | ### Shared Key Mappings 10 | 11 | If you use different programming languages you might also use different IDEs/editors. This forces you to learn different key mappings for each individual IDE/editor. With IDEs from JetBrains you only need to learn one key mapping because it's shared between all of their IDEs. If you customize your key mapping you can even export it from one IDE and import in the other one. 12 | 13 | ### Highly Customizable 14 | 15 | Not only can you do lots of customization when it comes to appearance, key mapping and a lot more, you also have plugins. These plugins cover everything from dealing with different file types to using external tools such as Git, Docker, databases, linters and time tracking. JetBrains offer a bunch of their own plugins but you can also develop and publish your own plugins. 16 | 17 | ### Integrated Tools 18 | 19 | Their IDEs offer so many tools that you never have to leave it if you don't want to. It supports a number of different VCSs (Git, Subversion, Perforce etc.), a terminal window, database browser, debuggers, SSH sessions and more. 20 | 21 | ### Powerful Refactoring 22 | 23 | Rename a method used all over your project with a few clicks, or change a method signature in the same way. With statically typed languages like Java and C the refactoring becomes even more powerful. 24 | 25 | ## Useful Shortcuts 26 | 27 | * Search for a file -- `CMD + SHIFT + O` 28 | * Search for a string -- `CMD + SHIFT + F` 29 | * Search everything, press `SHIFT` two (2) times 30 | * Context based action -- `ALT + ENTER` (this one is very contextual, you have to just try it out having your cursor in different places) 31 | * Refactor this -- `CTRL + T` (place your cursor on what you want to refactor) 32 | 33 | ## Supported Languages 34 | 35 | Their IDEs support a number of languages, here's a list covering all of the listed ones sorted alphabetically. 36 | 37 | * C, C#, C++ 38 | * CSS, Less, Sass, Stylus 39 | * F# 40 | * Go 41 | * Groovy 42 | * Java 43 | * JavaScript, TypeScript 44 | * Kotlin 45 | * Objective-C 46 | * PHP 47 | * Python 48 | * Ruby 49 | * Scala 50 | * SQL 51 | * Swift 52 | * VB.NET 53 | 54 | They offer support for more languages using plugins such as Rust, Dart, Haxe, Markdown, Pug/Jade, Slim, Twig and more. 55 | 56 | ## Installation 57 | 58 | Go to [their website](https://www.jetbrains.com/products.html?fromMenu#type=ide) and select what product you'd like to download. 59 | 60 | Alternatively, use the [Jetbrains Toolbox App](https://www.jetbrains.com/toolbox-app/) to manage product installations. 61 | 62 | ## Pricing 63 | 64 | If you're a **student** or an **instructor** (teaching staff members) all IDEs from JetBrains are free to use. You can read more on [their website](https://www.jetbrains.com/student/). If you're not a student they still offer a few free Community Edition (CE) IDEs. Check out [IntelliJ](https://www.jetbrains.com/idea/) (Java) or [PyCharm Edu](https://www.jetbrains.com/pycharm-edu/). 65 | 66 | If you as an individual want to have an [IntelliJ subscription](https://www.jetbrains.com/idea/buy/#edition=personal), for example, it's €14.90/$14.90 every month. Before buying a subscription you should [see if you apply for a free/discounted license](https://www.jetbrains.com/idea/buy/#edition=discounts). 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This content is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/. 2 | 3 | The code is licensed under the MIT License. 4 | Copyright (c) 2018, Sourabh Bajaj 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /LaTeX/README.md: -------------------------------------------------------------------------------- 1 | # LaTeX 2 | 3 | [LaTeX](https://www.latex-project.org/about/), which is pronounced «Lah-tech» or «Lay-tech», is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing. 4 | 5 | ## Installation 6 | 7 | When installing LaTex, two following options are given to users: 8 | 9 | 1. Install MacTeX with builtin editor (TexLive) - (3.2GB) 10 | 2. Install BasicTeX only (100MB) + your personal LaTeX editor 11 | 12 | ### MacTeX vs BasicTeX 13 | 14 | MacTeX includes additional programs such as an editor and a BibTeX reference manager that help users to work with TeX outside of the command line. BasicTeX does not include these GUI programs. The trade-off that comes with using BasicTeX is that you will have to download and install additional packages and programs as the need arises- and BasicTeX is so basic that the need will arise. So, after installing BasicTeX you will be faced with the tasks of installing additional programs and installing missing packages. 15 | 16 | #### MacTex 17 | 18 | Download [MacTex](http://www.tug.org/mactex/), or use `brew install --cask mactex`. 19 | You can read more about MacTex in [What is installed (pdf)](https://www.tug.org/mactex/What_Is_Installed.pdf). 20 | 21 | Since MacTex installs a LaTex editor ([TexMaker](http://www.xm1math.net/texmaker/download.html)) already, installing another LaTeX editor is unnecessary. 22 | 23 | #### BasicTeX 24 | 25 | Download [BasicTeX](http://tug.org/mactex/morepackages.html), or use `brew install --cask basictex`. You can read more about BasicTex in [BasicTeX (pdf)](https://www.tug.org/mactex/BasicTeX.pdf). 26 | 27 | You may use `tlmgr` to install tools/packages that you need. 28 | 29 | > **Note**: You may find CLI tool `tlmgr` cumbersome to use, in that case install GUI for `tlmgr` - [*TeX Live Utility*](https://amaxwell.github.io/tlutility/) - `brew install --cask tex-live-utility`. 30 | 31 | Now you should pick a LaTeX editor, here are some to choose from: 32 | 33 | 1. [TexMaker](http://www.xm1math.net/texmaker/) 34 | 2. [TeXstudio](http://texstudio.sourceforge.net/) 35 | 3. [TeXworks](https://github.com/TeXworks/texworks/releases) 36 | 4. [TeXShop](http://pages.uoregon.edu/koch/texshop/) 37 | 5. [LyX](http://www.lyx.org/) 38 | 6. [TeXlipse](http://texlipse.sourceforge.net/) 39 | 7. [Sublime Text 3 - LaTeXTools](https://github.com/SublimeText/LaTeXTools) 40 | 8. [Visual Studio Code - LaTeX-Workshop](https://github.com/James-Yu/LaTeX-Workshop) 41 | 42 | > **Note**: You may want to use a PDF reader that watches your PDF files, like Skim (can be installed by `brew install --cask skim` and *Sync* feature can be enabled in Preferences -> Sync). 43 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: ci deploy deps install lint serve 2 | 3 | GITBOOK = $(shell command -v ./node_modules/.bin/gitbook 2> /dev/null) 4 | MARKDOWNLINT = $(shell command -v ./node_modules/.bin/markdownlint 2> /dev/null) 5 | YARN = $(shell command -v yarn 2> /dev/null) 6 | 7 | 8 | # This is run on CI to verify linting is OK and that the guide builds 9 | ci: lint 10 | $(GITBOOK) install && $(GITBOOK) build 11 | 12 | 13 | # Deploy new version of the guide. Will update list of contributors 14 | deploy: 15 | sh ./scripts/publish_gitbook.sh 16 | 17 | 18 | # Install dependencies 19 | deps: 20 | ifeq ($(YARN),) 21 | $(error "yarn is not available, please install it") 22 | else 23 | $(YARN) 24 | endif 25 | 26 | # Install dependencies and gitbook 27 | install: deps 28 | $(GITBOOK) install 29 | 30 | 31 | # Lint markdown files 32 | lint: 33 | ifeq ($(MARKDOWNLINT),) 34 | $(error "markdownlint is not installed, run 'make deps' to install it") 35 | else 36 | @$(MARKDOWNLINT) . --ignore node_modules && echo 'All good 👌' 37 | endif 38 | 39 | 40 | # Start a server that serves the guide locally 41 | serve: 42 | ifeq ($(GITBOOK),) 43 | $(error "GitBook is not available, please run 'make install' first") 44 | else 45 | $(GITBOOK) serve 46 | endif 47 | -------------------------------------------------------------------------------- /MyySQL/README.md: -------------------------------------------------------------------------------- 1 | # MySQL 2 | 3 | ## Installation 4 | 5 | We will install [MySQL](http://www.mysql.com/) using Homebrew, which will also install some header files needed for MySQL bindings in different programming languages (MySQL-Python for one). 6 | 7 | > **Note**: Sequel Pro does not support latest MySQL (version 8), because of that you may want to install MySQL 5.7 instead - `brew install mysql@5.7`. 8 | 9 | ```sh 10 | brew install mysql 11 | ``` 12 | 13 | ## Usage 14 | 15 | To have launchd start MySQL now and restart at login: 16 | 17 | ```sh 18 | brew services start mysql 19 | ``` 20 | 21 | Or, if you don't want/need a background service you can just use the `mysql.server` tool: 22 | 23 | ```sh 24 | mysql.server start 25 | ``` 26 | 27 | To stop it when you are done, run: 28 | 29 | ```sh 30 | mysql.server stop 31 | ``` 32 | 33 | You can see the different commands available for `mysql.server` with: 34 | 35 | ```sh 36 | mysql.server --help 37 | ``` 38 | 39 | To connect with the command-line client, run: 40 | 41 | ```sh 42 | mysql -uroot 43 | ``` 44 | 45 | (Use `exit` to quit the MySQL shell) 46 | 47 | **Note**: By default, the MySQL user `root` has no password. It doesn't really matter for a local development database. If you wish to change it though, you can use `mysqladmin -u root password 'new-password'`. 48 | 49 | ## GUI Tool 50 | 51 | It is always nice to have a GUI tool for managing databases. For Mac, you can use [Sequel Pro](http://www.sequelpro.com/) to manage local and remote MySQL databases. It is a free tool, you can choose to donate to support the development. 52 | 53 | You may install Sequel Pro using [Homebrew](https://sourabhbajaj.com/mac-setup/Homebrew/Cask.html): 54 | 55 | ```sh 56 | brew install --cask sequel-pro 57 | ``` 58 | -------------------------------------------------------------------------------- /Node.js/README.md: -------------------------------------------------------------------------------- 1 | # Node.js 2 | 3 | Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. 4 | 5 | ## Installation 6 | 7 | ### Using Homebrew 8 | 9 | ```sh 10 | brew install node 11 | ``` 12 | 13 | ### Using Node Version Manager (nvm) 14 | 15 | Download and install [nvm](https://github.com/nvm-sh/nvm) by running: 16 | 17 | ```sh 18 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 19 | ``` 20 | 21 | or via Homebrew: 22 | 23 | ```sh 24 | brew install nvm 25 | ``` 26 | 27 | Then download Node and select your version by running: 28 | 29 | ```sh 30 | source ~/.bashrc # source your bashrc/zshrc to add nvm to PATH 31 | command -v nvm # check the nvm use message 32 | nvm install node # install most recent Node stable version 33 | nvm ls # list installed Node version 34 | nvm use node # use stable as current version 35 | nvm ls-remote # list all the Node versions you can install 36 | nvm alias default node # set the installed stable version as the default Node 37 | ``` 38 | 39 | See the [documentation](https://github.com/nvm-sh/nvm#installing-and-updating) for information. 40 | 41 | ## npm usage 42 | 43 | To install a package: 44 | 45 | ```sh 46 | npm install <package> # Install locally 47 | npm install -g <package> # Install globally 48 | ``` 49 | 50 | To install a package and save it in your project's `package.json` file: 51 | 52 | ```sh 53 | npm install <package> --save 54 | ``` 55 | 56 | To see what's installed: 57 | 58 | ```sh 59 | npm list [-g] 60 | ``` 61 | 62 | To find outdated packages: 63 | 64 | ```sh 65 | npm outdated [-g] 66 | ``` 67 | 68 | To upgrade all or a particular package: 69 | 70 | ```sh 71 | npm update [-g] [<package>] 72 | ``` 73 | 74 | To uninstall a package: 75 | 76 | ```sh 77 | npm uninstall [-g] <package> 78 | ``` 79 | 80 | ## yarn 81 | 82 | Yarn is another package manager built by Facebook. Yarn stands for Yet Another 83 | Resource Negotiator. It provides similar functionalities as NPM. It is an 84 | alternative to NPM when installing, uninstalling, and managing package 85 | dependencies from the NPM registry or GitHub repositories. 86 | 87 | ```sh 88 | brew install yarn 89 | ``` 90 | -------------------------------------------------------------------------------- /Perl/README.md: -------------------------------------------------------------------------------- 1 | # Perl 2 | 3 | macOS ships with [Perl](https://www.perl.org), but it's not safe to 4 | rely on it for more than basic one-liners. Apple has broken it twice, 5 | and let it go very stale at least once. Many packages distributed with 6 | Homebrew depend on the version of Perl it installs, but for complete 7 | control of what version you're running and what packages are 8 | installed, there's also [Perlbrew](https://perlbrew.pl). 9 | 10 | There are several methods of installing modules from the Comprehensive 11 | Perl Archive Network ([CPAN](https://www.cpan.org)), but the easiest 12 | is [cpanminus](https://metacpan.org/pod/App::cpanminus) (`cpanm`). 13 | 14 | ## Installation 15 | 16 | ### Homebrew 17 | 18 | ```sh 19 | brew install perl cpanminus 20 | ``` 21 | 22 | ### Perlbrew 23 | 24 | ```sh 25 | curl -L https://install.perlbrew.pl | bash 26 | 27 | source ~/perl5/perlbrew/etc/bashrc 28 | perlbrew install-cpanm 29 | perlbrew install --switch stable 30 | 31 | echo source ~/perl5/perlbrew/etc/bashrc >> ~/.bash_profile 32 | ``` 33 | 34 | Other useful commands: 35 | 36 | ```sh 37 | # full documentation 38 | perlbrew help 39 | 40 | # override version in current shell 41 | perlbrew use $version 42 | 43 | # execute a script with a specific version 44 | perlbrew exec $version $script 45 | 46 | # revert to vendor/Homebrew Perl in current shell 47 | perlbrew off 48 | 49 | # reinstall all modules in a different version 50 | perlbrew clone-modules $from $to 51 | ``` 52 | 53 | ## Usage 54 | 55 | To install additional modules from [CPAN](https://www.cpan.org): 56 | 57 | ```sh 58 | cpanm Modern::Perl 59 | ``` 60 | 61 | ## Customization 62 | 63 | You can set the environment variable `PERLBREW_ROOT` to override 64 | the default installation directory. 65 | -------------------------------------------------------------------------------- /PostgreSQL/README.md: -------------------------------------------------------------------------------- 1 | # PostgreSQL 2 | 3 | PostgreSQL is an open source relational database management system (RDBMS). It is the default database for macOS server. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | brew install postgres 9 | ``` 10 | 11 | After this, we can test the installation status by checking the version of installed PostgreSQL 12 | 13 | ```sh 14 | postgres -V 15 | ``` 16 | 17 | ## Usage 18 | 19 | ### Start PostgreSQL server 20 | 21 | ```sh 22 | pg_ctl -D /usr/local/var/postgres start 23 | ``` 24 | 25 | Or you can start the PostgreSQL server and have it start up at login automatically 26 | 27 | ```sh 28 | brew services start postgresql 29 | ``` 30 | 31 | ### Stop PostgreSQL server 32 | 33 | ```sh 34 | pg_ctl -D /usr/local/var/postgres stop 35 | ``` 36 | 37 | To make it stop starting up automatically at login 38 | 39 | ```sh 40 | brew services stop postgresql 41 | ``` 42 | 43 | ### Restart PostgreSQL server 44 | 45 | ```sh 46 | pg_ctl -D /usr/local/var/postgres restart 47 | ``` 48 | 49 | Or if you're using `homebrew` 50 | 51 | ```sh 52 | brew services restart postgresql 53 | ``` 54 | 55 | ### Start PostgreSQL console 56 | 57 | ```sh 58 | psql 59 | ``` 60 | 61 | ### GUI tool 62 | 63 | We can use `psequel` a free GUI tool for managing the local and remote PostgreSQL databases 64 | 65 | Install `psequel` using `homebrew` 66 | 67 | ```sh 68 | brew install psequel 69 | ``` 70 | -------------------------------------------------------------------------------- /Python/README.md: -------------------------------------------------------------------------------- 1 | # Python 2 | 3 | macOS, like Linux, ships with [Python](https://python.org/) already installed. 4 | But you don't want to mess with the system Python (some system tools rely on 5 | it, etc.), so we'll install our own version(s). There are two ways to install 6 | Python, (1) Homebrew and (2) Pyenv. If you plan to use multiple versions of 7 | Python (e.g. 2, 3, and anaconda) then you should use pyenv. 8 | 9 | ## Installation 10 | 11 | ### Homebrew method 12 | 13 | Python 3 is the default version when installing with Homebrew, so if you want 14 | to install Python 2.7 you'll have to be explicit about it. 15 | 16 | #### Python 3 17 | 18 | ```sh 19 | brew install python 20 | ``` 21 | 22 | #### Python 2.7 23 | 24 | ```sh 25 | brew install python@2 26 | ``` 27 | 28 | Installing Python also installs [pip](https://pypi.org/project/setuptools/) 29 | (and its dependency [Setuptools](https://pypi.python.org/pypi/setuptools)), 30 | which is the package manager for Python. Let's upgrade them both: 31 | 32 | ```sh 33 | pip install --upgrade setuptools 34 | pip install --upgrade pip 35 | ``` 36 | 37 | Executable scripts from Python packages you install will be put in 38 | `/usr/local/share/python`, make sure it's on your `PATH`. 39 | 40 | ### Pyenv method 41 | 42 | [`pyenv`](https://github.com/yyuu/pyenv) is a Python version manager that can 43 | manage and install different versions of Python. Works very much like `rbenv` 44 | for Ruby. First, we must install `pyenv` using Homebrew: 45 | 46 | ```sh 47 | brew install pyenv 48 | ``` 49 | 50 | To upgrade `pyenv` in the future, use `upgrade` instead of `install`. After 51 | installing, add `pyenv init` to your shell to enable shims and autocompletion 52 | (use `.zshrc` if you're using `zsh`). 53 | 54 | ```sh 55 | echo 'eval "$(pyenv init -)"' >> ~/.bash_profile 56 | ``` 57 | 58 | Restart your shell to make sure the path changes take effect. 59 | 60 | ```sh 61 | exec $SHELL 62 | ``` 63 | 64 | You can now begin using `pyenv`. To list the all available versions of Python, 65 | including Anaconda, Jython, PyPy and Stackless, use: 66 | 67 | ```sh 68 | pyenv install --list 69 | ``` 70 | 71 | Then install the desired versions: 72 | 73 | ```sh 74 | pyenv install 2.7.12 75 | pyenv install 3.5.2 76 | ``` 77 | 78 | Use the `global` command to set global version(s) of Python to be used in all 79 | shells. For example, if you prefer 2.7.12 over 3.5.2: 80 | 81 | ```sh 82 | pyenv global 2.7.12 3.5.2 83 | pyenv rehash 84 | ``` 85 | 86 | The leading version takes priority. All installed Python versions can be 87 | located in `~/.pyenv/versions`. Alternatively, you can run: 88 | 89 | ```console 90 | $ pyenv versions 91 | system (set by /Users/your_account/.pyenv/version) 92 | * 2.7.12 93 | * 3.5.2 94 | ``` 95 | 96 | This shows an asterisk `*` next to the currently active version. 97 | 98 | ### Application-specific Python version 99 | 100 | The `local` command will set local application-specific Python version(s) by 101 | writing the version name to a `.python-version` file in the current directory. 102 | This version overrides the global version. For example, to install 103 | anaconda3-4.1.1 in `path/to/directory`: 104 | 105 | ```console 106 | $ pyenv install anaconda3-4.1.1 107 | $ cd path/to/directory 108 | $ pyenv local anaconda3-4.1.1 109 | $ pyenv rehash 110 | $ pyenv versions 111 | system 112 | 2.7.12 113 | 3.5.2 114 | * anaconda3-4.1.1 (set by /Users/your_account/path/to/directory/.python-version) 115 | ``` 116 | -------------------------------------------------------------------------------- /Python/ipython.md: -------------------------------------------------------------------------------- 1 | # IPython 2 | 3 | [IPython](http://ipython.org/) is an improved Python shell than the one you get from running `python` in the command-line. It has many cool functions (running Unix commands from the Python shell, easy copy & paste, creating Matplotlib charts in-line etc.). You can find all functions in the [documentation](http://ipython.readthedocs.io/en/stable/). 4 | IPython is a kernel for Jupyter Notebook. If you are confused IPython with Jupyter, refer to the [Jupyter documentation](https://jupyter.readthedocs.io/en/latest/) 5 | 6 | ## Installation 7 | 8 | ```sh 9 | pip install ipython 10 | ``` 11 | 12 | If you want a more fine-grained command you can try the following: 13 | 14 | For zsh -> 15 | 16 | ```sh 17 | pip install 'ipython[zmq,qtconsole,notebook,test]' 18 | ``` 19 | 20 | For bash -> 21 | 22 | ```sh 23 | pip install ipython[zmq,qtconsole,notebook,test] 24 | ``` 25 | -------------------------------------------------------------------------------- /Python/numpy.md: -------------------------------------------------------------------------------- 1 | # Numpy, Scipy and Matplotlib 2 | 3 | The [NumPy](https://numpy.org/), [SciPy](https://scipy.org/) and [Matplotlib](https://matplotlib.org/) scientific libraries for Python are always a little tricky to install from source because they have all these dependencies they need to build correctly. 4 | 5 | There are two ways to install these libraries: 6 | 7 | * Using `pip` 8 | 9 | Python provides an inbuilt package management system `pip` which can be used to install these libraries 10 | 11 | ```sh 12 | python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose 13 | ``` 14 | 15 | * Using [MacPorts](https://www.macports.org/) and Python 3.5 16 | 17 | ```sh 18 | sudo port install py35-numpy py35-scipy py35-matplotlib py35-ipython +notebook py35-pandas py35-sympy py35-nose 19 | ``` 20 | -------------------------------------------------------------------------------- /Python/pip.md: -------------------------------------------------------------------------------- 1 | # pip 2 | 3 | macOS comes with Python so there's a chance `pip` is already installed on your machine. 4 | 5 | ## Installation 6 | 7 | ```console 8 | curl https://bootstrap.pypa.io/get-pip.py > get-pip.py 9 | sudo python get-pip.py 10 | ``` 11 | 12 | To verify `pip` is installed properly run 13 | 14 | ```sh 15 | pip --version 16 | ``` 17 | 18 | If it returns a version `pip` was successfully installed. 19 | 20 | ## Usage 21 | 22 | Here are a few `pip` commands to get you started. 23 | 24 | Install a Python package 25 | 26 | ```sh 27 | pip install <package> 28 | ``` 29 | 30 | Upgrade a package 31 | 32 | ```sh 33 | pip install --upgrade <package> 34 | ``` 35 | 36 | See what's installed 37 | 38 | ```sh 39 | pip freeze 40 | ``` 41 | 42 | Uninstall a package 43 | 44 | ```sh 45 | pip uninstall <package> 46 | ``` 47 | -------------------------------------------------------------------------------- /Python/virtualenv.md: -------------------------------------------------------------------------------- 1 | # Virtualenv 2 | 3 | [Virtualenv](http://www.virtualenv.org/) is a tool that lets you create an 4 | isolated Python environment for your project. It creates an environment that 5 | has its own installation directories, that doesn’t share dependencies with 6 | other `virtualenv` environments (and optionally doesn’t access the globally 7 | installed dependencies either). You can even configure what version of Python 8 | you want to use for each individual environment. It's very much recommended to 9 | use `virtualenv` when dealing with Python applications. 10 | 11 | ## Installation 12 | 13 | To install `virtualenv` run: 14 | 15 | ```sh 16 | pip install virtualenv 17 | ``` 18 | 19 | ## Usage 20 | 21 | If you have a project in a directory called `my-project` you can set up 22 | `virtualenv` for that project by running: 23 | 24 | ```sh 25 | cd my-project/ 26 | virtualenv venv 27 | ``` 28 | 29 | If you want your `virtualenv` to also inherit globally installed packages run: 30 | 31 | ```sh 32 | virtualenv venv --system-site-packages 33 | ``` 34 | 35 | These commands create a `venv/` directory in your project where all 36 | dependencies are installed. You need to **activate** it first though (in every 37 | terminal instance where you are working on your project): 38 | 39 | ```sh 40 | source venv/bin/activate 41 | ``` 42 | 43 | You should see a `(venv)` appear at the beginning of your terminal prompt 44 | indicating that you are working inside the `virtualenv`. Now when you install 45 | something like this: 46 | 47 | ```sh 48 | pip install <package> 49 | ``` 50 | 51 | It will get installed in the `venv/` folder, and not conflict with other 52 | projects. 53 | 54 | To leave the virtual environment run: 55 | 56 | ```sh 57 | deactivate 58 | ``` 59 | 60 | **Important**: Remember to add `venv` to your project's `.gitignore` file so 61 | you don't include all of that in your source code. 62 | 63 | It is preferable to install big packages (like Numpy), or packages you always 64 | use (like IPython) globally. All the rest can be installed in a `virtualenv`. 65 | 66 | ## Virtualenvwrapper 67 | 68 | To make it easier to work on multiple projects that has separate environments 69 | you can install `virtualenvwrapper`. It's an extension to `virtualenv` and 70 | makes it easier to create and delete virtual environments without creating 71 | dependency conflicts. 72 | 73 | To install `virtualenvwrapper` run: 74 | 75 | ```sh 76 | pip install virtualenvwrapper 77 | ``` 78 | 79 | Depending on your setup you might need to install it using `sudo`. Read the 80 | [installation 81 | documentation](https://virtualenvwrapper.readthedocs.io/en/latest/install.html) 82 | for more information. 83 | 84 | **Note**: `virtualenvwrapper` keeps all the virtual environments in 85 | `~/.virtualenv` while `virtualenv` keeps them in the project directory. 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [macOS Setup Guide](https://sourabhbajaj.com/mac-setup) 2 | 3 | [](https://github.com/sb2nov/mac-setup/actions?query=workflow%3ATest) [](https://github.com/sb2nov/mac-setup/actions?query=workflow%3ALinks) 4 | 5 | This guide covers the basics of setting up a development environment on a new 6 | Mac. Whether you are an experienced programmer or not, this guide is intended 7 | for everyone to use as a reference for setting up your environment or 8 | installing languages/libraries. 9 | 10 | [](https://raw.githubusercontent.com/sb2nov/mac-setup/main/assets/intro.gif) 11 | 12 | Some environments we will set up are [Node](https://nodejs.org) 13 | (JavaScript), [Python](https://www.python.org), 14 | [C++](http://www.cplusplus.com) and [Ruby](https://www.ruby-lang.org). 15 | Even if you don't program in all of them, they are useful to have as many 16 | command-line tools rely on them. We'll also show you some useful daily use 17 | applications. As you read and follow these steps, feel free to post any 18 | feedback or comments you may have. 19 | 20 | ## Contributing to the guide 21 | 22 | All contributions to the guide are welcome. Please help add support for other 23 | libraries and languages. To make a contribution please use our [contribution 24 | template](https://github.com/sb2nov/mac-setup/blob/main/.github/CONTRIBUTION_TEMPLATE.md). 25 | 26 | **We're looking for more contributors to maintain and extend the 27 | documentation.** 28 | 29 | ------------------------------------------------------------------------------- 30 | 31 | This guide is [MIT 32 | licensed](https://github.com/sb2nov/mac-setup/blob/main/LICENSE) and has been 33 | generated using [GitBook](https://www.gitbook.com/). Feel free to contribute or 34 | create new issues on [GitHub](https://github.com/sb2nov/mac-setup/issues). 35 | -------------------------------------------------------------------------------- /References/README.md: -------------------------------------------------------------------------------- 1 | # Credits & References 2 | 3 | Thank you for all the awesome pages and documentation below which helped set this up. 4 | 5 | - [Nicolashery](https://github.com/nicolashery/mac-dev-setup) 6 | - [GitHub](https://help.github.com/articles) 7 | - [GitBook](https://github.com/GitbookIO/gitbook) 8 | - [Sublime Plugins](https://sublime.wbond.net/) 9 | 10 | ## Contributing 11 | 12 | Please feel free to send [Pull Requests](https://github.com/sb2nov/mac-setup/pulls) fixing any mistakes in the book or adding additional information. 13 | -------------------------------------------------------------------------------- /Ruby/README.md: -------------------------------------------------------------------------------- 1 | # Ruby 2 | 3 | macOS comes with Ruby installed, but as we don't want to be messing with operating system core files we're going to use the tools `rbenv` and `ruby-build` to manage and install our Ruby versions for our development environment. 4 | 5 | ## Installation 6 | 7 | ```sh 8 | brew install rbenv ruby-build rbenv-default-gems rbenv-gemset 9 | echo 'eval "$(rbenv init -)"' >> ~/Projects/config/env.sh 10 | source ~/.zshrc # Apply changes 11 | ``` 12 | 13 | The packages we just installed allow us to install different versions of Ruby and specify which version to use on a per project basis and globally. This is very useful to keep a consistent development environment if you need to work in a particular Ruby version. 14 | 15 | ## Switching versions 16 | 17 | We can install version `3.1.1` and use it as our global version by running: 18 | 19 | ```sh 20 | rbenv install 3.1.1 21 | rbenv global 3.1.1 22 | ``` 23 | 24 | On M1 Macs to install older version of Ruby eg. `<2.7.3`, `<2.6.7` you first need to run: 25 | 26 | ```sh 27 | export optflags="-Wno-error=implicit-function-declaration" 28 | ``` 29 | 30 | ## Managing gems in application 31 | 32 | Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. 33 | 34 | ```sh 35 | gem install bundler 36 | echo 'bundler' >> "$(brew --prefix rbenv)/default-gems" 37 | ``` 38 | 39 | When starting a Ruby project, you can have sandboxed collections of gems. This lets you have multiple collections of gems installed in different sandboxes, and specify (on a per-application basis) which sets of gems should be used. To have gems install into a sub-folder in your project directory for easy later removal / editing / testing, you can use a project gemset. 40 | 41 | ```sh 42 | echo '.gems' > <my_project_path>/.rbenv-gemsets 43 | ``` 44 | 45 | Your gems will then get installed in `project/.gems`. 46 | 47 | ## Configuration 48 | 49 | If you use Google for finding your Gem documentation then you might want to consider saving a bit of time when installing gems by not including the documentation. 50 | 51 | ```sh 52 | echo 'gem: --no-document' >> ~/.gemrc 53 | ``` 54 | -------------------------------------------------------------------------------- /Ruby/RubyGems.md: -------------------------------------------------------------------------------- 1 | # RubyGems 2 | 3 | [RubyGems](http://rubygems.org/), the Ruby package manager, should be installed on your machine if you previously have installed Ruby. Verify this by running: 4 | 5 | ```sh 6 | which gem 7 | ``` 8 | 9 | ## Update RubyGems 10 | 11 | To update to its latest version with: 12 | 13 | ```sh 14 | gem update --system 15 | ``` 16 | 17 | ## Install gems 18 | 19 | To install a _gem_ (Ruby package), run: 20 | 21 | ```sh 22 | gem install <gemname> 23 | ``` 24 | 25 | To install without generating the documentation for each gem (faster): 26 | 27 | ```sh 28 | gem install <gemname> --no-document 29 | ``` 30 | 31 | ## List installed gems 32 | 33 | ```sh 34 | gem list 35 | ``` 36 | 37 | To check if any installed gems are outdated: 38 | 39 | ```sh 40 | gem outdated 41 | ``` 42 | 43 | ## Update installed gems 44 | 45 | To update all gems or a particular gem: 46 | 47 | ```sh 48 | gem update [<gemname>] 49 | ``` 50 | 51 | ## Remove old gem versions 52 | 53 | RubyGems keeps old versions of gems, so feel free to do some cleaning after updating: 54 | 55 | ```sh 56 | gem cleanup 57 | ``` 58 | -------------------------------------------------------------------------------- /Rust/README.md: -------------------------------------------------------------------------------- 1 | # Rust 2 | 3 | [Rust](https://www.rust-lang.org) is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. 4 | 5 | ## Installation 6 | 7 | For installation it's advised to use `rustup` as it will (among other things) 8 | allow you to switch between versions of Rust without having to download 9 | anything additional. 10 | 11 | ```sh 12 | brew install rustup-init 13 | ``` 14 | 15 | Use rustup to install the Rust compiler (rustc) and the Rust package manager (cargo). 16 | 17 | ```sh 18 | rustup-init 19 | ``` 20 | 21 | To verify you can run: 22 | 23 | ```sh 24 | rustc --version 25 | ``` 26 | 27 | [The official documentation on how to install Rust](https://www.rust-lang.org/en-US/install.html). 28 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Introduction](README.md) 4 | * [System Preferences](SystemPreferences/README.md) 5 | * [Xcode](Xcode/README.md) 6 | * [Homebrew](Homebrew/README.md) 7 | * [Usage](Homebrew/Usage.md) 8 | * [Cask](Homebrew/Cask.md) 9 | * [iTerm2](iTerm/README.md) 10 | * [Zsh](iTerm/zsh.md) 11 | * [tree](iTerm/tree.md) 12 | * [fzf](iTerm/fzf.md) 13 | * [ack](iTerm/ack.md) 14 | * [Git](Git/README.md) 15 | * [Git Ignore](Git/gitignore.md) 16 | * [Bash Completion](BashCompletion/README.md) 17 | * [Vim](Vim/README.md) 18 | * [Emacs](Emacs/README.md) 19 | * [Sublime Text](SublimeText/README.md) 20 | * [Preferences](SublimeText/Preferences.md) 21 | * [Packages 1/2](SublimeText/Packages.md) 22 | * [Packages 2/2](SublimeText/Plugins.md) 23 | * [Sublime Linter](SublimeText/SublimeLinter.md) 24 | * [Visual Studio Code](VisualStudioCode/README.md) 25 | * [JetBrains IDEs](JetBrainsIDEs/README.md) 26 | * [PostgreSQL](PostgreSQL/README.md) 27 | * [Python](Python/README.md) 28 | * [Pip](Python/pip.md) 29 | * [Virtualenv](Python/virtualenv.md) 30 | * [Numpy-Scipy](Python/numpy.md) 31 | * [IPython](Python/ipython.md) 32 | <!-- This is intentially named MyySql as this was causing a 404 when hosted with github pages --> 33 | <!-- TODO: Fix this once we figure out the issue more --> 34 | * [MySQL](MyySQL/README.md) 35 | * [CPlusPlus](Cpp/README.md) 36 | * [Java](Java/README.md) 37 | * [SDKMAN!](Java/sdkman.md) 38 | * [Scala](Scala/README.md) 39 | * [Ruby](Ruby/README.md) 40 | * [RubyGems](Ruby/RubyGems.md) 41 | * [Rust](Rust/README.md) 42 | * [Node.js](Node.js/README.md) 43 | * [Go](Go/README.md) 44 | * [Heroku](Heroku/README.md) 45 | * [Vagrant](Vagrant/README.md) 46 | * [Docker](Docker/README.md) 47 | * [Useful Commands](Docker/UsefulCommands.md) 48 | * [Tips and Tricks](Docker/TipsAndTricks.md) 49 | * [LaTeX](LaTeX/README.md) 50 | * [Other Apps](Apps/README.md) 51 | * [Octave](Apps/Octave.md) 52 | * [App Settings](Apps/Settings.md) 53 | * [Security](Security/README.md) 54 | * [References](References/README.md) 55 | * [Contributors](Contributors.md) 56 | -------------------------------------------------------------------------------- /Scala/README.md: -------------------------------------------------------------------------------- 1 | # Scala 2 | 3 | Make sure you have Java installed, the instructions are provided [here](/mac-setup/Java/README.html). 4 | 5 | ```sh 6 | brew update 7 | brew install scala sbt 8 | ``` 9 | 10 | (This step is optional) Update the `/usr/local/etc/sbtopts` by running the command below. 11 | 12 | ```sh 13 | echo '-J-XX:+CMSClassUnloadingEnabled' >> /usr/local/etc/sbtopts 14 | echo '-J-Xmx2G' >> /usr/local/etc/sbtopts 15 | ``` 16 | 17 | ## Scala Plugin for Eclipse 18 | 19 | Scala IDE for Eclipse is best installed (and updated) directly from within Eclipse. 20 | 21 | This is done by using `Help → Install New Software...`, add the `Add...` button in the dialog. 22 | 23 | Choose a name for the update site (`Scala IDE` is a suggestion). Then read the next section to select which version you will install. 24 | 25 | ### What version to install 26 | 27 | The list of URLs of the different update sites are available in the download area. The release ones are in the current section. Scala IDE is linked to specific version of Scala, so you have to decide which one you are going to use: 28 | 29 | - Version `2.10`: provides support for projects using Scala 2.10 (any minor version). This is the current version of Scala. Pick this one if you are unsure. 30 | 31 | - Version `2.9`: provides support for projects using Scala 2.9 (any minor version). 32 | 33 | The version of Scala used inside of Scala IDE cannot be chosen per project. So, if you want to work with a project using different version of Scala (like 2.9.3 and 2.10.1), you need different installation of Scala IDE. 34 | 35 | ### Finish installation 36 | 37 | Copy the URL as location and hit OK to validate. 38 | 39 | Select Scala IDE for Eclipse/IntelliJ from the list of available features. 40 | 41 | Finish the installation, restart Eclipse and Scala IDE is now installed. 42 | -------------------------------------------------------------------------------- /Security/README.md: -------------------------------------------------------------------------------- 1 | # Security and Safety 2 | 3 | A development machine should be secured against threats as well as any other machine \(or even _especially_ a development machine\). Therefore we will setup 4 | 5 | * a virus scanner 6 | * a firewall 7 | * disk encryption 8 | 9 | ## Virus Scanner 10 | 11 | Head over to [Avira](https://www.avira.com/), download and install their latest free package. 12 | 13 | ## Firewall 14 | 15 | This one is a bit controversial. If you do not install software which allows network access of any kind, skip it. If you run potentially vulnerable software you don't want to be accessed from other machines, consider turning the built-in firewall on. This particularly applies if you develop network software. 16 | 17 | To turn the built-in firewall on: 18 | 19 | 1. Choose Apple menu \(\) > System Preferences, then click Security & Privacy. 20 | 2. Click the Firewall tab. 21 | 3. Click the Lock button, then enter an administrator name and password. 22 | 4. Click Turn On Firewall. 23 | 5. Click Firewall Options. 24 | 6. Uncheck 'Automatically allow signed software to receive incoming connections'. 25 | 26 | The last step disables automatic access for software from the App Store. From now on you can either add \(dis\)allowed programs to the list within the Firewall Options or just click on Allow\/Deny, if you get a popup asking you if a specific software may be accessed. 27 | 28 | ## Disk Encryption 29 | 30 | Another controversial point. If you have a desktop machine in a secured building, you probably do not need disk encryption. If you travel a lot and take your notebook with you \(including all your source codes\), you might consider travelling with disk encryption enabled. 31 | 32 | The following steps were taken from the [official apple support page](https://support.apple.com/en-us/HT204837) on this: 33 | 34 | 1. Choose Apple menu \(\) > System Preferences, then click Security & Privacy. 35 | 2. Click the FileVault tab. 36 | 3. Click the Lock button, then enter an administrator name and password. 37 | 4. Click Turn On FileVault. 38 | 5. Follow the instructions. In my opinion you should create a local and offline possibility to disable encryption, when you are asked how to regain access in case of anything. 39 | -------------------------------------------------------------------------------- /SublimeText/Packages.md: -------------------------------------------------------------------------------- 1 | # Packages 2 | 3 | ## Install Package Control 4 | 5 | The simplest method of installation is through the Sublime Text console. The console is accessed via `View > Show Console` menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console. 6 | 7 | This snippet changes each version and older versions will return an error. 8 | 9 | To get the current versions code, go to [packagecontrol.io](https://packagecontrol.io/installation) 10 | -------------------------------------------------------------------------------- /SublimeText/Plugins.md: -------------------------------------------------------------------------------- 1 | # Recommended Plugins 2 | 3 | - [Alignment](https://github.com/wbond/sublime_alignment/issues): Easy alignment of multiple selections and multi-line selections 4 | - [All Autocomplete](https://github.com/alienhard/SublimeAllAutocomplete): Extend Sublime Text 2 auto-completion to find matches in all open files of the current window 5 | - [AutoFileName](https://github.com/BoundInCode/AutoFileName): Plugin that auto-completes filenames 6 | - [Bootstrap 3 Snippets](https://github.com/JasonMortonNZ/bs3-sublime-plugin): Twitter Bootstrap 3 snippets plugin for Sublime Text 2 and 3 7 | - [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter): Bracket and tag highlighter 8 | - [Dictionaries](https://github.com/SublimeText/Dictionaries): Hunspell UTF8 dictionaries 9 | - [DictionaryAutoComplete](https://github.com/Zinggi/DictionaryAutoComplete): Plugin that adds dictionary entries to the completions inside comments 10 | - [EncodingHelper](https://github.com/SublimeText/EncodingHelper): Guess encoding of files, show in status bar, convert to UTF-8 from a variety of encodings 11 | - [FileDiffs](https://github.com/colinta/SublimeFileDiffs): Shows diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes 12 | - [Git](https://github.com/kemayo/sublime-text-git): Plugin for some Git integration 13 | - [GitGutter](https://github.com/jisaacks/GitGutter): A Sublime Text 2 and 3 plugin to see git diff in gutter 14 | - [IndentXML](https://github.com/alek-sys/sublimetext_indentxml): Plugin for re-indenting XML and JSON files 15 | - [Jade](https://github.com/davidrios/jade-tmbundle): A comprehensive bundle for the Jade template language 16 | - [Jedi - Python autocompletion](https://github.com/srusskih/SublimeJEDI): Jedi is an autocompletion tool for Python 17 | - [Jekyll](https://github.com/23maverick23/sublime-jekyll): A plugin for Jekyll static sites 18 | - [LaTeXTools](https://github.com/SublimeText/LaTeXTools): A LaTeX Plugin for Sublime Text 2 and 3 19 | - [Python Auto-Complete](https://github.com/eliquious/Python-Auto-Complete): Sublime Text 2 plugin which adds additional auto-completion capability to Python scripts 20 | - [Python Imports Sorter](https://github.com/vi4m/sublime_python_imports): Sublime Text 2 plugin to organize your imports easily 21 | - [PythonTraceback](https://github.com/kedder/sublime-python-traceback): Easy navigation in your python tracebacks 22 | - [SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements): Enhancements to sidebar. Files and folders. 23 | - [SublimeCodeIntel](https://www.sublimecodeintel.com/): Full-featured code intelligence and smart auto-complete engine 24 | - [SublimeLinter](http://sublimelinter.readthedocs.org/): Interactive code linting framework for Sublime Text 3 25 | - [SublimeLinter-pep8](https://github.com/SublimeLinter/SublimeLinter-pep8): Linter plugin for python using PEP8 26 | - [TrailingSpaces](https://github.com/SublimeText/TrailingSpaces): Highlight trailing spaces and delete them in a flash 27 | -------------------------------------------------------------------------------- /SublimeText/Preferences.md: -------------------------------------------------------------------------------- 1 | # Preferences 2 | 3 | This is an example of User Settings for a basic development but please feel free to modify or update as per your choice. 4 | 5 | ```json 6 | { 7 | "auto_complete_delay": 5, 8 | "auto_complete_selector": "source, text", 9 | "color_scheme": "Packages/User/Monokai (SL).tmTheme", 10 | "create_window_at_startup": false, 11 | "folder_exclude_patterns": 12 | [ 13 | ".svn", 14 | ".git", 15 | ".DS_Store", 16 | "__pycache__", 17 | "*.pyc", 18 | "*.pyo", 19 | "*.exe", 20 | "*.dll", 21 | "*.obj", 22 | "*.o", 23 | "*.a", 24 | "*.lib", 25 | "*.so", 26 | "*.dylib", 27 | "*.ncb", 28 | "*.sdf", 29 | "*.suo", 30 | "*.pdb", 31 | "*.idb", 32 | "*.psd" 33 | ], 34 | "font_face": "Source Code Pro", 35 | "font_size": 13, 36 | "ignored_packages": 37 | [ 38 | "Markdown", 39 | "Vintage" 40 | ], 41 | "open_files_in_new_window": false, 42 | "rulers": 43 | [ 44 | 80 45 | ], 46 | "translate_tabs_to_spaces": true, 47 | "word_wrap": true 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /SublimeText/README.md: -------------------------------------------------------------------------------- 1 | # Sublime Text 2 | 3 | [Sublime Text](http://www.sublimetext.com/) is a widely used editor that describes it self as _a sophisticated text editor for code, markup and prose_. 4 | 5 | ## Installation 6 | 7 | Install using Homebrew: 8 | 9 | ```sh 10 | brew install --cask sublime-text 11 | ``` 12 | 13 | Or [download](https://www.sublimetext.com/) the **.dmg** file and drag-and-drop it to the **Applications** folder. 14 | 15 | ## Use CLI to open file 16 | 17 | Let's create a shortcut through which we can launch Sublime Text from the command-line 18 | 19 | ```sh 20 | ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl 21 | ``` 22 | 23 | Now you can open a file with `subl myfile.py` or start a new project in the current directory with `subl .`. 24 | 25 | ## Pricing 26 | 27 | Sublime Text is not free but it has an unlimited evaluation period that comes with notification pop-ups asking you to buy it, if you wish to remove the pop-ups you can purchase the tool [here](http://www.sublimetext.com/buy). 28 | -------------------------------------------------------------------------------- /SublimeText/SublimeLinter.md: -------------------------------------------------------------------------------- 1 | # SublimeLinter Settings 2 | 3 | ```json 4 | { 5 | "user": { 6 | "debug": false, 7 | "delay": 0.25, 8 | "error_color": "D02000", 9 | "gutter_theme": "none", 10 | "gutter_theme_excludes": [], 11 | "lint_mode": "background", 12 | "linters": { 13 | "pep8": { 14 | "@disable": false, 15 | "args": [], 16 | "disable": "", 17 | "enable": "", 18 | "excludes": [], 19 | "ignore": "", 20 | "max-line-length": null, 21 | "rcfile": "", 22 | "select": "" 23 | } 24 | }, 25 | "mark_style": "outline", 26 | "no_column_highlights_line": false, 27 | "paths": { 28 | "linux": [], 29 | "osx": [ 30 | "/usr/local/bin/" 31 | ], 32 | "windows": [] 33 | }, 34 | "python_paths": { 35 | "linux": [], 36 | "osx": [ 37 | "/usr/local/bin/" 38 | ], 39 | "windows": [] 40 | }, 41 | "rc_search_limit": 3, 42 | "shell_timeout": 10, 43 | "show_errors_on_save": false, 44 | "show_marks_in_minimap": true, 45 | "syntax_map": { 46 | "html (django)": "html", 47 | "html (rails)": "html", 48 | "html 5": "html", 49 | "php": "html", 50 | "python django": "python" 51 | }, 52 | "warning_color": "DDB700", 53 | "wrap_find": true 54 | } 55 | } 56 | ``` 57 | -------------------------------------------------------------------------------- /Sudo/README.md: -------------------------------------------------------------------------------- 1 | # Sudo 2 | 3 | Macs with Touch ID have the option to authenticate for sudo using Touch ID instead of the default password authentication. 4 | 5 | ## Customization 6 | 7 | ### Manually 8 | 9 | This can be enabled manually by editing the relevant PAM file: 10 | 11 | ```sh 12 | sudo vim /etc/pam.d/sudo 13 | ``` 14 | 15 | Add the following to the top of the list: 16 | 17 | ```sh 18 | auth sufficient pam_tid.so 19 | ``` 20 | 21 | Press esc, then save and exit 22 | 23 | ```vim 24 | :wq! 25 | ``` 26 | 27 | ### One-liner 28 | 29 | This can also be done as a one-liner by running: 30 | 31 | ```sh 32 | sudo sed -i '' '1a\'#39;\n''auth sufficient pam_tid.so'#39;\n' /etc/pam.d/sudo 33 | ``` 34 | -------------------------------------------------------------------------------- /SystemPreferences/README.md: -------------------------------------------------------------------------------- 1 | # System Preferences 2 | 3 | ## First Time Setup 4 | 5 | The first thing you should do is update your system. To do that go: 6 | **Apple menu () > About This Mac > Software Update.** 7 | 8 | Also upgrade your OS to the latest version to have a more secure OS. macOS 9 | upgrades are usually free so you might as well keep your machine up to date. 10 | 11 | If this is a new computer there are a couple tweaks you could make to the 12 | System Preferences. **These settings are all optional, consider them 13 | suggestions. Always choose the setting that makes the most sense to you.** 14 | 15 | ## Users & Groups 16 | 17 | - _Login Options_ -> _Change fast user switching menu as Icon_ 18 | - Set up _Password_, _Apple ID_, _Picture_, etc. 19 | 20 | ## Trackpad 21 | 22 | - _Point & Click_ 23 | - Enable _Tap to click with one finger_ 24 | - Change _Secondary click_ to _Right corner_ 25 | - Uncheck _Three Finger Drag_ 26 | - _Scroll & Zoom_ 27 | - Uncheck _all_ apart from _Zoom in and out_ 28 | 29 | ## Dock 30 | 31 | - _Visual Settings_ 32 | - _Change position_ to _Left_ and _make the size_ of icons _Small_ 33 | - _Other settings_ 34 | - Remove _workspace auto-switching_ by running the following command: 35 | 36 | ```sh 37 | defaults write com.apple.dock workspaces-auto-swoosh -bool NO 38 | killall Dock # Restart the Dock process 39 | ``` 40 | 41 | ## Finder 42 | 43 | - General 44 | - Change _New finder window show_ to open in your _Home Directory_ 45 | - Sidebar 46 | - Add _Home_ and your _Code Directory_ 47 | - Uncheck all _Shared_ boxes 48 | 49 | ## Menubar 50 | 51 | - Remove the _Display_ and _Bluetooth_ icons 52 | - Change _battery_ to _Show percentage symbols_ 53 | 54 | ## Spotlight 55 | 56 | - Uncheck _fonts_, _images_, _files_ etc. 57 | - Uncheck the _keyboard shortcuts_ as we'll be replacing them with 58 | [_Alfred_](https://www.alfredapp.com/) 59 | 60 | ## Accounts 61 | 62 | - Add an _iCloud account_ and sync _Calendar_, _Find my Mac_, _Contacts_ etc. 63 | 64 | ## User Defaults 65 | 66 | - Enable _repeating keys by pressing and holding down keys_: `defaults write 67 | NSGlobalDomain ApplePressAndHoldEnabled -bool false` (and restart any app 68 | that you need to repeat keys in) 69 | - Change the _default folder for screenshots_ 70 | - Open the terminal and create the folder where you would like to store 71 | your screenshots: `mkdir -p /path/to/screenshots/` 72 | - Then run the following command: `defaults write com.apple.screencapture 73 | location /path/to/screenshots/ && killall SystemUIServer` 74 | 75 | ## Security & Privacy 76 | 77 | - Set `Require Password ... after sleep or screen saver begins` to `immediately` 78 | - Enable FileVault to encrypt your hard drive 79 | - Turn on Firewall 80 | -------------------------------------------------------------------------------- /Vagrant/README.md: -------------------------------------------------------------------------------- 1 | # Vagrant 2 | 3 | Create and configure lightweight, reproducible, and portable development environments. [Vagrant](http://www.vagrantup.com/) is a tool for managing virtual machines via a simple to use command line interface. 4 | 5 | ## Prerequisite 6 | 7 | You'll need `homebrew-cask`, if you don't have it refer to [this section](../Homebrew/Cask.md). 8 | 9 | ## Installation 10 | 11 | Vagrant uses [Virtualbox](https://www.virtualbox.org/) to manage the virtual dependencies. You can [directly download virtualbox](https://www.virtualbox.org/wiki/Downloads) and install or use Homebrew for it. 12 | Notice that macOS High Sierra 10.13 introduces a new feature that requires user approval before loading new third-party kernel extensions. 13 | In case of failure follow the instructions [here](https://developer.apple.com/library/archive/technotes/tn2459/_index.html). 14 | 15 | ```sh 16 | brew install --cask virtualbox 17 | ``` 18 | 19 | Now install Vagrant either [from the website](http://www.vagrantup.com/downloads.html) or use Homebrew for installing it. 20 | 21 | ```sh 22 | brew install --cask vagrant 23 | ``` 24 | 25 | [Vagrant-Manager](http://vagrantmanager.com/) helps you manage all your virtual machines in one place directly from the menu bar. 26 | 27 | ```sh 28 | brew install --cask vagrant-manager 29 | ``` 30 | 31 | ## Usage 32 | 33 | Add the Vagrant box you want to use. We'll use Ubuntu 12.04 for the following example. 34 | 35 | ```sh 36 | vagrant box add precise64 https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box 37 | ``` 38 | 39 | You can find more boxes at [Vagrant Cloud](https://app.vagrantup.com/boxes/search). 40 | 41 | Now create a test directory and `cd` into the test directory. Then we'll initialize the vagrant machine. 42 | 43 | ```sh 44 | vagrant init precise64 45 | ``` 46 | 47 | Now lets start the machine using the following command. 48 | 49 | ```sh 50 | vagrant up 51 | ``` 52 | 53 | You can ssh into the machine now. 54 | 55 | ```sh 56 | vagrant ssh 57 | ``` 58 | 59 | Halt the vagrant machine now. 60 | 61 | ```sh 62 | vagrant halt 63 | ``` 64 | 65 | Other useful commands are `suspend` and `destroy`. 66 | -------------------------------------------------------------------------------- /Vim/README.md: -------------------------------------------------------------------------------- 1 | # Vim 2 | 3 | [Vim](http://www.vim.org/) is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple macOS. 4 | 5 | ## Installation 6 | 7 | To install the latest version, use homebrew: 8 | 9 | ```sh 10 | brew install vim 11 | ``` 12 | 13 | ## The Ultimate vimrc 14 | 15 | [The Ultimate vimrc](https://github.com/amix/vimrc) is a collection of vimrc configurations to make easy the usage of vim. 16 | 17 | To download the The Ultimate vimrc, you need to install the git client. If you need install it, use home brew: 18 | 19 | ```sh 20 | brew install git 21 | ``` 22 | 23 | Now, download the vimrc files: 24 | 25 | ```sh 26 | git clone https://github.com/amix/vimrc.git ~/.vim_runtime 27 | ``` 28 | 29 | To install the complete version, run: 30 | 31 | ```sh 32 | sh ~/.vim_runtime/install_awesome_vimrc.sh 33 | ``` 34 | 35 | To install the _basic_ version, run: 36 | 37 | ```sh 38 | sh ~/.vim_runtime/install_basic_vimrc.sh 39 | ``` 40 | 41 | ### Update 42 | 43 | To update the vimrc scripts, run: 44 | 45 | ```sh 46 | cd ~/.vim_runtime && git pull --rebase && cd - 47 | ``` 48 | 49 | ## Maximum Awesome 50 | 51 | [Maximum Awesome](https://github.com/square/maximum-awesome) is a collection of vim configuration and plugins, like a configuration manager for the vim environment. 52 | 53 | ### Installation 54 | 55 | To install it, just make a clone of the repository with the git client: 56 | 57 | ```sh 58 | git clone https://github.com/square/maximum-awesome.git 59 | ``` 60 | 61 | Then install it: 62 | 63 | ```sh 64 | cd maximum-awesome 65 | rake 66 | ``` 67 | 68 | > **NOTE:** the rake command will install all dependencies needed. 69 | -------------------------------------------------------------------------------- /VisualStudioCode/README.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code 2 | 3 | [Visual Studio Code](https://code.visualstudio.com/) is a lightweight code editor with support for many programming languages through [extensions](https://code.visualstudio.com/docs/editor/extension-gallery) 4 | 5 | ## Installation 6 | 7 | To install the latest version, use Homebrew: 8 | 9 | ```sh 10 | brew install --cask visual-studio-code 11 | ``` 12 | 13 | ## macOS integration 14 | 15 | Launch VS Code from the [command line](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line). 16 | 17 | After that, you can launch VS Code from your terminal: 18 | 19 | * `code .` will open VS Code in the current directory 20 | * `code myfile.txt` will open `myfile.txt` in VS Code 21 | 22 | ## Useful Extensions 23 | 24 | ### Python 25 | 26 | * [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - Python code highlighting 27 | 28 | To enable auto-formatting on "Save", i.e. `⌘ + S`, configure the following: 29 | 30 | 1. Change the default formatter to `Black` instead of `Autopep8`. Critical to avoid large diffs. Go to _Preferences_ -> _User Settings_ and update the setting `python.formatter.provider` to `Black` 31 | 32 | 2. Enable `Format on Save` Setting: _Editor: Format On Save_ setting on _Code_ -> _Preferences_ -> _Settings_ 33 | 34 | ### JavaScript 35 | 36 | * [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint 37 | ) - Useful to check JavaScript errors and helps in auto-formatting the code 38 | * [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode 39 | ) - JavaScript code formatter 40 | 41 | ### SQL 42 | 43 | * [PostgreSQL formatter](https://marketplace.visualstudio.com/items?itemName=bradymholt.pgformatter) 44 | 45 | ### Markdown 46 | 47 | * [Markdown Preview](https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) - Read Markdown files in VSCode 48 | 49 | ### GitLens 50 | 51 | * [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens 52 | ) - Supercharge the Git capabilities built into VSCode 53 | 54 | ### Docker 55 | 56 | * [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) - Create, manage, and debug images from within VSCode 57 | 58 | ### JSON 59 | 60 | * [Paste JSON as Code](https://marketplace.visualstudio.com/items?itemName=quicktype.quicktype) - Infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language 61 | 62 | ### Live Server 63 | 64 | * [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) - Launches a local development server with live reloading for both static and dynamic 65 | 66 | ### VS Code Icons 67 | 68 | * [vscode-icons](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons) - Adds unique icons to distinguish different file extensions (easier to glance through your directories) 69 | -------------------------------------------------------------------------------- /Xcode/README.md: -------------------------------------------------------------------------------- 1 | # Xcode 2 | 3 | [Xcode](https://developer.apple.com/xcode/) is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, watchOS and tvOS. 4 | 5 | Download and install it from the App Store or from [Apple's website](https://developer.apple.com/xcode/). 6 | 7 | For installing Xcode command line tools run: 8 | 9 | ```sh 10 | xcode-select --install 11 | ``` 12 | 13 | It'll prompt you to install the command line tools. Follow the instructions and you'll have Xcode and Xcode command line tools both installed. 14 | 15 | ## XQuartz 16 | 17 | XQuartz is Apple Inc.'s version of the X server, a component of the X Window System for macOS. It might be useful if you are developing software for macOS, it's available for download [here](http://xquartz.macosforge.org/landing/). 18 | -------------------------------------------------------------------------------- /_layouts/website/page.html: -------------------------------------------------------------------------------- 1 | {% extends template.self %} 2 | 3 | {% block book_sidebar %} 4 | {% block book_summary %} 5 | <nav role="navigation"> 6 | {% include "website/summary.html" %} 7 | </nav> 8 | {% endblock %} 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /assets/Iterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/assets/Iterm.png -------------------------------------------------------------------------------- /assets/intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sb2nov/mac-setup/16ba77c931fd08d0dd2337597970e013ddd76667/assets/intro.gif -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "macOS Setup Guide", 3 | "language": "en", 4 | "direction": "ltr", 5 | "gitbook": "3.2.3", 6 | "links": { 7 | "home": "https://sourabhbajaj.com/mac-setup/", 8 | "about": "https://sourabhbajaj.com", 9 | "issues": null, 10 | "contribute": null 11 | }, 12 | "pdf": { 13 | "toc": true, 14 | "pageNumbers": false, 15 | "fontSize": 12, 16 | "paperSize": "a4", 17 | "margin": { 18 | "right": 62, 19 | "left": 62, 20 | "top": 36, 21 | "bottom": 36 22 | } 23 | }, 24 | "plugins": [ 25 | "analytics" 26 | ], 27 | "pluginsConfig": { 28 | "analytics": { 29 | "google": "UA-40495390-3" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /iTerm/README.md: -------------------------------------------------------------------------------- 1 | # iTerm2 2 | 3 | [iTerm2](http://www.iterm2.com/) is an open source replacement for Apple's Terminal. It's highly customizable and comes with a lot of useful features. 4 | 5 | ## Installation 6 | 7 | Use [Homebrew](https://sourabhbajaj.com/mac-setup/Homebrew/) to download and install: 8 | 9 | ```sh 10 | brew install --cask iterm2 11 | ``` 12 | 13 | ## Customization 14 | 15 | ### Colors and Font Settings 16 | 17 | Here are some suggested settings you can change or set, **they are all optional**. 18 | 19 | - Set hot-key to open and close the terminal to `command + option + i` 20 | - Go to profiles -> Default -> Terminal -> Check silence bell to disable the terminal session from making any sound 21 | - Download [one of iTerm2 color schemes](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/schemes) and then set these to your default profile colors 22 | - Change the cursor text and cursor color to yellow make it more visible 23 | - Change the font to 14pt Source Code Pro Lite. Source Code Pro can be downloaded using [Homebrew](https://sourabhbajaj.com/mac-setup/Homebrew/) `brew tap homebrew/cask-fonts && brew install --cask font-source-code-pro` 24 | - If you're using BASH instead of ZSH you can add `export CLICOLOR=1` line to your `~/.bash_profile` file for nice coloring of listings 25 | 26 | [](https://raw.githubusercontent.com/sb2nov/mac-setup/main/assets/Iterm.png) 27 | 28 | ### MacOS shortcuts ⌘←, ⌘→ and ⌥←, ⌥→ 29 | 30 | You might be familiar with shortcuts to skip a word (⌥) or go to start/end of the line (⌘). iTerm is not set up to work with these shortcuts by default but here's how you set them up: 31 | 32 | Open up iTerm2 preferences (⌘ + ,) -> Profiles -> Keys -> Click on `+` icon (add new Keyboard shortcut). 33 | 34 | | shortcut | action | Esc+ | 35 | |:--------:|:--------------------:|:----:| 36 | | ⌘← | Send Escape Sequence | OH | 37 | | ⌘→ | Send Escape Sequence | OF | 38 | | ⌥← | Send Escape Sequence | b | 39 | | ⌥→ | Send Escape Sequence | f | 40 | 41 | ### Touch ID sudo workaround 42 | 43 | If you have enabled sudo authentication with Touch ID you will also need to set `Preferences -> Advanced -> Allow sessions to survive logging out and back in` to `No` in iTerm2 preferences. 44 | -------------------------------------------------------------------------------- /iTerm/ack.md: -------------------------------------------------------------------------------- 1 | # `ack` 2 | 3 | `ack` is a search tool designed for code. It's built to be a replacement for 4 | `grep` with higher speed and more options. 5 | 6 | ## Installation 7 | 8 | To install the latest version, use homebrew. 9 | 10 | ```sh 11 | brew install ack 12 | ``` 13 | 14 | ## Why use `ack` over `grep` 15 | 16 | - Faster 17 | - Skips unimportant files by default 18 | - It searches recursively by default 19 | - Customizable 20 | 21 | ## Usage 22 | 23 | ```sh 24 | ack [OPTION]... PATTERN [FILES OR DIRECTORIES] 25 | ``` 26 | 27 | Let's say you want to find all JavaScript files that are using the module 28 | `pancakes` in your project, with `ack` it's as easy as 29 | 30 | ```sh 31 | ack --js pancakes 32 | ``` 33 | 34 | Or you may want to find all files that _does not_ contain the word _brew_ 35 | 36 | ```sh 37 | ack -L brew 38 | ``` 39 | 40 | ## Customization 41 | 42 | You can customize `ack` to behave the way you want it to, this configuration i 43 | s stored in `/.ackrc`. 44 | 45 | For example, you can add a custom type to use as a flag when searching. The 46 | following configuration will allow you to only search in `.md`, `.mkd` and 47 | `.markdown` files using the `--markdown` flag. 48 | 49 | ```sh 50 | --type-set=markdown=.md,.mkd,.markdown 51 | ``` 52 | 53 | You can also tell ack to always sort and use colors in the result. 54 | 55 | ```sh 56 | --sort-files 57 | --color 58 | ``` 59 | 60 | To see what configuration `ack` uses you can use the `dump` flag. 61 | 62 | ```sh 63 | ack --dump 64 | ``` 65 | 66 | ## Alternatives to `ack` 67 | 68 | There's [The Silver Surfer](https://github.com/ggreer/the_silver_searcher) which describes itself as a 69 | > A code searching tool similar to `ack`, with a focus on speed. 70 | -------------------------------------------------------------------------------- /iTerm/autojump.md: -------------------------------------------------------------------------------- 1 | # `autojump` 2 | 3 | `autojump` is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line. 4 | 5 | ## Installation 6 | 7 | To install the latest version, use homebrew: 8 | 9 | ```sh 10 | brew install autojump 11 | ``` 12 | 13 | ## Usage 14 | 15 | Navigate to your most-visited directories as usual using `cd`, for example if you had a directory called `work/github/mac-setup` 16 | 17 | ```sh 18 | cd work/github/mac-setup 19 | ``` 20 | 21 | The next time you want to navigate to the same directory, use autojump like so - 22 | 23 | ```sh 24 | j mac-setup 25 | ``` 26 | -------------------------------------------------------------------------------- /iTerm/fzf.md: -------------------------------------------------------------------------------- 1 | # `fzf` 2 | 3 | [`fzf`](https://github.com/junegunn/fzf) is a general-purpose command-line 4 | fuzzy finder. On it's own it's not very useful but when combined with other 5 | tools it becomes super powerful. 6 | 7 | ## Installation 8 | 9 | Use [Homebrew](https://sourabhbajaj.com/mac-setup/Homebrew/README.html) to 10 | install `fzf`: 11 | 12 | ```sh 13 | brew install fzf 14 | ``` 15 | 16 | If you want to use shell extensions (better shell integration): 17 | 18 | ```sh 19 | /usr/local/opt/fzf/install 20 | ``` 21 | 22 | which gives you: 23 | 24 | - Key bindings (`CTRL-T`, `CTRL-R`, and `ALT-C`) (available for _bash_, _zsh_ 25 | and _fish_) 26 | - Fuzzy auto-completion (available for _bash_ and _zsh_) 27 | 28 | ## Example Usages 29 | 30 | Add any of these functions to your shell configuration file and apply the 31 | changes to try them out. Or just paste the function in your terminal if you 32 | just want to try it out without saving it. 33 | 34 | ```sh 35 | # fd - cd to selected directory 36 | fd() { 37 | local dir 38 | dir=$(find ${1:-.} -path '*/\.*' -prune \ 39 | -o -type d -print 2> /dev/null | fzf +m) && 40 | cd "$dir" 41 | } 42 | ``` 43 | 44 | ```sh 45 | # fh - search in your command history and execute selected command 46 | fh() { 47 | eval $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//') 48 | } 49 | ``` 50 | 51 | **For more fuzzy search examples see the 52 | [official repo](https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh).** 53 | 54 | ### Chrome history from your terminal 55 | 56 | **Note**: original [blog post](https://junegunn.kr/2015/04/browsing-chrome-history-with-fzf/) 57 | 58 | Open up your shell config and add following function: 59 | 60 | ```sh 61 | # ch - browse chrome history 62 | ch() { 63 | local cols sep 64 | cols=$(( COLUMNS / 3 )) 65 | sep='{::}' 66 | 67 | cp -f ~/Library/Application\ Support/Google/Chrome/Profile\ 1/History /tmp/h 68 | 69 | sqlite3 -separator $sep /tmp/h \ 70 | "select substr(title, 1, $cols), url 71 | from urls order by last_visit_time desc" | 72 | awk -F $sep '{printf "%-'$cols's \x1b[36m%s\x1b[m\n", $1, $2}' | 73 | fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs open 74 | } 75 | ``` 76 | 77 | **Note**: Ensure that path to `History` file is correct; read more information 78 | on [StackOverflow](https://stackoverflow.com/a/16742333/1564365). 79 | -------------------------------------------------------------------------------- /iTerm/tree.md: -------------------------------------------------------------------------------- 1 | # `tree` 2 | 3 | `tree` is a recursive directory listing command that produces a depth indented listing of files. 4 | 5 | ## Installation 6 | 7 | To install the latest version, use homebrew: 8 | 9 | ```sh 10 | brew install tree 11 | ``` 12 | 13 | ## Usage 14 | 15 | Running `tree` will produce output like this: 16 | 17 | ```console 18 | $ tree 19 | 20 | . 21 | ├── Apps 22 | │ ├── Octave.md 23 | │ ├── README.md 24 | │ ├── Settings.md 25 | │ ├── araxis-merge.jpg 26 | │ ├── beyond-compare.png 27 | │ ├── delta-walker.jpg 28 | │ ├── filemerge.png 29 | │ └── kaleidoscope.png 30 | ├── CONTRIBUTING.md 31 | ├── Cpp 32 | │ └── README.md 33 | ├── Docker 34 | │ └── README.md 35 | ├── Git 36 | │ ├── README.md 37 | │ └── gitignore.md 38 | └── Go 39 | └── README.md 40 | 41 | 5 directories, 14 files 42 | ``` 43 | 44 | To limit the recursion you can pass an `-L` flag and specify the maximum depth `tree` will use when searching. 45 | 46 | ```sh 47 | tree -L 1 48 | ``` 49 | 50 | will output: 51 | 52 | ```sh 53 | . 54 | ├── Apps 55 | ├── CONTRIBUTING.md 56 | ├── Cpp 57 | ├── Docker 58 | ├── Git 59 | └── Go 60 | 61 | 5 directories, 1 files 62 | ``` 63 | -------------------------------------------------------------------------------- /iTerm/zsh.md: -------------------------------------------------------------------------------- 1 | # zsh 2 | 3 | The Z shell (also known as `zsh`) is a Unix shell that is built on top of `bash` 4 | and that, since macOS 10.15 Catalina, is the **default** shell for macOS. 5 | Since it has many with additional features, _if you have a version of macOS older than Catalina_, 6 | it's recommended to use `zsh` over `bash`. In this case it's also highly recommended to install a framework with 7 | `zsh` as it makes dealing with configuration, plugins and themes a lot nicer. 8 | 9 | We've also included an `env.sh` file where we store our aliases, exports, path 10 | changes etc. We put this in a separate file to not pollute our main 11 | configuration file too much. This file is found in the bottom of this page. 12 | 13 | Install `zsh` using Homebrew: 14 | 15 | ```sh 16 | brew install zsh 17 | ``` 18 | 19 | Now you should install a framework, we recommend to use [Oh My Zsh](https://github.com/robbyrussell/oh-my-zsh) 20 | or [Prezto](https://github.com/sorin-ionescu/prezto). **Note that you should 21 | pick one of them, not use both.** 22 | 23 | The configuration file for `zsh` is called `.zshrc` and lives in your home 24 | folder (`~/.zshrc`). 25 | 26 | ## Oh My Zsh 27 | 28 | [Oh My Zsh](https://github.com/robbyrussell/oh-my-zsh) is an open source, 29 | community-driven framework for managing your `zsh` configuration. It comes 30 | with a bunch of features out of the box and improves your terminal experience. 31 | 32 | Install Oh My Zsh: 33 | 34 | ```sh 35 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 36 | ``` 37 | 38 | The installation script should set `zsh` to your default shell, but if it 39 | doesn't you can do it manually: 40 | 41 | ```sh 42 | chsh -s $(which zsh) 43 | ``` 44 | 45 | ### Configuration 46 | 47 | The out-of-the-box configuration is usable but you probably want to customise 48 | it to suit your needs. The [Official Wiki](https://github.com/robbyrussell/oh-my-zsh/wiki) 49 | contains a lot of useful information if you want to deep dive into what you 50 | can do with Oh My Zsh, but we'll cover the basics here. 51 | 52 | To apply the changes you make you need to either **start new shell instance** 53 | or run: 54 | 55 | ```sh 56 | source ~/.zshrc 57 | ``` 58 | 59 | #### Plugins 60 | 61 | Add plugins to your shell by adding the name of the plugin to the `plugin` 62 | array in your `.zshrc`. 63 | 64 | ```sh 65 | plugins=(git colored-man-pages colorize pip python brew macos) 66 | ``` 67 | 68 | You'll find a list of all plugins on the [Oh My Zsh Wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins). 69 | Note that adding plugins can cause your shell startup time to increase. 70 | 71 | ##### zsh-syntax-highlighting 72 | 73 | The Syntax Highlighting plugin adds beautiful colors to the commands you are typing. 74 | 75 | Clone the zsh-syntax-highlighting plugin’s repo and copy it to the “Oh My ZSH” plugins directory. 76 | 77 | ```sh 78 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting 79 | ``` 80 | 81 | ##### zsh-autosuggestions 82 | 83 | This plugin auto suggests any of the previous commands. Pretty handy! To select the completion, simply press → key. 84 | 85 | Clone the zsh-autosuggestions plugin’s repo and copy it to the “Oh My ZSH” plugins directory. 86 | 87 | ```sh 88 | git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions 89 | ``` 90 | 91 | ##### Enforce Changes 92 | 93 | To apply the changes you make you need to either **start new shell instance** 94 | or run: 95 | 96 | ```sh 97 | source ~/.zshrc 98 | ``` 99 | 100 | #### Themes 101 | 102 | Changing theme is as simple as changing a string in your configuration file. 103 | The default theme is `robbyrussell`. Just change that value to change theme, 104 | and don't forget to apply your changes. 105 | 106 | ```sh 107 | ZSH_THEME=pygmalion 108 | ``` 109 | 110 | You'll find a list of themes with screenshots on the 111 | [Oh My Zsh Wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/themes). 112 | 113 | ## Prezto 114 | 115 | [Prezto](https://github.com/sorin-ionescu/prezto) is a configuration framework 116 | for `zsh`; it enriches the command line interface environment with sane 117 | defaults, aliases, functions, auto completion, and prompt themes. 118 | 119 | Install Prezto: 120 | 121 | ```sh 122 | git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" 123 | ``` 124 | 125 | Next create your `~/.zshrc` by running: 126 | 127 | ```sh 128 | setopt EXTENDED_GLOB 129 | for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do 130 | ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" 131 | done 132 | ``` 133 | 134 | For more information on customisation visit the [GitHub repository for 135 | Prezto](https://github.com/sorin-ionescu/prezto). 136 | 137 | ### Modules 138 | 139 | Add modules to Prezto by editing `~/.zpreztorc` and adding the modules as 140 | strings to the list: 141 | 142 | ```sh 143 | zstyle ':prezto:load' pmodule \ 144 | 'environment' \ 145 | 'terminal' \ 146 | 'editor' \ 147 | 'history' \ 148 | 'directory' \ 149 | 'spectrum' \ 150 | 'utility' \ 151 | 'completion' \ 152 | 'git' \ 153 | 'syntax-highlighting' \ 154 | 'history-substring-search' \ 155 | 'prompt' 156 | ``` 157 | 158 | And don't forget to apply your changes by **starting a new shell instance**. 159 | 160 | ### Themes 161 | 162 | To list all available themes run: 163 | 164 | ```sh 165 | prompt -l 166 | ``` 167 | 168 | Then open up your config file (`~/.zpreztorc`) and change to the theme you want: 169 | 170 | ```sh 171 | zstyle ':prezto:module:prompt' theme 'minimal' 172 | ``` 173 | 174 | ## `env.sh` 175 | 176 | To include `env.sh`, open `~/.zshrc` and add the following: 177 | 178 | ```sh 179 | source ~/<path to file>/env.sh 180 | ``` 181 | 182 | This file comes with some pre-defined settings, **they are all optional**. 183 | Please review them before you use them as your configuration. These are just 184 | examples to show you what you can customise in your shell. 185 | 186 | ```sh 187 | #!/bin/zsh 188 | 189 | # Add commonly used folders to $PATH 190 | export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 191 | 192 | # Specify default editor. Possible values: vim, nano, ed etc. 193 | export EDITOR=vim 194 | 195 | # File search functions 196 | function f() { find . -iname "*$1*" ${@:2} } 197 | function r() { grep "$1" ${@:2} -R . } 198 | 199 | # Create a folder and move into it in one command 200 | function mkcd() { mkdir -p "$@" && cd "$_"; } 201 | 202 | # Example aliases 203 | alias cppcompile='c++ -std=c++11 -stdlib=libc++' 204 | alias g='git' 205 | ``` 206 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mac-setup", 3 | "version": "0.0.3", 4 | "homepage": "https://www.sourabhbajaj.com/", 5 | "description": "Installing Development environment on macOS", 6 | "devDependencies": { 7 | "gitbook": "3.2.3", 8 | "gitbook-cli": "2.3.2", 9 | "graceful-fs": "^4.2.11", 10 | "markdownlint-cli": "0.34.0", 11 | "node-fetch": "3.3.1" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/sb2nov/mac-setup.git" 16 | }, 17 | "keywords": [ 18 | "OSx", 19 | "OS X", 20 | "Install", 21 | "Mac", 22 | "macOS", 23 | "Git", 24 | "Gitbook", 25 | "Setup", 26 | "Instruction" 27 | ], 28 | "author": "Sourabh Bajaj", 29 | "license": "MIT", 30 | "bugs": { 31 | "url": "https://github.com/sb2nov/mac-setup/issues" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /scripts/generate_contributors.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * This script fetches contributors and writes their usernames and url 5 | * to the Contributors.md file. 6 | */ 7 | 8 | const fetch = require('node-fetch'); 9 | const fs = require('fs'); 10 | 11 | // Each call to the endpoint returns 30 contributors. In total we'll fetch 12 | // PAGE_COUNT * 30 contributors. 13 | const PAGE_COUNT = 4; 14 | const FILE_NAME = "Contributors.md"; 15 | const BASE_URL = "https://api.github.com/repos/sb2nov/mac-setup/contributors?page="; 16 | const HEADER = `# Contributors 17 | 18 | Thank you everyone that have contributed to creating this awesome guide! 19 | 20 | `; 21 | 22 | const validateWorkingDirectory = () => { 23 | const cwd = process.cwd(); 24 | 25 | if (!cwd.endsWith("/mac-setup")) { 26 | throw new Error("Script must be run from repo root"); 27 | } 28 | }; 29 | 30 | const fetchContributor = async url => { 31 | try { 32 | const response = await fetch(url); 33 | const json = await response.json(); 34 | return json; 35 | } catch (err) { 36 | throw new Error(err); 37 | } 38 | }; 39 | 40 | const fetchContributors = () => { 41 | return [...Array(PAGE_COUNT).keys()] 42 | .map(i => i + 1) 43 | .map(i => `${BASE_URL}${i}`) 44 | .map(fetchContributor); 45 | }; 46 | 47 | // Validate username to not contain anything naughty 48 | const validateUsername = contributor => { 49 | const username = contributor.login; 50 | 51 | return !username.includes("<script"); 52 | }; 53 | 54 | // Ignore users that are not human, such as bots 55 | const ignoreNonHumanUsers = contributor => { 56 | const username = contributor.login; 57 | const nonHumanUsernames = ["dependabot[bot]"]; 58 | 59 | return !nonHumanUsernames.includes(username); 60 | }; 61 | 62 | const parseContributors = contributors => { 63 | return contributors 64 | .flatMap(c => c) 65 | .filter(validateUsername) 66 | .filter(ignoreNonHumanUsers) 67 | .map(c => `- [${c.login}](${c.html_url})`) 68 | .join('\n'); 69 | }; 70 | 71 | const writeToFile = content => 72 | fs.writeFile(FILE_NAME, content, err => { 73 | if (err) throw new Error(err); 74 | }); 75 | 76 | const run = promises => 77 | Promise.all(promises) 78 | .then(contributors => { 79 | const contributorsMarkdown = parseContributors(contributors); 80 | const fileContent = HEADER + contributorsMarkdown + '\n'; 81 | 82 | writeToFile(fileContent); 83 | }); 84 | 85 | validateWorkingDirectory(); 86 | 87 | const promises = fetchContributors(); 88 | run(promises); 89 | -------------------------------------------------------------------------------- /scripts/health_check_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script verifies that no provided links in the repo are broken. It does 4 | # so by making a HTTP request to each website and looking at the status code of 5 | # the response. 6 | # 7 | # If the request responds with 5xx the script terminates with a status code of 8 | # 1, meaning a link is broken. 3xx and 4xx responses are treated as warnings 9 | # and are simply logged, because they do not guarantee that there is something 10 | # wrong with the requested website. The status code 000 is also treated as a 11 | # warning because the status code alone does not specify where the problem 12 | # lies, only that there is a problem, read more here: https://tinyurl.com/superuser-status-code-000 13 | # 14 | ### Dependencies 15 | # - curl 16 | # - GNU grep 17 | # - GNU parallel 18 | # 19 | ### Usage 20 | # 21 | # /bin/bash ./health_check_links.sh 22 | # 23 | ### Improvements to be made 24 | # - Be able to Blacklist files to be ignored 25 | # - Output the actual problem if the response status code was 000 (see link 26 | # above for more info) 27 | # - Do not use GNU grep 28 | # 29 | # Author: http://github.com/simeg 30 | # License: MIT 31 | # 32 | 33 | readonly PARALLEL_JOBS_COUNT=200 34 | 35 | echo "🔎 Finding markdown files.." 36 | readonly MARKDOWN_FILES_STR=$(find "$(PWD)"/.. -type f -name "*.md") 37 | readonly MARKDOWN_FILES_ARR=(${MARKDOWN_FILES_STR// / }) 38 | echo "Found [" ${#MARKDOWN_FILES_ARR[@]} "] files" 39 | 40 | echo "🔬 Parsing URLs.." 41 | URL_ARR=() 42 | for FILE in "${MARKDOWN_FILES_ARR[@]}"; do 43 | # Parse URL 44 | URLS_STR=$(cat $FILE | ggrep -o -E 'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)') 45 | # Split string into array 46 | URLS_STR_SPLIT=(${URLS_STR// / }) 47 | for i in "${URLS_STR_SPLIT[@]}"; do 48 | URL_ARR+=("$i") 49 | done 50 | done 51 | 52 | echo "Found [" ${#URL_ARR[@]} "] URLs" 53 | 54 | # Write URLs to file, parallel needs input from file 55 | readonly RAW_URLS_FILE=$(mktemp) 56 | printf "%s\\n" "${URL_ARR[@]}" > "$RAW_URLS_FILE" 57 | 58 | curl_for_status_code() { 59 | local url 60 | local status_code 61 | url="$1" 62 | 63 | status_code=$( 64 | curl "$url" \ 65 | --silent \ 66 | --max-time 5 \ 67 | --location \ 68 | --write-out "%{http_code}" \ 69 | --output /dev/null 70 | ) 71 | printf "%s\\t%d\\n" "$url" "$status_code" 72 | } 73 | 74 | # Make function available for parallel 75 | export -f curl_for_status_code 76 | 77 | echo "🚦 Checking statuses of URLs.." 78 | readonly URLS_WITH_STATUSES_FILE=$(mktemp) 79 | parallel --jobs $PARALLEL_JOBS_COUNT curl_for_status_code < "$RAW_URLS_FILE" >> "$URLS_WITH_STATUSES_FILE" 80 | 81 | cat "$URLS_WITH_STATUSES_FILE" | while read RESULT 82 | do 83 | URL=$(echo "$RESULT" | cut -f1) 84 | STATUS_CODE=$(echo "$RESULT" | cut -f2) 85 | FIRST_DIGIT=${STATUS_CODE:0:1} 86 | 87 | case "$FIRST_DIGIT" in 88 | "2") 89 | echo "✅ OK!" 90 | ;; 91 | "3" | "4" | "0") 92 | printf "⚠️ WARNING: URL [ %s ] responded with status code [ %d ], continuing..\\n" "$URL" "$STATUS_CODE" 93 | ;; 94 | "5") 95 | printf "🚨 ERROR: URL [ %s ] responded with status code [ %d ], aborting!\\n" "$URL" "$STATUS_CODE" 96 | exit 1 97 | ;; 98 | *) 99 | printf "UNKNOWN STATUS CODE: URL [ %s ] responded with status code [ %d ], continuing..\\n" "$URL" "$STATUS_CODE" 100 | ;; 101 | esac 102 | done 103 | -------------------------------------------------------------------------------- /scripts/publish_gitbook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | readonly commands=(git gitbook cp) 4 | 5 | # Make sure we don't push unrelated changes 6 | if [[ $(git status -s | wc -l) -gt 0 ]]; then 7 | echo "🚨 You have changed files. Aborting." 8 | exit 1 9 | fi 10 | 11 | function is_available { 12 | command -v $1 >/dev/null 2>&1 || 13 | { echo >&2 "🚨 I require $1 but it's not installed. Aborting."; exit 1; } 14 | } 15 | 16 | # Make sure all executables are available on $PATH 17 | for cmd in ${commands[@]}; do is_available "$cmd"; done 18 | echo "✅ All required packages are available, will continue" 19 | 20 | echo "👥 Updating list of contributors.." 21 | node ./scripts/generate_contributors.js 22 | git commit -a -m "Update list of contributors" 23 | git push origin main 24 | echo "👥 Completed updating list of contributors" 25 | 26 | echo "📖 Building the guide using gitbook.." 27 | gitbook install 28 | gitbook build 29 | echo "📖 Done building guide" 30 | 31 | git checkout gh-pages 32 | git pull origin gh-pages --rebase 33 | 34 | cp -R _book/* . 35 | 36 | echo "🌲 Cleaning untracked files from working tree.." 37 | git clean -fx node_modules 38 | git clean -fx _book 39 | echo "🌲 Done cleaning untracked files" 40 | 41 | git add . 42 | 43 | readonly HASH=$(git rev-parse --short HEAD) 44 | git commit -a -m "Deploy version with hash $HASH" 45 | 46 | git push origin gh-pages 47 | git checkout main 48 | 49 | echo "😎 Finished building and deploying new version of guide" 50 | -------------------------------------------------------------------------------- /styles/website.css: -------------------------------------------------------------------------------- 1 | .book-header .btn { 2 | color: #444; 3 | } 4 | --------------------------------------------------------------------------------