Cook the spaghetti in a large pot of lightly salted, boiling water, until tender, about 8 minutes. While the spaghetti cooks, place the butter and oil in a large skillet set over medium heat. When the butter is melted, add the garlic and chili flakes and cook until fragrant, about 1 minute. Add the shrimp and stock and bring to a simmer. When the pasta is cooked, drain well, reserving 1/2 cup of its cooking liquid. Add the spaghetti, reserved cooking liquid, basil or parsley and salt to the skillet, toss to combine and serve.