Category Archives: OSx

Turn Off the built in apache on OSx

There are a handful of reasons why you would want to turn off the built in apache on OSx, you might have installed your own version, maybe you don’t use apache and it is interfering with something else, whatever the reason there is one command you need to run to turn it off.

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

You should run that from Terminal.app

I wanted to take a second to explain what is going on because too often people (myself included) will post a code snippet without explaining what it is, the worrying this is so many people run them without checking what is happening.

sudo tells your computer to run the following command as the root (administrator) account.
launchctl is an OSx program that interfaces with launchd, which is a daemon manager. Daemons are small programs that run as background processes (like what would setup Apache).
unload tells launchctl to unload a specified configuration file.
-w tells launchctl to override a disabled key, basically this will force the file to be marked as disabled.
/System/Library/LaunchDaemons/org.apache.httpd.plist is the file that we are unloading.

Hopefully that helps!

Share this on

Editing remote files locally in OSx

Sometimes we spend so much time with our local text editor that when we need to jump onto the server to edit files (apache config files, for example) we have to stumble around with VIM or Emacs (I should state, both are fine editors — all I am saying is if it isn’t what you use day in day out they will not feel as comfortable as what you use).

Luckily if you use OSx there is a way you can map your remote server to allow you to edit files locally and have the changes saved automatically on the remote machine, and setting it up is really straight forward.

The first thing you will want is to set up SSH key authentication — I will not cover that here but if you have your machine talking to Github then you already have your public key so all you need to do is add it onto the list of allowed keys on the remote machine, google will help.

Next you want to install FUSE (http://osxfuse.github.com/) this is a package that once installed allows you access to a terminal command that we will use to set up the pairing.

Once installed run the following in terminal;

mkdir ~/my_server
sshfs username@my_server.com:/directory/i/want/to/map ~/my_server

Which should create the mapping.

Right now I don’t see a way of viewing this folder inside of finder (if you know, please tweet me!) but you should now be able to access your server by going to ~/my_server on your local machine, then running something like open . to open the folders up in finder.

Share this on

Finding email to delete if you are over quota in mail.app on OSx

At work I use mail.app on my machine which pulls email from an Exchange server. For some reason we have relatively small mail limits and I don’t think they are going to be increased anytime soon, so occasionally old email needs to be purged. This should be a best practice anyway because I am sure 60%+ of your email has no need to be stored after one month.

An issue with mail.app is that there doesn’t seem to be an easy way to view an entire mailbox (all folders listed in one view), if I was able to view this I could easily sort by size and delete the worst offenders.

The workaround is to target the folder that is the largest and then find the largest emails within it.

To do this right click on the mailbox that is full and click get account info.

The first time you run this it might take a minute or two to calculate all the folders but once it has you can sort by size and use that as the basis for your email hunt.

A more permanent solution would be to think about the email you are saving when you process your email and only keep mail that you think you will need – especially if people are sending files.

Share this on

Getting Netbeans Working with OS X Lion

One of the few things I needed to mess around with to get working when I upgraded from Snow Leopard to Lion was Netbeans.

Very basically Lion doesn’t ship with Java, and Netbeans obviously needs Java installed to work.

You would have thought this would have been a simple case of just going onto the Java website and grabbing a download link, but unfortunately they haven’t updated their downloads and for OS X it just says to get it from your OS (which was true up until Lion).

Instead the page you should visit is a download for Java hosted on the apple site.

Download the .dmg file, run it, then try and open up Netbeans, it should just automatically work.

Jobs a goodun’

Share this on