Skip to content

Instantly share code, notes, and snippets.

@MichaelMartinez
Created September 18, 2012 06:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelMartinez/3741517 to your computer and use it in GitHub Desktop.
Save MichaelMartinez/3741517 to your computer and use it in GitHub Desktop.
OSX-VM Setups/steps y mas

Mac Setup and play

Lib's and Development stuff to set up

The List of Items the VM has!

  1. Command Line Tools from Apple - Installed
  2. Sublime Text 2 - subl has been symlink and works
  3. Git use systems; can update using brew if needed in subsequent clones
  4. Homebrew - Watch the changes - raring to brew
  5. iTerm2 / oh-my-zsh - Need to test the plugins
  6. Dot files Need to test.... thoroughly
  7. X11 via Quartz is installed see below

Python

  • See File below

Ruby, RVM, Node

OSX specific

Lets see what the hell we are doing

  1. defaults write com.apple.finder AppleShowAllFiles TRUE
  2. killall Finder

###Write an automator script to make it toggle

  • Launch -> /Aplications/Automator
  • Select what type of workflow you would like. I feel a service is a good choice for this so go ahead and;
  • Select -> Service
  • At the top of the window there should be 2 combo-boxes.
  • Select -> no input
  • Select -> Finder.app
  • Drag -> Run shell script; from the left panel to the right and enter the following:
is_shown=$(defaults read com.apple.finder AppleShowAllFiles)
if [ $is_shown != "TRUE" ]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles NO
fi
  • Below that Drag -> Ask for confirmation and enter a message to the effect of "Do you want to relaunch finder? This will cancel any file transfers etc."
  • Under that, Drag -> Run shell script and enter
killall Finder
  • Save it, naming it whatever you want it to appear as under the services submenu of the Finder menu.

  • With Finder in the foreground, click Finder in the top left -> down to Services and click your newly created Service.

Setting up terminal

Remove Default OSX apps

...cd /Applications/
Michaels-Mac:Applications mam$ sudo rm -rf Mail.app
Michaels-Mac:Applications mam$ sudo rm -rf Messages.app
Michaels-Mac:Applications mam$ sudo rm -rf Reminders.app
Michaels-Mac:Applications mam$ sudo rm -rf Calendar.app
Michaels-Mac:Applications mam$ sudo rm -rf Chess.app
Michaels-Mac:Applications mam$ sudo rm -rf Contacts.app
Michaels-Mac:Applications mam$ sudo rm -rf DVD\ Player.app
Michaels-Mac:Applications mam$ sudo rm -rf FaceTime.app
Michaels-Mac:Applications mam$ sudo rm -rf Game\ Center.app
Michaels-Mac:Applications mam$ sudo rm -rf Image\ Capture.app
Michaels-Mac:Applications mam$ sudo rm -rf Photo\ Booth.app
Michaels-Mac:Applications mam$ sudo rm -rf Stickies.app

Monolingual

Homebrew and Mountain Lion

To use ssh on github

What I used to install iPython Notebook and qtconsole on my system - OSX 10.8

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="af-magic"

# Example aliases
# alias zshconfig="subl ~/.zshrc"
# alias ohmyzsh="subl ~/.oh-my-zsh"

# Pipe my public key to my clipboard. Fuck you, pay me.
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/X11/bin

[[ -s "$HOME/.pythonbrew/etc/bashrc" ]] && source "$HOME/.pythonbrew/etc/bashrc"

# brew install pyqt recommended this
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Other Notes

Python

  1. Installed pythonbrew, then installed and switched to 2.7.2 (permanent) confirmed with $ which python
  2. Making backups of this vm called OSX-VM-pythonbase
  3. In main /Documents/Virtual Machines/OSX-VM I will try to use $ pythonbrew venv
  4. I will follow this to get Science Py working: http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/
  5. and this; https://github.com/sympy/sympy/wiki/Installing-the-IPython-qtconsole-in-Mac-OS-X
  6. create venv for; Scipy, bumpy, pandas | iPython notebook | Django, Flask, pyramids and web stuff
  7. Installed sympy and other kits inside iPython for some serious fun
