A 25-year-old man has been convicted of murder and an attempted murder in Edinburgh two years ago.