release 2.2 clean

This commit is contained in:
bluxmit 2022-05-23 20:35:21 +00:00
parent 3aadce297a
commit 81fe32e177
95 changed files with 3 additions and 4580 deletions

View File

@ -35,4 +35,6 @@ If you feel you need to discuss first, create an issue.
> If you like this project, please support it by simply putting a Github star and sharing with friends on Twitter.
<p align="center">
<img src="img/stand_with_ukraine.png" alt="Ukraine" width="250">
</p>

BIN
img/stand_with_ukraine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

View File

@ -1,55 +0,0 @@
# Ansible tools
### [Ansible-cmdb](https://github.com/fboender/ansible-cmdb)
Ansible-cmdb takes the output of Ansible's fact gathering and converts
it into a static HTML overview page (and other things) containing system configuration information.
```
ansible -m setup --tree out/ all
ansible-cmdb out/ > overview.html
```
### [Ansible inventory grapher](https://github.com/willthames/ansible-inventory-grapher)
```
ansible-inventory-grapher all | dot -Tpng > /home/static-server/my.png
```
### [Ansible Playbook Grapher](https://github.com/haidaraM/ansible-playbook-grapher)
```
ansible-playbook-grapher --include-role-tasks example.yml -o /home/static-server/example
```
### [Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/installing.html)
```
ansible-lint --nocolor > /home/static-server/ansible-lint.txt
```
### [Ansible Doctor](https://ansible-doctor.geekdocs.de/)
ansible-doctor is a simple annotation like documentation generator based on Jinja2 templates.
hile ansible-doctor comes with a default template called readme, it is also possible to write your own templates.
The first step is to identify if the given folder is an Ansible role. This check is very simple,
if the folder contains a sub-directory called tasks is MUST be an Ansible role! :)
After the successful check, ansible-doctor will try to read some static files into a dictionary:
- defaults/main.yml
- meta/main.yml
```
ansible-doctor -o /home/static-server/ roles/example_production
```
### [**Ansible-pre-commit**](https://github.com/adarnimrod/ansible-pre-commit)
### Ansible Mitogen
Read [how to configure your Ansible project to work 7x faster!](https://mitogen.networkgenomics.com/ansible_detailed.html#installation)

View File

@ -1,129 +0,0 @@
# Ansible
This tutorial is a little demonstration of the included ansible toolset.
Workspace has an example ansible play which installs several installs packages.
We will use this playbook for some of the examples. For other examples, create your own ansible project.
To run an example ansible play, open terminal and execute
```
cd /home/examples/ansible-local
ansible-playbook install-packages.yml
```
## Ansible Ara
[Ansible ARA](https://github.com/ansible-community/ara) Records Ansible and makes it easier to understand and troubleshoot. Ansible Ara is
fully configured in the Ansible-Terraform workspace - it captures any execution (manual or scheduled)
of any ansible playbook.
Ara server is up and running. Open quickstart page and navigate to Ara WEB UI
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/Ansible-Ara.gif" alt="Htop" width="750">
</p>
## Ansible Lint
[Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/installing.html) is a command-line tool for linting playbooks, roles and collections aimed towards any Ansible users. Cd to the folder with
your Ansible project and execute
```
cd /home/examples/ansible-local
ansible-lint --nocolor > /home/static-server/ansible-lint.txt
```
You can view the resulted txt file with static file server, filebrowser.
## Ansible report
Ansible-report is a small utility that generates several reports from your ansible project - visualizes inventory, represents
all plays in a format of graphs, generates interactive static website with information about hosts etc.
Create your own ansible project, cd and execute
```
ansible-report
```
Ansible-report is a shell script that simply executes several ansible tools in one shot:
- ansible-lint
- ansible-cmdb
- ansible-inventory-grapher
- ansible-playbook-grapher (for all ansible plays in the folder)
You can also use any of the ansible tools separately.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/ansible-report.gif" alt="Htop" width="900">
</p>
## Ansible-cmdb
[Ansible-cmdb](https://github.com/fboender/ansible-cmdb) takes the output of Ansible's fact gathering and converts
it into a static HTML overview page (and other things) containing system configuration information.
Cd to the folder with your Ansible project and execute
```
ansible -m setup --tree out/ all
ansible-cmdb out/ > overview.html
```
## Ansible inventory grapher
[Ansible inventory grapher](https://github.com/willthames/ansible-inventory-grapher) creates a dot file suitable for use by graphviz. Cd to the folder with
your Ansible project and execute
```
ansible-inventory-grapher all | dot -Tpng > /home/static-server/my.png
```
## Ansible Playbook Grapher
[Ansible Playbook Grapher](https://github.com/haidaraM/ansible-playbook-grapher) - is a command line tool
that creates a graph representing your Ansible playbook plays, tasks and roles.
The aim of this project is to have an overview of your playbook. Cd to the folder with
your Ansible project and execute
```
ansible-playbook-grapher --include-role-tasks example.yml -o /home/static-server/example
```
## Ansible Doctor
[Ansible Doctor](https://ansible-doctor.geekdocs.de/) is a simple annotation like documentation generator based on Jinja2 templates.
while ansible-doctor comes with a default template called readme, it is also possible to write your own templates.
The first step is to identify if the given folder is an Ansible role. This check is very simple,
if the folder contains a sub-directory called tasks is MUST be an Ansible role! :)
After the successful check, ansible-doctor will try to read some static files into a dictionary:
- defaults/main.yml
- meta/main.yml
Cd to the folder with your Ansible project and execute
```
ansible-doctor -o /home/static-server/ roles/example_production
```
## Schedule Ansible playbook executions
Ansible-Terraform workspace has 2 tools (Cronicle and ARA) that make it simple and convenient to use Ansible for periodic tasks and jobs. For example,
maintenance jobs for your cloud infrastructure. This is especially handy if you run this workspace on a remote server.
- [**Cronicle**] - allows to schedule tasks and jobs, and lets you observe executions using a nice UI
- [**Ansible Ara**] - tracks all executions of ansible playbooks (manual or scheduled), and has nice UI that provides informationn about every step
of every playbook execution
You can try scheduling an example ansible playbook with Cronicle
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/cronicle-ansible.gif" alt="Htop" width="900">
</p>
**NOTE:** Scheduling Ansible playbooks is especially useful if you [launch Workspace on a remote server](#run-on-remote-server) rather than
on your local laptop.

View File

@ -1,211 +0,0 @@
Example of a compose file that launches Ansible-Terraform workspace behind reverse proxy (Traefik)
with auth middleware annd HTTPS
```
"services":
"traefik":
"command":
- "--entrypoints.DOCS_URL.address=:8020"
- "--entrypoints.FILEBROWSER_URL.address=:8021"
- "--entrypoints.STATICFS_URL.address=:8022"
- "--entrypoints.CRONICLE_URL.address=:8023"
- "--entrypoints.UNGIT_URL.address=:8024"
- "--entrypoints.IDE_URL.address=:8025"
- "--entrypoints.TERMINAL_URL.address=:8026"
- "--entrypoints.MC_URL.address=:8027"
- "--entrypoints.HTOP_URL.address=:8028"
- "--entrypoints.ANSIBLE_ARA.address=:8029"
- "--entrypoints.PORT_8031.address=:8031"
- "--entrypoints.PORT_8032.address=:8032"
- "--entrypoints.PORT_8033.address=:8033"
- "--entrypoints.PORT_8034.address=:8034"
- "--entrypoints.PORT_8035.address=:8035"
- "--providers.docker"
- "--providers.file.directory=/etc/traefik/dynamic_conf"
"container_name": "container_name"
"image": "traefik:v2.4"
"ports":
- "8020-8035:8020-8035"
"volumes":
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./certs:/tools/certs"
- "./config.yml:/etc/traefik/dynamic_conf/conf.yml:ro"
"workspace":
"environment":
"ARA_API_CLIENT": "https"
"ARA_API_SERVER": "http://68.183.69.198:8029"
"WRK_HOST": "68.183.69.198"
"WRK_PROTO": "https"
"image": "alnoda/ansible-terraform-workspace"
"labels":
- "traefik.enable=true"
- "traefik.http.middlewares.httprepl.redirectregex.regex=^http://(.*)"
- "traefik.http.middlewares.httprepl.redirectregex.replacement=https://$${1}"
- "traefik.http.services.DOCS_URLhttp.loadbalancer.server.port=8020"
- "traefik.http.routers.DOCS_URLhttp.service=DOCS_URL"
- "traefik.http.routers.DOCS_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.DOCS_URLhttp.entrypoints=DOCS_URL"
- "traefik.http.routers.DOCS_URLhttp.middlewares=httprepl"
- "traefik.http.services.DOCS_URL.loadbalancer.server.port=8020"
- "traefik.http.routers.DOCS_URL.service=DOCS_URL"
- "traefik.http.routers.DOCS_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.DOCS_URL.entrypoints=DOCS_URL"
- "traefik.http.routers.DOCS_URL.middlewares=basic-auth"
- "traefik.http.routers.DOCS_URL.tls=true"
- "traefik.http.services.FILEBROWSER_URLhttp.loadbalancer.server.port=8021"
- "traefik.http.routers.FILEBROWSER_URLhttp.service=FILEBROWSER_URL"
- "traefik.http.routers.FILEBROWSER_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.FILEBROWSER_URLhttp.entrypoints=FILEBROWSER_URL"
- "traefik.http.routers.FILEBROWSER_URLhttp.middlewares=httprepl"
- "traefik.http.services.FILEBROWSER_URL.loadbalancer.server.port=8021"
- "traefik.http.routers.FILEBROWSER_URL.service=FILEBROWSER_URL"
- "traefik.http.routers.FILEBROWSER_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.FILEBROWSER_URL.entrypoints=FILEBROWSER_URL"
- "traefik.http.routers.FILEBROWSER_URL.middlewares=basic-auth"
- "traefik.http.routers.FILEBROWSER_URL.tls=true"
- "traefik.http.services.STATICFS_URLhttp.loadbalancer.server.port=8022"
- "traefik.http.routers.STATICFS_URLhttp.service=STATICFS_URL"
- "traefik.http.routers.STATICFS_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.STATICFS_URLhttp.entrypoints=STATICFS_URL"
- "traefik.http.routers.STATICFS_URLhttp.middlewares=httprepl"
- "traefik.http.services.STATICFS_URL.loadbalancer.server.port=8022"
- "traefik.http.routers.STATICFS_URL.service=STATICFS_URL"
- "traefik.http.routers.STATICFS_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.STATICFS_URL.entrypoints=STATICFS_URL"
- "traefik.http.routers.STATICFS_URL.middlewares=basic-auth"
- "traefik.http.routers.STATICFS_URL.tls=true"
- "traefik.http.services.CRONICLE_URLhttp.loadbalancer.server.port=8023"
- "traefik.http.routers.CRONICLE_URLhttp.service=CRONICLE_URL"
- "traefik.http.routers.CRONICLE_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.CRONICLE_URLhttp.entrypoints=CRONICLE_URL"
- "traefik.http.routers.CRONICLE_URLhttp.middlewares=httprepl"
- "traefik.http.services.CRONICLE_URL.loadbalancer.server.port=8023"
- "traefik.http.routers.CRONICLE_URL.service=CRONICLE_URL"
- "traefik.http.routers.CRONICLE_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.CRONICLE_URL.entrypoints=CRONICLE_URL"
- "traefik.http.routers.CRONICLE_URL.middlewares=basic-auth"
- "traefik.http.routers.CRONICLE_URL.tls=true"
- "traefik.http.services.UNGIT_URLhttp.loadbalancer.server.port=8024"
- "traefik.http.routers.UNGIT_URLhttp.service=UNGIT_URL"
- "traefik.http.routers.UNGIT_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.UNGIT_URLhttp.entrypoints=UNGIT_URL"
- "traefik.http.routers.UNGIT_URLhttp.middlewares=httprepl"
- "traefik.http.services.UNGIT_URL.loadbalancer.server.port=8024"
- "traefik.http.routers.UNGIT_URL.service=UNGIT_URL"
- "traefik.http.routers.UNGIT_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.UNGIT_URL.entrypoints=UNGIT_URL"
- "traefik.http.routers.UNGIT_URL.middlewares=basic-auth"
- "traefik.http.routers.UNGIT_URL.tls=true"
- "traefik.http.services.IDE_URLhttp.loadbalancer.server.port=8025"
- "traefik.http.routers.IDE_URLhttp.service=IDE_URL"
- "traefik.http.routers.IDE_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.IDE_URLhttp.entrypoints=IDE_URL"
- "traefik.http.routers.IDE_URLhttp.middlewares=httprepl"
- "traefik.http.services.IDE_URL.loadbalancer.server.port=8025"
- "traefik.http.routers.IDE_URL.service=IDE_URL"
- "traefik.http.routers.IDE_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.IDE_URL.entrypoints=IDE_URL"
- "traefik.http.routers.IDE_URL.middlewares=basic-auth"
- "traefik.http.routers.IDE_URL.tls=true"
- "traefik.http.services.TERMINAL_URLhttp.loadbalancer.server.port=8026"
- "traefik.http.routers.TERMINAL_URLhttp.service=TERMINAL_URL"
- "traefik.http.routers.TERMINAL_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.TERMINAL_URLhttp.entrypoints=TERMINAL_URL"
- "traefik.http.routers.TERMINAL_URLhttp.middlewares=httprepl"
- "traefik.http.services.TERMINAL_URL.loadbalancer.server.port=8026"
- "traefik.http.routers.TERMINAL_URL.service=TERMINAL_URL"
- "traefik.http.routers.TERMINAL_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.TERMINAL_URL.entrypoints=TERMINAL_URL"
- "traefik.http.routers.TERMINAL_URL.middlewares=basic-auth"
- "traefik.http.routers.TERMINAL_URL.tls=true"
- "traefik.http.services.MC_URLhttp.loadbalancer.server.port=8027"
- "traefik.http.routers.MC_URLhttp.service=MC_URL"
- "traefik.http.routers.MC_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.MC_URLhttp.entrypoints=MC_URL"
- "traefik.http.routers.MC_URLhttp.middlewares=httprepl"
- "traefik.http.services.MC_URL.loadbalancer.server.port=8027"
- "traefik.http.routers.MC_URL.service=MC_URL"
- "traefik.http.routers.MC_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.MC_URL.entrypoints=MC_URL"
- "traefik.http.routers.MC_URL.middlewares=basic-auth"
- "traefik.http.routers.MC_URL.tls=true"
- "traefik.http.services.HTOP_URLhttp.loadbalancer.server.port=8028"
- "traefik.http.routers.HTOP_URLhttp.service=HTOP_URL"
- "traefik.http.routers.HTOP_URLhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.HTOP_URLhttp.entrypoints=HTOP_URL"
- "traefik.http.routers.HTOP_URLhttp.middlewares=httprepl"
- "traefik.http.services.HTOP_URL.loadbalancer.server.port=8028"
- "traefik.http.routers.HTOP_URL.service=HTOP_URL"
- "traefik.http.routers.HTOP_URL.rule=PathPrefix(`/`)"
- "traefik.http.routers.HTOP_URL.entrypoints=HTOP_URL"
- "traefik.http.routers.HTOP_URL.middlewares=basic-auth"
- "traefik.http.routers.HTOP_URL.tls=true"
- "traefik.http.services.ANSIBLE_ARAhttp.loadbalancer.server.port=8029"
- "traefik.http.routers.ANSIBLE_ARAhttp.service=ANSIBLE_ARA"
- "traefik.http.routers.ANSIBLE_ARAhttp.rule=PathPrefix(`/`)"
- "traefik.http.routers.ANSIBLE_ARAhttp.entrypoints=ANSIBLE_ARA"
- "traefik.http.routers.ANSIBLE_ARAhttp.middlewares=httprepl"
- "traefik.http.services.ANSIBLE_ARA.loadbalancer.server.port=8029"
- "traefik.http.routers.ANSIBLE_ARA.service=ANSIBLE_ARA"
- "traefik.http.routers.ANSIBLE_ARA.rule=PathPrefix(`/`)"
- "traefik.http.routers.ANSIBLE_ARA.entrypoints=ANSIBLE_ARA"
- "traefik.http.routers.ANSIBLE_ARA.middlewares=basic-auth"
- "traefik.http.routers.ANSIBLE_ARA.tls=true"
- "traefik.http.services.PORT_8031http.loadbalancer.server.port=8031"
- "traefik.http.routers.PORT_8031http.service=PORT_8031"
- "traefik.http.routers.PORT_8031http.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8031http.entrypoints=PORT_8031"
- "traefik.http.routers.PORT_8031http.middlewares=httprepl"
- "traefik.http.services.PORT_8031.loadbalancer.server.port=8031"
- "traefik.http.routers.PORT_8031.service=PORT_8031"
- "traefik.http.routers.PORT_8031.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8031.entrypoints=PORT_8031"
- "traefik.http.routers.PORT_8031.middlewares=basic-auth"
- "traefik.http.routers.PORT_8031.tls=true"
- "traefik.http.services.PORT_8032http.loadbalancer.server.port=8032"
- "traefik.http.routers.PORT_8032http.service=PORT_8032"
- "traefik.http.routers.PORT_8032http.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8032http.entrypoints=PORT_8032"
- "traefik.http.routers.PORT_8032http.middlewares=httprepl"
- "traefik.http.services.PORT_8032.loadbalancer.server.port=8032"
- "traefik.http.routers.PORT_8032.service=PORT_8032"
- "traefik.http.routers.PORT_8032.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8032.entrypoints=PORT_8032"
- "traefik.http.routers.PORT_8032.middlewares=basic-auth"
- "traefik.http.routers.PORT_8032.tls=true"
- "traefik.http.services.PORT_8033http.loadbalancer.server.port=8033"
- "traefik.http.routers.PORT_8033http.service=PORT_8033"
- "traefik.http.routers.PORT_8033http.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8033http.entrypoints=PORT_8033"
- "traefik.http.routers.PORT_8033http.middlewares=httprepl"
- "traefik.http.services.PORT_8033.loadbalancer.server.port=8033"
- "traefik.http.routers.PORT_8033.service=PORT_8033"
- "traefik.http.routers.PORT_8033.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8033.entrypoints=PORT_8033"
- "traefik.http.routers.PORT_8033.middlewares=basic-auth"
- "traefik.http.routers.PORT_8033.tls=true"
- "traefik.http.services.PORT_8034http.loadbalancer.server.port=8034"
- "traefik.http.routers.PORT_8034http.service=PORT_8034"
- "traefik.http.routers.PORT_8034http.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8034http.entrypoints=PORT_8034"
- "traefik.http.routers.PORT_8034http.middlewares=httprepl"
- "traefik.http.services.PORT_8034.loadbalancer.server.port=8034"
- "traefik.http.routers.PORT_8034.service=PORT_8034"
- "traefik.http.routers.PORT_8034.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8034.entrypoints=PORT_8034"
- "traefik.http.routers.PORT_8034.middlewares=basic-auth"
- "traefik.http.routers.PORT_8034.tls=true"
- "traefik.http.services.PORT_8035http.loadbalancer.server.port=8035"
- "traefik.http.routers.PORT_8035http.service=PORT_8035"
- "traefik.http.routers.PORT_8035http.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8035http.entrypoints=PORT_8035"
- "traefik.http.routers.PORT_8035http.middlewares=httprepl"
- "traefik.http.services.PORT_8035.loadbalancer.server.port=8035"
- "traefik.http.routers.PORT_8035.service=PORT_8035"
- "traefik.http.routers.PORT_8035.rule=PathPrefix(`/`)"
- "traefik.http.routers.PORT_8035.entrypoints=PORT_8035"
- "traefik.http.routers.PORT_8035.middlewares=basic-auth"
- "traefik.http.routers.PORT_8035.tls=true"
- "traefik.http.middlewares.basic-auth.basicauth.users=user1:$$2y$$05$$wY.IxQKqBVqpGsMxB9qwUe7rxBx2SSBetaZlHK6DNvNJo1lz8QiU."
"version": "3.3"
```

View File

@ -1,13 +0,0 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
hooks:
- id: terraform_fmt
- id: terraform_docs
- id: terraform_validate
- id: terraform_docs_without_aggregate_type_defaults
- id: terraform_docs_replace
- id: terraform_tflint
- id: terraform_tfsec
- id: checkov
- id: terrascan

View File

@ -1,33 +0,0 @@
# Create Server in Scaleway with Terraform
## Prepare workspace
Set your credentials as environment variable in your workspace.
Add the following lines to /home/abc/.zshrc:
```
export SCW_DEFAULT_PROJECT_ID=<YOUR_PROJECT_ID>
export SCW_ACCESS_KEY=<YOUR_ACCESS_KEY>
export SCW_SECRET_KEY=<YOUR_SECRET_KEY>
```
## Terraform
- Initialize terraform project
```
terraform init
```
- Show Terraform plan
```
terraform plan
```
- Apply to create new ifrastructure
```
terraform apply
```
- Destroy infrastructure completely
```
terraform destroy
```

View File

@ -1,50 +0,0 @@
terraform {
required_providers {
scaleway = {
source = "scaleway/scaleway"
}
}
required_version = ">= 0.13"
}
provider "scaleway" {
zone = "fr-par-1"
}
resource "scaleway_instance_ip" "public_ip" {}
resource "scaleway_instance_server" "web" {
type = "DEV1-S"
image = "ubuntu_focal"
ip_id = scaleway_instance_ip.public_ip.id
security_group_id = scaleway_instance_security_group.web.id
root_volume {
delete_on_termination = false
}
additional_volume_ids = [ scaleway_instance_volume.data.id ]
}
resource "scaleway_instance_security_group" "web" {
name = "http"
description = "allow HTTP and HTTPS traffic"
inbound_rule {
action = "accept"
port = 80
ip_range = "0.0.0.0/0"
protocol = "TCP"
}
inbound_rule {
action = "accept"
port = 443
ip_range = "0.0.0.0/0"
protocol = "TCP"
}
}
resource "scaleway_instance_volume" "data" {
size_in_gb = 100
type = "b_ssd"
}

View File

@ -1,76 +0,0 @@
# Terraform tools
### Pre-commit hook
### [Blast-Radius](https://github.com/28mm/blast-radius)
Serves folder `/home/terraform`
In order to serve another terraform folder, for example `/home/project/my-terraform`
```
blast-radius --serve --port 8030 /home/project/my-terraform
```
### [Terraform Visual](https://github.com/hieven/terraform-visual)
- Generate Terraform plan in json
```
terraform plan -out=plan.out # Run plan and output as a file
terraform show -json plan.out > plan.json # Read plan file and output it in JSON format
```
- Generate Terraform-visual report
```
terraform-visual --plan plan.json
```
### [Terraform Graph](https://www.terraform.io/docs/cli/commands/graph.html)
- Create report
```
terraform graph | dot -Tsvg > graph.svg
```
### [Inframap](https://github.com/cycloidio/inframap)
- Visualize terraform state
```
inframap generate terraform.tfstate | dot -Tpng > graph.png
```
### [Rover](https://github.com/im2nguyen/rover)
- serve terraform visualisation
```
rover --workingDir /home/terraform
```
NOTE: Rover serves only on port 9000
UPDATE: made fork and configured to serve on any port
ISSUES: does not work, no resources displayed
In order to add Rover to the Workspace:
- Include in Dockerfile
```
cd /tmp && curl -Lo ./terraform-rover.zip https://github.com/bluxmit/rover/releases/download/v1.6-cust/w1.7.zip \
&& unzip /tmp/terraform-rover.zip -d /tmp/rover && rm terraform-rover.zip \
&& chmod +x /tmp/rover/rover \
&& mv /tmp/rover/rover /usr/bin/rover \
&& rm -rf /tmp/rover \
```
- Include in supervisord-infra.conf
```
[program:rover]
directory=/home/terraform
command=/bin/sh -c " rover --workingDir /home/terraform --port 8031 "
```
## Tutorials
- [Deploy Cloud Instances with Packer and Terraform](https://www.scaleway.com/en/docs/deploy-cloud-servers-with-packer-and-terraform/)

View File

@ -1,165 +0,0 @@
# Terraform
[Terraform](https://www.terraform.io/) is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.
Ansible-Terraform workspace contains a small example Terraform project that creates a server on the Scaleway cloud
```
cd /home/examples/terraform-scaleway/ && terraform init
```
If you want to try, set your Scaleway credentials as environment variable in your workspace.
Add the following lines to /home/abc/.zshrc:
```
export SCW_DEFAULT_PROJECT_ID=<YOUR_PROJECT_ID>
export SCW_ACCESS_KEY=<YOUR_ACCESS_KEY>
export SCW_SECRET_KEY=<YOUR_SECRET_KEY>
```
Restart terminal, and execute
```
cd /home/examples/terraform-scaleway/ && terraform plan
```
Create Scaleway infrastructure with
```
cd /home/examples/terraform-scaleway/ && terraform apply
```
## Terraform report
A small tool that produces several outputs from a terraform project and visualizes terraform plan as an interactive HTML page.
Terraform report can be generated from the small example terraform project, included in the Workspace
```
cd /home/examples/terraform-scaleway/
terraform-report
```
Terraform-report outputs artefacts to the folder `/home/static-server/terraform-reports/`. This folder is served by the Static File Server that you
can use to view the artifacts, that include interactive HTML pages
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/terraform-report-scaleway.gif" alt="Htop" width="750">
</p>
**Example with AWS**
If you want to try Terraform report with your own AWS account, open workspace and configure AWS profile -
create [file with AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
```
mkdir -p ~/.aws
nano ~/.aws/credentials
```
The file `~/.aws/credentials` would look like this
```
[terraform]
aws_access_key_id = <YOUR_AWS_KEY>
aws_secret_access_key = <YOUR_AWS_SECRET>
```
Clone your terraform project to the workspace, or if you don't have any, you can use this terraform example repository:
```
git clone https://github.com/pvarentsov/terraform-aws-free-tier /home/project/aws-example
```
Open file `/home/project/aws-example/src/free-tier/main.tf` and comment out the part that configures S3 backend
```
terraform {
backend "s3" {}
}
```
Initialize a working Terraform directory
```
cd /home/project/aws-example/src/free-tier && terraform init
```
Paste public ssh key (for the sake of example you can type anything)
```
nano ./provision/access/free-tier-ec2-key.pub
```
Now you can generate terraform report
```
terraform-report
```
Use Static File Server to review the report
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/terraform-report.gif" alt="Htop" width="900">
</p>
## Terraform Rover
[Rover](https://github.com/im2nguyen/rover) - is an awesome Terraform visualizer with browser-based UI. Rover helps to better understand
Terraform state and planned changes. To see how Rover works, you can use a basic Terraform example in folder */home/examples/terraform-scaleway/*.
Initialize Terraform project first
```
cd /home/examples/terraform-scaleway/ && terraform init
```
and start Rover to visualize terraform state
```
rover --workingDir /home/examples/terraform-scaleway/
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/rover-scaleway.gif" alt="rover-scaleway" width="900">
</p>
If you have followed hands-on the tutorial from the previous section (terraform report from the terraform-aws-free-tier repo), you
can visualize it with Rover:
```
rover --workingDir /home/project/aws-example/src/free-tier
```
Go to the quickstart page, and open Rover WEB UI
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/rover-aws.gif" alt="rover-aws" width="900">
</p>
## Blast Radius
[Blast Radius](https://github.com/28mm/blast-radius) is a tool for reasoning about Terraform dependency graphs with interactive visualizations.
You can try Blast Radius - launch workspace and visualize an example Terraform project.
```
cd /home/examples/terraform-scaleway && terraform init
blast-radius --serve --port 8030
```
Go to the quickstart page, and open Blast Radius WEB UI
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ansible-terraform-workspace/img/blast-radius.gif" alt="Htop" width="900">
</p>
***NOTE:** Blast Radius is a great project, but there is lack of updates to the project recently, and it might not work
with some Terraform providers.*
### [Terraform Inframap](https://github.com/cycloidio/inframap)
- Visualize terraform state
```
inframap generate terraform.tfstate | dot -Tpng > graph.png
```

View File

@ -1,20 +0,0 @@
# Potential Future improvements
### [Glances](https://github.com/nicolargo/glances)
Glances is a cross-platform monitoring tool which aims to present a large amount of monitoring information through a curses or Web based interface. The information dynamically adapts depending on the size of the user interface.
**NOTE:** Great tool, lots of additional metrics. But adds more CPU overhead - around 2% compared to 0.7% of HTOP
- Install
```
pip install bottle
pip install glances
```
- Launch
```
glances -p 8030 -w
```

View File

@ -1,91 +0,0 @@
# Getting started
## About
This workspace has browser-based full-screen terminal, file manager, and task scheduler.
You can upload and dowload files and schedule periodic executios of scripts and jobs.
Workspace is based on the Ubuntu 20 docker image, with common CLI applications, such as Git, Vim, Nano and curl installed.
## Quicklaunch
From the quicklaunch page you can open workspace tools, such as filebrowser or terminal
## Terminal
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Scheduler
Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/cronicle.gif" alt="Cronicle" width="750">
</p>
## Install applications
Open workspace terminal to install new applications.
Simply execute `apt install` with `sudo`.
For example, install emacs
```sh
sudo apt-get install emacs
```
If you want to install PHP, execute
```sh
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.1
```
## Python
Python and Pip are installed. Execute `python3` in terminal.
To install python packages use PIP
```
pip install pandas
```
## Node.js
Use Nodeenv to create Node.js environments.
For example, open workspace terminal, create folder npmgui, and activate environment with node v.12.18.3 and npm v.6.0.0
```
cd /home
mkdir npmgui; cd npmgui
nodeenv --node=12.18.3 --npm=6.0.0 env
```
Let's install package and start node application, explicitly on port 8040
```
. env/bin/activate && npm i -g npm-gui
npm-gui 0.0.0.0:8040
```
In the Quicklaunch go to the tab 'My apps' and open app on the port 8040.
> **NOTE:** If you close terminal, the application will stop. If you want application to keep running after workspace terminal is closed
start it with **"&!"** at the end.
## Keep services runnning
Any application started in the terminal will run as long as your terminal session is alive.
If you want any application or service runing after terminal session is closed, start service with **"&!"** at the end of
the command.
For example, to start *npm-gui* and keep it running after terminal is closed, run
```
npm-gui 0.0.0.0:8040 &!
```

View File

@ -1,49 +0,0 @@
# Get started
This tutorial shows how to scrap Google news on schedule. We use Python for the demonstration purpose.
To start, open workspace terminal and install Python package GNews
```
pip install gnews
```
Create python script
```
nano scraper.py
```
Paste the following code snippet. This is scrapper, that will output results to a file
```py
from gnews import GNews
import json
google_news = GNews()
usa_news = google_news.get_news('USA')
with open('usa_news.json', 'w') as f:
json.dump(usa_news, f)
```
Save the file with `Ctrl+s` and return to the terminal with `Ctrl+x`.
Execute the script
```
python3 scraper.py
```
Navigate to Quickstart and Open file browser. View and download the output file
<p align="center">
<img src="https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/base-workspace/img/filebrowser-demo.gif?raw=true" alt="Filebrowser" width="750">
</p>
Schedule daily executions with Cronicle
<p align="center">
<img src="https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/base-workspace/img/cronicle-demo.gif?raw=true" alt="Filebrowser" width="750">
</p>

View File

@ -1,109 +0,0 @@
# Getting started
## About
This workspace has browser-based VS-Code version, full-screen terminal, file manager, and task scheduler.
You can code, upload and dowload files and schedule periodic executios of scripts and jobs.
Workspace is based on the Ubuntu 20 docker image, with common CLI applications, such as Git, Vim, Nano and curl installed.
## Quicklaunch
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
## Code Editor
Code editor is a browser-based open-source Visual Studio Code. It is fast, responsive, and full-featured. It features code highlighting,
autocompletion, a great number of pre-installed color themes. You can install any extension
from [open-vsx.org](https://open-vsx.org/) that has hundreeds of extensions for VS Code compatible editors.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
## Terminal
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Scheduler
Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/cronicle.gif" alt="Cronicle" width="750">
</p>
## Install applications
Open workspace terminal to install new applications.
Simply execute `apt install` with `sudo`.
For example, install emacs
```sh
sudo apt-get install emacs
```
If you want to install PHP, execute
```sh
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.1
```
## Python
Python and Pip are installed. Execute `python3` in terminal.
To install python packages use PIP
```
pip install pandas
```
## Node.js
Use Nodeenv to create Node.js environments.
For example, open workspace terminal, create folder npmgui, and activate environment with node v.12.18.3 and npm v.6.0.0
```
cd /home
mkdir npmgui; cd npmgui
nodeenv --node=12.18.3 --npm=6.0.0 env
```
Let's install package and start node application, explicitly on port 8040
```
. env/bin/activate && npm i -g npm-gui
npm-gui 0.0.0.0:8040
```
In the Quicklaunch go to the tab 'My apps' and open app on the port 8040.
> **NOTE:** If you close terminal, the application will stop. If you want application to keep running after workspace terminal is closed
start it with **"&!"** at the end.
## Keep services runnning
Any application started in the terminal will run as long as your terminal session is alive.
If you want any application or service runing after terminal session is closed, start service with **"&!"** at the end of
the command.
For example, to start *npm-gui* and keep it running after terminal is closed, run
```
npm-gui 0.0.0.0:8040 &!
```

View File

@ -1,153 +0,0 @@
# Elasticsearch workspace
This tutorial demonstrates how to use Elasticsearch workspace to explore cluster and export index to S3.
## Tutorial
Create `docker-compose.yaml` file to launch locally 3-node Elasticsearch cluster with Kibana
```yaml
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3
container_name: es02
environment:
- node.name=es02
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01,es03
- cluster.initial_master_nodes=es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data02:/usr/share/elasticsearch/data
networks:
- elastic
es03:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3
container_name: es03
environment:
- node.name=es03
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01,es02
- cluster.initial_master_nodes=es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data03:/usr/share/elasticsearch/data
networks:
- elastic
kib01:
image: docker.elastic.co/kibana/kibana:7.16.3
container_name: kib01
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://es01:9200
ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200"]'
networks:
- elastic
workspace:
image: alnoda/elasticsearch-workspace
container_name: workspace
ports:
- 8020-8030:8020-8030
networks:
- elastic
volumes:
data01:
driver: local
data02:
driver: local
data03:
driver: local
networks:
elastic:
driver: bridge
```
and start it with `docker-compose up`
Wait untill the cluster is fully ready, open Kibana on [http://localhost:5601](/http://localhost:5601/) and import sample datasets.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/elasticsearch-workspace/img/Kibana-sample.png" alt="Kibana" width="750">
</p>
Open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the workspace tools
<p align="center">
<img src="https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/ide-workspace/img/wid-ui.png?raw=true" alt="WID demo" width="900">
</p>
Open browser-based terminal [localhost:8026](http://localhost:8026/), check cluster nodes and shards
```
vulcanizer --host es01 nodes
vulcanizer --host es01 shards
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/elasticsearch-workspace/img/vulcanizer-demo.png" alt="vulcanizer" width="750">
</p>
Use elasticdump to export index `kibana_sample_data_ecommerce` (from eCommerce sample dataset) to S3
```
elasticdump \
--s3AccessKeyId "${access_key_id}" \
--s3SecretAccessKey "${access_key_secret}" \
--input=http://es01:9200/kibana_sample_data_ecommerce \
--output "s3://${bucket_name}/kibana_sample_data_ecommerce.json"
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/elasticsearch-workspace/img/elasticdump-demo.png" alt="elasticdump" width="750">
</p>
Open browser-based IDE [localhost:8026](http://localhost:8026/) and create file `/home/project/export.sh` file with the script to export data to S3.
Make it executable with `chmod +x /home/project/export.sh`.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/elasticsearch-workspace/img/IDE-demo.png" alt="IDE" width="750">
</p>
Open browser-based Scheduler [localhost:8026](http://localhost:8026/) (user/pass: admin/admin),
and schedule script, for example weekly. Select category - "general", plugin - "Shell Script"
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/elasticsearch-workspace/img/Cronicle-demo.png" alt="Cronicle" width="750">
</p>

View File

@ -1,148 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Example: hello world
Check Go version
```
go version
```
Create new Go project
```
mkdir myProject/
cd myProject
go mod init myProject
```
Create file `main.go`
```
package main
import "fmt"
func main() {
fmt.Println("Hello Go")
}
```
Then test it using the go run command
```
go run main.go
```
## Dependencies
Go Modules - Gos dependency management system that makes dependency version information explicit and easier to manage.
Create new Go project
```
mkdir simpleserver/
cd simpleserver
go mod init simpleserver
```
Adding a remote module as a dependency manually:
```
go get github.com/spf13/cobra@latest
```
Check `go.mod` file
```
cat go.mod
```
Create file `main.go`
```
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
r.Run()
}
```
To add module requirements and sums execute
```
go mod tidy
```
## Run, build and install
- `go run` - to quickly test your go code and to check the output. But internally it compiles your code and builds an executable binary in a temporary location, launches that temp exe-file and finally cleans it when your app exits.
- `go build` - compile and builds executable in current directory.
- `go build` - will compile and move the executable to executable directory included in $PATH, so that you can run this executable from any path on the terminal.
Run the simple server with
```
export PORT=8030
go run main.go
```
Open in browser [localhost:8030/ping](http://localhost:8030/ping)
Build executable locally
```
go build
```
This will create an executable `simpleserver` in the same folder.
Build and move to executable folder
```
go install
```
Now you can execute anywhere in terminal
```
export PORT=8030
simpleserver
```
and the server will start

View File

@ -1,115 +0,0 @@
# Getting started
## About
This workspace has browser-based VS-Code version, full-screen terminal, file manager, and task scheduler.
You can code, upload and dowload files and schedule periodic executios of scripts and jobs.
Workspace is based on the Ubuntu 20 docker image, with common CLI applications, such as Git, Vim, Nano and curl installed.
## Quicklaunch
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
## Code Editor
Code editor is a browser-based open-source Visual Studio Code. It is fast, responsive, and full-featured. It features code highlighting,
autocompletion, rendering of notebooks has a tree-based file browser, and a great number of pre-installed color themes.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/theia-themes.png" alt="theia-themes.png" width="750">
</p>
You can install any extension from [open-vsx.org](https://open-vsx.org/) that has hundreeds of extensions for VS Code compatible editors.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/theia.gif" alt="Theia demo" width="750">
</p>
## Terminal
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Scheduler
Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/cronicle.gif" alt="Cronicle" width="750">
</p>
## Install applications
Open workspace terminal to install new applications.
Simply execute `apt install` with `sudo`.
For example, install emacs
```sh
sudo apt-get install emacs
```
If you want to install PHP, execute
```sh
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.1
```
## Python
Python and Pip are installed. Execute `python3` in terminal.
To install python packages use PIP
```
pip install pandas
```
## Node.js
Use Nodeenv to create Node.js environments.
For example, open workspace terminal, create folder npmgui, and activate environment with node v.12.18.3 and npm v.6.0.0
```
cd /home
mkdir npmgui; cd npmgui
nodeenv --node=12.18.3 --npm=6.0.0 env
```
Let's install package and start node application, explicitly on port 8040
```
. env/bin/activate && npm i -g npm-gui
npm-gui 0.0.0.0:8040
```
In the Quicklaunch go to the tab 'My apps' and open app on the port 8040.
> **NOTE:** If you close terminal, the application will stop. If you want application to keep running after workspace terminal is closed
start it with **"&!"** at the end.
## Keep services runnning
Any application started in the terminal will run as long as your terminal session is alive.
If you want any application or service runing after terminal session is closed, start service with **"&!"** at the end of
the command.
For example, to start *npm-gui* and keep it running after terminal is closed, run
```
npm-gui 0.0.0.0:8040 &!
```

View File

@ -1,130 +0,0 @@
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Example
```
java -version
```
Open IDE and create file `Main.java` with the following content
```
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
```
Use terminal to compile and execute
```
cd /home/project
javac Main.java
java Main
```
## Maven
Maven helps with:
- Making the build process easy
- Providing a uniform build system
- Providing quality project information
- Encouraging better development practices
Check Maven version in terminal
```
mvn -v
```
Build Java code
```
cp -r /home/abc/example /home/project/example
cd /home/project/example
mvn compile
```
This will run Maven, telling it to execute the compile goal. When its finished, you should find the compiled .class files in the target/classes directory.
Run the package goal
```
mvn package
```
To execute the JAR file run
```
java -jar target/gs-maven-0.1.0.jar
```
*(taken from https://spring.io/guides/gs/maven/)*
# Gradle
Copy example project
```
cp -r /home/abc/example /home/project/example
cd /home/project/example
```
Check Gradle installation, run Gradle from the command-line
```
cd /home/project/example
gradle
```
Initialize Gradle
```
gradle init
```
Now that Gradle is installed, see what it can do
```
gradle tasks
```
Build project with Gradle
```
gradle build
```

View File

@ -1,147 +0,0 @@
# Getting started
## Intro
This tutorial demonstrates how to use Kafka workspace to explore and interact with Kafka.
Singl-node Kafka cluster is running within the workspace, but all the tools can be used with the external Kafka clusters.
To start, open workspace UI [http://localhost:8020/](http://localhost:8020/) for quick access to all the tools
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/kafka-workspace/img/Kafka-wid.png" alt="Kafka WID" width="750">
</p>
Open browser-based VS-code editor from the workspace UI, or go directly to [http://localhost:8025/](http://localhost:8025/), and connect
to the local Kafka cluster using VS-code Kafka extension. You only need to provide the name for the cluster, which can be any.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/kafka-workspace/img/theia-connect-kafka.png" alt="Theia connect WID" width="750">
</p>
Using VS-code Kafka extension create topic "quickstart-events", and cosume events from this topic directly in VS-code using Kafka extension
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/kafka-workspace/img/theia-kafka-consume.png" alt="Theia Kafka consume" width="750">
</p>
### Kafka native tools
Kafka distribution itself contains command line tools that allow to create topics, send and consume events, etc.
Open workspace terminal [http://localhost:8026/](http://localhost:8026/) and go to Kafka directory
```
cd /opt/kafka
```
- create topic
```
bin/kafka-topics.sh --create --partitions 1 --replication-factor 1 --topic quickstart-events --bootstrap-server localhost:9092
```
- send some messages
```
bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092
```
- consume messages
```
bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/kafka-workspace/img/send-msg.png" alt="Send message" width="500">
</p>
### [kt](https://github.com/fgeller/kt)
Kafka tool that likes JSON.
Configure brokers, topic, Kafka version and authentication via environment variables KT_BROKERS, KT_TOPIC, KT_KAFKA_VERSION and KT_AUTH.
- Set topic to "quickstart-events" (local Kafka instance by default)
```
export KT_TOPIC="quickstart-events"
```
- Get information about topics, brockers and consumer groups
```
kt topic
kt group
```
- consume messages
```
kt consume
```
- produce messages
```
echo 'Bob wins Oscar' | kt produce -topic quickstart-events -literal
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/kafka-workspace/img/kt-demo.png" alt="KT demo" width="350">
</p>
### [kafkactl](https://github.com/deviceinsight/kafkactl)
A command-line interface for interaction with Apache Kafka.
- Consume from topic "quickstart-events"
```
kafkactl consume quickstart-events --from-beginning
kafkactl consume quickstart-events --from-beginning --print-keys --print-timestamps -o yaml
```
### [kcat](https://github.com/edenhill/kcat)
Generic non-JVM producer and consumer for Apache Kafka.
- Consume topic "quickstart-events"
```
kafkacat -b localhost -t quickstart-events
```
- Produce events to the topic
```
echo "Hello World" | kafkacat -b localhost -t quickstart-events
```
### [kcli](https://github.com/cswank/kcli)
Kafka read only command line browser
Launch kcli in the Workspace terminal
```
kcli
```
### [trubka](https://github.com/xitonix/trubka)
Kafka CLI tool built in Go which gives you everything you need.
- Consume from the topic "quickstart-events"
```
trubka consume plain quickstart-events --brokers localhost:9092
```
- Produce message to the topic
```
trubka produce plain quickstart-events "Random Data" --brokers localhost:9092
```

View File

@ -1,128 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The code editor in this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Node.js
Check Node.js and npm versions
```
node -v
npm -v
```
## NVM
NOTE: nvm does not work from the Codeserver embedded terminal.
Use another version of Node.js
```
nvm install 16.0.0
nvm use 16.0.0
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/nodejs-workspace/img/nvm.png" alt="nvm.png" width="500">
</p>
## NPM
Check npm version
```
npm -v
```
Install latest version of npm
```
npm install -g npm@latest
```
## Yarn
[Yarn](https://yarnpkg.com/) is a package manager for Node. js that focuses on speed, security, and consistency.
It was originally created to address some issues with the popular NPM package manager.
```
npm install --global yarn
yarn --version
```
## Nodeenv
Node.js virtual environment - a tool to create isolated node.js environments.
It creates an environment that has its own installation directories, that doesnt share libraries with other node.js virtual environments.
Create folder and vrtual ennvironment in it
```
mkdir /home/project/venv-test
cd /home/project/venv-test
nodeenv --node=12.18.3 env && . env/bin/activate
```
Check Nnode.js version
```
node -v
npm -v
```
## Simple example
Clone example project
```
cd /home/project
git clone https://github.com/contentful/the-example-app.nodejs.git
cd the-example-app.nodejs
```
Install the dependencies
```
npm install
```
Start app
```
export PORT=8030
npm run start:dev
```
Open browser on [localhost:8030](http://localhost:8030/)

View File

@ -1,90 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Hello World
Check PHP version
```
php -v
```
Open IDE and create file `hello.php` with the following content
```
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
```
Start server in terminal
```
cd /home/project
php -S 127.0.0.1:8030
```
Open [localhost:8030/hello.php](http://localhost:8030/hello.php) in browser
## Website example
Clone GitHub repo with a PHP website, for example
```
git clone https://github.com/banago/simple-php-website.git
```
Server with PHP development server
```
cd simple-php-website
php -S 0.0.0.0:8030
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/php-workspace/img/serve-website.png" alt="serve-website" width="500">
</p>
# Composer
Install package with Composer
```
composer require phpunit/php-timer
```

View File

@ -1,17 +0,0 @@
__Potential candidates__
- [sqlpipe](https://sqlpipe.com/about/). Looks great. Haven't tried yet.
- [dbmate](https://github.com/amacneil/dbmate)
- [pg_back](https://github.com/orgrim/pg_back)
- [trdsql](https://github.com/noborus/trdsql#PostgreSQL)
- [eralchemy](https://github.com/Alexis-benoist/eralchemy). Functionality already available in schemaspy. Can be useful for custom doc preparation.
- [datasette](https://github.com/simonw/datasette). Nice, but does not really fit the purpose of the workspace. Pgclimb can generate HTML.
- [rclone gui](https://rclone.org/gui/). Nice, but is not really needed. Problems with removing basic auth
- [OctoSQL](https://github.com/cube2222/octosql). Nice, but has limitations: only Postgres public schema can be queried; does not allow uppercase in table names; lack of flexibility parsing csv
- [nancy](https://gitlab.com/postgres-ai/nancy). Lack of maintenance recently.
- [azimutt](https://github.com/azimuttapp/azimutt). Lack of maturity.
- [planter](https://github.com/achiku/planter).
- [pgsh](https://github.com/sastraxi/pgsh). Lack of documentation.
- [dbvisualizer](https://github.com/eska-muc/dbvisualizer). Functionality is already covered in schemaspy.
- [er-diagram-endpoint](https://github.com/kedziorski/er-diagram-endpoint). Lack of recent updates.
- [pgdiff](https://github.com/joncrlsn/pgdiff). Pgdiff compares the schema between two PostgreSQL 9 databases. NNice, but last release is in 2017. Also, Migra covers the same functionality.

View File

@ -1,639 +0,0 @@
# Getting started
## Intro
These tutorials demonstrates how to use Postgres workspace to explore and interact with Postgres.
To start, open Quickstart page [http://localhost:8020/](http://localhost:8020/) for quick access to all the tools.
Use terminal to execute commands from this tutorial.
## Postgres
The workspace includes Postgres 14 up and running. You can use it to experiment and try things before trying on the application database.
Connection parameters: host - _localhost_, user - _abc_ (no password), database - _abc_.
You can load sample database to check out the workspace features and applications. For example, load "usda" database
```
git clone https://github.com/morenoh149/postgresDBSamples /home/pg_dbs
cd /home/pg_dbs/usda-r18-1.0
createdb usda
psql -f usda.sql usda
#Explore data
pgcli usda
SELECT * FROM data_src
```
load Chinook database
```
cd /home/pg_dbs/chinook-1.4
createdb -E UTF8 chinook
psql -f Chinook_PostgreSql_utf8.sql -d chinook
# Explore data
pgcli chinook
SELECT * FROM "Track"
```
load Adventureworks database
```
cd /home/pg_dbs/adventureworks/
unzip data.zip # this will unzip all csv to the current directory
psql -c "CREATE DATABASE \"adventureworks\";"
psql -d adventureworks < install.sql
# Explore data
pgcli adventureworks
SELECT * FROM sales.salesorderdetail
```
Further examples will use this local Postgres instance, but can easily applied to another Postgres database.
# VS-code & plugins
[Apache Theia](https://theia-ide.org/), a browser-based version of the VS-code, is part of the workspace. It has
extensions to query Postgres
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/Theia connect.png" alt="Theia connect" width="750">
</p>
If you loaded sample databases to the local Postgres, connect & explore data directly in the IDE
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/Theia explore data.png" alt="Theia explore" width="750">
</p>
## Postgres CLI tools
Querying from command line can be awesome!
### psql
[psql](https://www.postgresql.org/docs/14/app-psql.html) is a PostgreSQL interactive terminal
```
# connect to local Postgres
psql
# connect to database chinook (local Postgres)
psql chinook
# general psql connection pattern
psql postgresql://dbmaster:5432/mydb
# with password prompt
psql -U postgres -W postgresql://my-postgres-host:5432/mydb
$ without password prompt
PGPASSWORD=xxxxxxxxxxx psql -U postgres postgresql://my-postgres-host:5432/mydb
```
### pgcli
[pgcli](https://www.pgcli.com/) - is a postgres client that does auto-completion and syntax highlighting.
```
# pgcli to the local Postgres
pgcli
# connect to database usda (local Postgres)
pgcli usda
# pgcli to the remote Postgres
pgcli -h my-postgres-host -p 5432 -U postgres -W -d mydb
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/pgcli.png" alt="pgcli" width="750">
</p>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/pspg.png" alt="pspg" width="750">
</p>
### pspg
[Pspg](https://github.com/okbob/pspg) is a unix pager (with very rich functionality) designed for work with tables.
Pspg is enabled by default, and will automatically applied to psql and pgcli if the result of SELECT statement is large.
You can disable pspg by deleting the (last) line _PAGER='pspg -s 4 --interactive --no-mouse'_ from file /home/abc/.zshrc.
(or you can modify configuration).
## Performance and load testing
Monitor live activity, collect and analyse metrics, perform load tests.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/pgmetrics.png" alt="pgmetrics" width="500">
</p>
### pgmetrics
[pgmetrics](https://pgmetrics.io/) is an open-source, zero-dependency, single-binary tool that can collect 350+ metrics from a running PostgreSQL
server and display it in easy-to-read text format or export it as JSON and CSV for scripting.
```
# Try on local Postgres database "usda" (upon password prompt just hit Enter)
pgmetrics --no-pager -h localhost -U abc usda
# Remote Postgres
pgmetrics --no-pager -h my-postgres-host -p 5432 -U postgres mydb
```
_Hint:_ Output to txt file `pgmetrics -h localhost -U abc usda >> /home/static-server/pgmetrics-usda.txt` and open static server [http://localhost:8022](http://localhost:8022)
### pgCenter
[pgCenter](https://github.com/lesovsky/pgcenter) is a command-line admin tool for observing and troubleshooting Postgres.
```
# for local Postgres
pgcenter top -h localhost -p 5432 -U abc -d usda
# for remote Postgres (password prompt)
pgcenter top -h my-postgres-host -p 5432 -U postgres -d mydb
# for remote Postgres (no password prompt)
PGPASSWORD=xxxxxxxxxxx pgcenter top -h my-postgres-host -p 5432 -U postgres -d mydb
```
### pgbench
[pgbench](https://www.postgresql.org/docs/devel/pgbench.html) is a simple program for running benchmark tests on PostgreSQL.
```
# initialize
pgbench -h localhost -U abc -i -s 50 abc
# test
pgbench -h localhost -U abc -c 10 -j 2 -t 10000 abc
```
Example use on remote Postgres:
```
# initialize
pgbench -h my-postgres-host -U postgres -i -s 50 mydb
# test
pgbench -h my-postgres-host -U postgres -c 10 -j 2 -t 10000 mydb
```
__Learn more:__
- [Pgbench tutorial](https://www.cloudbees.com/blog/tuning-postgresql-with-pgbench).
## Backups and restore
Create backup dumps with [pg_dump](https://www.postgresql.org/docs/current/backup-dump.html) or [pg_dumpall](https://www.postgresql.org/docs/14/app-pg-dumpall.html),
push to S3 with [rclone](https://rclone.org/) and schedule with [Cronicle](https://github.com/jhuckaby/Cronicle).
### pgdump
The purpose of [pg_dump](https://www.postgresql.org/docs/current/backup-dump.html) is to generate a file with SQL commands that,
when fed back to the server, will recreate the database in the same state as it was at the time of the dump.
```
mkdir /home/dumps/
# Dump from local Postgres
pg_dump -h localhost -p 5432 -U abc usda > /home/dumps/local_postgres_dump
# Dump from remote Postgres
PGPASSWORD=xxxxxxxxxxx pg_dump -h my-postgres-host -p 5432 -U postgres mydb > /home/dumps/remote_postgres_dump
# Restore from dump to local Postgres
psql dbname < /home/dumps/remote_postgres_dump
```
__Other versions of pg_dump__
The default pg_dump version is for Postgres 14. If you see error _error: aborting because of server version mismatch_, try
pg_dump for your postgres version (currently Postgres versions 12, 13 and 14 are supported)
```
pg_dump_12 -h localhost -p 5432 -U abc abc > /home/dumps/local_postgres_dump_12
pg_dump_13 -h localhost -p 5432 -U abc abc > /home/dumps/local_postgres_dump_13
```
### pg_dumpall
[pg_dumpall](https://www.postgresql.org/docs/14/app-pg-dumpall.html) is a utility for writing out ("dumping")
all PostgreSQL databases of a cluster into one script file.
```
pg_dumpall -h localhost -p 5432 -U abc > /home/dumps/local_postgres_dumpall
# Dump from remote Postgres
PGPASSWORD=xxxxxxxxxxx pg_dump -h my-postgres-host -p 5432 -U postgres mydb > /home/dumps/remote_postgres_dump
# Restore from dump to local Postgres
psql dbname < /home/dumps/remote_postgres_dump
```
The default is pg_dumpall for Postgres 14, if you need earlier version, use `pg_dumpall_12`, `pg_dumpall_13`.
### rclone
[rclone](https://rclone.org/) is a command line program to manage files on cloud storage.
It is a feature rich alternative to cloud vendors' web storage interfaces.
__Copy dump to S3:__
Create file `~/.config/rclone/rclone.conf` with the following content
```
[remote]
type = s3
provider = AWS
access_key_id = XXXXXXXXXXXXXXXXXXXXXX
secret_access_key = XXxxXXxXXXxxxXXxXXXxxXXXxxxXXXxXXXX
region = xx-xxxx-x
```
Use Rclone to copy to S3 and delete from local
```
rclone move /home/dumps/ remote:my-s3-bucket/dumps/
```
__Restore from S3 to local:__
When there is a need to restore database from a dump, copy dupm from S3 or mount S3 bucket to local folder.
In case of mounting, file will not be physically copied. Database restoration will happen directly from dump on S3.
```
# copy & restore
rclone copy remote:dwh-1/dumps/remote_postgres_dump /home/s3-dumps/
psql dbname < /home/s3-dumps/remote_postgres_dump
# mount & restore
rclone sync remote:dwh-1/dumps /home/s3-dumps
psql dbname < /home/s3-dumps/remote_postgres_dump
```
### scheduling backups
__Schedule with Cronicle__: open Cronicle WEB UI from the main Workspace page, or directly on [http://localhost:8023/](http://localhost:8023/)
(user/pass - admin/admin) and create scheduled event (plugin - shell script). Provide commands to be executed.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/Cronicle2.png" alt="Cronicle" width="750">
</p>
## Database sample
Who hasn't faced a need to make a sample database for testing/development purposes? :-)
```
# Create sample from database "usda" in local Postgres
pg_sample -h localhost -U abc --limit=500 --file=/home/project/sample_db.sql usda
# create new database (local Postgres)
createdb usda_sample
# restore sample to the new database
psql usda_sample < /home/project/sample_db.sql
```
## Data import/export
Import data from various files, export to csv, json, html. Download with [Filebrowser](https://github.com/filebrowser/filebrowser),
upload to S3 with [Rclone](https://rclone.org/), schedule with [Cronicle](https://github.com/jhuckaby/Cronicle).
### pgclimb
[pgclimb](https://github.com/lukasmartinelli/pgclimb) is a PostgreSQL utility to export data into different data formats with support for templates.
```
# From local Postgres instance
pgclimb --host localhost --port 5432 --dbname abc --username abc --query "SELECT * FROM distributors" -o /home/project/distributors.csv csv
# From remote Postgres instance
pgclimb --host my-postgres-host --port 5432 --dbname mydb --username postgres --password xxxxxxxxxxx --query "SELECT * FROM phonebook" -o /home/project/phone.csv csv
pgclimb --host my-postgres-host --port 5432 --dbname mydb --username postgres --password xxxxxxxxxxx --query "SELECT * FROM phonebook" -o /home/static-server/phone.html html
```
### pgfutter
[pgfutter](https://github.com/lukasmartinelli/pgfutter) helps to import CSV and line delimited JSON into PostgreSQL the easy way.
For example, create file `/home/project/friends.json` with the following content
```json
{"name": "Jacob", "age": 26, "friends": ["Anthony"]}
{"name": "Anthony", "age": 25, "friends": []}
{"name": "Emma", "age": 28, "friends": ["Jacob", "Anthony"]}
```
Import data to Postgres
```
# to the local Postgres
pgfutter --host localhost --port 5432 --dbname abc --username abc --table friends json /home/project/friends.json
# to the remote Postgres
pgfutter --host my-postgres-host --port 5432 --dbname mydb --username postgres --pass admin --schema imports --table friends json /home/project/friends.json
```
Another example: create file `/home/project/friends2.csv` with the following content
```
name,age,friends
Jacob,26,"Anthony"
Anthony,25,""
Emma,28,"Jacob,Anthony"
```
Import data to Postgres
```
pgfutter --host my-postgres-host --port 5432 --dbname mydb --username postgres --pass admin --schema public --table friends2 csv /home/project/friends2.csv
```
### PGLoader
[PGLoader](https://pgloader.readthedocs.io/en/latest/index.html) - a very versatile data loading tool for PostgreSQL.
Load data from files, or migrate entire databases to Postgres.
Example of use: create test load file `/home/project/test.csv` with the following content
```
Header, with a © sign
"2.6.190.56","2.6.190.63","33996344","33996351","GB","United Kingdom"
"3.0.0.0","4.17.135.31","50331648","68257567","US","United States"
"4.17.135.32","4.17.135.63","68257568","68257599","CA","Canada"
"4.17.135.64","4.17.142.255","68257600","68259583","US","United States"
"4.17.143.0","4.17.143.15","68259584","68259599","CA","Canada"
"4.17.143.16","4.18.32.71","68259600","68296775","US","United States"
```
Create PGLoader file `/home/project/test.load` with the following content (use your postgres connection arguments)
```
LOAD CSV
FROM '/home/project/test.csv' (x, y, a, b, c, d)
-- local Postgres
INTO postgresql://abc@localhost:5432/abc?csv (a, b, d, c)
-- remote Postgres
-- INTO postgresql://user:password@my-postgres-host:5432/mydb?csv (a, b, d, c)
WITH truncate,
skip header = 1,
fields optionally enclosed by '"',
fields escaped by double-quote,
fields terminated by ','
SET client_encoding to 'latin1',
work_mem to '12MB',
standard_conforming_strings to 'on'
BEFORE LOAD DO
$$ drop table if exists csv; $$,
$$ create table csv (
a bigint,
b bigint,
c char(2),
d text
);
$$;
```
Load data into new table called "csv"
```
pgloader /home/project/test.load
```
## Data generators/mocking
Generate realistic data for existing tables, create new mock tables or databases.
### Synth
[Synth](https://github.com/getsynth/synth) is a tool for generating realistic data using a declarative data model. Synth is database agnostic and can scale to millions of rows of data.
Create dir `mkdir /home/project/synth` and create file `/home/project/synth/companies.json` with the following contents
```json
{
"type": "array",
"length": {
"type": "number",
"constant": 1
},
"content": {
"type": "object",
"company_id": {
"type": "number",
"id": {}
},
"company_name": {
"type": "string",
"faker": {
"generator": "company_name"
}
}
}
}
```
Generate data (2 entries only) as json - `synth generate /home/project/synth/ --size 2 | jq`.
Generate data into (local) Postgres
```
# Create table users in local Postgres database
echo "CREATE TABLE companies(company_id SERIAL PRIMARY KEY, company_name VARCHAR(255) NOT NULL);" | psql
# generate random data to table users
synth generate /home/project/synth/ --size 200 --to postgres://abc@localhost:5432/abc
# check 10 records
echo "SELECT * FROM companies LIMIT 10" | psql
```
__Learn more:__
- [Synth docs](https://www.getsynth.com/docs/getting_started/synth)
- [How to Create PostgreSQL Test Data](https://www.getsynth.com/docs/blog/2021/03/09/postgres-data-gen)
### mock-data
The idea behind [mock-data](https://github.com/faisaltheparttimecoder/mock-data)is to allow users to test database queries with sets of fake data in any pre-defined table.
```
# Create table in (local) Postgres
echo "CREATE TABLE distributors (did integer, name varchar(40));" | psql
# Populate (local) Postgres with fake data (2000 rows)
mock tables -t "distributors" -r 2000 --uri="postgres://abc@localhost:5432/abc?sslmode=disable"
```
__Learn more:__
- [Mock-data documentation](https://github.com/faisaltheparttimecoder/mock-data/wiki)
## Database change management
Implement database change management in your team and drive higher software delivery and organizational performance.
### sqitch
[sqitch](https://github.com/sqitchers/sqitch) - is a database change management application.
To demonstrate (very briefly) how Sqitch works, create a new database called 'flipr_test' in the local Postgres:
```
createdb flipr_test
```
Initialize and configure a Sqitch project, called 'flipr'
```
mkdir /home/project/flipr && cd /home/project/flipr
sqitch init flipr --engine pg
```
Open file `/home/project/flipr/sqitch.conf` and update configuration for the "pg" engine to conect to local Postgres as following
```
[core]
engine = pg
[engine "pg"]
target = db:pg:
client = psql
```
Create database and changes to be managed by Sqitch
```
# create new Postgres database
createdb flipr_test
# create sqitch change
sqitch add appschema -n 'Add schema for all flipr objects.'
# add SQL command to change file
echo "CREATE SCHEMA flipr;" >> /home/project/flipr/deploy/appschema.sql
# add SQL command to change-revert file
echo "DROP SCHEMA flipr;" >> /home/project/flipr/revert/appschema.sql
```
Apply db change with Squitch
```
sqitch deploy db:pg:flipr_test
```
Connet to local Postgres, database 'flipr_test' and check schema 'flipr' was created
```
pgcli flipr_test
SELECT schema_name FROM information_schema.schemata
```
Now you can open terminal back, and revert this change with the command `sqitch revert db:pg:flipr_test`.
__Learn more__:
- [Sqitch Postgres tutorial](https://sqitch.org/docs/manual/sqitchtutorial/)
### yuniql
[Yuniql](https://github.com/rdagumampan/yuniql) is a data platform devops tool using migration-based and database-first
delivery model. Migration-based as each changeset to the schema and seed data is a set of carefully prepared scripts
controlled with a version number.
To briefly demonstrate how Yuniql works, clone example Yuniql project
```
git clone https://github.com/rdagumampan/yuniql.git /home/project/yuniql
```
Create new database in the local Postgres instance
```
createdb helloyuniql
```
Apply to the local Postgres a Yuniql project in `/home/project/yuniql/samples/basic-postgresql-sample`
```
export YUNIQL_PLATFORM="postgresql"
export YUNIQL_WORKSPACE="/home/project/yuniql/samples/basic-postgresql-sample"
export YUNIQL_CONNECTION_STRING="Host=localhost;Port=5432;Username=abc;Password=;Database=helloyuniql"
```
Finally, run migrations
```
cd /home/project/yuniql/samples/basic-postgresql-sample
yuniql run -a --platform postgresql
```
Check the results
```
pgcli helloyuniql
SELECT * FROM regions
```
### migra
[migra](https://databaseci.com/docs/migra) is a schema comparison tool for PostgreSQL.
Find differences in database schemas as easily as running a diff on two text files.
Migra makes schema changes almost automatic. Management of database migration deployments becomes much easier,
faster, and more reliable. For example, compare two local Postgres databases
```
migra postgresql://abc:@localhost:5432/abc postgresql://abc:@localhost:5432/helloyuniql --unsafe
```
Migra will produce a set of SQL commands to make database "abc" have the same DDL as databas "helloyuniql".
## Visualization tools
### dbdesigner
[dbdesigner](https://github.com/akreienbring/dbdesigner) a visual tool to create entity relationship diagrams and
generate Postgres DDL code. Open dbdesigner from the Quickstart page.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/dbdesigner.png" alt="dbdesigner" width="750">
</p>
### schemaspy
[schemaspy](https://github.com/schemaspy/schemaspy) generates complete database documentation that looks great.
```
schemaspy -h localhost -p 5432 -d usda -u abc -o /home/static-server/usda-schemaspy
```
And open static file server on [http://localhost:8022/](http://localhost:8022/) folder usda-schemaspy
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/schemaspy.gif" alt="schemaspy" width="750">
</p>
### Postgres explain visualizer
[Pev](https://github.com/AlexTatiyants/pev) helps to understand Postgres execution plans
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/pev.gif" alt="pev" width="750">
</p>
### tbls
[tbls](https://github.com/k1LoW/tbls) - a tool for document a database, written in Go.
For example, generate Markdown docs
```
tbls doc "postgres://abc@localhost:5432/usda?sslmode=disable" /home/static-server/usda-tbls
```
Now you can push these docks push to Github.
### pg_flame
[pg_flame](https://github.com/mgartner/pg_flame) - a flamegraph generator for Postgres EXPLAIN ANALYZE output.
```
psql usda -qAtc 'EXPLAIN (ANALYZE, FORMAT JSON) SELECT *
FROM nut_data N
JOIN food_des F ON F.ndb_no = N.ndb_no
JOIN datsrcln D ON D.nutr_no = N.nutr_no
LEFT JOIN data_src ON data_src.datasrc_id = D.datasrc_id
WHERE N.nutr_val > 20
AND data_src.year > 1975 AND data_src.year < 1986;' \
| pg_flame > /home/static-server/flamegraph.html
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/postgres-workspace/img/pgflame.png" alt="pgflame" width="750">
</p>
## Other useful tools
### pg_insights
Convenient SQL for monitoring Postgres database health. Clone repo and use it to analyse Postgres databases
```
git clone https://github.com/lob/pg_insights /home/pg_insights
```
### sqlfluff
[Sqlfluff](https://www.sqlfluff.com/) is a moduler sql linter for humans.
```
echo "select * from t where id=1" >/tmp/test.sql
sqlfluff lint /tmp/test.sql
```
Results in:
```
== [/tmp/test.sql] FAIL
L: 1 | P: 1 | L044 | Query produces an unknown number of result columns.
L: 1 | P: 27 | L006 | Missing whitespace before =
L: 1 | P: 27 | L006 | Missing whitespace after =
```

View File

@ -1,68 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Scrapy stuff:
.scrapy
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# virtualenv
venv/
ENV/
# MkDocs documentation
site/

View File

@ -1,142 +0,0 @@
<style>
/* These styles apply only to this page! */
.md-content__button {
display: none;
}
.md-sidebar--secondary{
display: none !important;
}
.md-typeset h1 {
line-height: 0;
margin: 0;
margin-left: -9999px;
}
.quickstart-wrapper {
min-width: 300px;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding-left: -50px;
column-gap: 50px;
row-gap: 50px;
}
.quickstart-wrapper > div {
flex: 300px;
max-width: 300px;
}
.tool-img{
box-shadow: rgba(0, 0, 0, 0.24) 0px 5px 5px;
border-radius: 5px;
min-width: 300px;
max-width: 300px;
max-height: 170px;
min-height: 170px;
}
.tool-caption{
font-family: Roboto, Helvetica, sans-serif;
text-align: center;
margin-top: 10px;
font-size: 1.2rem;
font-weight: bold;
/* font-size: 1.25em;
font-weight: 400; */
letter-spacing: -.02em;
line-height: 1.5;
}
.tool-description{
font-family: Helvetica, sans-serif;
text-align: center;
margin-top: 10px;
font-size: 0.7rem;
font-style: oblique;
/* font-weight: bold; */
}
</style>
{%
set tools = [
{
"env": "IDE_URL",
"name": "IDE",
"image": "assets/home/IDE.jpg",
"description": "Browser-based version of Visual Studio Code. Develop in any language, install hundreeds of extensions"
},
{
"env": "TERMINAL_URL",
"name": "Terminal",
"image": "assets/home/Terminal.png",
"description": "Full-fledged browser-based terminal with Z-shell"
},
{
"env": "FILEBROWSER_URL",
"name": "File Browser",
"image": "assets/home/Filebrowser.png",
"description": "Browse, upload and download files and folders to and from the Workspace"
},
{
"env": "CRONICLE_URL",
"name": "Cronicle",
"image": "assets/home/Cronicle.jpg",
"description": "Schedule jobs, manage schedules, observe and monitor executions (user/pass - admin/admin)"
},
{
"env": "DBDESIGNER_URL",
"name": "DB designer",
"image": "assets/home/dbdesigner.png",
"description": "Visual design tool for Entity Relationship Diagrams & SQL generator"
},
{
"env": "PEV2_URL",
"name": "Postgres Explain Visualizer",
"image": "assets/home/Pev2.png",
"description": "PostgreSQL execution plan visualizer "
},
{
"env": "UNGIT_URL",
"name": "Ungit",
"image": "assets/home/Ungit.jpg",
"description": "Manage Git repositories and work flow using beautiful UI"
},
{
"env": "STATICFS_URL",
"name": "Static File Server",
"image": "assets/home/Static-server.png",
"description": "Serve any static websites like a breeze"
},
{
"env": "MC_URL",
"name": "M.Commander",
"image": "assets/home/MC.jpg",
"description": "Feature rich visual file manager with internal text viewer and editor"
},
{
"env": "HTOP_URL",
"name": "Process monitor",
"image": "assets/home/Htop.jpg",
"description": "Monitor running process and resource utilization"
}
]
%}
<div class="quickstart-wrapper">
{% for tool in tools %}
{% set tool_url = get_tool_url(tool.env) %}
<div>
<a href="{{ tool_url }}" target="_blank" rel="noopener noreferrer">
<img src="{{ tool.image }}" class="tool-img"/>
</a>
<a href="{{ tool_url }}">
<div class="tool-caption">{{ tool.name }}</div>
</a>
<div class="tool-description">{{ tool.description }}</div>
</div>
{% endfor %}
</div>

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1280" height="1024" viewBox="0 0 10000 9600" xml:space="preserve">
<desc>Created with Fabric.js 3.6.3</desc>
<defs>
</defs>
<g transform="matrix(2,0,0,2,640,512)" id="background-logo" >
</g>
<g transform="matrix(2,0,0,2,640,416.3)" id="logo-logo" >
<g transform="matrix(18.9,0,0,24.4,-502.2,-1009.3)" style="" paint-order="stroke" >
<g transform="matrix(0.2,0,0,-0.2,0,-61.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1745)" d="M 3062 1050.1 c -466.3 107.3 -950.8 107.3 -1417.1 0 c -16.2 -3.7 -26.6 -18.2 -23.3 -32.1 c 3.4 -13.9 19 -22.1 34.9 -18.4 c 458.6 105.5 935.2 105.5 1393.9 0 c 15.9 -3.7 31.5 4.5 34.9 18.4 c 3.4 13.9 -7 28.4 -23.3 32.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1423.3)" d="M 1847.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-111.1,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1143.2,-1383.2)" d="M 1861.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-103.4,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1176.6,-1397.2)" d="M 1894.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,17.5)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1401.8)" d="M 1928.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-88,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1243.4,-1397.2)" d="M 1961.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-80.3,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1276.8,-1383.2)" d="M 1994.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1423.3)" d="M 2262.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1558.2,-1383.2)" d="M 2276.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1591.6,-1397.2)" d="M 2309.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,17.5)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1401.8)" d="M 2343.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1658.4,-1397.2)" d="M 2376.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1691.8,-1383.2)" d="M 2409.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1423.3)" d="M 2677.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,80.3,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1973.2,-1383.2)" d="M 2691.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,88,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2006.6,-1397.2)" d="M 2724.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,17.5)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1401.8)" d="M 2758.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,103.4,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2073.4,-1397.2)" d="M 2791.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,111.1,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2106.8,-1383.2)" d="M 2824.8 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

View File

@ -1,16 +0,0 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})

View File

@ -1,59 +0,0 @@
"""
Basic example of a Mkdocs-macros module.
Include this {{ macros_info() }} in any page to get complete macro info
"""
import os
port_increments = {
"DOCS_URL": 0,
"FILEBROWSER_URL": 1,
"STATICFS_URL": 2,
"CRONICLE_URL": 3,
"UNGIT_URL": 4,
"IDE_URL": 5,
"TERMINAL_URL": 6,
"MC_URL": 7,
"HTOP_URL": 8,
"DBDESIGNER_URL": 9,
"PEV2_URL": 10
}
# this function name should not be changed
def define_env(env):
"""
This is the hook for defining variables, macros and filters
- variables: the dictionary that contains the environment variables
- macro: a decorator function, to declare a macro.
- filter: a function with one of more arguments,
used to perform a transformation
"""
@env.macro
def get_tool_url(env):
try:
return os.environ[env]
except:
# Get host
host = "localhost"
try:
host = os.environ["WRK_HOST"]
except:
pass
proto = "http"
try:
proto = os.environ["WRK_PROTO"]
except:
pass
# Entry port - port relative to which other ports will be calculated
entry_port = 8020
try:
entry_port = int(os.environ["ENTRY_PORT"])
except:
pass
# Assign port
try:
port = port_increments[env] + entry_port
except:
port = 80
return f"{proto}://{host}:{port}"

View File

@ -1,69 +0,0 @@
# ===========================================================
# NAVIGATION
# ===========================================================
nav:
- Home: README.md
- Get started: getting-started.md
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: My Workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://alnoda.org
edit_uri: ""
# ===========================================================
# APPEARANCE
# ===========================================================
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
custom_dir: overrides
icon:
repo: fontawesome/brands/git-alt
features:
- navigation.instant
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: red
accent: deep orange
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to dark mode
primary: deep orange
accent: red
extra:
# Link to open when your logo is clicked
homepage: https://alnoda.org
host_url: http://localhost
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View File

@ -1,288 +0,0 @@
# Getting started
## Contents
* [Intro](#intro)
* [Code Editor](#code-editor)
* [Terminal](#terminal)
* [IPython and Notebooks](#ipython-and-notebooks)
* [Python tooling](#python-tooling)
* [Python-report](#python-report)
* [Pytest-html-reporter](#pytest-html-reporter)
* [Pdoc3](#pdoc3)
* [SnakeViz](#snakeviz)
* [Vprof](#vprof)
* [Flameprof](#flameprof)
* [Pyinstrument](#pyinstrument)
* [cProfile](#cprofile)
* [Pylint-json2html](#pylint-json2html)
* [Pre-commit](#pre-commit)
* [Schedule Python scripts](#schedule-python-scripts)
## Intro
This doc contains example tutorials how to use Python tooling included in Python workspace.
To start, open Quickstart page [http://localhost:8020/](http://localhost:8020/) for quick access to all the tools
## Code Editor
Code editor of this workspace is [**Eclipse Theia**](https://theia-ide.org/docs/) - an open-source version of popular Visual Studio Code IDE.
You can install any extension from [open-vsx.org](https://open-vsx.org/) that has hundreeds of extensions for VS Code compatible editors.
<div align="center" style="font-style: italic;">
Demo: Eclipse Theia
</div>
<p align="center">
<img src="https://github.com/bluxmit/alnoda-workspaces/blob/main/workspaces/ide-workspace/img/theia.png?raw=true" alt="Theia" width="750">
</p>
## Terminal
Open Terminnal from the Quickstart page.
<div align="center" style="font-style: italic;">
Demo: Browser-based terminal
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/python-terminal.gif" alt="python-terminal.gif" width="750">
</p>
## [IPython and Notebooks](https://ipython.readthedocs.io/en/stable/)
IPython provides a rich toolkit to help you make the most of using Python interactively. One of its main components
is a powerful interactive Python shell. IPython is very handy. For example, starting with IPython 7.0, and when using
Python 3.6 and above, IPython offer the ability to run asynchronous code from the REPL.
To start IPython kernel, open workspace terminal ad execute `ipython`. Below is an example of installing packages and
evaluation of async code in IPython shell - something you cannot do in a standard python shell:
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/ipython.png" alt="ipython.png" width="900">
</p>
**NOTE:** in order not to increase the Workspace size, by default Python Workspace can only render notebooks.
Workspace does not have installed all the requirements to run notebooks. This is can be done easily. As soon as you
try to run a cell in the note, you will see a pop-out winndow suggesting to install missing dependencies. You just need to accept.
<div align="center" style="font-style: italic;">
Demo: Install dependencies for notebooks
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/notebooks-install.png" alt="notebooks-install.png" width="900">
</p>
## Python tooling
### Python-report
Python-report is a small utility that tryies to generate various reports and artefacts from your python project, such as linting
report; run tests and make HTML report; make auto-documentation and profiling visualizations. Unit test statistics will be visualised
with the browser-based dashboard.
> `cd /home/examples/simple-script && python-report `
The resulting report will be produced to the folder `/home/static-server/<NAME-OF-PYTHON-PROJECT-FOLDER>/<TIMESTAMP>`.
<div align="center" style="font-style: italic;">
Demo: Python report
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/python-report.gif" alt="python-report.gif" width="900">
</p>
*(In addition, all pytests statistics will be collected, and available in foldder `/home/static-server/<NAME-OF-PYTHON-PROJECT-FOLDER>`)*.
Python-report is a simple bash script `/home/abc/utils/python-report.sh`. You can also use separately any of the toos.
### [Pytest-html-reporter](https://github.com/prashanth-sams/pytest-html-reporter)
Pytest-html-reporter generates a beautiful static html report based on pytest framework. These reports result in dashboard website,
that shows all historical tests and statistics.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/pytest-html-report.png" alt="pytest-html-report.png" width="750">
</p>
To execute tests, and generate report with Pytest-html-reporter, cd to the python project tests folder,
and execute `pytest ./ --html-report=./pytest-report`. The results will be produced to the sub-folder `./pytest-report`.
For instance, execute tests and generate report for the example python project execute
> `cd /home/examples/simple-script && pytest ./ --html-report=/home/static-server/my-pytest-report `
the output will be in folder `/home/static-server/my-pytest-report` that is served with a Static-file server
<div align="center" style="font-style: italic;">
Demo: Pytest-html-reporter
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/pytest-html-report.gif" alt="pytest-html-report.gif" width="900">
</p>
### [Pdoc3](https://github.com/pdoc3/pdoc)
Auto-generate API documentation for Python projects. Let's generate autodocumentation website for the example python project,
with output into `` where it can be viewed with Static-file server
> ` cd /home/examples/simple-script && pdoc --html --output-dir /home/static-server/pdoc-html ./ `
<div align="center" style="font-style: italic;">
Demo: Pdoc3
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/pdoc3.gif" alt="pdoc3.gif" width="900">
</p>
### [Vprof](https://github.com/nvdv/vprof)
Vprof is a Python package providing rich and interactive visualizations for various Python program characteristics
such as running time and memory usage.
Vprof is a browser-based profiling tool. Here is an example of profiling scripts from the example python project:
> `cd /home/examples/simple-script && vprof -H 0.0.0.0 -p 8031 -c cpmh fib.py `
> `cd /home/examples/simple-script && vprof -H 0.0.0.0 -p 8031 -c cpmh script.py `
<div align="center" style="font-style: italic;">
Demo: Vprof
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/vprof.gif" alt="vprof.gif" width="900">
</p>
### [SnakeViz](https://jiffyclub.github.io/snakeviz/)
SnakeViz is a browser based graphical viewer for the output of Pythons cProfile module. Let's profile
and visualize one of python modules in the example project:
> `cd /home/examples/simple-script && python -m cProfile -o script.prof script.py `
> `snakeviz -s -p 8030 -H 0.0.0.0 script.prof `
You will see thae link appeared in the terminal, open it in browser
<div align="center" style="font-style: italic;">
Demo: SnakeViz
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/snakeviz.gif" alt="snakeviz.gif" width="900">
</p>
### [Flameprof](https://github.com/baverman/flameprof/)
Flameprof is a Flamegraph generator for python's cProfile stats.
Let's profile and visualize one of python modules in the example project:
> `cd /home/examples/simple-script && python -m cProfile -o script.prof script.py `
> ` flameprof script.prof > script.svg `
<div align="center" style="font-style: italic;">
Demo: Flameprof
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/flameprof.png" alt="flameprof.png" width="750">
</p>
### [Pyinstrument](https://pypi.org/project/pyinstrument/3.0.0b3/)
Pyinstrument is a Python profiler. A profiler is a tool to help you 'optimize' your code - make it faster.
It sounds obvious, but to get the biggest speed increase you must focus on the slowest part of your program.
Pyinstrument helps you find it!
Profile and visualize one of python modules in the example project:
> `mkdir -p /home/static-server/profiling/basic-python-script `
> `pyinstrument -t -r html -o /home/static-server/profiling/basic-python-script/p2 script.py `
<div align="center" style="font-style: italic;">
Demo: Pyinstrument
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/pyinstrument.png" alt="pyinstrument.png" width="900">
</p>
### [cProfile](https://docs.python.org/3/library/profile.html#module-cProfile)
cProfile is recommended for most users; it's a C extension with reasonable overhead that makes it suitable
for profiling long-running programs. Profile and visualize one of python modules in the example project:
> `cd /home/examples/simple-script && python -m cProfile script.py >> /home/static-server/cprof.tx `
### [Pylint-json2html](https://github.com/Exirel/pylint-json2html)
A pylint JSON report file to HTML: pylint is used to generate a JSON report, and this tool will transform this report into
an HTML document:
> `pylint script.py | pylint-json2html -f jsonextended -o script.html `
<div align="center" style="font-style: italic;">
Demo: Pylint-json2html demo
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/pylint.png" alt="pylint.png" width="750">
</p>
### Pre-commit
Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit
to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing
these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting
time with trivial style nitpicks.
The example python project has a pre-commit configuration file:
> `cd /home/examples/simple-script && pre-commit install `
> `pre-commit run --all-files `
### Schedule python jobs
Workspace inncludes [Cronicle](https://github.com/jhuckaby/Cronicle) - a powerful scheduling tool, that has a browser-based UI with dashboards,
allows to configure resource limits for jobs and much more!
Python Workspace includes an example script that fetches today's exchange rates:
> `cd /home/examples/exchange_rates `
> `python fetch-rates.py `
The script will fetch today's exchange rates from and output result to the folder `/home/static-server/exchange-rates_<DATE>.json`. This
folder is served by the Static-file server
<div align="center" style="font-style: italic;">
Demo: Fetch exchange rates
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/exchange-rates.gif" alt="exchange-rates.gif" width="900">
</p>
Fetching echange rates - is a typical problems for nearly every business, that is working on the international market. You can
schedule execution of this script to fetch exchange rates daily
<div align="center" style="font-style: italic;">
Demo: Schedule exchange rates
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/schedule-exchange-rates.gif" alt="exchange-rates.gif" width="900">
</p>
**NOTE:** Scheduling jobs is especially useful when the Workspace is running on a cloud server.
[Read here how to launch workspace in cloud](#secure-remote-workspace).

View File

@ -1,69 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
This workspace includes RStudio Server, a browser-based IDE for R.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/r-workspace/img/RStudio.png" alt="RStudio" width="750">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## R
Open terminal, and check R version
```
R --version
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/r-workspace/img/r-version.png" alt="RStudio" width="500">
</p>
To start R shell, simply execute `R` in the terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/r-workspace/img/r-shell.png" alt="RStudio" width="500">
</p>
If you want to install packages from the terminal, execute
```
Rscript -e 'install.packages("drat", repos="https://cloud.r-project.org")'
```
## Examples
CUse terminal to clone example repository
```
cd /home/abc
git clone https://github.com/dmarcelinobr/r-code-examples.git
```
Open Rstudio, and try some examples, i.e. `2d-density-plot.r`. Evaluate code, agree to install dependencies
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/r-workspace/img/2d-density-plot.png" alt="RStudio" width="750">
</p>

View File

@ -1,68 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Scrapy stuff:
.scrapy
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# virtualenv
venv/
ENV/
# MkDocs documentation
site/

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1280" height="1024" viewBox="0 0 10000 9600" xml:space="preserve">
<desc>Created with Fabric.js 3.6.3</desc>
<defs>
</defs>
<g transform="matrix(2,0,0,2,640,512)" id="background-logo" >
</g>
<g transform="matrix(2,0,0,2,640,416.3)" id="logo-logo" >
<g transform="matrix(18.9,0,0,24.4,-502.2,-1009.3)" style="" paint-order="stroke" >
<g transform="matrix(0.2,0,0,-0.2,0,-61.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1745)" d="M 3062 1050.1 c -466.3 107.3 -950.8 107.3 -1417.1 0 c -16.2 -3.7 -26.6 -18.2 -23.3 -32.1 c 3.4 -13.9 19 -22.1 34.9 -18.4 c 458.6 105.5 935.2 105.5 1393.9 0 c 15.9 -3.7 31.5 4.5 34.9 18.4 c 3.4 13.9 -7 28.4 -23.3 32.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1423.3)" d="M 1847.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-111.1,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1143.2,-1383.2)" d="M 1861.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-103.4,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1176.6,-1397.2)" d="M 1894.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,17.5)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1401.8)" d="M 1928.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-88,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1243.4,-1397.2)" d="M 1961.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-80.3,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1276.8,-1383.2)" d="M 1994.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1423.3)" d="M 2262.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1558.2,-1383.2)" d="M 2276.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1591.6,-1397.2)" d="M 2309.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,17.5)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1401.8)" d="M 2343.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1658.4,-1397.2)" d="M 2376.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1691.8,-1383.2)" d="M 2409.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1423.3)" d="M 2677.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,80.3,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1973.2,-1383.2)" d="M 2691.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,88,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2006.6,-1397.2)" d="M 2724.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,17.5)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1401.8)" d="M 2758.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,103.4,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2073.4,-1397.2)" d="M 2791.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,111.1,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2106.8,-1383.2)" d="M 2824.8 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

View File

@ -1,16 +0,0 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})

View File

@ -1,57 +0,0 @@
"""
Basic example of a Mkdocs-macros module.
Include this {{ macros_info() }} in any page to get complete macro info
"""
import os
port_increments = {
"DOCS_URL": 0,
"FILEBROWSER_URL": 1,
"STATICFS_URL": 2,
"CRONICLE_URL": 3,
"UNGIT_URL": 4,
"IDE_URL": 5,
"TERMINAL_URL": 6,
"MC_URL": 7,
"HTOP_URL": 8
}
# this function name should not be changed
def define_env(env):
"""
This is the hook for defining variables, macros and filters
- variables: the dictionary that contains the environment variables
- macro: a decorator function, to declare a macro.
- filter: a function with one of more arguments,
used to perform a transformation
"""
@env.macro
def get_tool_url(env):
try:
return os.environ[env]
except:
# Get host
host = "localhost"
try:
host = os.environ["WRK_HOST"]
except:
pass
proto = "http"
try:
proto = os.environ["WRK_PROTO"]
except:
pass
# Entry port - port relative to which other ports will be calculated
entry_port = 8020
try:
entry_port = int(os.environ["ENTRY_PORT"])
except:
pass
# Assign port
try:
port = port_increments[env] + entry_port
except:
port = 80
return f"{proto}://{host}:{port}"

View File

@ -1,69 +0,0 @@
# ===========================================================
# NAVIGATION
# ===========================================================
nav:
- Home: README.md
- Get started: getting-started.md
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: My Workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://alnoda.org
edit_uri: ""
# ===========================================================
# APPEARANCE
# ===========================================================
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
custom_dir: overrides
icon:
repo: fontawesome/brands/git-alt
features:
- navigation.instant
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: brown
accent: deep orange
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to dark mode
primary: orange
accent: red
extra:
# Link to open when your logo is clicked
homepage: https://alnoda.org
host_url: http://localhost
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View File

@ -1,78 +0,0 @@
# Get started
This doc has examples how to use workspace to interact with Redis.
In examples we use local Redis that is running inside the workspace, but the commands apply to any Redis instance.
## Tutorial
Open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Redis-wid.png" alt="Redis WID" width="750">
</p>
Use workspace terminal [localhost:8026](http://localhost:8026/) and load some Redis datasets
```
git clone https://github.com/redis-developer/redis-datasets.git /home/project/redis-datasets
cat /home/project/redis-datasets/movie-database/import_actors.redis | redis-cli
cat /home/project/redis-datasets/movie-database/import_movies.redis | redis-cli
```
### GUI
Open Redis Commander UI on [localhost:8029](http://localhost:8029/) and explore Redis databases
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Rediscommander.png" alt="Redis commander" width="750">
</p>
Alternatively use browser-based VS-code [localhost:8025](http://localhost:8025/) with Redis extension
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Theia-redis.png" alt="Theia" width="750">
</p>
### CLI tools
If you prefer working in the terminal, explore Redis with [Redis-Tui](https://github.com/mylxsw/redis-tui).
To connect to the internal Redis instance simply execute
```
redis-tui
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/redis-tui.png" alt="Redis TUI" width="750">
</p>
To interact with internal Redis, inn the workspace terminal launch iredis CLI, get & set keys
```
iredis
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/iredis.png" alt="Iredis" width="400">
</p>
Iredis has autocompletion and hints, which might be handy for administrative tasks
```
iredis --newbie
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/iredis-newbie.png" alt="Iredis-newbie" width="750">
</p>
Create dump of the Redis database
```
redis-dump-go -h localhost > /home/redis-movie-dump.resp
```
Use File Browser [localhost:8021](http://localhost:8021) to get the dump to your PC

View File

@ -1,68 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Scrapy stuff:
.scrapy
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# virtualenv
venv/
ENV/
# MkDocs documentation
site/

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1280" height="1024" viewBox="0 0 10000 9600" xml:space="preserve">
<desc>Created with Fabric.js 3.6.3</desc>
<defs>
</defs>
<g transform="matrix(2,0,0,2,640,512)" id="background-logo" >
</g>
<g transform="matrix(2,0,0,2,640,416.3)" id="logo-logo" >
<g transform="matrix(18.9,0,0,24.4,-502.2,-1009.3)" style="" paint-order="stroke" >
<g transform="matrix(0.2,0,0,-0.2,0,-61.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1745)" d="M 3062 1050.1 c -466.3 107.3 -950.8 107.3 -1417.1 0 c -16.2 -3.7 -26.6 -18.2 -23.3 -32.1 c 3.4 -13.9 19 -22.1 34.9 -18.4 c 458.6 105.5 935.2 105.5 1393.9 0 c 15.9 -3.7 31.5 4.5 34.9 18.4 c 3.4 13.9 -7 28.4 -23.3 32.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1423.3)" d="M 1847.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-111.1,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1143.2,-1383.2)" d="M 1861.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-103.4,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1176.6,-1397.2)" d="M 1894.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,17.5)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1401.8)" d="M 1928.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-88,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1243.4,-1397.2)" d="M 1961.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-80.3,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1276.8,-1383.2)" d="M 1994.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1423.3)" d="M 2262.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1558.2,-1383.2)" d="M 2276.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1591.6,-1397.2)" d="M 2309.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,17.5)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1401.8)" d="M 2343.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1658.4,-1397.2)" d="M 2376.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1691.8,-1383.2)" d="M 2409.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1423.3)" d="M 2677.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,80.3,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1973.2,-1383.2)" d="M 2691.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,88,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2006.6,-1397.2)" d="M 2724.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,17.5)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1401.8)" d="M 2758.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,103.4,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2073.4,-1397.2)" d="M 2791.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,111.1,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2106.8,-1383.2)" d="M 2824.8 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

View File

@ -1,16 +0,0 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})

View File

@ -1,69 +0,0 @@
# ===========================================================
# NAVIGATION
# ===========================================================
nav:
- Home: README.md
- Get started: getting-started.md
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: My Workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://alnoda.org
edit_uri: ""
# ===========================================================
# APPEARANCE
# ===========================================================
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
custom_dir: overrides
icon:
repo: fontawesome/brands/git-alt
features:
- navigation.instant
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: red
accent: deep orange
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to dark mode
primary: deep orange
accent: red
extra:
# Link to open when your logo is clicked
homepage: https://alnoda.org
host_url: http://localhost
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View File

@ -1,137 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Ruby
Check Ruby version
```
ruby -v
```
Install Rails - a web application development framework written in the Ruby programming language.
```
gem install rails
```
Check version
```
rails --version
```
## Bundler
Create file `Gemfile` with the following content
```
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rack', '~> 2.0.1'
gem 'rspec'
```
Install all of the required gems
```
bundle install
```
## Rbenv
Use [rbenv](https://github.com/rbenv/rbenv) to pick a Ruby version for your application and guarantee that your development environment matches production.
List available versions, and install another one
```
rbenv install --list
rbenv install 3.0.4
```
Lists all Ruby versions known to rbenv, and shows an asterisk next to the currently active version.
```
rbenv versions
```
__global environment__
Change global Ruby (for all folders)
```
rbenv global 3.0.4
```
__local environment (specific folder)__
Chose local Ruby environment for this specific folder
```
rbenv local 3.0.4
```
## Basic example
Create file `http_server.rb`
```rb
# http_server.rb
require 'socket'
server = TCPServer.new 8030
while session = server.accept
request = session.gets
puts request
session.print "HTTP/1.1 200\r\n" # 1
session.print "Content-Type: text/html\r\n" # 2
session.print "\r\n" # 3
session.print "Hello world! The time is #{Time.now}" #4
session.close
end
```
Serve simple server
```
ruby http_server.rb
```
Open browser on [localhost:8030](http://localhost:8030/)

View File

@ -1,126 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Hello world
Check Rust version
```
rustc --version
```
Create new project folder
```
cargo new my_example
cd my_example
```
The new project is created together, with hello-world app in `src` sub-folder
```
cat src/main.rs
```
Compile it
```
cargo build
```
And then run it
```
./target/debug/my_example
```
We can also compile and then run it, all in one step
```
cargo run
```
## Rustup
A toolchain is a specific version of the collection of programs needed to compile a Rust application. It includes, but is not limited to:
- The compiler, rustc
- The dependency manager and build tool, cargo
- The documentation generator, rustdoc
Rustup provides ways to install, remove, update, select and otherwise manage these toolchains and their associated pieces.
Install specific version of Rust toolchain
```
rustup install 1.30.0
```
Show toolchains
```
rustup show
```
Change default toolchain
```
rustup default 1.30.0
```
## Project with dependencies
Cargo is also the Rust package manager. It is a tool that allows Rust packages to declare their various dependencies and ensure that youll always get a repeatable build.
Clone example repo
```
git clone https://github.com/rdesarz/rust-http-server.git
cd rust-http-server
```
Build and start the server
```
cd example
cargo run --package http-server --bin http-server 0.0.0.0:8030
```
You will see that before cargo builds the package, it installs all the dependencies from the file `Cargo.toml`.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/rust-workspace/img/cargo-deps.png" alt="cargo dependencies" width="500">
</p>
Open in your browser [0.0.0.0:8030/hello.html](http://0.0.0.0:8030/hello.html) to see a simple page.

View File

@ -1,117 +0,0 @@
# Getting started
## Intro
To start, open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the tools
From the quicklaunch page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Scala
To check scala version, execute in terminal
```
scala -version
```
To open scala REPL simply execute
```
scala
```
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/scala-workspace/img/scala-repl.png" alt="scala-repl.png" width="500">
</p>
### Hello world
Use Code editor to create folder `helloworld` with file `Hello.scala` in it. The file should have the following content
```
object Hello {
def main(args: Array[String]) = {
println("Hello, world")
}
}
```
Open terminal, go into this folder and execute
```
scala Hello.scala
```
### Hello world with sbt
cd to the projects directory, and create new project with Sbt
```
cd /home/project
sbt new scala/scala3.g8
```
Upon prompt type any project name, i.e. "hello-world". Sbt will generate progje boilerplate with the required folder structure.
Enter the project folder, compile and run the app
```
sbt run
```
## Coursier
[Coursier](https://get-coursier.io/) is the Scala application and artifact manager. It can install Scala applications and setup your Scala development environment.
It can also download and cache artifacts from the web.
Coursier provides a number of services:
- manage the installed Scala applications: `install`, `list`, `update`, `uninstall`, `search`
- configure channels to install Scala applications from: `channel`
- launchers for Scala applications: `launch`, `bootstrap`
- manage the installed JVMs: `java`, `java-home`
- directly manipulate Maven dependencies: `fetch`, `resolve`
- perform setup again
List all applications, installed by Coursier
```
cs list
```
The `install` command installs Scala applications, i.e.
```
cs install scalafmt
```
If you want to launch another scala version
```
cs launch scala:2.12.15
```

View File

@ -1,46 +0,0 @@
# Getting started
## Intro
From the quicklaunch Home page you can open workspace tools, such as code editor or terminal
<div align="center" style="font-style: italic;">
Demo: Workspace UI
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/ide-workspace/img/wid-ui.png" alt="wid-ui.png" width="750">
</p>
The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server)
<div align="center" style="font-style: italic;">
Demo: Code-server
</div>
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-demo.gif" alt="Code-server demo" width="900">
</p>
Workspace has full-size browser-base terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="750">
</p>
## Streamlit
Open terminal, and launch example streamlit application
```
streamlit run /home/examples/uber.py
```
Open running Streamlit app from the quickstart page
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/streamlit-workspace/img/streamlit-launch.gif" alt="Start Steamlit" width="750">
</p>
You can luanch any Streamlit app, annd use quickstart page to quickly ope the app.

View File

@ -1,68 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Scrapy stuff:
.scrapy
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# virtualenv
venv/
ENV/
# MkDocs documentation
site/

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1280" height="1024" viewBox="0 0 10000 9600" xml:space="preserve">
<desc>Created with Fabric.js 3.6.3</desc>
<defs>
</defs>
<g transform="matrix(2,0,0,2,640,512)" id="background-logo" >
</g>
<g transform="matrix(2,0,0,2,640,416.3)" id="logo-logo" >
<g transform="matrix(18.9,0,0,24.4,-502.2,-1009.3)" style="" paint-order="stroke" >
<g transform="matrix(0.2,0,0,-0.2,0,-61.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1745)" d="M 3062 1050.1 c -466.3 107.3 -950.8 107.3 -1417.1 0 c -16.2 -3.7 -26.6 -18.2 -23.3 -32.1 c 3.4 -13.9 19 -22.1 34.9 -18.4 c 458.6 105.5 935.2 105.5 1393.9 0 c 15.9 -3.7 31.5 4.5 34.9 18.4 c 3.4 13.9 -7 28.4 -23.3 32.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1423.3)" d="M 1847.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-111.1,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1143.2,-1383.2)" d="M 1861.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-103.4,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1176.6,-1397.2)" d="M 1894.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,17.5)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1401.8)" d="M 1928.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-88,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1243.4,-1397.2)" d="M 1961.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-80.3,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1276.8,-1383.2)" d="M 1994.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1423.3)" d="M 2262.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1558.2,-1383.2)" d="M 2276.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1591.6,-1397.2)" d="M 2309.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,17.5)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1401.8)" d="M 2343.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1658.4,-1397.2)" d="M 2376.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1691.8,-1383.2)" d="M 2409.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1423.3)" d="M 2677.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,80.3,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1973.2,-1383.2)" d="M 2691.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,88,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2006.6,-1397.2)" d="M 2724.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,17.5)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1401.8)" d="M 2758.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,103.4,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2073.4,-1397.2)" d="M 2791.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,111.1,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2106.8,-1383.2)" d="M 2824.8 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

View File

@ -1,16 +0,0 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})

View File

@ -1,69 +0,0 @@
# ===========================================================
# NAVIGATION
# ===========================================================
nav:
- Home: README.md
- Get started: getting-started.md
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: Streamlit Workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://alnoda.org
edit_uri: ""
# ===========================================================
# APPEARANCE
# ===========================================================
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
custom_dir: overrides
icon:
repo: fontawesome/brands/git-alt
features:
- navigation.instant
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: blue grey
accent: amber
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to dark mode
primary: grey
accent: amber
extra:
# Link to open when your logo is clicked
homepage: https://alnoda.org
host_url: http://localhost
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6