This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# use this script in a fresh lxd container | |
set -ex | |
tmp=$(mktemp -d) | |
cd "$tmp" | |
sudo apt update | |
sudo apt install golang-go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/bloodearnest/ebf044476e70c4baee59c5000a10f4c8 | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
$ python3 writebench.py | |
Wrote 4768.42 MB in 2.30 secs | |
""" | |
import os | |
import tempfile | |
import time | |
t0 = time.time() |