drupal

How to run cron with drush within Virtualmin Control Panel

Navigate to => system => Scheduled Cron jobs tab and paste the below command in the command input box. Run it as root and schedule the minutes as required.
Move it up the list to give it more priority. Please note replace with the xxx to your environment.

/usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 /usr/local/bin/drush --root=/home/xxx/public_html --uri=http://yoursite.com/cron.php?cron_key=xxxxxxxxxx --quiet cron

How to install drush with composer on linux box

I had trouble installing Drush on my newly created Centos box. Therefore, I have documented my steps.

First, you need install Composer ( PHP Dependency Manager) cd into the
$ cd /tmp

Download Composer.phar here

$ curl -sS https://getcomposer.org/installer | php

Then move it to /usr/local/bin so that it can be used globaly.
$ mv composer.phar /usr/local/bin/composer

Now type $composer

If you done everything right you should get something that look like this:

How install Aegir octopus High performance Hostmaster for Drupal

I have tried install BOA-3.0.2 to host my many Drupal sites and I have struggled a lot install it. I am hopping this write up may help someone to have better experience.

This is the description from the smart people who developed this software/script.

BOA is an acronym of high performance Barracuda, Octopus and Aegir LEMP stack.

Includes all-in-one bash scripts (see docs/INSTALL.txt for details) to install
and upgrade high performance Aegir Hosting Systems for Drupal, with Nginx, PHP-FPM, Zend OPcache, MariaDB and Redis.

What is Octopus?

Directory /proc/vz not found, assuming non-OpenVZ kernel Container init failed: Cgroup is not mounted TASK ERROR: command 'vzctl destroy 100' failed: exit code 5

Directory /proc/vz not found, assuming non-OpenVZ kernel
Container init failed: Cgroup is not mounted
TASK ERROR: command 'vzctl destroy 100' failed: exit code 5

TO delete just navigate to /etc/pve/nodes/xxxx/openvz/ and delete the file which has the vm number. Mine was 100.conf
$ rm 100.conf
This will completely delete the node.

how to make bootstrap image responsive

Add this at the end of your custom css usually the file called style.css

img { width: 100%; }
you can also use img{display-block; width:100%;}
or
img {
display: inline-block;
height: auto;
max-width: 100%;
}

or
img {
display:block;
height: auto;
max-width: 100%;
}

Whichever works for you. Display block turns the image to a block element and will put it on its own line. Me; I just use img{width:100%;}

That is all there is to it.

Youtube API gdata to fetch videos

To fetch youtube gdata you need to use the following path
This code is v2 is deprecated by google
http://gdata.youtube.com/feeds/api/videos?q=wahtiskeyword-youlookingfor&...
http://gdata.youtube.com/feeds/api/videos?q=drupal&orderby=published&v=2
With will get up to 25 videos with keyword durpal orderby published date.

How to migrate your drupal site with drush

I have recently tried to move a large database to another host and I have encountered problems regarding this.

I have decided to document this so that other Drupal users may benefit from it.

There are many ways to restoring a database to different host but this has worked for me.

First, you need to have a working drush system in your both drupal installations.

Start with clearing all of your database cache

$cd /home/home/public_html or wherever is your root Drupal installation
$drush cc all

Your command line PHP installation is too old. Drush requires at [error] least PHP 5.3.0. To suppress this check, set the environment variable DRUSH_NO_MIN_PHP=1(solved)

If you see the above error, you're probably running a php version not compatible with drush.
To remedy this, use the following command. This is on centos, on ubuntu or other linux flavors the path may be different.

First find the folder where the drush include file is located. You use the linux command
$find / -name "folder_you're_looking for"
Output should be something similar to this

find / -name "drush"
/usr/share/pear/drush
/usr/bin/drush
/tmp/pear/download/drush-6.2.0.0/drush

Mine was
$/usr/share/pear/drush/includes

Enable root user to login to shell after disallowing Root with shell

run this command on your browser login as root and that is!
whm.yourdomain.com/cpsess6053459985/scripts2/doautofixer?autofix=safesshrestart
This restarts to shell to allow to login again as root.

yourdomain.com/cpsess6053459985/scripts2/doautofixer?autofix=safesshrestart. You should see this output.
AutoFixer Execution

Requesting script ...

Done.

Executing script ...

Attempting to locate sshd binaries installed on the system ...

Located /usr/sbin/sshd

Done.

Killing exisiting sshd processes...

Apache Yahoo News Feed

Drupal Yahoo News

Linux Yahoo News Feed

Mysql Yahoo News Feed