Importing zip mysql dump

zcat /Users/Marko/Downloads/file.sql.gz | mysql -u 'root' -p'password' your_database

just drop this line in your linux or mac and fill data you need to fill and wait :) or this for gz files

gunzip < /Users/Marko/Downloads/mydb.sql.gz | mysql -u root -p mydb

or for ZIP files

Git logs, find where it went wrong

When I want to find something in GIT and see who and when removed some code I start to search GIT, best command combo is this.

 git log -S "$location['country_code']" -p

For current branch

Logging mysql on localhost

In mysql 5.6+. Use this:

[mysqld]
general_log = on
general_log_file=/usr/log/general.log

in your my.cnf / my.ini file

DB Uploading from local to remote

mysqldump -u user -p databasename > dump.sql

Then using SCP transfer the file to the remote server:

scp dump.sql user@remotehost.ip:

Then use the mysql client there to import the dump.sql with:

mysql -u user_name -p databasename

Choosing which PHP to run with Drush, changing CLI php

Using drush on mac with mamp gave me some problems with default setup. I didnt set
DRUSH_PHP variable anywhere so default php was used, also with that no php.ini setting was set and in my drush status I got empty "Drush configuration" variable. So to set this up, I needed to add this to either .profile or to .bash_profile (depends of load order, later goes first if you have it)

Quickly import DB on server

If you want to quickly import DB on your linux do this combo command, before just create that Database you want to have.

gunzip < data.mysql.gz | mysql -u root -p db_name

Quick out of memory or out of time debugging

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
ini_set('memory_limit', ''728M');
ini_set('max_execution_time', 120)

add this to index.php and see what is the output, act on that.

$_SERVER['HTTPS']='on' on reverse proxies - nginx and SSL

When using nginx and SSL and you have a problem that CSS or JS files are using HTTP in their urls and everything else is in HTTPS. The thing you need to do is use this magic

$_SERVER['HTTPS']='on';

put it in settings.php and also if you have wordpress, do the same, put it in wp-config.php it will do the same and solve the same problem.