These apps should be manually installed asap because I use them for my entire installation process:
Login with your user to sync apps, bookmarks and settings. In case you don't like syncing with google you can just:
- retrieve everything
- export the bookmarks somewhere
- change user
- import the bookmarks back
- delete the google user
- Theme:
- download and extract Solarized Dark Theme
- open
iterm2-colors-solarized
folder and double click onSolarized Dark.itermcolors
- open iterm
Preferences/Profiles/Colors/Load presets
and choseSolarized Dark
color scheme (or your favorite theme)
- Fonts for
powerline
- download and extract the fonts for powerline
- drag the whole folder over
Font Book
application. This will install all the fonts system wide - open iterm
Preferences/ Profiles / Text /
Regular Font
and selectDejaVu sans mono 12pt for Powerline
Antialiased
and selectInconsolata 12pt for Powerline
- Setup dropbox, then Enable iterm2 sync options:
- Change the login shell
- If you have installed bash 4 with
brew install bash
then you have to tell your mac this is your default shell, not the standard/bin/bash
. - Otherwise add a line in
/etc/shells
with the PATH to your brew bash installation (and restart) - Execute:
chsh -s /usr/local/bin/bash sudo chsh -s /usr/local/bin/bash
- Logout/Login
- If you have installed bash 4 with
To enable shell integration either you follow the default procedure by iTerm2>Install Shell Integration or given that I've already installed it and added some extra utilities scripts you can just open the file ~/.bash_local
and uncomment this line and you are ready to go:
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
I source the iterm shell integration scipt from .bash_local
because I do not want it on all my machines so by default it is disabled.
If you enable shell integration from .bash_local
you will also get these cool commands (see the ~/iterm2
directory):
cd ~/Pictures
imgls # directory listing that includes a thumbnail of each image in a directory
imgcat my_image.jpg # Displays one or more images inline at their full size
download file_name # Downloads a file, but does not display it inline.
divider my_image.jpg # Draws a full-width, one line-tall graphical divider.
Check here https://www.iterm2.com/documentation-images.html for more docs.
- open xcode to agree to the TOS (or it won't install the components)
- install Command Line Tools:
xcode-select --install
then click install - open Xcode's preferences and install the command line tools package (this will install also git, from apple)
Right after a clean installation it's a good idea to crete a bootable backup on an external hard drive when the system is still clean.
- Disk Utility / Erase or Partition / Mac Os Extended (Journaled)
- Go to the (entire) hard disk section / select the partiton /
- Be sure that it is "GUID Partition Table"
- Otherwise / Options / Check GUID Partition Table
- Backup Everything from the current hard disk to the external one with CCC
I usually run step by step all the instruction in ./1.brew.sh
but the shortest way is to sh 1.brew.sh
.
This script will install:
- GNU replacement for various osx terminal commands
- Bash 4
- Libraries
- Bash completions
- Java (Oracle)
- PostgreSQL
- MySQL
- mod_wsgi
brew install postgresql
initdb /usr/local/var/postgres -E utf8
brew install mysql
# Or if you prefer mariadb
# brew install mariadb
# then also follow the instruction for setting up php.ini (under __apache__ section)
unset TMPDIR
export TMPDIR=/tmp
mysqld --initialize-insecure --log-error-verbosity --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql
For setup:
- launch mysql (I usually do so with launchroket)
mysql_secure_installation
sudo cp $(brew --prefix mysql)/support-files/my-default.cnf /etc/my.cnf
mod_php
is already installed (but not activated) mod_wsgi
needs to be installed from brew.
cd /etc/apache2
sudo vi httpd.conf
uncomment # LoadModule php5_module libexec/apache2/libphp5.so
next find the <IfModule dir_module>
, should be around the line 231 and substitute this block
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
with
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
this tells apache to process index.html
OR index.php
if a directory is requested.
Setup your php.ini
cd /etc/
sudo cp php.ini.default php.ini
In case you installed and want to use mariadb instead of mysql then:
sudo chmod +w php.ini
sudo vi php.ini
In php.ini, change the MySQL Unix socket (MariaDB installed by Homebrew use /tmp/mysql.sock by default). If php.ini copied from php.ini.default is not writable, make it writable then replace every occurence of /var/mysql/mysql.sock with /tmp/mysql.sock (it should be at two places) Credits
Search for ;date.timezone = Europe/London
and uncomment it by removing the semicolon and add your timezone, for example: date.timezone = Europe/London
. Then test apache and restart it:
apachectl configtest
sudo apachectl graceful
Php has a built-in development server, if you just want a basic local web server you can cd mywebsite
and launch php -S localhost:8000
and access it at the address http://localhost:8000
.
Furthermore if you are using a php web framework, for example Silex, you can specify your application entry point (routing): php -S localhost:8000 index.php
.
In my .bash_functions
there is a function called server
, when I need a server on a directory, I just cd into it and launch server
it will also open Chrome Canary (if installed) at the specified address or the default browser if Canary was not found.
brew tap homebrew/apache
brew install mod_wsgi
If problem in compiling see: https://github.com/Homebrew/homebrew-apache In short:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
edit /etc/apache2/http.conf
and add this:
LoadModule wsgi_module /usr/local/Cellar/mod_wsgi/3.4/libexec/mod_wsgi.so
or the correct version you have in Cellar
Then test everything is ok:
apachectl configtest
sudo apachectl restart
Be also sure to uncomment LoadModule rewrite_module libexec/apache2/mod_rewrite.so
in your httpd.conf
file.
Normally by default this line should be already uncommented but better to double check.
mod_rewrite
is what let you create websites with pretty URLs as for example applications like WordPress do.
Open /etc/apache2/httpd.conf
and look for all occurrences of AllowOverride None
and change them with AllowOverride All
in the relevant places you want to make pretty urls. Then again:
apachectl configtest
sudo apachectl restart
If you aren't aware brew is collecting your usage data by default.
I don't like this, so: brew analytics off
Run step by step or sh 2.envs.sh
This script will install rbenv, pyenv and nvm that means tools to easily switch version of Ruby, Python and Node.
brew install rbenv #for different versions of ruby
brew install ruby-build
rbenv install -l # list all the available versions of ruby to install
rbenv install 2.1.2 # will install ruby 2.1.2
rbenv global 2.1.2 # makes ruby 2.1.2 the default one
rbenv rehash # Run this command after you install a new version of Ruby, or install a gem that provides commands
rbenv gemset, for sandboxed collection of gems, for example for a specific project. SEE: https://github.com/jf/rbenv-gemset
brew install rbenv-gemset
specific_install to install gem from github (or anywhere else)
gem install specific_install # USAGE: gem specific_install -l <url to a github gem>
Gemfile
gem install bundler
rbenv rehash
bundle install
This will create a Gemfile.lock
file
brew install pyenv
pyenv install --list # for the list of the available python version to install
pyenv install 2.7.10 # install a specific version
pyenv global 2.7.10 # set default global to be used in all shells by writing the version name to the
pyenv rehash # to rebuild your shim files. Doing this on init makes sure everything is up to date
#
pyenv versions # list installed versions
pyenv version # current active version
pyenv local 2.7.5 # set a python version for the current directory. It creates .python-version file inside the current directory
If everything is ok which python
should prompt /Users/USERNAME/.pyenv/shims/python
NOT /bin/python
pip install virtualenv virtualenvwrapper # If virtualenvwrapper wont work just uninstall and reinstall virtualenv
brew install pyenv-virtualenvwrapper # probably not needed
Then don't forget to source: $(brew --prefix)/bin/virtualenvwrapper.sh
.
# create a virtualenv using the currently set global python
mkvirtualenv my_venv1
# for specific version of python (need to specify the full path)
mkvirtualenv -p /Users/myuser/.pyenv/versions/2.6.6/bin/python2.6 my_venv2
I manage to manually install this, because the installation script write in my .bashrc
(no, thanks).
See: https://github.com/nvm-sh/nvm#git-install
Then source this from you .bash_profile
(see the configuration into this file).
https://github.com/creationix/nvm#usage
To install the latest node version
nvm install node
This also installs all the global packages (for this version of node listed in ~/.nvm/default-packages
Set your default node version with:
nvm alias default node vx.y.z
Follow the instructions at: https://github.com/nvm-sh/nvm#automatically-call-nvm-use
npm cache clean –force
nvm cache clear
Run step by step or sh 3.npm.sh
Run step by step or sh 4.tools.sh
This will install:
- various global python libraries
- lua packages
- linters, useful for Sublime Linter plugins
- mackup
- mert
- screengif
- Other things
# Python Packages for mysql and postgres
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install psycopg2 # postgres HAS to be installed
pip install mysql-python
mert is amazing! It is a command line tool for managing windows, tabs, and pane configurations for iTerm.
npm install -g mert
Example:
Run mert init
in your project directory with, it will create a .mertrc
file.
Edit the .mertrc
file:
root: "/Users/foo/Projects/NonNewtonianApplesFallingUpwards"
layout:
-
- workon foo_virtual_env; python manage.py runserver;
-
- cd webapp; gulp serve;
-
- git status;
then run mert start
.
This will read the .mertrc
file and create 3 horizontal panes in iterm with your favorite commands for your project.
I created an alias in .bash_aliases
:
alias start="mert start"
so that I just cd myproject; start
will launch my defined panes and commands defined in the .mertrc
. This saves me a lot of time!
alcatraz packet manager for xcode. I don't have enough experience with this, I need to play with it a little bit more
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
# uninstall with
rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin
# Remove all cached data:
rm -rf ~/Library/Application\ Support/Alcatraz
Mackup sync app settings. I only use this for better touch tool and f.lux but can be used with almost any application.
Open ~/.mackup.cfg and change the directory to point to your dropbox (or whatever) where you saved your setting from another machine or osx installation. Then mackup restore
.
mackup backup # Launch it and back up your files
mackup restore # Launch it and restore your files
mackup uninstall # Copy back any synced config file to its original place.
"Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to OS X applications and large binaries alike."
Basically I can install all my GUI application just by sh 5.cask.sh
so I don't have to find each App homepage, download them, unzip, mount the dmg, drag and drop..I have so many apps that this task could take a lot of times. And most important I never remember all the apps I had previously installed.
Casks comes with brew by default, to activate it, just: brew tap caskroom/cask
.
To find an application:
brew search chrome
will return a list with all matching applications.
To install for example dropbox in /Applications/Web
directory:
brew cask install --appdir="/Applications/Web" dropbox
I've created two aliases. In .bash_aliases
alias caskinstall='brew cask install'
LaunchRocket is a Mac PrefPane to manage all your Homebrew-installed services
brew cask install launchrocket
This will make your life easier when you need to launch/stop/launch at startup services. For example you can handle mysql
mongodb
rabbitmq
, postgresql
and so on..
Make sure to go to pref panel/Security & Privacy: allows apps downloaded from anywhere.
- Alfred2
- Docker
- LightRoom 6
- Then chose Buy/Upgrade and follow instructions
- Add License
- SimpleMovieX
- Apple Remote
- Video container switcher GPL
- Pycharm v.5.05 professional
- WebStorm v.2016.1
Don't forget to add licenses for the following apps:
- System Preferences / Language & Region /
- Choose Preferred Languages
- Keyboard Preferences / Input Sources / Choose Layouts:
- U.S. Extended
- U.S. International (for accents supports)
- Italian or Whatever
I keep all my data in a separate partition. Music, Movies, Pictures, ectr BUT "Library" and of course the dotfiles. Don't forget to symlink all the folders from external partiton to home:
- Copy/Paste the folder icons from home folders to external folders
- Erase home folders that exist on external hd
- Simlynk them:
cd ~/; ln -s /Volumes/HomeData/*/ .
(ln is smart enough not to overwrite existing folder)
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
killall Dock
System Preferences / Accessibility / Mouse and trackpad / Trackpad options/ Enable dragging
TODO: add images. System Preferences / Keyboard / Shortcuts / ...
System Preferences / Accessibility / Display / Reduce Transparency
System Preferences / General / Show Scroll Bars -> Always
- System Preferences /
- Security / Require pass immediately ...
- Security / Disable Automatic Login
- Desktop & Screen Saver / Screen Saver / Start After X minutes
If you have a non-Apple ssd Hard Drive it's a good idea to enable Trim Support: sudo trimforce enable