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 | |
# to use, run: curl -sL bit.ly/mlgrm-cros_docker_sh | bash | |
set -e | |
set -x | |
# download a big image | |
lxc launch ubuntu:16.04 docker | |
# make a copy of the default profile |
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 | |
set -e | |
set -x | |
# first make sure you have the docker container running: | |
# https://gist.github.com/mlgrm/6d8af41fb40640355d4bdb2d8bb597d4 | |
# to run from termina: | |
# curl -sL bit.ly/mlgrm-docker_tidyverse_sh | lxc exec docker -- sudo -u ubuntu --login bash | |
# to run directly from a docker host: |
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 | |
# google-auth [options] [[http[s]://]api-server]endpoint [key=value ...] | |
# | |
# ########### | |
# # options # | |
# ########### | |
# | |
# all options can be set as environment variables, i.e.: | |
# > google-api --option-name "option-value" ... | |
# is equivalent to |
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 | |
############################################################################### | |
# borgify.sh - google cloud snapshot to borg backup migration script # | |
############################################################################### | |
# | |
# for every snapshot of SOURCE_DISK, | |
# 1. create a disk from it | |
# 2. mount it on a server | |
# 3. back up TARGET_DIR to RSYNC_LOGIN/~/REPO | |
# 4. unmount and delete the disk |
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 | |
# roll out a gcp compute instance running container-optimized os or ubuntu 18.04 | |
# you need to have gcloud configured with a project and region/zone | |
# usage: curl -sL bit.ly/mlgrm-gcp-docker | bash | |
DAYS=${DAYS:-36500} | |
HOST=${HOST:-cosima} | |
LOGIN=chronos@$HOST | |
IP_NAME=${IP_NAME:-$HOST} | |
BOOT_DISK_SIZE=${BOOT_DISK_SIZE:-10GB} |
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
#cloud-config | |
# | |
# run docker with tls for remote management | |
packages: | |
- dmsetup | |
- libdevmapper1.02.1 | |
- libparted2 | |
- parted | |
write_files: | |
- path: /etc/docker/daemon.json |
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 | |
# usage: curl -sL bit.ly/mlgrm-rstudio | DOCKER_HOST=docker DOCKER_USER=ubuntu USER=rstudio bash | |
DOCKER_HOST=${DOCKER_HOST:-"docker"} | |
DOCKER_USER=${DOCKER_USER:-"ubuntu"} | |
USER=${USER:-"rstudio"} | |
lxc exec $DOCKER_HOST -- sudo su - $DOCKER_USER -c "\ | |
docker run -d \ | |
--name rstudio \ |
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 | |
# usage: | |
# curl -sL bit.ly/mlgrm-docker | HOST_NAME=name bash | |
# all flags can be replaced by env vars with the usual keymapping | |
trap clean_up ERR SIGTERM SIGINT | |
clean_up () { | |
lxc rm --force $HOST_NAME | |
lxc profile delete $HOST_NAME |
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 | |
# usage: curl -sL bit.ly/mlgrm-penguin | [ KEY=value [...] ] bash | |
# keys: | |
# USER_NAME google user name. | |
# RCLONE_TOKEN (optional) valid token generated by rclone on the user's drive | |
# if provided, the home directory will be recovered from penguin/home/$USER_NAME | |
# and backups scheduled hourly | |
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 | |
# usage curl -sL bit.ly/mlgrm-cros-guest | lxc exec penguin -- bash | |
set -e | |
# adapted from: | |
# http://joshua.blogspot.com/2018/08/introduction-to-crostini-part-3-using.html | |
# (which used to be public...) | |
apt-get update |
OlderNewer