markdown 全新安装 - OS X 10.11 El Capitan
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 全新安装 - OS X 10.11 El Capitan相关的知识,希望对你有一定的参考价值。
#Mac OS X
[Mensch coding font](http://robey.lag.net/2010/06/21/mensch-font.html)
Apps
----
* [Webkit](http://webkit.org)
* [Chrome](http://www.chromium.org/getting-involved/dev-channel)
* [Firefox](http://www.mozilla.org/en-US/firefox/beta/)
* [Opera](http://www.opera.com/browser/next/)
* [iTerm](http://iterm2.com)
* [FileZilla](http://filezilla-project.org/download.php)
* [Sublime Text](http://www.sublimetext.com/dev)
* [Atom Editor](https://atom.io/)
* [LiveReload](http://livereload.com)
* [LiveReload Extensions](http://help.livereload.com/kb/general-use/browser-extensions)
* [Clipy](https://clipy-app.com/)
* [Captain](https://getcaptain.co/)
* [Brew services menubar](https://github.com/andrewn/brew-services-menubar)
#Xcode Command Line Tools
`Xcode > Preferences > Downloads > Command Line Tools`
####Homebrew
```bash
# install package manager
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew packages
brew install \
tree \
node \
ssh-copy-id \
wget \
jpegoptim \
pngcrush \
colordiff \
imagemagick \
graphicsmagick \
ack \
caskroom/cask/brew-cask
```
####Homebrew Web Server Packages
```bash
brew install \
rabbitmq \
dnsmasq \
nginx \
mariadb \
redis \
memcached \
libmemcached \
```
####Homebrew Cask Apps & Fonts
```bash
# add support for fonts
brew tap caskroom/fonts
#add dev/beta versions
brew tap caskroom/versions
#install mac apps & fonts
brew cask install \
font-source-code-pro \
adobe-creative-cloud \
blueharvest \
cleanmymac \
cocktail \
ghostlab \
coda \
sublime-text-dev \
virtualbox \
coderunner \
google-chrome \
firefox \
codekit \
iterm2-beta \
sequel-pro \
querious \
imageoptim \
imagealpha \
xquartz \
simpholders-2-alpha \
handbrake \
vagrant \
ksdiff \
spotify \
launchrocket
```
#Shell
Switch to z-shell
---------------
```bash
brew install zsh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
```
Update .zshrc
-------------
```bash
subl ~/.zshrc
```
```bash
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="candy"
plugins=(git osx rails3 ruby github node npm brew)
source $ZSH/oh-my-zsh.sh
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/usr/X11/bin
```
Install rvm
-------------
```bash
\curl -L https://get.rvm.io | bash -s stable
rvm requirements
```
OR
Install rbenv
-------------
```bash
brew install rbenv
```
Install rubies
-------------
```bash
rvm install 2.3.0 # OR
rbenv install 2.3.0
```
# OS X Preferences
```bash
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Disable window animations ("new window" scale effect)
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Turn on dashboard-as-space
defaults write com.apple.dashboard enabled-state 2
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Make top-right hotspot start screensaver
defaults write com.apple.dock wvous-tr-corner -int 5 && \
defaults write com.apple.dock wvous-tr-modifier -int 0
# Set default Finder location to home folder (~/)
defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Disable ext change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
# Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Trackpad: map bottom right corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2 && \
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true && \
defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1 && \
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true && \
defaults write com.apple.Safari IncludeDevelopMenu -bool true && \
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true && \
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true && \
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Show absolute path in finder's title bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
# Auto-play videos when opened with QuickTime Player
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1
# Enable AirDrop over Ethernet and on unsupported Macs
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Disable WebkitNightly.app's homepage
defaults write org.webkit.nightly.WebKit StartPageDisabled -bool true
```
Set hostname
------------
`sudo scutil --set HostName Work`
Install python
------------
```bash
brew install python3
```
Install virtualenv with pip
------------
```bash
pip3 install virtualenv
pip3 install virtualenvwrapper
```
Source virtualenvwrapper script
```bash
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 source /usr/local/bin/virtualenvwrapper.sh
```
#Git
Setup Github
------------
```bash
ssh-keygen -t rsa -C "g3dinua@gmail.com"
#copy ssh key to github.com
subl ~/.ssh/id_rsa.pub
#test connection
ssh -T git@github.com
#set git config values
git config --global user.name "Bohdan Viter"
git config --global user.email "g3dinua@gmail.com"
git config --global github.user g3d
git config --global github.token your_token_here
git config --global core.editor "subl -w"
git config --global color.ui true
```
#Sublime Text
Add Sublime Text CLI
--------------------
```bash
sudo mkdir -p "/usr/local/bin/" && ln -s "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" "/usr/local/bin/subl"
```
Install Package Control
-----------------------
```python
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
```
Settings
--------
```json
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"close_windows_when_empty": true,
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "Cyrillic (Windows 1251)",
"font_face": "Mensch",
"font_size": 15,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"margin": 2,
"material_theme_accent_lime": true,
"material_theme_accent_orange": true,
"material_theme_accent_purple": true,
"material_theme_accent_red": true,
"material_theme_accent_yellow": true,
"material_theme_bold_tab": true,
"material_theme_disable_fileicons": true,
"material_theme_disable_folder_animation": true,
"material_theme_disable_tree_indicator": true,
"material_theme_small_statusbar": true,
"material_theme_small_tab": true,
"open_files_in_new_window": false,
"overlay_scroll_bars": "enabled",
"rulers":
[
80
],
"show_full_path": true,
"show_tab_close_buttons": true,
"soda_classic_tabs": false,
"soda_folder_icons": true,
"spell_check": false,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"use_simple_full_screen": true,
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?",
"word_wrap": "true"
}
```
Key Bindings
------------
```json
[
{ "keys": ["super+b"], "command": "expand_selection", "args": {"to": "brackets"} },
{ "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace"} },
{ "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "find"} }
]
```
#Server
Install pow
---------------
```bash
curl get.pow.cx | sh
```
MySQL
-----
```bash
brew install mysql
```
MySQL Settings
--------------
```bash
# start mysql
mysql.server start
# secure mysql
mysql_secure_installation
# connecto to mysql
mysql -uroot
```
PostgreSQL
-----
```bash
brew install postgres
```
PostgreSQL Settings
--------------
```bash
# connect to psql
psql -U `whoami` -d postgres
# create user and databases
createuser user
createdb -Ouser -Eutf8 -T template0 user_development
createdb -Ouser -Eutf8 -T template0 user_test
```
Manage homebrew installed packages with LaunchRocket
--------------
![LaunchRocke Screenshot](https://raw.githubusercontent.com/jimbojsb/launchrocket/master/screenshots/LaunchRocket.png)
Enjoy your new OS X!
--------------
![aww yeah](http://i.imgur.com/AmFax.gif)
以上是关于markdown 全新安装 - OS X 10.11 El Capitan的主要内容,如果未能解决你的问题,请参考以下文章
markdown Ruby on Rails的安装环境(Mac OS X 10.9或更高版本)
markdown 如何为Mac OS X创建“DMG安装程序”
markdown 如果你已经在Mac OS X或Linuxbrew上通过Homebrew安装了Node,那么如何修复npm的说明
markdown 有关如何在Mac OS X上安装Fish shell的说明,包括Oh My Fish!。还包括几个有用的功能。