Eclipse – Adding Files to Git Index problem

Posted December 4th, 2011 in Zanimivosti by Metod

Encountering the following error in Eclipse/Zend Studio while trying to add files in Git?

Adding Files to Git Index problem

Check if a file ‘index.lock’ exists in the .git folder located in the root folder of your project.

If so, remove it and you can continue working!

  1. rm .git/index.lock

SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

Posted June 25th, 2011 in Zanimivosti by Metod

When you run into this error, a few solutions apply.

First one is to check where mysql.sock or mysqld.sock actually resides and change values in php.ini appropriately.

  1. mysqli.default_socket = /var/run/mysqld/mysqld.sock

You can also make a symbolic link to the correct location.

  1. # ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

For me, the above solution did not work. All I got was the change in error from (2) to (13). Turns out the solution is quite interesting. Instead of using ‘localhost’ as host for DB, use 127.0.0.1 – it magically begins to work again.

Phing executing multiple commands

Posted March 26th, 2011 in Zanimivosti by Metod

A little tip. If you deploy your PHP projects with Phing, you are familiar with the file build.xml. If you want to execute multiple commands, that depend on each other to be executed, you have to use && in between the commands. For example, clearing the cache:

  1. ssh user@example.com ‘cd cache && rm *’

The line in phing build.xml would look like this:

  1. <exec command="ssh user@example.com ‘cd cache && rm *’ />

But typing it like that will produce an error, since it is not a well-formed XML document. You have to transform the &’s into entities.

  1. <exec command="ssh user@example.com ‘cd cache &amp;&amp; rm *’ />

This will work as expected.

How to minimize skype to tray in windows 7

Posted January 14th, 2011 in Zanimivosti by Metod

*Warning*: This solution seems to cause skype to crash in latest versions.

If you ever used skype on Windows 7 then you know that it is really annoying as it doesn’t minimize to tray when you click the close button. Luckily there is a solution. Just run it in compatibility mode for Windows Vista (Service Pack 2) or older. In a step-by-step:

1. Go to Phone folder in your skype installation folder (C:\Program Files (x86)\Skype\Phone)
2. Right click on Skype.exe and choose Properties
3. In properties select Compatibility tab
4. Check the “Run this program in compatibility mode for:” checkbox and select Windows Vista (Service Pack 2) or sth older
5. Click OK and you are done

Enjoy the better skype experience on Windows 7. :)