SSH: how to run a PHP script in background forever in Linux (CentOS) ?

If you want to run a PHP script in the background forever through SSH then follow these steps: If you are using a SSH terminal (PuTTY) then directly run following command: // Notice '&'; that operator will help to run this script forever. php server.php & // make sure that you …

Read More »

CentOS: how to execute a php file with different php version than the php version of OS

To execute a php file with different php version than the version installed on the main php of your Server follow this: You should know that where is that php version located so that you can add the path. In my case I want to use PHP 7 that is …

Read More »

How to install Plesk on Linux CentOS?

Download the autoinstaller from our website: wget http://autoinstall.plesk.com/plesk-installer Add execute permissions to the autoinstaller: chmod +x plesk-installer Launch the autoinstaller: ./plesk-installer If upgrading Plesk from a lower version: Command line: /usr/local/psa/admin/sbin/autoinstaller --all-versions GUI (Graphical user interface): /usr/local/psa/admin/sbin/autoinstaller --all-versions --web-interface For more information, please refer to Plesk Installation guide. Tested on …

Read More »

How to install Node.js on Linux CentOS from the EPEL Repository?

An alternative installation method uses the EPEL (Extra Packages for Enterprise Linux) repository that is available for CentOS and related distributions. To gain access to the EPEL repo, you must modify the repo-list of your installation. Fortunately, we can reconfigure access to this repository by installing a package available in …

Read More »

How to download full source of old commit in BitBucket?

It’s very easy to download complete source of your project from an old commit by just following these steps: Click on Commits from the dashboard of your project in BitBucket. Get the commit id of the commit you want to access e.g. 341583f Open https://bitbucket.org/USERNAME/PROJECT_NAME/get/COMMIT_ID.zipFrom above url replace USERNAME , PROJECT_NAME and COMMIT_ID with …

Read More »

Android: How to generate key hash for Android Facebook?

In order to generate key hash you need to follow some easy steps. 1) Download Openssl from: here. 2) Make a openssl folder in C drive 3) Extract Zip files into this openssl folder created in C Drive. 4) Copy the File debug.keystore from .android folder in my case (C:\Users\SYSTEM.android) …

Read More »

Cordova: How to download file and get download progress?

var assetURL = 'http://www.anywebsite.com/test.mp3'; var store = cordova.file.externalRootDirectory; // output in android: file:///storage/emulated/0/ // or // var store = "cdvfile://localhost/persistent/"; var fileName = 'Sounds/test.mp3'; // NOTE: Sounds folder should already be there in order to download file in that folder var fileTransfer = new FileTransfer(); fileTransfer.download(assetURL, store + fileName, function(entry) …

Read More »

Cordova: How to check if a file exists or not?

document.addEventListener("deviceready", init, false); //The directory to store data var store; //File name of our important data file we didn't ship with the app var fileName = "testfile.txt"; function init() { console.log("Checking for data file."); // output in android: file:///storage/emulated/0/ store = cordova.file.externalRootDirectory; // or // store = "cdvfile://localhost/persistent/"; //Check for …

Read More »

Cordova: How to get list of all Files/Directories in a directory?

function success(entries) { var i; for (i=0; i<entries.length; i++) { console.log('En - ', entries[i]); } } function fail(error) { console.log("Failed to list directory contents: ", error); } // output in android: file:///storage/emulated/0/Sounds var directory_path = cordova.file.externalRootDirectory+"Sounds"; window.resolveLocalFileSystemURL(directory_path , function(dirEntry) { var directoryReader = dirEntry.createReader(); console.log(dirEntry); // Get a list of …

Read More »

Cordova: How to create directory?

/* ############ # Method 1 # ############ */ // output in android: file:///storage/emulated/0/ var base_url = cordova.file.externalRootDirectory; // or // var base_url = "cdvfile://localhost/persistent/"; var new_directory = 'TEST'; // To Create a sub Directory inside a folder // var new_directory = 'Sounds/Test'; // Here 'Sounds' is the name of existing …

Read More »