Thursday, December 2, 2021

How to change file extension in Linux.

 

Command line:

Open terminal and type following command "#mv filename.oldextension filename.newextension"

For example if you want to change "index.html" to "index.php" you would type the following command.

#mv index.html index.php

Graphical Mode:

Same as Microsoft Windows right click and rename its extension.

Multiple file extension change.

for x in *.html; do mv "$x" "${x%.html}.php"; done

This script will change all files in current directory ending with html extension to

php extension. (*.html to *.php), You can customize it as per your requirment.

Saturday, August 7, 2021

Connect to mysql through ssh tunnel from php

 

Connect to mysql through ssh tunnel from php

 

shell_exec("ssh -fNg -L 3307:$dbServerHost:3306 user@remote_host");
$conection = new mysqli($dbServerHost, $username, $password, $dbname, 3307);

 

security header validate

  HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)