Apply Zend Security Patch To Magento Installation Via SSH

Thursday, 19. July 2012

Here is a nice and quick way to apply the Zend Security Patch to your Magento install via SSH (command terminal)

Patch is only necessary for the versions less than CE Magento
This solution is for Magento CE to Change the patch file to match your version. More info here:

Command Line script

wget && patch -p0 -i CE_1.5.0.0-


Setting Up Magento Cron Jobs Via SSH Command Line

Tuesday, 10. April 2012

Setting up cron jobs via command line tool is easy if you know how. First you will need to open the cron tab before you can enter and schedule your tasks.

This simple walk through will shade some lights on how to do just that and what are the required setting to complete a successful job setup.

1) Opening the Cron Tab

To open the cron tab as the user you are logged in as type:

crontab -e

To open the cron tab as a specific user, type:

crontab -u USERNAME -e

Time Format Steps:
minute hour day month day-of-week

minute 0-59
hour 0-23
day 1-31
month 1-12
day-of-week 0-7 (where both 0 and 7 mean Sun, 1 = Mon, 2 = Tue, etc)

This is how the cron should look

min hour day month dayofweek command_to_run

Examples: What stuff really means

0 1 * * *  ==> Every day at 1Am
* * * 12 * ==> December
14,29,44,59 * * * * ==> at after 14, 29, 44 and 59 minutes every hour of everyday
*/5 * * * * ==> Every 5 minutes

Now that you know where to add your cron job command, let’s go through two simple ways to set it up.

Magento Cron Job Using WGET

*/5 * * * * wget -q

Magento Cron Job Using PHP

*/5 * * * * /path/to/php -f /local/path/to/cron.php

Testing The Magento Cron Jobs

It is difficult to test that the Magento cron jobs are now set up correctly without waiting a couple of days and seeing whether your indexes have been refreshed. Fortunately, there is a quick test you can perform to tell. Change your cron tab command to one of the following (depending on the method you chose).

[email protected]
*/5 * * * * wget-bad-command -q
[email protected]
*/5 * * * * /path/to/php -f /local/path/to/cron-bad-filename.php

More examples

# run at 10 pm on weekdays, 
0 22 * * 1-5   mail -s "It's 10pm" ken%Ken,%%Where is food?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun     echo "run at 5 after 4 every sunday"

Ubuntu: Restart Samba service from command line

Wednesday, 27. July 2011

Here is a little command you will need to be able to restart Samba service from a command line on ubuntu.

sudo service smbd start

You can also use this command

sudo /etc/init.d/smbd start