Archive for the ‘Mac’ Category

Tip for a SVN project

Monday, May 9th, 2011

Ok, this is the scenario:

There is a huge project hosted on a SVN repo. I’m to start a new project based on that one… No, I’m not allowed to create a new branch. And I must upload this project to a new SVN repo.

So checking out the project is easy. Now that I have the project in my Mac I want to be able to check it into the new SVN repo, the only thing is that when I checked out the project it downloaded to mi machine with a whole bunch of “.svn” folders.

Now, there are 2 different ways to get a clean copy of a project from a repo.

1. Do an export instead of a checkout, this will give you a project copy without the annoying “.svn” folders.

2. Do a regular checkout and then delete all the “.svn” folders.

On my humble opinion it’s better to do an export. If you do a checkout you can delete the “.svn” folders manually but be aware if you have lots of folders because an “.svn” folder will be created within each of your project’s folder so if you have a project with 10 folders and each one with two subfolders you’ll have to go into each f them to delete the “.svn” folders manually… it’s easy but it might take a lot of time and resources you might not have.

To speed up things it’s better to do the following:

Go to your project’s folder and run the following command:

find . -name ".svn" -type d -exec rm -rf {} \;

It will search for all directories called “.svn” and delete them as well as it’s contents.
I found this to be very useful and I really use it frequently but I keep forgetting it so I’m posting it here 😀

Zend Server – Mac OS issue with MySQL

Tuesday, May 3rd, 2011

So I finally decided to install a dev env in my Mac.
A couple of days I installed Zend Server on my Mac but I wasn’t too convinced about installling a dev env in my Mac so I uninstalled Zend Server as I thought was the proper way to do it: Drag the Zend Server from apps to the trash.
So yesterday I finally made up my mind and decided to go along with a dev env. Since the first install went smoothly I thought it would only require me to do exactly the same thing…. WRONG!!!!
I downloaded the package and ran the installer, no error messages were displayed, I even opened the Zend Server console and it worked, I even tested a few scripts and it was doing fine.
Next thing I wanted to do was to create a database in MySQL and this is when my headache started.
First time I installed Zend Server I realized it wasn’t enable to work as a network server, by default you can connect to it by a socket which is fine if the server will only run on your machine… Honestly I didn’t have any problems with it… the problem was that apparently MySQL wasn’t working.
Ok, calm down, don’t panic. I thought it had something to do with socket permissions… WRONG!
mmmm ok, what exactly can be the problem?
I opened a console and typed:

sudo [path_to_zend_bin]/zendctl.sh restart

Apache did ok, Zend Server GUI (Lighthttpd) did ok but MySQL didn’t…. it showed the following message:

ERROR! MySQL manager or server PID file could not be found!
Starting MySQL
. ERROR! Manager of pid-file quit without updating file.

What in God’s name does that mean????
I searched it in Google, apparently I’m not the only one experiencing the issue. It looks that there were a lot of different solutions but none of them worked for me :(…. Now I really wanted my Zend Server to work, and I’m stubborn so I kept searching, went to the forums (official MySQL forums) and nothing. By that time I was both mad and sad. I tried deleting files, reinstalling, changing owners and NADA!
Finally, since it was already to late and I was falling asleep I decided to leave it for “tomorrow”.
I even dreamed about this not being solved hahahahaha.
Anyway the next day I relaxed, saw a couple of videos on youtube and finally came up with the most easy solution to this in a blog.
In a few words this meant that me dragging the Zend Server app to the trash can is not the proper way to uninstall it. I have to use the following command:

sudo /usr/local/zend/bin/uninstall.sh

It was the only thing I didn’t try so I typed it and hit enter…. this got the job done!!! :O
OMG! it was sooooo simple, I felt stupid hahahahahaha
So I’m posting it here to remember it.