Skip to content

Instantly share code, notes, and snippets.

View bloodearnest's full-sized avatar

Simon Davy bloodearnest

  • Bennett Institute for Appllied Data Science, Oxford University
  • Leeds, UK
  • X @bloodearnest
View GitHub Profile
@maxiberta
maxiberta / staging-image.sh
Last active October 4, 2019 14:10 — forked from fgimenez/staging-image.sh
Ubuntu Core image for the staging Snap Store
# Create an Ubuntu core image with a custom snapd that talks to the staging Snap Store.
#
# LXD-based alternative:
# https://gist.github.com/maxiberta/5fb47645b0d32137e13f5046ff330eb6
set -ex
tmp=$(mktemp -d)
cd "$tmp"
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted