Skip to content

Instantly share code, notes, and snippets.

View rwcitek's full-sized avatar

Robert Citek rwcitek

View GitHub Profile
@rwcitek
rwcitek / mqtt.mosquitto.docker.phase-01.sh
Last active July 10, 2023 04:24
An example pub/sub using mosquitto in Docker
# === 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 || {
@rwcitek
rwcitek / mongodb.client.docker.sh
Last active January 25, 2023 17:20
MongoDB client in Docker on Ubuntu 22.04
# 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
@rwcitek
rwcitek / data.science.cli.md
Last active April 3, 2023 01:32
Docker container with Data Science CLI tools

Commands 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
@rwcitek
rwcitek / pyscript.docker.md
Created February 8, 2023 23:27
Playing with PyScripts using Docker
@rwcitek
rwcitek / number.generator.md
Last active February 13, 2023 04:56
Generate list of number with some tweaks

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}

Digital Ocean cloud computing

Overview of steps

  • 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
@rwcitek
rwcitek / windows.wsl2.docker.md
Last active March 4, 2025 00:41
Installing Docker on Windows without Docker Desktop

Installing Docker on Windows without Docker Desktop

WSL2 [1]

Newer versions of Windows

Open PowerShell with Admin rights and run wsl --install -d Ubuntu-24.04.

Older versions of Windows

@rwcitek
rwcitek / htmlq.docker.md
Last active June 1, 2023 00:34
Installing and running htmlq within Docker
@rwcitek
rwcitek / homebrew.md
Last active April 16, 2024 19:57
Installing and running Homebrew under Ubuntu in Docker
@rwcitek
rwcitek / nushell.docker.md
Last active August 10, 2023 03:23
nushell in Docker

Running nushell in Docker

Discover latest version

elinks --dump https://github.com/nushell/nushell/releases |
grep -m1 -o https:.*x86_64-unknown-linux-gnu.tar.gz |
rev |
cut -d/ -f2 |
rev