Skip to main content

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}

 

How to mysqldump remote db on a AWS server?

The generally accepted answer to a mysqldump is:

mysqldump -h [host] -u [user] -p [database_name] [table_name] > [file].sql

Or a variant there of...  Of course if you are logged in to the server and working from it you don't need to express the -h [host]

mysqldump -u [user] -p [database_name] [table_name] > [file].sql

 

Drupal resolving a white screen of death

On a git pull from remote dev environment to a staging environment running off AWS server... I was greeted with the white screen of death.  While it took me a while to resolve the actual issue, my action plan was as follows:

 

How to resolve:

  1. Look in your log files;
  2. Add a few lines to your index.php file

 

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

Onboarding

Joining a new company / team there is always a lot of new items to do, install and familiarise yourself.  Below is a working list:

How to solve "The provided host name is not valid for this server" in Drupal

Don't worry this is an issue that many Drupal developers have come across. In particular it raises its head when you add a subdomain.  Your Drupal website is only showing a plain white screen with “The provided host name is not valid for this server" on it. What does it mean and how to fix it.

Installing Node and npm on CentOS 7

Working on a new CentOS 7 server, Node wasn't installed.  You can quickly this through using the prompt node -v

node not found

In Plesk, the extension had been installed, however this doesn't mean correctly.  So I needed to install Node and npm on the CentOS 7 server.

 

Allegedly a server upgrade to CentOS 7

I had been running a few Centos 6 servers just past their EOL (30th November 2020) and it was time to kick in to action a plan I had been working on when I realised EOL was on my doorstep.

Subscribe to Terminal