- Setup ( one time )
- Create a DO account
- Create a public/private SSH key
- Add the key to your DO account
- Each time
- Launch an instance configured with the public SSH key
This function creates a sequential list of numbers then shuffles, removes one, and duplicates one into another list.
The challenge is to find the missing number and the duplicated number in the shuffled list.
Number list generator
number_list_generator () {
# given an order of magnitude, set output file names
local LC_ALL=C
local oom=${1:-3}This was inspired by this article:
https://realpython.com/pyscript-python-in-browser/
docker container stop pyscript ; docker container rm pyscriptCommands for creating a Docker container inspired by Data Science at the Command Line, 2nd Edition
# clean up namespace
docker container stop ds_cli ; docker container rm ds_cli
# run instance as service
docker container run -d -v /tmp/ds_cli:/tmp/ds_cli --name ds_cli ubuntu:22.04 sleep inf
This file contains hidden or 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
| # remove any existing Docker instance | |
| docker container stop mongodb ; docker container rm mongodb | |
| # start a Docker instance as a service | |
| docker container run -d --name mongodb ubuntu:22.04 sleep inf | |
| # install packages | |
| docker container exec -i mongodb /bin/bash << 'eof' | |
| export DEBIAN_FRONTEND=noninteractive | |
| apt-get update |
This file contains hidden or 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
| # === Subscriber and publisher in single container, eclipse broker | |
| # remove any existing container | |
| docker container stop mosquitto ; docker container rm mosquitto | |
| # start the instance in the background ( and create an image, if needed ) | |
| docker image list -a | grep -q mosquitto && | |
| docker container run -d --name mosquitto mosquitto sleep inf || { |
This file contains hidden or 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
| # From: https://www.simplilearn.com/tutorials/docker-tutorial/raspberry-pi-docker | |
| curl -fsSL https://get.docker.com -o get-docker.sh | |
| sudo sh get-docker.sh | |
| sudo usermod -aG docker ${USER} | |
| exec sudo su - ${USER} | |
| docker image pull ubuntu:22.04 |
From https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/87
These commands were run using the bash shell on Debian 11 in the Linuv Dev Env on a Chromebook.
Make sure no mongodb instances exist
docker container stop mongodb ; docker container rm mongodb ; sleep 2Run an Ubuntu 22.04 container in the background
This file contains hidden or 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
| # This should be turned into a multi-stage Dockerfile | |
| docker container stop build_haskell ; docker container rm build_haskell ; sleep 1 | |
| docker container run -d --name build_haskell ubuntu:20.04 sleep inf | |
| <<'eof' docker container exec -i -w /tmp/ build_haskell /bin/bash | |
| export DEBIAN_FRONTEND=noninteractive | |
| apt-get update | |
| apt-get install -y vim tree jq file wget gcc g++ make xz-utils curl |
This file contains hidden or 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
| # Using a shell pipeline of awk, bc, sort, head in Docker with the Alpine image | |
| <<'eof' docker container run --rm -i alpine | |
| { cat <<'eof2' | |
| 1000 | |
| 2000 | |
| 3000 | |
| 4000 |