If $ pythonbrew venv is less than ideal
  1. installed virtualenv and virtualenv wrapper with the recommended settings from their github repos
  2. create virtualenv for; Scipy, bumpy, pandas | create virtual env for iPython notebook | Django, Flask, pyramids and web stuff
  1. python 2.7.3
  2. pythonbrew switch 2.7.3
  3. pythonbrew venv create envMain
  4. pythonbrew venv use envMain
  5. pip install numpy
  • #verify:
  • python
  • import numpy
  • print numpy.version
  • print numpy.file
  • quit()
  1. pip install scipy
  • #verify (as numpy above)
  1. To install matplotlib (install numpy first, then this):
  • brew install libpng # libpng is not a python package, here I'm using HomeBrew to install libpng on my mac
  • brew install freetype # also not a python package
  • current version of matplotlib failed to install on lion, using developers version instead:
  • pip install git+git://github.com/matplotlib/matplotlib.git
  • #verify (as above)
  1. pip install readline
  2. pip install ipython
Python blogs, tuts and more

Creating /Users/mam/.pythonbrew/venvs/Python-2.7.2/ipython/lib/python2.7/site-packages/numpy.egg-link (link to .)
    Adding scipy numpy to easy-install.pth file
    
    Installed /Users/mam/.pythonbrew/venvs/Python-2.7.2/ipython/src/numpy
Successfully installed numpy

 Creating /Users/mam/.pythonbrew/venvs/Python-2.7.2/ipython/lib/python2.7/site-packages/scipy.egg-link (link to .)
    Adding scipy 0.12.0.dev-fd68897 to easy-install.pth file
    
    Installed /Users/mam/.pythonbrew/venvs/Python-2.7.2/ipython/src/scipy
Successfully installed scipy

Successfully installed matplotlib-dev
Cleaning up...

Successfully installed ipython
Cleaning up...

Successfully installed readline
Cleaning up...

~ » brew install pyqt                                                               mam@Michaels-Mac
==> Installing pyqt dependency: sip
==> Downloading http://www.riverbankcomputing.co.uk/hg/sip/archive/4.13.3.tar.gz
######################################################################## 100.0%
==> Patching
patching file build.py
Hunk #1 succeeded at 185 (offset 6 lines).
Hunk #2 succeeded at 198 (offset 6 lines).
patching file siputils.py
Hunk #1 succeeded at 1485 (offset 51 lines).
==> python build.py prepare
==> python configure.py --destdir=/usr/local/Cellar/sip/4.13.3/lib/python2.7/site-packages --bindir=/
==> make install
==> Caveats
For non-homebrew Python, you need to amend your PYTHONPATH like so:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
==> Summary
/usr/local/Cellar/sip/4.13.3: 8 files, 576K, built in 5 seconds
==> Installing pyqt dependency: qt
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.3.mountainlion.bottle.tar
######################################################################## 100.0%
==> Pouring qt-4.8.3.mountainlion.bottle.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
==> Summary
/usr/local/Cellar/qt/4.8.3: 2779 files, 194M
==> Installing pyqt
==> Downloading http://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.9.4/PyQt-mac-gpl-4.9.4.tar.gz
######################################################################## 100.0%
==> python ./configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.9.4/bin --destdir=/usr/
==> make
==> make install
==> Caveats
For non-homebrew Python, you need to amend your PYTHONPATH like so:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
==> Summary
/usr/local/Cellar/pyqt/4.9.4: 551 files, 20M, built in 8.3 minutes

-------------------------------------------------------------------

```bash
~ » brew install zmq                                           mam@Michaels-Mac
==> Downloading http://download.zeromq.org/zeromq-2.2.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/zeromq-2.2.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/zeromq/2.2.0
==> make
==> make install
==> Caveats
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
you may need to do:

    ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local

If you want to build the Java bindings from https://github.com/zeromq/jzmq
you will need the Java Developer Package from http://connect.apple.com/
==> Summary
/usr/local/Cellar/zeromq/2.2.0: 41 files, 1.6M, built in 24 seconds

Successfully installed pyzmq
Cleaning up...

Successfully installed pygments
Cleaning up...

Successfully installed tornado
Cleaning up...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment