How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

December 8, 2017

delete large directory containing thousands of files

Filed under: Linux — Tags: , , , , , — admin @ 11:22 am

Well if you try to remove a directory with multiple files rm will take a long time also some load on that server .

One solution is to rsync a empty directory .

mkdir empty_dir
rsync -a –delete empty_dir/ yourdirectory/

Also a perl can be made but the rsync is easy for me to remeber .

Some more information about this you can find here

https://serverfault.com/questions/183821/rm-on-a-directory-with-millions-of-files/328305#328305

 

November 2, 2017

Modify .htaccess on wordpress site to move to new domain

Filed under: Linux — Tags: , , , — admin @ 10:25 am

In order to move the wordpress to new domain you must modify the .htaccess with

 

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.newdomain.com$1 [R=301,L]

June 27, 2017

change root password for mysql 5.7 fresh installed

Filed under: Linux — Tags: , , — admin @ 11:35 am

In order to find out actual password you need to grep log file

grep password /var/log/mysqld.log

This will provide you with root password .

After login on your mysql server with

mysql -u root -p

Then you must change root password with

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘newpassword’;

 

May 29, 2017

How to install git composer globally

Filed under: Linux,Php — Tags: , , — admin @ 10:28 am

Hello

The easy way to install composer globally is to run bellow commands


curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

April 25, 2017

how to disable gzip for specific file

Filed under: Linux,Php — Tags: , , , , , , — admin @ 1:33 pm

The short answer is

RewriteRule ^dashboard/index - [E=no-gzip:1]
SetEnvIf REDIRECT_no-gzip 1 no-gzip

Some explination of that solution

The – means NOOP, E means set variable, 1 is the value. After redirects, the variables are renamed and prepended with REDIRECT_.

This work for php FPM

If you have a mod dso you can use also this

apache_setenv('no-gzip', '1');
« Newer PostsOlder Posts »

Powered by WordPress