Installing Git in Centos 5.5 with yum

· konordo
Installing Git in Centos 5.5 with yum is just a matter of seconds. First we need to set up the Webtatic repository (http://www.webtatic.com/projects/yum-repository/) in yum. We can do this with the following command in our terminal: rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm Once the repository is available, we can install Git with the following: yum install --enablerepo=webtatic git-all

Drupal: How to generate different view results, using a taxonomy keyword as an argument

· konordo
The following would apply if you wanted to generate nodes according to a specific taxonomy term, but you didn't want to create a different view for each case. For instance, we have a market place and in the preface region of our theme, we've setup a 3x3 panel, and in each of the 9 dials we want to demonstrate the latest product from a specific category. We would create a new node type(Product) for our market products, and a taxonomy vocabulary(Product Categories), which we would then asign to the aforementioned node type. Finally, we would create a view with the following options:

Upgrade Java 1.4 to 1.5 on Centos 5.5

· konordo
While trying to install Solr in Centos, I noticed that Java 1.5 is required, however Java 1.4 is installed by default. Now, in order not to have Tomcat start the old Java version, we need to uninstall it using a simple yum line: sudo yum remove java Next on the list is to install the new Java versions. Good thing it is included :) sudo yum install java-1.6.0-openjdk and yum install java-1.6.0-openjdk-devel Finally, we are ready to install Tomcat: sudo yum install -y tomcat5 Start tomcat with: service tomcat5 start

How to install APC PHP accelerator

· konordo
Here is a list of commands to install APC php accelerator on CentOS: yum install php-pear yum install pcre-devel yum install php-devel yum install httpd-devel pecl install apc-beta echo "extension=apc.so" > /etc/php.d/apc.ini service httpd restart To see if APC is loading, create a php file e.g. info.php with the code phpinfo();. Search for the APC section in the output of this file.

Your PHP MySQL library version 5.0.91 differs from your MySQL server version 5.1.50. This may cause unpredictable behavior | phpMyAdmin

· konordo
Right after a fresh installation of phpMyAdmin, you open the main page with your favorite browser (ie explorer no doubt) and view the contents. Our beloved third party displays just fine, but at the bottom there lies the following warning: Your PHP MySQL library version 5.0.91 differs from your MySQL server version 5.1.50. This may cause unpredictable behavior. Nobody likes unpredictable behaviors. Check again... Nope, PHP and MySQL newer versions installed. Where does the warning come from? How to deal with this?

phpMyAdmin: Change the root password of phpmyadmin after a fresh installation on your server

· konordo
After a fresh install of phpMyAdmin, you can use your browser to login (http://www.yoursite-or-IP.com/phpmyadmin) using the credentials root and empty passwort. Obviously this is a security hole that needs to be fixed asap. Not so obvious, however, is how. Using your terminal (or Putty in Windows), you can use the following command to change the password for root: /usr/local/mysql/bin/mysqladmin -u root password ’somepassword’ where ’somepassword’ is the password you have chosen for the root user of Mysql.

Drupal time ago function in template.php

· konordo

Would you like to make time appear as an interval like "4 days 3 hours ago"? Possibly you have worked with such formatters (drupal time ago) in views and date fields, but what about editing a node.tpl.php for example? Or programmaticaly include the last login time of a node's author, as time ago, in a block?

It comes in handy when there is a reusable function to format our time statements as drupal time ago - and php in general. So here comes a little function to be included in the template.php file. You can easily use it in your themes to display a timestamp as "Time ago".