mysql: backup from remote host using ssh

Sometimes you need to dump a mysql database, and there’s no free space on the server. Here’s you can do to back up the database:

ssh -p <ssh port> user@host "mysqldump -u dbuser -ppassword dbname | gzip -9" > database.sql.gz

At the end you will get mysq database on a local server. Although ssh is slow and it would take some time to transfer the database.

Solving “Can’t locate File/ in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)”

To solve this problem:

 Can't locate File/ in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 
 BEGIN failed--compilation aborted

you just need to install perl-File-Which package:

yum install perl-File-Which

Free SSL certificates set up on Ubuntu in 5 min

Install certbot:

wget ; chmod a+x certbot-auto ; ./certbot-auto

Add the required location to nginx:

vim /etc/nginx/sites-enabled/
location ~ /.well-known { allow all; }
sudo service nginx restart

Run and follow the instruction:

root@host:~# ./certbot-auto certonly -d
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Failed to find apache2ctl in PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

How would you like to authenticate with the ACME CA?
1: Place files in webroot directory (webroot)
2: Spin up a temporary webserver (standalone)
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for

Select the webroot for for
1: Enter a new webroot
Press 1 [enter] to confirm the selection (press 'c' to cancel):
Input the webroot for (Enter 'c' to cancel):/usr/share/nginx/html
Waiting for verification...
Cleaning up challenges
Generating key (2048 bits): /etc/letsencrypt/keys/0000_key-certbot.pem
Creating CSR: /etc/letsencrypt/csr/0000_csr-certbot.pem

- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/ Your cert will
expire on 2017-04-20. To obtain a new or tweaked version of this
certificate in the future, simply run certbot-auto again. To
non-interactively renew *all* of your certificates, run
"certbot-auto renew"
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt:
Donating to EFF:

Add SSL config to nginx:

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/keys/0000_key-certbot.pem;
    ssl_protocols TLSv1  TLSv1.1 TLSv1.2;