How to make your MAC-OS shell look pretty

If you are from the Linux world or maybe familiar with the Ubuntu shell (or any other distro you prefer) like me, then you would find the Mac OS shell quite dull. It is pretty much black text on a white background by default and that is not always nice when executing commands or when spending some time in the shell. For example , when you run the “ls” command you would like to see the highlighting in differences between files and directories, or read-only and executable files. This functionality is default in Linux but in Mac …….. well……. not so much.

I will explain in some detail in this post how to make your Mac shell a tad more nicer with some colouring via some screenshots taken on my Development box.

(Note: to take screenshots on MAC you can use the following commands :

  • Command-Shift-3: Take a screenshot of the screen, and save it as a file your desktop
  • Command-Shift-4, then select an area to capture and save it to the desktop
  • Command-Shift-4, then space, then click a window and save it to the desktop
  • Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard
  • Command-Control-Shift-4, then select an area and save it to the clipboard
  • Command-Control-Shift-4, then space, then click a window and save it to the clipboard )
  • We first need to open up a terminal and then type in the command to open up the profile file (Very important that if this file does not exist you would have to create it in the root of your home folder). This is done by executing the command “edit ~/.profile”
  • Screen shot 2011-08-12 at 11.03.06 AM

  • You can then add the following exports as depicted in the image below to add colouring to the commands of your terminal for your profile.       Screen shot 2011-08-12 at 11.03.33 AM
  • You can then close your terminal, and open up a new instance.
  • Then run the following command “ls” to see the colouring magic applied on your terminal.
  • This is GREAT, but we are still stuck with the burning white as a background in the terminal. To change this you need to click on the preferences of the terminal once a terminal is open.Screen shot 2011-08-12 at 11.07.35 AM
  • When presented with the preference screen , you can select your theme (mine is set to homebrew) and set that as default.Screen shot 2011-08-12 at 11.08.12 AM
  • Then close your terminal , and open up a new instance.
  • You will then see the colours has changed, and when you run the “ls” command you will see the colouring on terminal commands as well. Screen shot 2011-08-12 at 11.09.00 AM

That’s it for changing your shell to look similar to the Linux one. Have fun , and let me know if you struggle.


NOTE: If my images look funny that’s because I blocked out the computer and user name from the shell with the red block, so yours will definitely look different there. Smile

Running X-Window apps remotely

I’ve been using SSH (Secure shell) for a looooong time on my Linux based systems for remotely controlling my headless servers. During this week I had a guy over at my desk that wanted to have a look at some of my settings on my Ubuntu box to see the difference in configs between what he has done and what I have done differently. I quickly jumped into putty on my windows box (since that is my daily workstation because of VS2010 ) and connected to my server remotely.

Opened up nautilus on linux so I could visually browse to my config files (could have probably done this through shell  too), Nautilus then opened up in my windows OS as any other window would have. Since the other guy has never seen this he was obviously shocked to see the window appearing in my windows environment. I then went off to explain to him how this works and thought that I would share this since a couple of people have asked me “HOW DO YOU DO THAT” before, so here goes.

Remote-X (not the official name I think , but that’s what I call it ) is enabled via ssh or secure shell. SSH is a protocol used to securely access a Unix/Linux machines from another that allows you to run command line and graphical apps remotely and also for file transfers or creating secure networks over the internet to tunnel through(such as a remote http proxy or so). To accomplish this we would need 2 things.

  • Open SSH server for hosting and setting up the secure connection to the linux box that you want to connect to (Thus this runs on the server)
  • SSH client such as Putty to then connect to the server remotely via ssh protocol

Note that is a lot more uses for ssh such as secure ftp connections but I am just going to explain the basics to get a remote connection with openssh and remote X execution from a windows box.

Server Side Setup

First thing to-do is to get Open ssh setup on your Linux box (I am using Ubuntu 10.04 so my commands provided relates to Ubuntu).

Install Open ssh on your Ubuntu box via the following command

sudo apt-get install openssh-server

Once this is done you can change your configs as needed (have a look in the man file. man sshd_config for more info or just lookup sshd on the ubuntu site)

Now we just need to get the openssh daemon running and we’re set on the server side. This can be done with the following command.

sudo /etc/init.d/ssh restart
Client Side Setup

From a client side perspective , most machine would have a client to connect to a server via ssh such as putty. Ubuntu just needs the client downloaded to it and your set, since you have X-server doing all the X windows stuff on ubuntu by default, you won’t have a problem at all in opening the X-apps remotely that sits on your server.To get that client you can simply run the following command and then connect via that client once your set.

sudo apt-get install openssh-client

From a windows perspective, it is a tad more complicated because windows does not make use of the X- server natively for hosting or running its windowing system. In order to get that sorted we must do a couple of things as follows.

    • Download and install X-Ming a X-windowing server for windows.This will provide the capability to windows to run X-window apps within windows.
    • Download and install Putty used for connecting via ssh ( apparently X-ming has a way to connect to a server via ssh with its own mechanisms but I haven’t used that before. I prefer the familiar )

Once these 2 apps are installed you are all set to connect to your server.

Try Connecting ……

To check that the whole process as explained before was successful, we will try and connect to our Linux server over ssh.

    • Run xming and make sure you see the xming icon in your taskbar in the bottom right of your screen.


    • Now run putty and enter your server details

    • Before we connect we need to make sure Putty understands that we want to allow X-window apps to execute. Browse to the SSH settings in putty and expand that. You should see a sub option for X11, open that and then check that the X11 forwarding on the right hand is enabled.

    • You can now click “Open” and you should be connected to your remote server and prompted for the login details of that remote machine


    • Once logged in you can try and run a X-App to see that the remote server will then forward the X11 window to your windows machine.I usually run the following command to test: xcalc and will then be presentedwith the XCalc app in your windows environment


Sooooo , that’s quite a process on paper, but its actually very simple once you’ve tried it. You can then execute any X-window app remotely with convenience and this is very useful if you have multiple Linux of Unix machines that you work off.

Try this out if you have a remote scenario and let me know if you come right, if you struggle or have some questions.Drop me a comment or question and we’ll take it from there.

Happy computing. Ciao ciao

Boot Menu edit or BCDEdit

I recently had to work quite allot with the MS BCDEdit tool to get my boot options sorted out for bootable VHD files and for changing options on Winserver 2008 to boot without a hypervisor running.( This was done so that I could get VMWare and Virtualbox running, since Hyper-V and the others cannot co exist) it was quite tedious doing everything in command line. It works but visualization of such function is always nicer , so I set out on looking for a tool that can assist me and found a nice one from the guys at NEO Smart

This is a visual BCDEdit tool , and it works absolutely marvellous  for changing those entries.


Virtualization and Windows activation

Hey there again , and happy new year. This is the first post for 2010. Big year for us guys down here in South Africa.

I thought I’d share a little resolution I’ve struggled with this morning for people that make use of virtualization quite frequently.

I was installing windows server 2008 on VMware and run into an issue when activating the OS. My environment is setup using NAT for networking.
The issue is as follows:

DNS name does not exist.
Not sure why this happens BUT the resolution was quite interesting.
You have to run an elevated command prompt, type “slmgr.vbs -ipk your-serial-activation-key”
This will take a while and you should be presented with a popup message when this is done.

Now you can try and reactivate windows. This worked wonders for me.

Hope this is help full. 🙂