OSX

Install Yosemite with an USB key

  • Download "Install OS X Yosemite.app" from the Apple store
  • Format the USB key using "Disk Utility":
    1. select the usb key in the left Window
    2. click in the tab Erase
    3. select "Mac OS Extended (Journaled)
    4. Name: untitled
    5. click on erase at the bottom
  • In terminal:
    sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
  • The USB key is now bootable
  • Start the mac to be installed while pressing the button alt
  • Select the disk "Install OS X Yosemite"
  • Using Disk Utility, format the existing system disk the same way as the usb key
  • Again in Disk utility, choose "Install OSX"

Connect two Macs using Thunderbolt

  • Power off the Mac you would like to use in Target Disk Mode and connect a Thunderbolt cable from it to another Mac you intend to access it from.
  • Power on the Mac whilst holding down the T key.
  • After a few seconds, the Thunderbolt logo will appear on the Mac signifying it’s now in Target Disk Mode.

Now that the Mac is in Target Disk Mode, it will appear as an external hard drive on the Mac it’s connected to. You can then access any data that may reside on the Mac and even use Migration Assistant, providing an automated way to transfer your documents and applications from an old Mac to a new one.

Work with "Projects" in Sublime

  • Be sure to work on a project basis in Sublime text
  • cmd R = search for a function
  • cmd maj R = search for function everywhere
  • cmd p = search for files

Show/hide hidden files using Terminal

Show files: defaults write com.apple.finder AppleShowAllFiles -boolean true

Hide files: defaults delete com.apple.finder AppleShowAllFiles

killall Finder

Homebrew package manager for OSX

Homebrew installs the stuff you need that Apple didn’t. Read more...

Usage examples in terminal: brew wget, brew varnish, etc

Change from PHP 5.6 to 7.25:
  • brew unlink php56
  • brew install php
  • php -v

Filesharing via FTP on OSX

  • OSX preferences > Sharing > File sharing > Options
  • Share files and folders using ftp
  • Use the provided ip address in the ftp client to connect (filezilla)

Using Sublime Text 2 as command line editor

Sublime Text 2 includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text 2, as well working as an EDITOR for unix tools, such as git and subversion.

  • mkdir /usr/local/bin
  • ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
  • in command line, use "subl filename" to open a file with Sublime text 2

Read more http://www.sublimetext.com/docs/2/osx_command_line.html

Set up a public/private key pair using Terminal

  • type "ssh-keygen -t rsa"
  • Enter an output file path. Do not enter a passphrase (just hit return twice).
  • The following files are generated:
  • ~/.ssh/id_rsa : identification (private) key
  • ~/.ssh/id_rsa.pub : public key
  • Send the public key to the server admin who will add it to the server

Flush DNS

Further to a change in the host file, dns needs to be flushed on the machine

  • Windows: ipconfig /flushdns
  • OSX: sudo dscacheutil -flushcache.