diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-06-16 10:44:49 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-06-16 10:44:49 +0200 |
commit | 0d389e1d6c1aed4a92f82d9711f4564a12390fcd (patch) | |
tree | ca4925547669a045d836c2aeb6d4b2309c3f5996 | |
parent | 32422d2b9001291d7136036581122cf4b4eec75c (diff) |
vault backup: 2025-06-16 10:44:49
33 files changed, 229 insertions, 7 deletions
diff --git a/daily/02-Jun-2025.md b/.trash/02-Jun-2025.md index e69de29..e69de29 100644 --- a/daily/02-Jun-2025.md +++ b/.trash/02-Jun-2025.md diff --git a/daily/15-May-2025.md b/.trash/15-May-2025.md index e69de29..e69de29 100644 --- a/daily/15-May-2025.md +++ b/.trash/15-May-2025.md diff --git a/daily/20-May-2025.md b/.trash/20-May-2025.md index e69de29..e69de29 100644 --- a/daily/20-May-2025.md +++ b/.trash/20-May-2025.md diff --git a/.trash/Group.ONE Gitlab CI.md b/.trash/Group.ONE Gitlab CI.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.trash/Group.ONE Gitlab CI.md diff --git a/Access another repository from a gitlab CI job.md b/Access another repository from a gitlab CI job.md new file mode 100644 index 0000000..c785f62 --- /dev/null +++ b/Access another repository from a gitlab CI job.md @@ -0,0 +1,6 @@ +[[Gitlab Docs]] [[Use YAML anchors to reuse scripts in Gitlab CI]] + +To access another repo from a CI job use basic auth over https using the credentials: `gitlab-ci-token:${CI_JOB_TOKEN}`. + +Example: +`https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.group.one/groupvps/group-one-backup-agent.git`
\ No newline at end of file @@ -0,0 +1,22 @@ +--- +tags: +--- +[[Docker]] [[Docker images]] + +Bake is a tool that manages docker build configurations, that are easily referenced e.g: `docker buildx bake <target>`. + +It uses a config file: `docker-bake.hcl`. With it you can specify multiple targets and their build switches (as one would pass directly to docker build): + +```docker-bake.hcl +target "test" { + dockerfile = "docker/test.Dockerfile" +} + +target "debian" { + dockerfile = "docker/debian.Dockerfile" +} + +target "ci" { + dockerfile = "docker/ci.Dockerfile" +} +``` diff --git a/DON'T organize your zettelkasten by Morganeua (YT) - 2024.md b/DON'T organize your zettelkasten by Morganeua (YT) - 2024.md new file mode 100644 index 0000000..c2ddc77 --- /dev/null +++ b/DON'T organize your zettelkasten by Morganeua (YT) - 2024.md @@ -0,0 +1 @@ +https://www.youtube.com/watch?v=GUdBI1JSZKA diff --git a/Docker images.md b/Docker images.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Docker images.md diff --git a/Docker-in-docker.md b/Docker-in-docker.md new file mode 100644 index 0000000..9a2eae4 --- /dev/null +++ b/Docker-in-docker.md @@ -0,0 +1,13 @@ +[[Use YAML anchors to reuse scripts in Gitlab CI]] + +**To use docker-in-docker** we need to specify a tag, a service and a specific image: +``` + tags: + - docker-in-docker + image: harbor.one.com/docker-hub/library/docker:latest + services: + - docker:dind +``` + +> It's not possible with a custom CI image afaik, so everything needs to run inside a docker container. + diff --git a/Docker.md b/Docker.md new file mode 100644 index 0000000..d803590 --- /dev/null +++ b/Docker.md @@ -0,0 +1,4 @@ +A container platform which makes it very easy to spin up containers. For example on NixOS when I run into issues because of it being a Non-FHS distro, I can work around it by spinning up a small ubuntu container that does whatever I wanted to do until I (or someone else) makes it available on Nix. + +How it works: +First you build a [[Docker images]] which
\ No newline at end of file diff --git a/Executing background tasks from a script.md b/Executing background tasks from a script.md new file mode 100644 index 0000000..7db07be --- /dev/null +++ b/Executing background tasks from a script.md @@ -0,0 +1,7 @@ +--- +tags: + - bash +--- +[[Bash]] [[Executing bash commands as another user]] + +The easiest way I've found is via tmux: `tmux -d new-session -s somename 'command'`. Stuff with `nohup` and `&` tends to be a little bit painful. Especially so when executing this over ssh.
\ No newline at end of file diff --git a/Executing bash commands as another user.md b/Executing bash commands as another user.md new file mode 100644 index 0000000..c934f16 --- /dev/null +++ b/Executing bash commands as another user.md @@ -0,0 +1,12 @@ +--- +tags: + - bash +--- +[[Bash]] [[Temporary set permissions with which new files are created]] + +Using `sudo` we can execute commands as other users, most commonly as the root user. When passing `-u` switch we can specify different users. + +When the command involves output redirection it is common to pass the entire command to a shell executed as that user: `sudo -u user bash -c 'command > redirect'`. + +## Why do I get "command not found" as I execute with another user? +This can be because `sudo` normally discards the environment. Passing the `-i` switch makes sudo "login" which causes `.profile` et al to be sourced, thus configuring the user environment.
\ No newline at end of file diff --git a/Gitlab CI job artifacts.md b/Gitlab CI job artifacts.md new file mode 100644 index 0000000..97b05d5 --- /dev/null +++ b/Gitlab CI job artifacts.md @@ -0,0 +1,40 @@ +[Job artifacts](https://docs.gitlab.com/ci/jobs/job_artifacts/) + +--- +# Creation +Expose via +``` +artifacts: + path: + - blaat.txt +``` + > path is relative to repository where job was created + + Wildcards can be used: `*` in the path. + Expiry can be set, ie: `expire_in: 1 week`. +`artifacts: name` to explicitly name the artifact. +# Using +Artifacts are downloaded into the job's working directory by default. If one specifies either: `dependencies` or `needs` only artifacts of jobs of those are downloaded. +`dependencies` only specifies which artifacts to download whereas `needs` also defined the relationship between jobs. +To prevent downloading dependencies at all just set `dependencies: []`. + +Example: +``` +dependencies: + - build-gobs + - build-goba +``` + +They can also be downloaded over http. Using the job token is allowed. +```plaintext +https://gitlab.com/api/v4/projects/<project-id>/jobs/artifacts/main/download?job=build +``` + +``` +build_submodule: + stage: test + script: + - apt update && apt install -y unzip + - curl --location --output artifacts.zip "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/main/download?job=test&job_token=$CI_JOB_TOKEN" + - unzip artifacts.zip +```
\ No newline at end of file diff --git a/Gitlab Docs - Resource Group.md b/Gitlab Docs - Resource Group.md new file mode 100644 index 0000000..162c8f1 --- /dev/null +++ b/Gitlab Docs - Resource Group.md @@ -0,0 +1,7 @@ +[[Gitlab Docs]] + +--- + +[Resource groups](https://docs.gitlab.com/ci/resource_groups/) +[Update process mode](https://docs.gitlab.com/api/resource_groups/#edit-an-existing-resource-group) + diff --git a/Gitlab Docs.md b/Gitlab Docs.md new file mode 100644 index 0000000..97432b1 --- /dev/null +++ b/Gitlab Docs.md @@ -0,0 +1,5 @@ +[[Gitlab]] + +--- + +[[Gitlab CI job artifacts]] diff --git a/Gitlab.md b/Gitlab.md new file mode 100644 index 0000000..d8cb424 --- /dev/null +++ b/Gitlab.md @@ -0,0 +1 @@ +[[Gitlab Docs]] @@ -3,7 +3,7 @@ tags: - html - web --- -HyperText Markup Language. + HyperText Markup Language. Describes structure of documents on the web. Consists of elements, which is denoted by tags. An element is everything from the start tag to the end tag and in between. An element can contain other elements. diff --git a/Makefiletutorial.com.md b/Makefiletutorial.com.md new file mode 100644 index 0000000..48c1c70 --- /dev/null +++ b/Makefiletutorial.com.md @@ -0,0 +1 @@ +https://makefiletutorial.com
\ No newline at end of file diff --git a/Manila.md b/Manila.md new file mode 100644 index 0000000..6263c5a --- /dev/null +++ b/Manila.md @@ -0,0 +1,7 @@ +[[OpenStack]] +### Random notes from before +Share network +Cinder + +**dhss = driver_handles_share_server** +Means that Manilla creates a share server, requiring a share network and a service image.
\ No newline at end of file diff --git a/Native Protocol - Web.md b/Native Protocol - Web.md new file mode 100644 index 0000000..08e3c3c --- /dev/null +++ b/Native Protocol - Web.md @@ -0,0 +1,15 @@ +[[PipeWire]] + +--- + +[Native Protocol](https://docs.pipewire.org/page_native_protocol.html). + +**Message** +- header 16 bytes + - 4 - uint32 words (id, (opcode, size), seq, n_fds) +- payload: variable length + +IPC over UNIX sockets. Socket default name: `pipewire-0` found in either: +- env: PIPEWIREresource gro_RUNTIME_DIR +- env: XDG_RUNTIME_DIR +- env: USERPROFILE
\ No newline at end of file diff --git a/OpenStack.md b/OpenStack.md new file mode 100644 index 0000000..37baea7 --- /dev/null +++ b/OpenStack.md @@ -0,0 +1,4 @@ +Our cloud platform comprised of many "microservices". + +# Services +[[Manila]]
\ No newline at end of file diff --git a/PipeWire.md b/PipeWire.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PipeWire.md diff --git a/Pytest.md b/Pytest.md new file mode 100644 index 0000000..9caf78d --- /dev/null +++ b/Pytest.md @@ -0,0 +1,3 @@ +# Invocation +`pytest test_mod.py::test_func` +`pytest test_mod.py::TestClass::test_method`
\ No newline at end of file diff --git a/Resource groups for mutual exclusive running of jobs.md b/Resource groups for mutual exclusive running of jobs.md new file mode 100644 index 0000000..d56edbf --- /dev/null +++ b/Resource groups for mutual exclusive running of jobs.md @@ -0,0 +1,23 @@ +[[Gitlab Docs - Resource Group]] + +--- + +It is possible for jobs to be run in serial over different pipelines by adding them to a `resource_group`. Jobs in the same `resource_group` will wait on other jobs in that group to be finished before starting. + +Keyword: `resource_group`. + +For example this was useful when building a pipeline that spins up a VM to run devstack and install the backup service. To prevent more recent pipelines from interfering with prior pipelines that are still running I've put jobs that need to wait in the `resource_group: devstack`. + +### Process modes +- unordered +- oldest_first +- newest_first +- newest_ready_first + +Sadly these can't be easily set in the YAML definition but have to be configured for a specific resource group via the API. + +``` +curl --request PUT --data "process_mode=oldest_first" \ + --header "PRIVATE-TOKEN: glpat-GpPmmkY5LYuHscpvZPJ8" "https://gitlab.group.one/api/v4/projects/6675/resource_groups/devstack" +{"id":102,"key":"devstack","process_mode":"oldest_first","created_at":"2025-05-27T13:10:00.691Z","updated_at":"2025-06-10T15:06:48.569Z"} +```
\ No newline at end of file diff --git a/Source notes and note notes.md b/Source notes and note notes.md new file mode 100644 index 0000000..35ac8f5 --- /dev/null +++ b/Source notes and note notes.md @@ -0,0 +1,13 @@ +The idea of specific notes that describe where a piece of information comes from are source notes. + +An example she gives of a source note is a note named: The Climate Crisis by Mary Jane - 2018. In this note she for example sticks raw quotes from the book. + +**Source note naming convention**: Title - Author - Year + +Note notes contain just raw information. +**Note naming convention**: just a descriptive title. + +Another useful thing I noticed that she does is have a note for a broad topic, e.g "climate change" which doesn't contain anything itself but is just linked against. + +--- +[[DON'T organize your zettelkasten by Morganeua (YT) - 2024]]
\ No newline at end of file diff --git a/Submodules.md b/Submodules.md new file mode 100644 index 0000000..fe761e2 --- /dev/null +++ b/Submodules.md @@ -0,0 +1,4 @@ +To add another repo as a submodule: `git submodule add` + +To point the submodule to a specific branch: `git submodule set-branch -b <branch> submodule-path`. +It's important to pass `--remote` to `git submodule update` to make sure it tracks the branch specified.e
\ No newline at end of file diff --git a/Use YAML anchors to reuse scripts in Gitlab CI.md b/Use YAML anchors to reuse scripts in Gitlab CI.md new file mode 100644 index 0000000..ba22919 --- /dev/null +++ b/Use YAML anchors to reuse scripts in Gitlab CI.md @@ -0,0 +1,13 @@ +[[Docker-in-docker]] + +**Re-usable scripts** via YAML anchors, `extends` doesn't seem to merge scripts. +``` +.devstack-script: &devstack-script + - echo "${SECURE_YAML}" > secure.yaml + - echo "${SSH_PRIVATE_KEY}" | base64 -d > ssh-id + +blaat: + script: + - *devstack-script + - myscript +```
\ No newline at end of file diff --git a/daily/04-Jun-2025.md b/daily/04-Jun-2025.md new file mode 100644 index 0000000..3cb7031 --- /dev/null +++ b/daily/04-Jun-2025.md @@ -0,0 +1,4 @@ +**Occurrences** +Trying to install goba/gobs in the global venv of devstack. Had to relax the requirements of dependencies; thus dependencies being newer than tested with. This is suboptimal because now our environment is different from our prod.. + +In a more recent version of sqlalchemy they mask the password in engine.url by default (opposite to not masking it before): this caused a connection error during db sync. I remembered I ran into this before when looking at nova's db sync code and saw the `engine.url.render_as_string(hide_password=False)`. Updated our code with this fixed the issue
\ No newline at end of file diff --git a/daily/07-May-2025.md b/daily/07-May-2025.md index 298b634..1263975 100644 --- a/daily/07-May-2025.md +++ b/daily/07-May-2025.md @@ -1,10 +1,6 @@ Werk aan ZFS backup goba met Mohammed. Mohammed was paar dagen sidetracked met devstack opzetten. Had eigenlijk gehoopt dat hij met een plan van aanpak betreffende implementatie zou komen (daar had ik op gehint vrijdag (of donderdag al?)).. Nu afgesproken dat hij dit gaat maken. Om 15:00 doen we een meet om het door te spreken. Rutger hint ernaar dat wij een business service gaan opzetten die producten voor de group op openstack oplevert. - - - - # Non-functional requirements: Technical constraints: - Python @@ -18,7 +14,6 @@ Requirements: * Creating new resources should always be validated properly, doesn't have to be fast as long as its correct. * Reliable * Creating or updating resources should be atomic - # Functional requirements: - Authentication: the system requires users to be authenticated before being able to use its APIs. - Eventually consistent: it must not be that if a requested resource fails to create that another request has to be made. The creation of a resource is guaranteed. diff --git a/daily/10-Jun-2025.md b/daily/10-Jun-2025.md new file mode 100644 index 0000000..fff3fbd --- /dev/null +++ b/daily/10-Jun-2025.md @@ -0,0 +1,17 @@ +Performance review + +Beter tijdsinschatting geven. + +Work environment +Feedback: nicest person + +quality of work + +beter estimaten + +Doel: LPIC. + + +--- + +OVN loadbalancer health check. OVN nb: `nbctl show load_balancer_health_check`
\ No newline at end of file diff --git a/daily/11-Jun-2025.md b/daily/11-Jun-2025.md new file mode 100644 index 0000000..e693fed --- /dev/null +++ b/daily/11-Jun-2025.md @@ -0,0 +1,5 @@ +access to openstack, marcus ripkens. +marcus: cloud-init scripts to setup vms, loadbalancers, 2 dedicated personen, dns migration (yves geen vertrouwen axfr, geen insight in wat wel/niet goed synced is) +bare metal -> 10 vm's, lb needs update: domain -> new ip. +500K+ customers. +Yves overtuigen dat MHC team de proxies moet beheren indien permanent oplossing./
\ No newline at end of file diff --git a/daily/15-Jun-2025.md b/daily/15-Jun-2025.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/daily/15-Jun-2025.md @@ -0,0 +1 @@ + diff --git a/daily/27-May-2025.md b/daily/27-May-2025.md index 908736b..1000488 100644 --- a/daily/27-May-2025.md +++ b/daily/27-May-2025.md @@ -1,4 +1,3 @@ Decided that devenv is too invasive for use at work; I can't commit its .envrc nor .pre-commit-config.yaml. Therefore I'm setting up just regular shell.nix usage. I quickly ran into an issue where the nix shell is using bash and found a tool called Lorri which promises to be useful for developer environments with shell.nix. Let's hope that is less invasive than devenv. Thus far it's not very nice, it install stuff on the background ( a systemd daemon that listens for change ) of which you have no idea when its done. -TIL: gitlab ci job can specify `resource_group` to make it mutually exclusive with other jobs that have this resource group.
\ No newline at end of file |