diff --git a/README.md b/README.md index 9e985b1..c24c9cb 100644 --- a/README.md +++ b/README.md @@ -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. - +

+ Ukraine +

diff --git a/img/stand_with_ukraine.png b/img/stand_with_ukraine.png new file mode 100644 index 0000000..0d3a8b0 Binary files /dev/null and b/img/stand_with_ukraine.png differ diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/ansible-tools.md b/workspaces/ansible-terraform-workspace/removeme_docs/ansible-tools.md deleted file mode 100644 index 2165e10..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/ansible-tools.md +++ /dev/null @@ -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) - diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/ansible.md b/workspaces/ansible-terraform-workspace/removeme_docs/ansible.md deleted file mode 100644 index 2680ab3..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/ansible.md +++ /dev/null @@ -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 - -

- Htop -

- -## 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. - -

- Htop -

- - -## 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 - -

- Htop -

- -**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. - diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/example-compose.md b/workspaces/ansible-terraform-workspace/removeme_docs/example-compose.md deleted file mode 100644 index 95d53d2..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/example-compose.md +++ /dev/null @@ -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" -``` \ No newline at end of file diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/.pre-commit-config.yaml b/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/.pre-commit-config.yaml deleted file mode 100644 index 562ece7..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/.pre-commit-config.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/README.md b/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/README.md deleted file mode 100644 index 52dc065..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/README.md +++ /dev/null @@ -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= -export SCW_ACCESS_KEY= -export SCW_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 -``` - - diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/scaleway.tf b/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/scaleway.tf deleted file mode 100644 index 5fa7474..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-scaleway/scaleway.tf +++ /dev/null @@ -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" -} \ No newline at end of file diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-tools.md b/workspaces/ansible-terraform-workspace/removeme_docs/terraform-tools.md deleted file mode 100644 index f90502d..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/terraform-tools.md +++ /dev/null @@ -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/) \ No newline at end of file diff --git a/workspaces/ansible-terraform-workspace/removeme_docs/terraform.md b/workspaces/ansible-terraform-workspace/removeme_docs/terraform.md deleted file mode 100644 index 45158da..0000000 --- a/workspaces/ansible-terraform-workspace/removeme_docs/terraform.md +++ /dev/null @@ -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= -export SCW_ACCESS_KEY= -export SCW_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 - - -

- Htop -

- - -**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 = -aws_secret_access_key = -``` - -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 - -

- Htop -

- -## 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/ -``` - -

- rover-scaleway -

- -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 - -

- rover-aws -

- -## 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 - -

- Htop -

- -***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 -``` diff --git a/workspaces/base-workspace/removeme_docs/future-improvements.md b/workspaces/base-workspace/removeme_docs/future-improvements.md deleted file mode 100644 index 7d8bb31..0000000 --- a/workspaces/base-workspace/removeme_docs/future-improvements.md +++ /dev/null @@ -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 -``` \ No newline at end of file diff --git a/workspaces/base-workspace/removeme_docs/getting-started.md b/workspaces/base-workspace/removeme_docs/getting-started.md deleted file mode 100644 index b69d2b9..0000000 --- a/workspaces/base-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -

- Base-Workspace terminal -

- -## Scheduler - -Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures - -

- Cronicle -

- -## 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 &! -``` diff --git a/workspaces/base-workspace/removeme_docs/schedule-script.md b/workspaces/base-workspace/removeme_docs/schedule-script.md deleted file mode 100644 index 0ff5ea7..0000000 --- a/workspaces/base-workspace/removeme_docs/schedule-script.md +++ /dev/null @@ -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 - -

- Filebrowser -

- -Schedule daily executions with Cronicle - -

- Filebrowser -

- diff --git a/workspaces/codeserver-workspace/removeme_docs/getting-started.md b/workspaces/codeserver-workspace/removeme_docs/getting-started.md deleted file mode 100644 index d8b343f..0000000 --- a/workspaces/codeserver-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -## 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. - -

- Code-server demo -

- -## Terminal - -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- -## Scheduler - -Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures - -

- Cronicle -

- -## 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 &! -``` diff --git a/workspaces/elasticsearch-workspace/removeme_docs/tutorial.md b/workspaces/elasticsearch-workspace/removeme_docs/tutorial.md deleted file mode 100644 index b1eea31..0000000 --- a/workspaces/elasticsearch-workspace/removeme_docs/tutorial.md +++ /dev/null @@ -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. - -

- Kibana -

- -Open Quickstart page [localhost:8020](http://localhost:8020/) for quick access to all the workspace tools - -

- WID demo -

- -Open browser-based terminal [localhost:8026](http://localhost:8026/), check cluster nodes and shards - -``` -vulcanizer --host es01 nodes -vulcanizer --host es01 shards -``` - -

- vulcanizer -

- -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" -``` - -

- elasticdump -

- -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`. - -

- IDE -

- -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" - -

- Cronicle -

diff --git a/workspaces/go-workspace/removeme_docs/getting-started.md b/workspaces/go-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 9423f7b..0000000 --- a/workspaces/go-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- -## 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 - Go’s 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 \ No newline at end of file diff --git a/workspaces/ide-workspace/removeme_docs/getting-started.md b/workspaces/ide-workspace/removeme_docs/getting-started.md deleted file mode 100644 index cb75696..0000000 --- a/workspaces/ide-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -## 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. - -

- theia-themes.png -

- -You can install any extension from [open-vsx.org](https://open-vsx.org/) that has hundreeds of extensions for VS Code compatible editors. - - -

- Theia demo -

- -## Terminal - -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- -## Scheduler - -Cronicle can execute on schedule scripts, jobs and tasks. It has nice UI to monitor executions and failures - -

- Cronicle -

- -## 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 &! -``` diff --git a/workspaces/java-workspace/removeme_docs/getting-started.md b/workspaces/java-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 525b2dd..0000000 --- a/workspaces/java-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## 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 it’s 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 -``` - - - diff --git a/workspaces/kafka-workspace/removeme_docs/getting-started.md b/workspaces/kafka-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 4d31ec6..0000000 --- a/workspaces/kafka-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -

- Kafka WID -

- -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. - -

- Theia connect WID -

- -Using VS-code Kafka extension create topic "quickstart-events", and cosume events from this topic directly in VS-code using Kafka extension - -

- Theia Kafka consume -

- -### 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 -``` - -

- Send message -

- - -### [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 -``` - -

- KT demo -

- -### [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 -``` diff --git a/workspaces/nodejs-workspace/removeme_docs/getting-started.md b/workspaces/nodejs-workspace/removeme_docs/getting-started.md deleted file mode 100644 index bfb6525..0000000 --- a/workspaces/nodejs-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The code editor in this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- -## 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 -``` - -

- nvm.png -

- - -## 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 doesn’t 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/) - - diff --git a/workspaces/php-workspace/removeme_docs/getting-started.md b/workspaces/php-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 75ea78b..0000000 --- a/workspaces/php-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## Hello World - -Check PHP version - -``` -php -v -``` - -Open IDE and create file `hello.php` with the following content - -``` - - - PHP Test - - - Hello World

'; ?> - - -``` - -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 -``` - -

- serve-website -

- -# Composer - -Install package with Composer - -``` -composer require phpunit/php-timer -``` - diff --git a/workspaces/postgres-workspace/removeme_docs/future-candidates.md b/workspaces/postgres-workspace/removeme_docs/future-candidates.md deleted file mode 100644 index dd7b631..0000000 --- a/workspaces/postgres-workspace/removeme_docs/future-candidates.md +++ /dev/null @@ -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. \ No newline at end of file diff --git a/workspaces/postgres-workspace/removeme_docs/getting-started.md b/workspaces/postgres-workspace/removeme_docs/getting-started.md deleted file mode 100644 index d2a9360..0000000 --- a/workspaces/postgres-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -

- Theia connect -

- -If you loaded sample databases to the local Postgres, connect & explore data directly in the IDE - -

- Theia explore -

- -## 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 -``` - -

- pgcli -

- -

- pspg -

- -### 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. - -

- pgmetrics -

- -### 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. - -

- Cronicle -

- -## 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. - -

- dbdesigner -

- -### 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 - -

- schemaspy -

- -### Postgres explain visualizer - -[Pev](https://github.com/AlexTatiyants/pev) helps to understand Postgres execution plans - -

- pev -

- -### 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 -``` - -

- pgflame -

- -## 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 = -``` - diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/.gitignore b/workspaces/postgres-workspace/removeme_mkdocs2/.gitignore deleted file mode 100644 index c9bd680..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/.gitignore +++ /dev/null @@ -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/ \ No newline at end of file diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/README.md b/workspaces/postgres-workspace/removeme_mkdocs2/docs/README.md deleted file mode 100644 index e08226b..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/docs/README.md +++ /dev/null @@ -1,142 +0,0 @@ - - - -{% - 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" - } - ] -%} - - -
- {% for tool in tools %} - {% set tool_url = get_tool_url(tool.env) %} -
- - - - -
{{ tool.name }}
-
-
{{ tool.description }}
-
- {% endfor %} -
- - - - - diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg deleted file mode 100644 index db53f4c..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - -Created with Fabric.js 3.6.3 - - - - - \ No newline at end of file diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/favicon.ico b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/favicon.ico deleted file mode 100644 index 2c8bed5..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/favicon.ico and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg deleted file mode 100644 index 03c56be..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png deleted file mode 100644 index f4b5700..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg deleted file mode 100644 index 994bc13..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg deleted file mode 100644 index 0330ae5..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg deleted file mode 100644 index 9b0a92a..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png deleted file mode 100755 index 333cb6c..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Pev2.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Pev2.png deleted file mode 100644 index f1a6b47..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Pev2.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png deleted file mode 100644 index 4d8fa6b..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png deleted file mode 100644 index 9ccb947..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg deleted file mode 100644 index c09223c..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/dbdesigner.png b/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/dbdesigner.png deleted file mode 100644 index 1d670c4..0000000 Binary files a/workspaces/postgres-workspace/removeme_mkdocs2/docs/assets/home/dbdesigner.png and /dev/null differ diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/docs/javascript/config.js b/workspaces/postgres-workspace/removeme_mkdocs2/docs/javascript/config.js deleted file mode 100644 index 06dbf38..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/docs/javascript/config.js +++ /dev/null @@ -1,16 +0,0 @@ -window.MathJax = { - tex: { - inlineMath: [["\\(", "\\)"]], - displayMath: [["\\[", "\\]"]], - processEscapes: true, - processEnvironments: true - }, - options: { - ignoreHtmlClass: ".*|", - processHtmlClass: "arithmatex" - } -}; - -document$.subscribe(() => { - MathJax.typesetPromise() -}) diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/macros/helpers.py b/workspaces/postgres-workspace/removeme_mkdocs2/macros/helpers.py deleted file mode 100644 index e8084e6..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/macros/helpers.py +++ /dev/null @@ -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}" - - \ No newline at end of file diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/mkdocs.yml b/workspaces/postgres-workspace/removeme_mkdocs2/mkdocs.yml deleted file mode 100644 index 548a6e2..0000000 --- a/workspaces/postgres-workspace/removeme_mkdocs2/mkdocs.yml +++ /dev/null @@ -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 - - - - - - - - - diff --git a/workspaces/postgres-workspace/removeme_mkdocs2/overrides/partials/footer.html b/workspaces/postgres-workspace/removeme_mkdocs2/overrides/partials/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/workspaces/python-workspace/removeme_docs/getting-started.md b/workspaces/python-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 6452479..0000000 --- a/workspaces/python-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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. - -
- Demo: Eclipse Theia -
- -

- Theia -

- -## Terminal - -Open Terminnal from the Quickstart page. - -
- Demo: Browser-based terminal -
- -

- python-terminal.gif -

- - -## [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: - -

- ipython.png -

- -**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. - -
- Demo: Install dependencies for notebooks -
- -

- notebooks-install.png -

- - -## 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//`. - -
- Demo: Python report -
- -

- python-report.gif -

- -*(In addition, all pytests statistics will be collected, and available in foldder `/home/static-server/`)*. - -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. - -

- pytest-html-report.png -

- -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 - -
- Demo: Pytest-html-reporter -
- -

- pytest-html-report.gif -

- -### [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 ./ ` - -
- Demo: Pdoc3 -
- -

- pdoc3.gif -

- - -### [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 ` - -
- Demo: Vprof -
- -

- vprof.gif -

- - -### [SnakeViz](https://jiffyclub.github.io/snakeviz/) - -SnakeViz is a browser based graphical viewer for the output of Python’s 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 - -
- Demo: SnakeViz -
- -

- snakeviz.gif -

- -### [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 ` - -
- Demo: Flameprof -
- -

- flameprof.png -

- - -### [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 ` - -
- Demo: Pyinstrument -
- -

- pyinstrument.png -

- - -### [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 ` - -
- Demo: Pylint-json2html demo -
- -

- pylint.png -

- -### 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_.json`. This -folder is served by the Static-file server - -
- Demo: Fetch exchange rates -
- -

- exchange-rates.gif -

- -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 - -
- Demo: Schedule exchange rates -
- -

- exchange-rates.gif -

- -**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). \ No newline at end of file diff --git a/workspaces/r-workspace/removeme_docs/getting-started.md b/workspaces/r-workspace/removeme_docs/getting-started.md deleted file mode 100644 index d90b1e1..0000000 --- a/workspaces/r-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -This workspace includes RStudio Server, a browser-based IDE for R. - -

- RStudio -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## R - -Open terminal, and check R version - -``` -R --version -``` - -

- RStudio -

- -To start R shell, simply execute `R` in the terminal - -

- RStudio -

- -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 - -

- RStudio -

- diff --git a/workspaces/r-workspace/removeme_mkdocs2/.gitignore b/workspaces/r-workspace/removeme_mkdocs2/.gitignore deleted file mode 100644 index c9bd680..0000000 --- a/workspaces/r-workspace/removeme_mkdocs2/.gitignore +++ /dev/null @@ -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/ \ No newline at end of file diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg deleted file mode 100644 index db53f4c..0000000 --- a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - -Created with Fabric.js 3.6.3 - - - - - \ No newline at end of file diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/favicon.ico b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/favicon.ico deleted file mode 100644 index 2c8bed5..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/favicon.ico and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg deleted file mode 100644 index 03c56be..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png deleted file mode 100644 index f4b5700..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg deleted file mode 100644 index 994bc13..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg deleted file mode 100644 index 0330ae5..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg deleted file mode 100644 index 9b0a92a..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png deleted file mode 100755 index 333cb6c..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png deleted file mode 100644 index 4d8fa6b..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png deleted file mode 100644 index 9ccb947..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg b/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg deleted file mode 100644 index c09223c..0000000 Binary files a/workspaces/r-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg and /dev/null differ diff --git a/workspaces/r-workspace/removeme_mkdocs2/docs/javascript/config.js b/workspaces/r-workspace/removeme_mkdocs2/docs/javascript/config.js deleted file mode 100644 index 06dbf38..0000000 --- a/workspaces/r-workspace/removeme_mkdocs2/docs/javascript/config.js +++ /dev/null @@ -1,16 +0,0 @@ -window.MathJax = { - tex: { - inlineMath: [["\\(", "\\)"]], - displayMath: [["\\[", "\\]"]], - processEscapes: true, - processEnvironments: true - }, - options: { - ignoreHtmlClass: ".*|", - processHtmlClass: "arithmatex" - } -}; - -document$.subscribe(() => { - MathJax.typesetPromise() -}) diff --git a/workspaces/r-workspace/removeme_mkdocs2/macros/helpers.py b/workspaces/r-workspace/removeme_mkdocs2/macros/helpers.py deleted file mode 100644 index 11e499b..0000000 --- a/workspaces/r-workspace/removeme_mkdocs2/macros/helpers.py +++ /dev/null @@ -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}" - - \ No newline at end of file diff --git a/workspaces/r-workspace/removeme_mkdocs2/mkdocs.yml b/workspaces/r-workspace/removeme_mkdocs2/mkdocs.yml deleted file mode 100644 index 4de1685..0000000 --- a/workspaces/r-workspace/removeme_mkdocs2/mkdocs.yml +++ /dev/null @@ -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 - - - - - - - - - diff --git a/workspaces/r-workspace/removeme_mkdocs2/overrides/partials/footer.html b/workspaces/r-workspace/removeme_mkdocs2/overrides/partials/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/workspaces/redis-workspace/removeme_docs/getting-started.md b/workspaces/redis-workspace/removeme_docs/getting-started.md deleted file mode 100644 index cfcf487..0000000 --- a/workspaces/redis-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -

