Adding a Git repo to a server
git clone git@bitbucket.org:{username}/{repo}.git
And I was unceremoniously delivered the following error
fatal: could not create work tree dir '{project}
': Permission denied
My initial thought was the error due to server permission... being sudo. This was tested by running the command
sudo git clone git@bitbucket.{username}/{repo}.git
Which generated the error
How to Create New MySQL User
How to Create New MySQL User
Before you can create a new MySQL user, you need to open a terminal window and launch the MySQL shell as the root user. To do so, enter the following command:
sudo mysql –u root –p
or rather than typing sudo each time you can enter:
sudo su mysql -u root -p
In either scenario next type in the root password and press Enter.
The prompt will change to
mysql>
How To Update All Packages Linux
In the terminal type, the following command:
sudo apt update
After typing the above command, enter your password.
How to zip a file using command (cmd) line?
This short guide explains to you how to extract/unzip .zip archive files to a specific or different directory in Linux.
Install zip
sudo apt-get install zip
Zip a directory
Zip your folder:
zip -r {filename.zip} {directory}
Unzip
unzip {filename.zip}
Terminal does a file exists using PHP
I needed the check if a file existed in a directory as the migrate script wasn't recognising the file. To check if a file exists:
FILE={your-directory-path} if test -f "$FILE"; then echo "$FILE exists." fi
If your directory path is /Users/{your name}/Sites/migrate/local_dest_dir/fish/../media/apple-store.png
composer memory_limit
A recent attempt to run an update composer (regular activity for many of us), I had a memory limit issue. This was surprising because the memory setting via Plesk is set to 2G. Yet through Terminal it was showing only 128MB. What gives??
The error I was seeing: