To enable extensions, verify that they are enabled in those .ini files:

Problem

You are trying to install the dependencies in a PHP Symfony project, but you get an error about enable extensions in ini files.

Solution

Make sure that you install the correct packages for the PHP version you are using. So installing php-curl while using PHP 7.1 results in the error.
When installing php7.1-curl the installation completes successfuly.

Docker Cloud moving one node from one account to another

Problem

You have used ‘Bring your own node’ to use a server with one account, but you want to change the account and move the node to the new one.

Solution

Use your old account to terminate the node or login to the server and use the following to stop the running dockercloud-agent:

Go to the Docker Cloud web ui interface, and use the 'Bring your own node'. Copy the token that appears after the sudo -H sh -s on the popup window.

On the server update the token with the one from the new account that you just copied, by running the following:

And now restart the dockercloud-agent on the server:

You should now be able to see 'Node xxxx detected' on the Docker Cloud web ui after a couple of minutes.

Copy file from host to vagrant

Problem

You would like to quickly copy a file from the local host to the vagrant machine.

Solution

Find the private key, ssh and IP port with ssh-config:

Copy the file using the private key as a parameter to scp:

Taken from the answer here

Create a MySQL table with dashes

Problem

You want to create a MySQL table that contains spaces, but when you try you get the following error message:

Solution

Use the backticks to create the table:

Bash getting the parent folder name from a bash defined variable

Problem

You have defined a variable in a bash script (ie MY_FOLDER) but you also want to dynamically get the parent folder (ie MY_FOLDER can have multiple values).

Solution

Use the dirname as in the following

Removing a range of history lines from bash history

Problem

You would like to remove some lines from the bash history (ie using cut and paste with wrong values).

Solution

You can use the following, taken from the answer here

where start_line is the start of the lines you want to remove and no_of_lines is the number of lines you want to be removed.

Symfony doctrine migrations up and down

Problem

You would like to run a migration in a symfony 2x project either up or down.

Solution

You can run the following for getting a migration up or down:

Using tables with dashes in MySQL queries

Problem

You have some databases in MySQL that contain dashes in their names, and when you try to use them (ie grant access to them), you get the following error:

Solution

To be able to use them, enclose the database name in backticks (`) like: