Ssh tunnel

Random port tunnelling using a private key:

#!/bin/sh
 
ssh -L 5446:hostname:5446  -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222

Mysql port tunnelling using a private key:

#!/bin/sh
 
ssh -L 3309:127.0.0.1:3306  -i /home/imran/Servers/iaghayev iaghayev@192.168.1.10 -p 2222

Configuring Exim4 on Ubuntu

Use the following utility:

dpkg-reconfigure exim4-config

Rsync examples

cd /home/imran/Projects/pp-frontend
rsync -azP --exclude .git/ --exclude .idea/ --exclude user_guide . imran@192.168.56.101:/var/www/vhosts/httpdocs

Rsync local to remote

cd /home/imran
rsync -avz --exclude default-soapui-workspace.xml --exclude Desktop --exclude Dropbox --exclude "Google Drive" --exclude --exclude NetBeansProjects --exclude PhpstormProjects --exclude Public --exclude Software --exclude "Software Archive" --exclude "Soap UI Configuration" /home/imran/* /home/imran/Google\ Drive

Rsync remote to local

rsync -chavzP kaspi-emlak.com@ssh.kaspi-emlak.com:/www/* /home/imran/Projects/kaspi-emlak-live/www

MySQL empty or NULL

In mySQL empty or ” is differrent than NULL.
Empty means empty string but NULL means it is not set at all, not exist.

Git remote change url

git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git

Smart live server updates through links

Use /var/www-production & /var/www-prerelease

Link /var/www.repo1 to /var/www-production and /var/www.repo2 to /var/www-prerelease.
Update /var/www-prerelease, test, do customizations.

When ready simply swap the links, move prerelease production and production to prerelease

Magento 1.9 RAM Table

products = RAM
up to 1000 = 8 GB
up to 50,000 = 16 GB
up to 100,000 = 32 GB
up to 250,000 = 48 GB
up to 500,000 = 64 GB
up to 750,000 = 96 GB
up to 999,999 = 128 GB

Magento Zend Framework Mappings

CE – Community Edition
PE – Professional Edition
EE – Enterprise Edition

CE 1.9 – ZF 1.12.3
CE 1.5 – CE 1.8 – ZF 1.11.1
CE 1.4.2.0 – ZF 1.10.8
CE 1.4.0.1 – ZF 1.9.6
CE 1.3.2.1 – ZF 1.7.2
CE 1.2.0.1 – ZF 1.7.2
CE 1.1.6 – ZF 1.5.1
CE 1.0.19870.4 – ZF 1.5.1

PE 1.11 – ZF 1.11.1
PE 1.10 – ZF 1.11.1

EE 1.14 – ZF 1.12.3
EE 1.10 – 1.13 – ZF 1.11.1
EE 1.9.1.1 – ZF 1.10.8

Php increase memory limit

<?php
 
ini_set('memory_limit','2048M');

WordPress change site url

UPDATE wp_options SET option_value = REPLACE(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
 
UPDATE wp_posts SET guid = REPLACE(guid, 'http://www.oldurl','http://www.newurl');
 
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.oldurl', 'http://www.newurl');
 
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'http://www.oldurl','http://www.newurl');