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');

Git change remote url

git remote set-url origin https://username@hostname:port/project.git

Yii2 print ActiveRecord query sql output

<?php
 
echo $query->createCommand()->sql;

Beanstalkd stats and jobs delete

telnet localhost 11300
stats
 
peek-ready
FOUND 7 90
{"job":"Kleidoo\\Queue\\Job\\Shop\\Import\\ProductFeed","data":{"id":"303","revision":19}}
 
peek-delayed
FOUND 7 90
{"job":"Kleidoo\\Queue\\Job\\Shop\\Import\\ProductFeed","data":{"id":"303","revision":19}}
 
delete 7

Beanstalkd “cold” delete all jobs

/etc/init.d/beanstalkd stop
cd /var/lib/beanstalkd
rm -r -f *
/etc/init.d/beanstalkd start

Git hard remove last commit

git reset --hard HEAD~1

Apache2 enable mod_proxy

a2enmod proxy_http

Php curl verbose

<?php
 
curl_setopt($f1, CURLOPT_VERBOSE, true);

Yii 2 Download a File

<?php
 
return Yii::$app->response->sendFile($fileName);