Running Multiple VSCode Windows from the Same Workspace

In order to have two separate VSCode windows open that point to the same workspace, press CTRL+Shift+P and then search for Duplicate As Workspace in New Window. This will open a new window that is associated with the current workspace.

The thing to keep in mind is that it just DUPLICATED the existing workspace in a new window. Notice that at the top of the EXPLORER it will say UNTITLED (WORKSPACE). You can now work with two windows editing your code, but when you quit out of VSCode close the duplicate workspace first. It will ask you to save the workspace. You can tell it to close without saving.

Apple Pie

A recipe for a double-crust pie. See this post for the pie crust recipe.

  • About 7 or 8 cups of chopped apples (I like to use sweet ones and then I can use less sugar)
  • 1 cup sugar (or 1/2 if you have sweet apples)
  • 1/4 cup flour
  • 1 tsp cinnamon
  • 1/4 tsp nutmeg
  • 1/4 tsp allspice
  • 1/4 tsp ground cloves
  • 1/4 tsp salt
  • 1 tablespoon cider vinegar, or regular white vinegar
  • 1/4 cup citrus juice (apple, orange, etc)
  • 1 tsp vanilla extract
  1. Peel, core and coarsely chop your apples. I have no time or inclination to carefully slice them, if you do, go for it, but it is not necessary.
  2. Mix sugar, flour, spices, salt in a small mixing bowl.
  3. Mix together the juice, vinegar and vanilla and sprinkle over the chopped apples in a large bowl and mix. Then sprinkle the spice mixture over the apples and mix. Then turn out into pie crust.
  4. Place the top crust on the pie and pierce in a few places.
  5. Bake your pie at 400 degrees for 50-60 minutes until the crust starts to brown and/or the mixture starts bubbling up through the crust a bit.

Hint: Place a cookie sheet covered in tinfoil on the lowest oven rack (not on the same rack as the pie) to prevent any overflow from reaching the bottom of the oven–easy cleanup!

Sweet Potato Pie

The egg whites folded into the mix make it a more fluffy and less dense pie. A wonderful treat! A recipe for a single-crust pie. See this post for the pie crust recipe.

  • 3 cups mashed sweet potatoes
  • 1/2 cup butter
  • 1/2 or 1 cup sugar
  • 1/2 cup milk
  • 3 eggs
  • 1/2 tsp nutmeg, cinnamon
  • 1 tsp vanilla
  1. Take the butter out of the fridge to let it come to room temp
  2. You can either peel and boil the potatoes till soft, or roast them until soft.
  3. Mix the sugar and spices
  4. Cream butter and sugar and spices
  5. Separate the eggs
  6. Add egg yolks to the butter and sugar mix and beat
  7. Stir in potatoes, milk, and vanilla
  8. Beat egg whites to soft peaks and fold into mix
  9. Pour into a pie crust and bake for about 45 minutes to an hour or until the center is firm @ 375

Configuring a Bitbucket Pipeline for a Golang Project with Privately Hosted Dependencies

Go’s dependency management is based solely on git repos. Most of the libraries have publicly available repos from which you can clone the source and then build your project.

In my case, most of the Go that I’m writing ends up in private repos in Bitbucket. Currently, I’ve got a program that I am writing that is dependent on a library that I have written that is hosted as a private repo in Bitbucket. I wanted to setup a Bitbucket Pipeline to build and then run the unit and integration tests when a PR was submitted.

Initially, I had a bit of a hard time figuring out how to set up the pipeline to work correctly and posted this Stack Overflow question. Not being one to give up, I kept at it and stumbled upon some Atlassian documentation that gave me what I needed to get it sorted out.

The key (no pun intended) ended up being the distribution of SSH keys between the repos and some additional go specific environment variables in the pipeline code.

bitbucket-pipelines.yml

image: golang:1.16

pipelines:
  pull-requests:
    '**':
      - step:
          name: Build and test
          script:
            - /bin/bash build/bitbucket-pipelines.sh

The pipeline yaml is straightforward. I’m using a golang builder image, defining a pull-request trigger for any branch, and specifying a shell script that contains the details for buiding and running my tests. The script is in the build directory which is in the base of my repository.

bitbucket-pipelines.sh

# Export the following go specific env vars to configure the tool chain so that I can clone
# repos from my private Bitbucket project.
export GONOPROXY="bitbucket.org/my-project"
export GONOSUMDB="bitbucket.org/my-project"
export GOPRIVATE="bitbucket.org/my-project"

# Configure git to force using ssh instead of https to clone the repos hosted in
# my Bitbucket project
git config --global url."git@bitbucket.org:my-project".insteadof "https://bitbucket.org/my-project"

CGO_ENABLED=0 go build
CGO_ENABLED=0 go test -count=1 -tags=unit ./...
CGO_ENABLED=0 go test -count=1 -tags=integration ./integration_tests/

SSH Key Configuration

With this basic pipeline code you then need to create a distribute ssh keys between the projects

Create the Pipeline SSH key pair in the Repo where you are running the pipeline

  1. In the repo where you are running the build, and composing the library, go to Repository settings. Then under PIPELINES, click on SSH keys
  2. Click Generate keys to create a new key pair.
  3. Copy the Public key to your clipboard. This public key will be added to all of dependent repos to enable us to clone and build with their source code.

For each of the dependency repos do the following:

  1. Go to Repository Settings and under GENERAL click on Access keys
  2. Click Add key and enter a Label and then paste the public key in the Key field.
  3. Then click Add SSH key

Once the public keys have been distributed to the dependent repositories your pipeline will have the permissions required to clone during the build.