- Redis WID -

- -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 - -

- Redis commander -

- -Alternatively use browser-based VS-code [localhost:8025](http://localhost:8025/) with Redis extension - -

- Theia -

- -### 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 -``` - -

- Redis TUI -

- -To interact with internal Redis, inn the workspace terminal launch iredis CLI, get & set keys - -``` -iredis -``` - -

- Iredis -

- -Iredis has autocompletion and hints, which might be handy for administrative tasks - -``` -iredis --newbie -``` - -

- Iredis-newbie -

- - -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 diff --git a/workspaces/redis-workspace/removeme_mkdocs2/.gitignore b/workspaces/redis-workspace/removeme_mkdocs2/.gitignore deleted file mode 100644 index c9bd680..0000000 --- a/workspaces/redis-workspace/removeme_mkdocs2/.gitignore +++ /dev/null @@ -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/ \ No newline at end of file diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg deleted file mode 100644 index db53f4c..0000000 --- a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - -Created with Fabric.js 3.6.3 - - - - - \ No newline at end of file diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/favicon.ico b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/favicon.ico deleted file mode 100644 index 2c8bed5..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/favicon.ico and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg deleted file mode 100644 index 03c56be..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png deleted file mode 100644 index f4b5700..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg deleted file mode 100644 index 994bc13..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg deleted file mode 100644 index 0330ae5..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg deleted file mode 100644 index 9b0a92a..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png deleted file mode 100755 index 333cb6c..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png deleted file mode 100644 index 4d8fa6b..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png deleted file mode 100644 index 9ccb947..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg b/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg deleted file mode 100644 index c09223c..0000000 Binary files a/workspaces/redis-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg and /dev/null differ diff --git a/workspaces/redis-workspace/removeme_mkdocs2/docs/javascript/config.js b/workspaces/redis-workspace/removeme_mkdocs2/docs/javascript/config.js deleted file mode 100644 index 06dbf38..0000000 --- a/workspaces/redis-workspace/removeme_mkdocs2/docs/javascript/config.js +++ /dev/null @@ -1,16 +0,0 @@ -window.MathJax = { - tex: { - inlineMath: [["\\(", "\\)"]], - displayMath: [["\\[", "\\]"]], - processEscapes: true, - processEnvironments: true - }, - options: { - ignoreHtmlClass: ".*|", - processHtmlClass: "arithmatex" - } -}; - -document$.subscribe(() => { - MathJax.typesetPromise() -}) diff --git a/workspaces/redis-workspace/removeme_mkdocs2/mkdocs.yml b/workspaces/redis-workspace/removeme_mkdocs2/mkdocs.yml deleted file mode 100644 index 548a6e2..0000000 --- a/workspaces/redis-workspace/removeme_mkdocs2/mkdocs.yml +++ /dev/null @@ -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 - - - - - - - - - diff --git a/workspaces/redis-workspace/removeme_mkdocs2/overrides/partials/footer.html b/workspaces/redis-workspace/removeme_mkdocs2/overrides/partials/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/workspaces/ruby-workspace/removeme_docs/getting-started.md b/workspaces/ruby-workspace/removeme_docs/getting-started.md deleted file mode 100644 index f4c386c..0000000 --- a/workspaces/ruby-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- -## 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/) - - - - - diff --git a/workspaces/rust-workspace/removeme_docs/getting-started.md b/workspaces/rust-workspace/removeme_docs/getting-started.md deleted file mode 100644 index 0c850ed..0000000 --- a/workspaces/rust-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## 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 you’ll 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`. - -

- cargo dependencies -

- -Open in your browser [0.0.0.0:8030/hello.html](http://0.0.0.0:8030/hello.html) to see a simple page. diff --git a/workspaces/scala-workspace/removeme_docs/getting-started.md b/workspaces/scala-workspace/removeme_docs/getting-started.md deleted file mode 100644 index a9c34e5..0000000 --- a/workspaces/scala-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -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 - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## Scala - -To check scala version, execute in terminal - -``` -scala -version -``` - -To open scala REPL simply execute - -``` -scala -``` - -

- scala-repl.png -

- -### 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 -``` diff --git a/workspaces/streamlit-workspace/removeme_docs/getting-started.md b/workspaces/streamlit-workspace/removeme_docs/getting-started.md deleted file mode 100644 index df19fcb..0000000 --- a/workspaces/streamlit-workspace/removeme_docs/getting-started.md +++ /dev/null @@ -1,46 +0,0 @@ -# Getting started - -## Intro - -From the quicklaunch Home page you can open workspace tools, such as code editor or terminal - -
- Demo: Workspace UI -
- -

- wid-ui.png -

- -The main code editor of this workspace is [Code-server](https://github.com/cdr/code-server) - -
- Demo: Code-server -
- -

- Code-server demo -

- -Workspace has full-size browser-base terminal - -

- Base-Workspace terminal -

- - -## Streamlit - -Open terminal, and launch example streamlit application - -``` -streamlit run /home/examples/uber.py -``` - -Open running Streamlit app from the quickstart page - -

- Start Steamlit -

- -You can luanch any Streamlit app, annd use quickstart page to quickly ope the app. diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/.gitignore b/workspaces/streamlit-workspace/removeme_mkdocs2/.gitignore deleted file mode 100644 index c9bd680..0000000 --- a/workspaces/streamlit-workspace/removeme_mkdocs2/.gitignore +++ /dev/null @@ -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/ \ No newline at end of file diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg deleted file mode 100644 index db53f4c..0000000 --- a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/Alnoda-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - -Created with Fabric.js 3.6.3 - - - - - \ No newline at end of file diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/favicon.ico b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/favicon.ico deleted file mode 100644 index 2c8bed5..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/favicon.ico and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg deleted file mode 100644 index 03c56be..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Cronicle.jpg and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png deleted file mode 100644 index f4b5700..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Filebrowser.png and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg deleted file mode 100644 index 994bc13..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Htop.jpg and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg deleted file mode 100644 index 0330ae5..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/IDE.jpg and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg deleted file mode 100644 index 9b0a92a..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MC.jpg and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png deleted file mode 100755 index 333cb6c..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/MkDocs.png and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png deleted file mode 100644 index 4d8fa6b..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Static-server.png and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png deleted file mode 100644 index 9ccb947..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Terminal.png and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg deleted file mode 100644 index c09223c..0000000 Binary files a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/assets/home/Ungit.jpg and /dev/null differ diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/javascript/config.js b/workspaces/streamlit-workspace/removeme_mkdocs2/docs/javascript/config.js deleted file mode 100644 index 06dbf38..0000000 --- a/workspaces/streamlit-workspace/removeme_mkdocs2/docs/javascript/config.js +++ /dev/null @@ -1,16 +0,0 @@ -window.MathJax = { - tex: { - inlineMath: [["\\(", "\\)"]], - displayMath: [["\\[", "\\]"]], - processEscapes: true, - processEnvironments: true - }, - options: { - ignoreHtmlClass: ".*|", - processHtmlClass: "arithmatex" - } -}; - -document$.subscribe(() => { - MathJax.typesetPromise() -}) diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/mkdocs.yml b/workspaces/streamlit-workspace/removeme_mkdocs2/mkdocs.yml deleted file mode 100644 index b8b4b3f..0000000 --- a/workspaces/streamlit-workspace/removeme_mkdocs2/mkdocs.yml +++ /dev/null @@ -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 - - - - - - - - - diff --git a/workspaces/streamlit-workspace/removeme_mkdocs2/overrides/partials/footer.html b/workspaces/streamlit-workspace/removeme_mkdocs2/overrides/partials/footer.html deleted file mode 100644 index e69de29..0000000