/new convention: think of it as "dotfiles" but "for computers"

/new convention: think of it as "dotfiles" but "for computers"

Geoffrey Huntley
🔎
I authored this blog post whilst I was an employee of Gitpod for Gitpod. I no longer work at Gitpod.

Earlier last year I added a /new page to my website at https://ghuntley.com/new/ as a productivity shortcut and partly out of necessity of doing software development from an iPad.

Reflections on software development from anywhere on an iPad
The Macbook Pro M1 is the software development laptop of choice yet I love my iPad considerably more. I’m all in with my thin client for hipsters. Here’s what I’ve learned over the months and how my baremetal homelab in the sky is setup.

It's not actually a "page" as per say, it's a redirect to the following URL https://gitpod.io#github.com/ghuntley/new which provides a temporary ephemeral computer via Gitpod that is customised to my liking. It's a simple link, easy to type, easy to remember and it get's typed often.

Think of it as "dotfiles" but "for computers". Zach Holman authored Dotfiles are meant to be forked back in 2010 and that blog post had a profound impact on my career as it was my first pull-request and gateway into the wonderful world of GitHub.

Dotfiles Are Meant to Be Forked
Written pieces, talks, and other bits by Zach Holman.

By taking lessons learned from the infrastructure-as-code movement and upgrading the dotfiles pattern into full blown Docker images then utilising products such as Gitpod to consume, build and execute the Dockerfile then I no longer need to worry about the security of my endpoint when playing with open-source software created by complete internet randoms.

$ sudo rm -rf / === npm install
In what seems like a long time ago, in part because it is, I learned thecatastrophic capabilities of this command the hard way and I’m sure folks myvintage have similar stories as it’s essentially a right of passage in thesysadmin world. Back in 1996, I was 14

Each new environment is sandboxed and completely disposable - freeing me of concerns of accidentally bricking my local computer, open-source supply chain attacks or a desktop folder full of junk source control checkouts. These days instead of opening a new Windows Terminal, iTerm2 or Blink session I head to my /new.

GitHub - ghuntley/new: Ephemeral terminals in the sky
Ephemeral terminals in the sky. Contribute to ghuntley/new development by creating an account on GitHub.
source code to my personalised ephemeral computer

Above you'll find the source code to my personalised ephemeral computer which uses nix (because really good reasons) but if nix isn't your thing then I encourage you to roll your own. There are three components to a /new:

1) .gitpod.yml

## The 'image' section defines which Docker image Gitpod should use. 
##
## By default, Gitpod uses a standard Docker Image called
## 'workspace-full' which can be found at
## 'https://github.com/gitpod-io/workspace-images'

image:
  file: Dockerfile

## The 'tasks' section defines how Gitpod prepares and builds
## this project or how Gitpod can start development servers.
##
## With Gitpod, there are three types of tasks:
##
## - before: Use this for tasks that need to run before init
##           and before command. 
## - init:   Use this to configure prebuilds of heavy-lifting
##           tasks such as downloading dependencies or compiling
##           source code.
## - command: Use this to start an application when the workspace
##            starts.

tasks:
  - name: nix
    command: |
      direnv allow
  - name: tailscaled
    command: |
      sudo tailscaled
  - name: tailscale
    command: |
      sudo -E tailscale up --hostname "gitpod-${GITPOD_WORKSPACE_ID}" \
                           --authkey "${TAILSCALE_AUTHKEY}"
https://www.gitpod.io/docs/references/gitpod-yml

2) Dockerfile

FROM ubuntu

# https://twitter.com/mitchellh/status/1491102567296040961
RUN sh <(curl -L https://nixos.org/nix/install) --daemon


https://docs.docker.com/engine/reference/builder/

3) Webserver redirect

If the computer definition is hosted at https://github.com/ghuntley/new then https://gitpod.io/#https://github.com/ghuntley/new is the link that would be the redirect destination.