2  analysis.yml

2.1 The script

  • Adds CRAN and Docker APT sources
  • Installs packages for:
    • Python (pip, libraries)
  • R (base, dev tools, packages)
  • Installs Docker and Docker Compose
  • Add security (fail2ban, ufw)
  • Creates a user piet with sudo and Docker access
  • Configures SSH on port 4444
  • Saves a log as /var/log/cloud-init-output.log
  • Sets up fail2ban and a firewall
  • Installs Python and R packages
  • Optionally adds swap space for R
  • Installs a large set of R packages
  • Installs Node.js for JavaScript-based services
  • Installs npm for JavaScript package management
  • Installs Express.js generator
  • Creates a simple marker file to verify cloud-init completion

2.2 References

Help on cloud-init syntax from:

Help on R and Docker installation syntax from:

Detailed explanations of lines of code for Node.js setup:

  • git: Essential for version control and cloning repositories.

  • nodejs and npm: Required for running and managing JavaScript packages.

  • npm install -g npm@latest: Ensures you’re using the latest npm version, which can fix bugs and improve compatibility.

  • express-generator: A helpful tool for quickly scaffolding Express.js applications.