Grafana with github authentication problem

Problem

You are trying to use the github OAuth authentication for having users login to your Grafana but there is an error that redirect_uri must match that is coming from Github.

Solution

Make sure that you add a line with the root_url in your /etc/grafana/grafana.ini file that has the same IP/domain name as your server, and restart the service.

ERROR 1290 (HY000): The MySQL server is running with the –secure-file-priv option so it cannot execute this statement

Problem

You want to export a MySQL database table as a csv with something like:

but you get the error that MySQL cannot execute this command.

Solution

Find out the location that MySQL can use to export files by running the following:

and then use the path to change the outfile path (ie /var/lib/mysql-files/table_name.csv).

Taken from the answer here

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.