Jenkins doesn’t load under OS X Mountain Lion (or Server)? Here is the fix!

Answer: your machine doesn’t have Java installed on it. This happened to me. Jenkins installed fine, but then when I opened it on its default port of 8080, nothing happened.

To fix it, open Terminal and type “java” without the quotation marks.

This will tell you that you have to have Java SE installed on your computer and then will download and install Java SE automatically for you. Done! 🙂

scp and cronjob (without password) on OS X

I wanted to copy some files from my computer over to a server every minute, as a cronjob. I searched around the internet but the solutions were scattered all over the place and a lot of “do this and do that” so I decided to put things together in this comprehensive video.

In this video, you will learn:

  1. How to set up your RSA private/public keys.
  2. How to set up passwordless SSH access to your server.
  3. How to “scp” files from your client to your server under your user name.
  4. How to set up a cronjob to copy your files over to the server once every minute.
If you have any questions, leave them down here and I will do my best helping

Git from command-line after installing Xcode on OS X Lion

Xcode 4.3.x or newer comes with Git but the problem is when you install Xcode on your machine (OS X Lion or newer), Git’s path won’t be added to the user path which means if you run git from your command-line, your system will say:

-bash: git: command not found

Xcode’s installation of Git is at the following location on your machine:

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/

With the git binary sitting here:

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git

To add this binary to your path (which will allow you to run “git” from any directory on your system), go to terminal and type this command:

export PATH=”/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/”:$PATH

There is one caveat to this approach and that is the PATH will only be changed in your current running instance of terminal. As soon as you close terminal and open it again, you will have to enter the above command again to get access to the git app. So what is the proper solution? You will have to add the above “export” command to the .profile file in your home directory. The .profile file gets read every time you open terminal. So open a terminal instance and type the following command:

cd ~/

And then type this command:

ls -la | grep “.profile”

We are trying to find out if we already have a file named .profile in our home directory. If after running the above command you won’t see anything getting printed to the terminal, use the following command to create a new .profile file. If you already have a .profile file, skip this command:

touch .profile

Now open the .profile with this command:

open .profile

Now add the git path to the PATH variable in the .profile file so that your .profile content will look something like this (it really depends on what you already have in this file. I am assuming your .profile file didn’t exist until now and you just created it):

export PATH=”/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/”:$PATH

Save your changes to the .profile file and close terminal and open it again. Now whichever directory you are in, in terminal, you can use the git command. Good luck.