Tuesday, 29 October 2013

Installing Command Line Tools (Mavericks)

Installing Command Line Tools is useful for running package managers such as MacPorts and HomeBrew on OS X. Apple recently released it's latest operating system 10.9 - Mavericks and it's now even easier to install Command Line Tools, in-fact you don't even need Xcode to install them.


Prerequisites

This tutorial was done with the following versions:

  • Mavericks (10.9)


Installation 

1. Open up your preferred terminal.

My preferred terminal - iTerm2


2. Copy this into your terminal and press enter

xcode-select --install

3. Click install on the next prompt

Install Prompt

4. Accept the license agreement

5. The installer will automatically download and install

Installer doing its thing

6. You now have Command Line Tools installed.

The software was installed. :) 


There are other ways of installing Command Line Tools. You can directly download them from Apples developer website. https://developer.apple.com/downloads/index.action


End Notes

You can now build and compile software on OS X! You're free to also download and use a package manager of your choice.




Thursday, 17 October 2013

Installing Homebrew

A Package Manager is used to manage software on an operating system. Although OS X comes with it's own package management (The App Store) it's limited to Apples restrictions. There are currently several popular package managers for OS X based on open-source software that are usually ports from unix/linux systems. The popular ones include MacPorts, Homebrew, Fink and pkgsrc. Today we will be installing Homebrew and an example application matrix.


Prerequisites

Before Attempting this tutorial it is useful to have X11 and Command Line Tools installed


This tutorial was done with the following versions: 
  • Mountain Lion (10.8.5)
  • Homebrew (Version as of 18 October 2013)

this tutorial should also work on 10.9 Mavericks.

While it's possible to have 2 package managers installed on the one system, it's not recommended. You should pick either Homebrew or MacPorts, don't install both unless you know what you're doing.


Installation

1. Open up your preferred terminal. 

My preferred terminal - iTerm2


2. Copy this into it and hit enter
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

3. Press enter to continue

Press enter before continuing installation


4. Enter your password to proceed. Homebrew will install.

Enter your password

5. Homebrew is now installed. It's that simple.


Brew Doctor 

Homebrew comes with an awesome feature to check if there is any potential problems when using it. 

Run this in your terminal to check for problems
brew doctor
Your System is ready to brew

Sometimes brew doctor will give you warnings about files already in your /usr/local directory (the directory that Homebrew uses). Files can be put their based on other things you've installed on OS X. For example. I have "Paragon NTFS 9" installed on my Mac (a program that allows write access to NTFS drives) which has installed some files to the /usr/local directory. I can go ahead and ignore these warnings because I know why these files are here.

Brew Doctor Warnings

Installing cmatrix

Installing applications in Homebrew is fairly easy. Write the following into your terminal:
brew install cmatrix
Installing an application in homebrew

This command checks the Homebrew repository for an application called cmatrix (the repository was installed by default when you installed Homebrew) and then downloads and installs the application.

We can now run the application from the terminal, type:
cmatrix
The application "cmatrix" running


End Notes

Now that you have a package manager installed you download and use thousands of applications.




Wednesday, 16 October 2013

Installing Command Line Tools (Mountain Lion)

Even though you may not be developing applications, all of the popular package managers (such as MacPorts and Homebrew) require you to have "Command Line Tools" installed to be able to build and compile packages. Xcode is Apples IDE for developing software and is the easiest way to install the tools you need for these package managers.

Prerequisites


Note: This tutorial is obsolete if you're running 10.9 - Mavericks. Please use this tutorial instead. Installing Command Line Tools (Mavericks)

This tutorial was done with the following versions:

  • Mountain Lion (10.8.5)
  • Xcode (5.0) 


Installation


1. Download Xcode form the App Store (you will need an Apple ID for this)

Downloading Xcode from the App Store

2.  Launch Xcode

Starting Xcode from Launchpad

3. You'll need to agree to the terms and conditions and enter your password 

Agree to the Licence Agreement

4. Once Xcode has started. From the menubar select
Xcode -> Preferences

Enter Xcode Prefrences

 5. This will bring up the preferences window. Across the top are different menus tabs. It defaults to "General". Click "Downloads".

Preference Window -"General" tab.

7. Once in the "Downloads" menu. Click the little arrow next to "Command Line Tools" to start the download.

Downloading "Command Line Tools"

8. Once the Download / Installation is finished a tick will appear and you're now free to close Xcode.

"Command Line Tools" are installed.

End Notes

You can now build and compile software on OS X! You're free to also download and use a package manager of your choice.





Installing XQuartz


A windowing system is used by an operating systems to draw and move windows and other GUI elements. The default windowing system on OS X is the Quartz Compositor. The X Window System (X11) is a common windowing system for unix/linux operating systems that was packaged in OS X until Mountain Lion (OS X 10.8). 

X11 is needed for running certain programs (Wireshark) and window managers (i3, awesome) that where built for it. Luckily we can install the now open source version of XQuartz to do so.

Prerequisites

This tutorial was done with the following versions: 
  • Mountain Lion (10.8.5)
  • XQuartz (2.7.4)
This method should also work on OS X 10.9 - Mavericks.  


Installation


     1. Downlaod XQuartz from http://xquartz.macosforge.org/landing/

     2. Mount (open the dmg)

Mount XQuartz.dmg

     3. Run XQuartz.pkg

Run XQuartz.pkg


     4. Continue through the setup (defaults are fine)

Defaults are fine for installer

     5.  The installer will prompt you about logging out and in again to make XQuartz your default X11 server. Click OK

Message by installer

     6. Once the installer has finished. Logout and Log back in again.

     7. Start XQuartz

Lunchpad to open XQuartz

     8. You are now running the X Window System on OS X. xterm (a terminal application that runs on X11) will open by default.

xterm window


Additional Information

To see other examples of applications running on X11 type the following into xterm:
  • xeyes
  • xclock
  • xedit
  • xlogo
  • xcalc
To stop these applications press "ctrl + c" in the xterm window

All of these programs come bundled with XQuartz and are just some examples of programs that you can run using the X Window System.

End Notes

We can do some fun things now that we can X11 installed