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.

root_url = http://xxxx.xxxx.xxxx.xxxx:3000

Get github to link your commits to your user account if you have more than one git accounts

Problem

You would like to link the commits to a github repository to your github account but you may have different git accounts (ie gitolite etc).
So you would need to specify in the config file which account you want to use.

Solution

There is a help page in github that describes this problem here, but they recommend to change your global settings which is maybe not what you want.
So you could the following to change only the current project settings:

cd ~/my_project
git config --local user.email="your_github_account_email"

Or add the following to your .git/config file inside your local repository:

[user]
  email = user_name@domain.com
  name = Firstname Surname

And to check the settings:

git config --local -l
git config --global -l

Stop github asking your username

Problem
You are working with a git repository but after first cloning the project to your localhost and trying to push changes afterwards, github is asking for you username and password.

Solution
Edit your git configuration and make sure that it uses the git protocol instead of https, so in your ~/project/.git/config file

replace:

remote.origin.url=https://github.com/project_name/repository_name.git

with:

remote.origin.url=git@github.com:project_name/repository_name.git

Getting your Github git project to dreamhost

Problem
You already have a project in github, but you want to move it to a different host (ie dreamhost)

Solution
Following the post here that describes how to setup a new git repository in dreamhost, the only difference after the initial setup :

ssh username@dreamhost_domain.com

mkdir -p ~/git/yourproject.git

cd ~/git/yourproject.git

git --bare init

is to edit your project’s .git/config file:
vi local_host/your_project/.git/config

and change the :
url = git@github.com:user_name/project_name.git

to the following:
ssh://dreamhost_username@dreamhost_domain/~/git/yourproject.git

Lastly you have to push for the first time to the server:
git push origin master

Optionally if you would like to check and/or checkout to a different pc you can use:
git clone ssh://dreamhost_username@dreamhost_domain/~/git/yourproject.git