Showing posts with label Terminal. Show all posts
Showing posts with label Terminal. Show all posts

Thursday 18 July 2019

How to run composer install in another PHP version

How to tell Composer to use Different PHP Version
#ea-php72 /opt/cpanel/composer/bin/composer install
You can get list of php by using following command
# ls /usr/bin/ | grep php 

Wednesday 12 June 2019

How to check URL and server OR SSL error and using terminal and curl

There are several way to check issue of URL and server OR SSL error and using terminal and curl

curl https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L
curl -vo /dev/null https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L
curl -I https://cdn.example.com/assets/storetheme/.htaccess.txt -L
curl -v /dev/null https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L

Tuesday 28 May 2019

How to connect ssh using PPK file into Cpanel from terminal Ubuntu

Connection command without PPK file
ssh username@146.66.87.208 -p18765
 Connection command with PPK file
ssh -i privatekey.ppk username@146.66.87.208 -p18765 (if not connect with PPK or give an error like "Load key "privatekey.ppk": invalid format" so please use the direct file without PPK format (See the following screenshot) ) (Supported port : 22, 18765, 18675)

Friday 8 June 2018

Add Template ‘Empty Document’ Options in Right Click Context Menu in Ubuntu 18.04 | 17.10

New versions of Ubuntu 17.10 | 18.04 etc don’t give the option to create a new text document in right-click context menu anymore. Here is how to create new Empty Document like below image



I was trying to create a new text file in Ubuntu 18.04. I right clicked of the mouse but I didn’t see the option to create a new document. This option in the right-click context menu allowed creating an empty text file.


Step 1
Create " Empty Document " into /home/jaydip/Templates directory
Step 2
Open terminal and put following command
touch ~/Templates/Empty\ Document

Thursday 12 April 2018

How to Find / Search a file using CMD / Terminal Command Linux Ubuntu


1. Find file from computer using CMD / Terminal Command

sudo find / -name index.php
2. Find file from Specific Directory using CMD / Terminal Command

sudo find /var/www/html/ -name index.php

Monday 25 December 2017

File Directly Open in NetBeans in Ubuntu / Linux using terminal


 File Directly Open in NetBeans in Ubuntu / Linux using terminal

1. Open terminal and login with sudo su
2. Edit file using nano in terminal (Use following command)
sudo nano /usr/share/applications/netbeans-8.1.desktop 
3. Change

Exec=/bin/sh "/usr/local/netbeans-8.1/bin/netbeans"
to
Exec=/bin/sh "/usr/local/netbeans-8.1/bin/netbeans" %U

Terminal=0
to
Terminal=false
4. Press CTRL+X , than Y and Enter
5. That't IT, Now you can see NetBeans in open with application

Ref by. Nirav Patel

Tuesday 12 December 2017

How to check commit log of the particular file on Git or Bitbucket using terminal

How to check commit log of the particular file on Git or Bitbucket 


sudo git log -- app/code/local/jaydip/kansagra/controllers/CountryController.php

Saturday 9 September 2017

W: GPG error: https://repo.skype.com stable InRelease

Did you got error something like this, whenever you get update ubuntu "sudo apt-get update" in terminal?

W: GPG error: https://repo.skype.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1F3045A5DF7587C3

ANS.

According to https://repo.skype.com/, run:

curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -

in a terminal

Monday 23 January 2017

How to import Big SQL file usign PHP with shell command into hosting server

<?php

error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 1);
ini_set('memory_limit', '512M');

$dbinfo = array(
    "host" => 'localhost',
    "user" => 'magentom_jaydip',
    "pass" => 'rmO22RQ%UbW0',
    "dbname" => 'magentom_jaydip'
);


// Database Config
$sqlhost = $dbinfo["host"];
$dbuser = $dbinfo["user"];
$dbpassword = $dbinfo["pass"];
$dbname = $dbinfo["dbname"];

// filename
$file = "mg_jaydip.sql";

shell_exec("mysql -u $dbuser --password='$dbpassword' --host='$sqlhost' $dbname < $file");

echo 'Finished!<br/>';
?>

Thursday 22 September 2016

Adding an existing project to GitHub /Bitbucket using the command line

1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.

2. Open Terminal.

3. Change the current working directory to your local project.

4. Initialize the local directory as a Git repository.
    $ git init

5. Add the files in your new local repository. This stages them for the first commit.
    $ git add .
    # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.

6. Commit the files that you've staged in your local repository.
    $ git commit -m "First commit"
    # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.

7. At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.

8. In Terminal, add the URL for the remote repository where your local repository will be pushed.
    $ git remote add origin remote repository URL
    # Sets the new remote
    $ git remote -v
    # Verifies the new remote URL

9. Push the changes in your local repository to GitHub.
    $ git push origin master
    # Pushes the changes in your local repository up to the remote repository you specified as the origin