Friday, September 16, 2011

Tip / Trick for web developers

Today I was trying to install JEvent2.0 in Joomla1.5.23 for one of my client.
But, when ever I "upload and install" JEvent I was getting few MySQL error messages.
Something like this:
* Component Install: DB function failed with error number 2006
MySQL server has gone away SQL=INSERT INTO ULJoomla_components VALUES( 0, 'JEvents MVC', 'option=com_jevents', 0, 0, 'option=com_jevents', 'JEvents MVC', 'com_jevents', 0, 'js/ThemeOffice/component.png', 0, '', 1 )
SQL =

INSERT INTO ULJoomla_components VALUES( 0, 'JEvents MVC', 'option=com_jevents', 0, 0, 'option=com_jevents', 'JEvents MVC', 'com_jevents', 0, 'js/ThemeOffice/component.png', 0, '', 1 )

* Error Loading ModulesMySQL server has gone away SQL=SELECT id, title, module, position, content, showtitle, control, params FROM ULJoomla_modules AS m LEFT JOIN ULJoomla_modules_menu AS mm ON mm.moduleid = m.id WHERE m.published = 1 AND m.access <= 2 AND m.client_id = 1 ORDER BY position, ordering

Solution:
Extract the archive file and paste the complete path and press "Install" (not upload and install).
But, in my case I don't have full path since I have access to joomla's root directory using ftp only.
Here, goes the solution, how I made it worked for me:
1. upload the archive file into (joomla'root directory)/tmp/
2. now use "upload and install" method to install file.
Finally installed smoothly without a single issue.

Thursday, September 15, 2011

Alias to find process id of a running process

This is an example for those who believe in saving time.
You can create your own aliases to save your time from typing long commands again and again.
Create alias
# alias p_id='echo -n '\''process name:'\'';read a;ps -e | grep firefox | cut -d '\'' '\'' -f 2'
Execute it
# p_id
process name:[name of the running process]
[output will be the process id]