curl -sSL https://gist.github.com/philpl/cc89a49f121b3dacfc25a2f3daea73e3/raw/406b2ac8d4fb6fb5afa9230ee901f36ade264cae/mac.sh | sh
Last active
March 30, 2016 10:29
-
-
Save kitten/cc89a49f121b3dacfc25a2f3daea73e3 to your computer and use it in GitHub Desktop.
Setting up OS X systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Ansi 0 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.0</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.0</real> | |
| <key>Red Component</key> | |
| <real>0.0</real> | |
| </dict> | |
| <key>Ansi 1 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.3333333432674408</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.3333333432674408</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Ansi 10 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.48235294222831726</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.98039215803146362</real> | |
| <key>Red Component</key> | |
| <real>0.31372550129890442</real> | |
| </dict> | |
| <key>Ansi 11 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.54901963472366333</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.98039215803146362</real> | |
| <key>Red Component</key> | |
| <real>0.94509804248809814</real> | |
| </dict> | |
| <key>Ansi 12 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.97647058963775635</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.57647061347961426</real> | |
| <key>Red Component</key> | |
| <real>0.74117648601531982</real> | |
| </dict> | |
| <key>Ansi 13 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.7764706015586853</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.47450980544090271</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Ansi 14 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.99215686321258545</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.91372549533843994</real> | |
| <key>Red Component</key> | |
| <real>0.54509806632995605</real> | |
| </dict> | |
| <key>Ansi 15 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>1</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>1</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Ansi 2 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.48235294222831726</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.98039215803146362</real> | |
| <key>Red Component</key> | |
| <real>0.31372550129890442</real> | |
| </dict> | |
| <key>Ansi 3 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.54901963472366333</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.98039215803146362</real> | |
| <key>Red Component</key> | |
| <real>0.94509804248809814</real> | |
| </dict> | |
| <key>Ansi 4 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.97647058963775635</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.57647061347961426</real> | |
| <key>Red Component</key> | |
| <real>0.74117648601531982</real> | |
| </dict> | |
| <key>Ansi 5 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.7764706015586853</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.47450980544090271</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Ansi 6 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.99215686321258545</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.91372549533843994</real> | |
| <key>Red Component</key> | |
| <real>0.54509806632995605</real> | |
| </dict> | |
| <key>Ansi 7 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.73333334922790527</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.73333334922790527</real> | |
| <key>Red Component</key> | |
| <real>0.73333334922790527</real> | |
| </dict> | |
| <key>Ansi 8 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.33333333333333331</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.33333333333333331</real> | |
| <key>Red Component</key> | |
| <real>0.33333333333333331</real> | |
| </dict> | |
| <key>Ansi 9 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.3333333432674408</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.3333333432674408</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Background Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.15977837145328522</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.12215272337198257</real> | |
| <key>Red Component</key> | |
| <real>0.11765811592340469</real> | |
| </dict> | |
| <key>Badge Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>0.5</real> | |
| <key>Blue Component</key> | |
| <real>0.0</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.0</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Bold Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>1</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>1</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Cursor Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.73333334922790527</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.73333334922790527</real> | |
| <key>Red Component</key> | |
| <real>0.73333334922790527</real> | |
| </dict> | |
| <key>Cursor Guide Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>0.25</real> | |
| <key>Blue Component</key> | |
| <real>1</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.9100000262260437</real> | |
| <key>Red Component</key> | |
| <real>0.64999997615814209</real> | |
| </dict> | |
| <key>Cursor Text Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>1</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>1</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Foreground Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.94901961088180542</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.97254902124404907</real> | |
| <key>Red Component</key> | |
| <real>0.97254902124404907</real> | |
| </dict> | |
| <key>Link Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.67799997329711914</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.27000001072883606</real> | |
| <key>Red Component</key> | |
| <real>0.023000000044703484</real> | |
| </dict> | |
| <key>Selected Text Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>1</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>1</real> | |
| <key>Red Component</key> | |
| <real>1</real> | |
| </dict> | |
| <key>Selection Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.35294118523597717</real> | |
| <key>Color Space</key> | |
| <string>Calibrated</string> | |
| <key>Green Component</key> | |
| <real>0.27843138575553894</real> | |
| <key>Red Component</key> | |
| <real>0.26666668057441711</real> | |
| </dict> | |
| </dict> | |
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| unamestr=`uname -s` | |
| if [[ "$unamestr" != 'Darwin' ]]; then | |
| echo "Script only supports OS X." | |
| exit 1 | |
| fi | |
| if [ ! `command -v brew` ]; then | |
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| fi | |
| brew tap caskroom/cask | |
| brew tap caskroom/fonts | |
| brew tap caskroom/versions | |
| brew tap homebrew/dupes | |
| brew tap homebrew/services | |
| brew install ruby | |
| # Install tmux | |
| curl -L -o /usr/local/Library/Formula/tmux.rb https://gist.github.com/philpl/0d3cd1766028e3d10ba361d42357bf82/raw/9b650a630eacb2a8c6d463d5412cdc759bb9a4a0/tmux.rb | |
| brew install --with-truecolor tmux | |
| # ZSH Dependencies | |
| brew install tmux | |
| brew install zsh | |
| brew install reattach-to-user-namespace | |
| brew install tree | |
| brew install thefuck | |
| brew install the_silver_searcher | |
| # Docker Dependencies | |
| brew install docker | |
| brew install docker-machine | |
| # Dupes | |
| brew install openssh | |
| brew install openssl | |
| brew install curl | |
| brew link --force openssh | |
| brew link --force openssl | |
| brew link --force curl | |
| brew intall ssh-copy-id | |
| brew install imagemagick | |
| brew install dnscrypt-proxy | |
| brew install dnsmasq | |
| brew install git | |
| # Install Casks | |
| brew cask install 1password | |
| brew cask install google-chrome-canary | |
| brew cask install font-monoid | |
| brew cask install slack | |
| brew cask install spotify | |
| brew cask install zeplin | |
| brew cask install keepingyouawake | |
| brew cask install infinit | |
| brew cask install iterm2-nightly | |
| # Python | |
| brew install python | |
| brew link --force python | |
| brew install python3 | |
| # External non-tapped intalls | |
| brew install neovim/neovim/neovim | |
| brew install thoughtbot/formulae/rcm | |
| # Neovim + Python | |
| sudo pip install neovim | |
| # Load dotfiles | |
| git clone [email protected]:philpl/dotfiles.git ~/dotfiles | |
| # Init rcm | |
| env RCRC=$HOME/dotfiles/rcrc rcup | |
| # Switch to zsh | |
| echo "/usr/local/bin/zsh" > /etc/shells | |
| chsh -s /usr/local/bin/zsh | |
| # Download dnscrypt resolvers csv | |
| mkdir -p /usr/local/share/dnscrypt-proxy-static | |
| curl -L -o /usr/local/share/dnscrypt-proxy-static/dnscrypt-resolvers.csv https://github.com/jedisct1/dnscrypt-proxy/raw/master/dnscrypt-resolvers.csv | |
| # Setup dnscrypt | |
| sudo tee -a /Library/LaunchDaemons/homebrew.mxcl.dnscrypt-proxy.plist <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>homebrew.mxcl.dnscrypt-proxy</string> | |
| <key>KeepAlive</key> | |
| <true/> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/opt/dnscrypt-proxy/sbin/dnscrypt-proxy</string> | |
| <string>--local-address=127.0.0.1:5355</string> | |
| <string>--ephemeral-keys</string> | |
| <string>--resolvers-list=/usr/local/share/dnscrypt-proxy-static/dnscrypt-resolvers.csv</string> | |
| <string>--resolver-name=cs-de</string> | |
| <string>--user=nobody</string> | |
| </array> | |
| <key>UserName</key> | |
| <string>root</string> | |
| <key>StandardErrorPath</key> | |
| <string>/dev/null</string> | |
| <key>StandardOutPath</key> | |
| <string>/dev/null</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| # Setup dnsmasq | |
| sudo tee -a /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>homebrew.mxcl.dnsmasq</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/opt/dnsmasq/sbin/dnsmasq</string> | |
| <string>--keep-in-foreground</string> | |
| <string>-C</string> | |
| <string>/usr/local/etc/dnsmasq.conf</string> | |
| </array> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| <key>KeepAlive</key> | |
| <true/> | |
| </dict> | |
| </plist> | |
| EOF | |
| cat > /usr/local/etc/dnsmasq.conf <<EOF | |
| # Forward queries to dnscrypt on localhost | |
| server=127.0.0.1#5355 | |
| # Interfaces to listen on | |
| interface=lo0 | |
| interface=en0 | |
| interface=bridge100 | |
| # Never forward plain names | |
| domain-needed | |
| # Blackhole Tor hidden services and local TLDs | |
| address=/.onion/0.0.0.0 | |
| address=/.local/0.0.0.0 | |
| address=/.openvpn/0.0.0.0 | |
| # Never forward addresses in the non-routed address spaces | |
| bogus-priv | |
| # Reject private addresses from upstream nameservers | |
| stop-dns-rebind | |
| # Query servers in order | |
| strict-order | |
| # Set the size of the cache | |
| # The default is to keep 150 hostnames | |
| cache-size=8192 | |
| # Optional logging directives | |
| log-async | |
| log-dhcp | |
| log-queries | |
| log-facility=/var/log/dnsmasq.log | |
| #cname=local-npm.dev,local.docker | |
| EOF | |
| # Setup SSH | |
| sudo tee -a /Library/LaunchDaemons/com.custom.ssh.plist <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.custom.ssh</string> | |
| <key>Program</key> | |
| <string>/usr/libexec/sshd-keygen-wrapper</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/sbin/sshd</string> | |
| <string>-i</string> | |
| <string>-f</string> | |
| <string>/usr/local/etc/ssh/sshd_config</string> | |
| </array> | |
| <key>Sockets</key> | |
| <dict> | |
| <key>Listeners</key> | |
| <dict> | |
| <key>SockServiceName</key> | |
| <string>ssh</string> | |
| <key>Bonjour</key> | |
| <array> | |
| <string>ssh</string> | |
| <string>sftp-ssh</string> | |
| </array> | |
| </dict> | |
| </dict> | |
| <key>inetdCompatibility</key> | |
| <dict> | |
| <key>Wait</key> | |
| <false/> | |
| <key>Instances</key> | |
| <integer>42</integer> | |
| </dict> | |
| <key>StandardErrorPath</key> | |
| <string>/dev/null</string> | |
| <key>SHAuthorizationRight</key> | |
| <string>system.preferences</string> | |
| <key>POSIXSpawnType</key> | |
| <string>Interactive</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| cat > /usr/local/etc/ssh/sshd_config <<EOF | |
| Port 22 | |
| ListenAddress 127.0.0.1 | |
| Protocol 2 | |
| HostKey /usr/local/etc/ssh/ssh_host_rsa_key | |
| HostKey /usr/local/etc/ssh/ssh_host_dsa_key | |
| HostKey /usr/local/etc/ssh/ssh_host_ecdsa_key | |
| HostKey /usr/local/etc/ssh/ssh_host_ed25519_key | |
| Ciphers blowfish-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] | |
| SyslogFacility AUTH | |
| LogLevel INFO | |
| PermitRootLogin no | |
| StrictModes yes | |
| MaxSessions 1 | |
| PubkeyAuthentication yes | |
| AuthorizedKeysFile .ssh/authorized_keys | |
| HostbasedAuthentication no | |
| IgnoreUserKnownHosts yes | |
| IgnoreRhosts yes | |
| PasswordAuthentication no | |
| PermitEmptyPasswords no | |
| KerberosAuthentication no | |
| GSSAPIAuthentication no | |
| UsePAM no | |
| AllowAgentForwarding no | |
| AllowTcpForwarding no | |
| GatewayPorts no | |
| X11Forwarding no | |
| PrintMotd no | |
| UsePrivilegeSeparation sandbox | |
| PermitTunnel no | |
| AllowUsers phil | |
| Subsystem sftp /usr/local/Cellar/openssh/7.1p1/libexec/sftp-server | |
| EOF | |
| # Start all daemons | |
| sudo launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.dnscrypt-proxy.plist | |
| sudo launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
| sudo launchctl bootstrap system /Library/LaunchDaemons/com.custom.ssh.plist | |
| sudo launchctl enable system/homebrew.mxcl.dnscrypt-proxy | |
| sudo launchctl enable system/homebrew.mxcl.dnsmasq | |
| sudo launchctl enable system/com.custom.ssh | |
| # Add resolver dir | |
| sudo mkdir -p /etc/resolver | |
| sudo tee -a /etc/resolver/dev <<EOF | |
| nameserver 127.0.0.1 | |
| EOF | |
| # Reboot | |
| sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment