How To Show Hidden Files In Filezilla – .htaccess

Thursday, 20. December 2012

There are time you encounter some servers that are just a little odd. Normally hidden files such as .htaccess, .htpasswd etc are directly visible on filezilla on most servers — Logical.

However, if you ever come across such other servers that hides such files, this little tricky can help you

Enjoy!

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)

Forma
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 http://www.yourdomain.com/cron.php

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 http://www.yourdomain.com/cron.php
[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"

Database Export Error domains_databases_phpMyAdmin_export

Wednesday, 1. February 2012

Came across this error today while trying to export the database via PhpMyAdmin and took sometime to reliaze that the error had nothing to do with the actual file but rather the fact that the Db itself was of high size to be exported with the current settings on the server, notably memory size

Solution:

Simply increase your memory_limit as to something a big.

This can be found in your php.ini for the server – probably /etc/php.ini

Locate and change: memory_limit = 128M – to big amount as is possible for your server.

Enjoy!

Get Disk and directory Size in linux using shell command

Tuesday, 6. December 2011

Folder size in human readable numbers

$ ls
dir1  dir2
$ du -sh dir1
2.4M  dir1

Disk Space Usage

$ df -kh

Sort Folders By Size

du -H --max-depth=1 /home/ | sort -n -r

Memcache and NGINX – strart and stop services – cheat sheet

Saturday, 3. December 2011

start nginx:

sudo /usr/local/nserver/nginx/sbin/nginx

stop nginx:

sudo kill -HUP $( cat /usr/local/nserver/nginx/nginx.pid )
sudo kill -QUIT $( cat /usr/local/nserver/nginx/nginx.pid )

The master process can handle the following signals:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
KILL– Halts a stubborn process
HUP– Configuration reload. Start the new worker processes with a new configuration. Gracefully shutdown the old worker processes
USR1– Reopen the log files
USR2– Upgrade Executable on the fly
WINCH– Gracefully shutdown the worker processes

There’s no need to control the worker processes yourself. However, they support some signals, too:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
USR1– Reopen the log files

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 start

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 stop

NOTE:
You way want to try: sudo locate ‘memcache’ OR ‘nginx.pid’ in order to locate your paths.