This is my personal guide to restore my configuration and setup my system for a fresh install. I use it and keep it updated frequently. Hope it will inspire you on your own way =].
Before a fresh reinstall, don't forget to backup many things. A regular ghost made with CarbonCopyCloner or Clonezilla is a good solution, but if you can't, you should save the following :
- MySQL databases (use the script bellow)
- User preferences
- ~/Library/Application Support
- ~/Library/ColorSync/Profiles
- ~/Library/Fonts
- ~/Library/Keychains
- ~/Library/LaunchAgents
- ~/Library/Preferences
- ~/Library/QuickLook
- Configs
- ~/.gitconfig
- ~/.glacier-cmd
- ~/.gnupg
- ~/.pow
- ~/.powconfig
- ~/.s3cfg
- ~/.ssh
Another pretty good solution is to use Mackup that provides a smart way to keep your dotfiles synced in a cloud storage.
After a clean fresh install (format disk and reinstall the base OS and updates), let's install xtras.
You can restore the previously backuped files. If you do so, don't forget to restore permissions : restart in Restore mode with ⌘+R
, open the terminal
and launch resetpassword2
.
I use ZSH instead of the legacy bash shell. To do so :
$ git clone https://github.com/m4dz/oh-my-zsh.git ~/.oh-my-zsh
$ cd ~/.oh-my-zsh
$ git submodule update --init
$ cd
$ cp ~/.oh-my-zsh/custom/zshenv .zshenv
$ cp ~/.oh-my-zsh/custom/zshrc .zshrc
$ chsh -s /bin/zsh
Homebrew is a package manager for OS X. I use to manage my developer tools, and my desktop apps using its submanager : cask.
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ brew tap homebrew/php
$ brew tap homebrew/dupes
$ brew install caskroom/cask/brew-cask
$ brew tap caskroom/versions
If you do not need to use the whole stack given by Pow (including the rack server, see below) but only want to have a simple dns resolver, you should use DNSmasq. Be careful that you need Homebrew installed and configured (see previous-section). More informations are detailled here.
$ brew install dnsmasq
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
Edit the /usr/local/etc/dnsmasq.conf
file and add the following line :
address=/dev/127.0.0.1
Then enable the daemon and launch it :
$ sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Finally, add a resolver :
$ sudo mkdir /etc/resolver
$ sudo echo "nameserver 127.0.0.1" > /etc/resolver/dev
Pow is a tools that combines a local host names resolver (based on the .dev
tld) and a rack server for ruby (and others) apps.
$ echo 'export POW_DST_PORT=88' >> ~/.powconfig
$ curl get.pow.cx | sh
Use Mackup for dotfiles syncing:
$ brew install mackup
$ mackup restore
My basic tools for everyday use.
via caskroom
$ brew cask install dropbox arq asepsis little-snitch trim-enabler alfred iterm2 istat-menus hyperdock appcleaner cocktail gpgtools firefox macdown
via Appstore
- 1password
- Divvy
- Mouseposé
- DaisyDisk
- Simplenotegl
My development envrionment is a little bit complex due to many languages and apps I use everyday. You can simplify it to adapt it to your requirements.
Do not forget to add launch plist
files for daemons. You can add the plist
for your servers (http, PHP-FPM, Mysql,Memcached…) directly to /Library/LaunchDaemons
to start it at boot with root permissions. Use brew info <package>
to view extras informations. For Nginx and PHP-FPM, configure user / group to _www
in config files ; for Memcache, configure plist file with UserName / GroupName daemon
.
$ brew install git
$ brew install ack aria2 apple-gcc42 zsh-completions zsh-syntax-highlighting gettext pidof curl ssh-copy-id s3cmd
$ brew install imagemagick --use-cms --with-freetype --use-rsvg --use-tiff
$ brew install optipng
$ sudo gem install --no-ri --no-rdoc lunchy
$ brew install nginx
$ mkdir -p /usr/local/var/log/nginx
$ chown _www /usr/local/var/log/nginx
$ brew install mariadb postgresql memcached sqlite
$ brew install python pyenv pyenv-virtualenv pyenv-pip-rehash
$ brew install ruby-build rbenv rbenv-gem-rehash
$ rbenv install 2.1.3
$ gem install --no-ri --no-rdoc bundler
$ brew install node
$ curl http://npmjs.org/install.sh | sh
$ npm -g install bower coffee-script csslint docco grunt-cli jscs jshint
$ brew install php56 --with-fpm --with-homebrew-curl --with-homebrew-openssl --with-pgsql
$ brew install php56-apcu php56-memcached php56-xdebug php56-yaml
$ brew install drush
$ chmod -R ug+w /usr/local/Cellar/php56/5.6.2/lib/php
$ pear config-set php_ini /usr/local/etc/php/5.6/php.ini
via caskroom
$ brew cask install vagrant virtualbox sequel-pro google-chrome chromium firefox-aurora imagealpha imageoptim
via Appstore
- Base
- xScope
- JPEGmini Lite
- XCode
I use sublime text and store the config in a git repository.
$ brew cask install sublime-text3
$ git clone https://github.com/m4dz/ST3-User-package ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
via caskroom
$ brew cask install adium limechat skype
via Appstore
- tweetbot
- tweetdeck
- Adobe CreativeCloud
via caskroom
$ brew cask install spotify xld handbrake vlc
via Appstore
- imovie
via caskroom
$ brew cask install libreoffice calibre
via appstore
- Wunderlist
- Fantastical
- ReadKit
- Pages
- Keynote
- Glui
- Cloudapp
- Mindnode Pro