diff --git a/docs/AI-Usage.md b/docs/AI-Usage.md index de6966d..16b9607 100644 --- a/docs/AI-Usage.md +++ b/docs/AI-Usage.md @@ -5,6 +5,7 @@ AI is prone to halucinations and mistakes, therefore will AI used in a thoughtfu ## Tools used Different group members use different harnesses and models, according to personal preference. * Mistral Vibe Code CLI +* Mistral Vibe Work ## Summary of how AI was used ... @@ -14,4 +15,6 @@ Different group members use different harnesses and models, according to persona | --- | --- | ---- | ------------ | | 29.09.2026 | Daniel | Mistral Vibe Work, Mistral Vibe Code CLI | Critize my PRD in context of best practices and project description | | 29.09.2026 | Daniel | Mistral Vibe Work | Find fitting labels for issues and PRs for the project | +| 9.10.2026 | Daniel | Mistral Vibe Work | Help with freeing disk space on VM and make a list over usefull postgreSQL command | + diff --git a/docs/postgresql-management.md b/docs/postgresql-management.md new file mode 100644 index 0000000..8e043a4 --- /dev/null +++ b/docs/postgresql-management.md @@ -0,0 +1,27 @@ +# Manage Postgresql database +SSH into the VM to manage the database. There is currntly no exposed postgreSQL ports for remote management other than trough SSH. + +## Connect to the database and run queries. +Run as the postgres system user. Use your user account password if sudo requests it. +``` +sudo -u postgres psql +``` + +Run a sinlge query +``` +sudo -u postgres psql -c "SELECT example FROM EXAMPLE;" +``` + +## Some handful commands inside psql — meta-commands +| Command | What it does | +| --- | --- | +| `\l` | List all databases | +| `\c mydb` | Switch to another database | +| `\dt` | List tables in the current schema | +| `\d mytable` | Describe a table (columns, types, indexes) | +| `\du` | List roles/users and their privileges | +| `\dn` | List schemas | +| `\x` | Toggle expanded row display (great for wide rows) | +| `\timing` | Show how long each query takes | +| `\i script.sql` | Execute a SQL file | +| `\q` | Quit | \ No newline at end of file diff --git a/docs/postgresql-setup.md b/docs/postgresql-setup.md new file mode 100644 index 0000000..9a236b8 --- /dev/null +++ b/docs/postgresql-setup.md @@ -0,0 +1,55 @@ +# PostgreSQL setup/install + +## VM needed cleanup +The VM was full, no avialable storage. The install failed first time. +Before: +``` +$ df -h / +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/ubuntu--vg-ubuntu--lv 22G 21G 0 100% / +``` + +Commands i used to get back some storage space. +``` +sudo apt-get clean +sudo journalctl --vacuum-size=100M +sudo apt-get autoremove --purge && sudo apt-get autoclean +``` + +After: +``` +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/ubuntu--vg-ubuntu--lv 22G 19G 2.0G 91% / +``` + +## Installing PostgreSQL +``` +apt install postgresql +``` + +Check that it is running +``` +$ systemctl status postgresql +● postgresql.service - PostgreSQL RDBMS + Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled) + Active: active (exited) since Fri 2026-10-09 10:45:03 CEST; 1min 2s ago + Invocation: 53a72781a00d4fe89442166a499e2145 + Main PID: 1823221 (code=exited, status=0/SUCCESS) + Mem peak: 1.7M + CPU: 4ms +``` +``` +$ pg_isready +/var/run/postgresql:5432 - accepting connections +$ sudo ss -ltnp | grep 5432 +LISTEN 0 200 127.0.0.1:5432 0.0.0.0:* users:(("postgres",pid=1824131,fd=6)) +$ sudo -u postgres psql +psql (18.6 (Ubuntu 18.6-0ubuntu0.26.04.1)) +Type "help" for help. + +postgres=# SELECT version(); + version +--------------------------------------------------------------------------------------------------------------------------------- + PostgreSQL 18.6 (Ubuntu 18.6-0ubuntu0.26.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit +``` +