diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-04-18 20:58:54 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-04-18 20:58:54 +0200 |
commit | ab409a3701bf59dd73dc1e0324376bdac8b6d74f (patch) | |
tree | 17fba0a6811534858300a550c06376b25f9644c6 | |
parent | c8c774ad7c0d98def2e83647d4f635ee275b66de (diff) |
vault backup: 2025-04-18 20:58:54
-rw-r--r-- | .obsidian/workspace.json | 81 | ||||
-rw-r--r-- | .trash/Untitled 3.md | 0 | ||||
-rw-r--r-- | About keyboard layout on Wayland.md | 15 | ||||
-rw-r--r-- | Benchmarking code in Golang.md | 40 | ||||
-rw-r--r-- | Debugging issues with updating Puppet dependency.md | 46 | ||||
-rw-r--r-- | Exposing development headers on Nixos.md | 15 | ||||
-rw-r--r-- | Freenet CPU steal graph.md | 2 | ||||
-rw-r--r-- | How to RIP (grep).md (renamed from How to (RIP) Grep.md) | 0 | ||||
-rw-r--r-- | How to show the mysql galera cluster status.md | 14 | ||||
-rw-r--r-- | Importing GPG keys from a keyserver.md | 6 | ||||
-rw-r--r-- | It's recommended to use small-medium ARC for hypervisors where ZFS is used.md | 10 | ||||
-rw-r--r-- | Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md | 7 | ||||
-rw-r--r-- | Testing Golang programs.md | 9 | ||||
-rw-r--r-- | Working with Nix shells.md | 66 | ||||
-rw-r--r-- | daily/16-Apr-2025.md | 15 | ||||
-rw-r--r-- | daily/17-Apr-2025.md | 2 | ||||
-rw-r--r-- | daily/18-Apr-2025.md | 6 |
17 files changed, 285 insertions, 49 deletions
diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index d57c196..c2973af 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,86 +4,71 @@ "type": "split", "children": [ { - "id": "b5921b94f3580090", + "id": "f33c11cf18be28d7", "type": "tabs", "children": [ { - "id": "8533accf5c2515ac", + "id": "3628dba7efa2e99a", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "daily/11-Apr-2025.md", + "file": "Freenet CPU steal graph.md", "mode": "source", "backlinks": true, "source": false }, "icon": "lucide-file", - "title": "11-Apr-2025" + "title": "Freenet CPU steal graph" } }, { - "id": "a06a83491e7620e5", + "id": "b1754e4cb810f3a0", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Device mapper.md", + "file": "How to show the mysql galera cluster status.md", "mode": "source", "backlinks": true, "source": false }, "icon": "lucide-file", - "title": "Device mapper" + "title": "How to show the mysql galera cluster status" } }, { - "id": "30f6cf07a77bd478", + "id": "5ac5819f83e59327", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Examples of proper JQ usage.md", + "file": "Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md", "mode": "source", "backlinks": true, "source": false }, "icon": "lucide-file", - "title": "Examples of proper JQ usage" + "title": "Managing the amount of WSGI processes ran by apache is done from the apache site configuration" } }, { - "id": "c550cd183351059f", + "id": "487149710eacf558", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "Using Libvirt to manage QEMU image bitmaps.md", + "file": "daily/18-Apr-2025.md", "mode": "source", "backlinks": true, "source": false }, "icon": "lucide-file", - "title": "Using Libvirt to manage QEMU image bitmaps" - } - }, - { - "id": "5b6958c83833df4a", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "daily/15-Apr-2025.md", - "mode": "source", - "backlinks": true, - "source": false - }, - "icon": "lucide-file", - "title": "15-Apr-2025" + "title": "18-Apr-2025" } } ], - "currentTab": 4 + "currentTab": 3 } ], "direction": "vertical" @@ -114,7 +99,7 @@ "state": { "type": "search", "state": { - "query": "qemu bitm", + "query": "iptables", "matchingCase": false, "explainSearch": false, "collapseAll": false, @@ -234,12 +219,27 @@ "obsidian-excalidraw-plugin:New drawing": false } }, - "active": "5b6958c83833df4a", + "active": "487149710eacf558", "lastOpenFiles": [ - "How to properly do options in a bash script with getopt!.md", "daily/15-Apr-2025.md", - "Using Libvirt to manage QEMU image bitmaps.md", + "daily/18-Apr-2025.md", + "Working with Nix shells.md", + "Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md", + "How to show the mysql galera cluster status.md", + "Freenet CPU steal graph.md", + "daily/17-Apr-2025.md", "daily/14-Apr-2025.md", + "daily/16-Apr-2025.md", + "Debugging issues with updating Puppet dependency.md", + "It's recommended to use small-medium ARC for hypervisors where ZFS is used.md", + "How to RIP (grep).md", + "Using Libvirt to manage QEMU image bitmaps.md", + "Importing GPG keys from a keyserver.md", + "Exposing development headers on Nixos.md", + "About keyboard layout on Wayland.md", + "Benchmarking code in Golang.md", + "Testing Golang programs.md", + "How to properly do options in a bash script with getopt!.md", "We don't support filesystem discard syscalls on our openstack platform.md", "Examples of proper JQ usage.md", "Device mapper.md", @@ -247,22 +247,7 @@ "daily/10-Apr-2025.md", "List of tags I use in this Vault and their purpose.md", "Managing Ceph on Devstack & OpenStack.md", - "OpenStack Tempest.md", - "Tempest Plugin.md", - "High Gear Low Gear Testing.md", - "TDD.md", - "The volume type of a Cinder volume can be changed.md", - "How to (RIP) Grep.md", - "I assumed that Mohammed made an oopsie but instead it turned out to be one of us that forgot to clean up.md", - "Writing a test double before the real implementation gives feedback on design.md", - "London-style versus Detroit-style TDD.md", - "I'm worried that Freenet will completely go DOWN due to OVN upgrade.md", - "OVN upgrade.md", "daily", - "2025-04-10.md", - "Installing Ceph on devstack.md", - "Overview of Ceph.md", - "Gobs Ceph Client Key Access.md", "ESP", "Excalidraw" ] diff --git a/.trash/Untitled 3.md b/.trash/Untitled 3.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.trash/Untitled 3.md diff --git a/About keyboard layout on Wayland.md b/About keyboard layout on Wayland.md new file mode 100644 index 0000000..b4e8550 --- /dev/null +++ b/About keyboard layout on Wayland.md @@ -0,0 +1,15 @@ +--- +tags: + - wayland + - hyprland + - keyboard +--- +In Wayland the keyboard layout is managed by the compositor. In my case that is currently Hyprland. + +To find variants: +`localectl list-x11-keymap layouts:` +`localectl list-x11-keymap-variants us` + +^ This doesn't seem to work on NixOS. + +I've set it now via `services.xserver.xkb.variant`, and queried variants from gemini.
\ No newline at end of file diff --git a/Benchmarking code in Golang.md b/Benchmarking code in Golang.md new file mode 100644 index 0000000..22d180d --- /dev/null +++ b/Benchmarking code in Golang.md @@ -0,0 +1,40 @@ +--- +tags: + - golang + - howto +--- +Simple timing can be done using the time package. +``` +import time +import fmt + +func main() { + start := time.Now() + elapsed = time.Since(start).Seconds() + fmt.Printf("%.2fs", elapsed) +} +``` + +Writing benchmarks. They look similar to tests: +``` +import testing + +func BenchmarkSome(b *testing.B) { + for i := 0; i < b.N; i++ { + Some() + } +} +``` +b.N is supplied by test driver and is dynamically changed depending on runtime. + +`go test -bench=<regex>` + +This just benchmarks a function being called many times, comparative benchmarks can be written using a regular function being called from Benchmarks, something like so : +``` +import testing + +func doBench(b *testing.B, size int) { ... vary inputs size } +func Bench1(b *testing.B) +func Bench10(b *testing.B) +func Bench100(b * testing.B) +```
\ No newline at end of file diff --git a/Debugging issues with updating Puppet dependency.md b/Debugging issues with updating Puppet dependency.md new file mode 100644 index 0000000..da6e2f2 --- /dev/null +++ b/Debugging issues with updating Puppet dependency.md @@ -0,0 +1,46 @@ +--- +tags: + - puppet +--- +Updated the ref in Puppetfile to yoga-eol instead of unmaintained/yoga. + +Stap 1: `librarian-puppet install --verbose`. +Stap 2: `librarian-puppet update openstack-neutron --verbose`. + +Check puppet-neutron `metadata.json` This is where dependency information lives. According to the gitlab readme it is also possible that this lives in `Modulefile` or `Puppetfile`. + +Verbose info gives: +``` +[Librarian] Failed to resolve puppetlabs-stdlib (>= 4.18.0, < 7.0.0) <(no source specified)> (from <nil>) +``` + +Erik determined this is due to `puppet-yum` by inspecting the lock file and checking who sets those requirements. +``` +puppet master* ≡ +❯ rg '>= 4.18.0, < 7.0.0' Puppetfile.lock +68: puppetlabs-stdlib (>= 4.18.0, < 7.0.0) +``` +``` + 1 │ puppet-yum (4.3.0) + 1 │ │ puppetlabs-concat (>= 1.2.5, < 7.0.0) + 68 │ │ puppetlabs-stdlib (>= 4.18.0, < 7.0.0) +``` + +It turns out that this version of `puppet-yum` came from `elastic-elastic_stack` which came in turn from `elastic-logstash`. +We found that `elastic-logstash` has been deprecated, so we cannot upgrade this dependency. It is replaced by `puppet-logstash`. + +``` +puppet master ≡5s +❯ rg puppet-yum Puppetfile.lock +8: puppet-yum (>= 0.9.6, < 5.0.0) +66: puppet-yum (4.3.0) + +hx Puppetfile.lock + elastic-elastic_stack (6.3.2) + puppet-yum (>= 0.9.6, < 5.0.0) + +``` + +Changing the dependency from `elastic-logstash` to `puppet-logstash`, also brings issue. + +At the end our hacky resolution is to update the commit hash in `Puppetfile.lock` and push that. Possible only because we didn't change any dependencies in `openstack-neutron`. diff --git a/Exposing development headers on Nixos.md b/Exposing development headers on Nixos.md new file mode 100644 index 0000000..72db811 --- /dev/null +++ b/Exposing development headers on Nixos.md @@ -0,0 +1,15 @@ +--- +tags: + - nixos +--- +On regular distro's such as Ubuntu we would install them system-wide, for example, `apt install libx` + +On NixOS these kind of outputs (on search.nixos.org the pkgs should specify out: dev) are not exposed by default, so installing the package system wide doesn't work. + +Instead they get loaded when the package is installed in a nix shell: +``` +[nix-shell:~/projects/group.one/vps/openstack/puppet-neutron]$ cat shell.nix +{ pkgs ? import <nixpkgs> {}}: pkgs.mkShell { + packages = [ pkgs.augeas pkgs.pkg-config pkgs.libxml2 ]; +} +```
\ No newline at end of file diff --git a/Freenet CPU steal graph.md b/Freenet CPU steal graph.md index 1172c0b..b18c662 100644 --- a/Freenet CPU steal graph.md +++ b/Freenet CPU steal graph.md @@ -5,4 +5,4 @@ tags: --- `https://prometheus3.fnrz.de/graph?g0.expr=topk(5%2C%20avg_over_time(cpu_usage_steal%7Bcpu%3D%22cpu-total%22%7D%5B10m%5D))&g0.tab=0&g0.stacked=0&g0.show_exemplars=0&g0.range_input=12h` -`sudo ip r a 194.97.212.67 via 172.16.16.1` +`s i` diff --git a/How to (RIP) Grep.md b/How to RIP (grep).md index f7122a3..f7122a3 100644 --- a/How to (RIP) Grep.md +++ b/How to RIP (grep).md diff --git a/How to show the mysql galera cluster status.md b/How to show the mysql galera cluster status.md new file mode 100644 index 0000000..27bb50f --- /dev/null +++ b/How to show the mysql galera cluster status.md @@ -0,0 +1,14 @@ +--- +tags: + - mysql + - galera + - howto +--- +Can be queried using `SHOW STATUS`. + +`sudo mysql --exec "SHOW STATUS LIKE 'wsrep%'"` + +**wsrep_cluster_status:** +- Primary; desired state. Primary component (so the cluster is one big component). Quorum of nodes is present. +- Non-Primary; Part of a partition (the non primary one) of nodes, so the cluster is partitioned. Cluster lost quorum. +- Disconnected: The node is not connected to the cluster at all.
\ No newline at end of file diff --git a/Importing GPG keys from a keyserver.md b/Importing GPG keys from a keyserver.md new file mode 100644 index 0000000..d8981b2 --- /dev/null +++ b/Importing GPG keys from a keyserver.md @@ -0,0 +1,6 @@ +--- +tags: + - gpg + - howto +--- +`gpg --keyserver <server> --recv-keys FINGERPRINT`
\ No newline at end of file diff --git a/It's recommended to use small-medium ARC for hypervisors where ZFS is used.md b/It's recommended to use small-medium ARC for hypervisors where ZFS is used.md new file mode 100644 index 0000000..a92d3d7 --- /dev/null +++ b/It's recommended to use small-medium ARC for hypervisors where ZFS is used.md @@ -0,0 +1,10 @@ +--- +tags: + - architecture + - nova + - zfs + - arc +--- +https://papers.freebsd.org/2019/FOSDEM/jude-eli5_zfs_caching.files/ELI5_ZFS_ARC.pdf + +What is small-medium? TBD. For now we will go with the default of 1/32th of the total memory. diff --git a/Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md b/Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md new file mode 100644 index 0000000..6990073 --- /dev/null +++ b/Managing the amount of WSGI processes ran by apache is done from the apache site configuration.md @@ -0,0 +1,7 @@ +--- +tags: + - openstack + - wsgi + - apache +--- +Instead of configuring for example `octavia.conf` the number of wsgi workers is controller via the httpd config at `/etc/apache2/sites-available/10-octavia_wsgi.conf`.[]()
\ No newline at end of file diff --git a/Testing Golang programs.md b/Testing Golang programs.md new file mode 100644 index 0000000..e9d48de --- /dev/null +++ b/Testing Golang programs.md @@ -0,0 +1,9 @@ +--- +tags: + - golang + - howto +--- +`go test` reads files ending with `_test.go`: 3 specialized functions: +- Test functions; names start with Test, 1 arg. \*testing.T +- Benchmarks: names start with Benchmarkt, 1 arg: \*testing.B +- Example functions: names start with Example
\ No newline at end of file diff --git a/Working with Nix shells.md b/Working with Nix shells.md new file mode 100644 index 0000000..c042edd --- /dev/null +++ b/Working with Nix shells.md @@ -0,0 +1,66 @@ +Basic invocation: `nix-shell -p [ pkgs ... ]` + +# Shebang +``` +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p bash + +do stuff +``` + +Different interpreters can be set with the `-i` option such as python +``` +#! /usr/bin/env nix-shell +#! nix-shell -i python3 -p python3 + +print("hello world") +``` + +The `-I` option can be used to pin nixpkgs +``` +#! /usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/aed4b19d312525ae7ca9bceb4e1efe3357d0e2eb.tar.gz + +echo hello world +``` +# Shell.nix +Can be used to set up per dir environments, e.g using direnv to automatically activate them. +## Python +https://nixos.org/manual/nixpkgs/stable/#python + +```nix +{ pkgs ? import <nixpkgs> {}}: + +pkgs.mkShell { + packages = [ pkgs.virtualenv ]; +} +``` + +```nix +with import <nixpkgs> {}; +let + my_toolz = python311.pkgs.buildPythonPackage rec { + pname = "toolz"; + version = "0.10.0"; + pyproject = true; + src = fetchPypi { + inherit pname version; + hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA="; + }; + nativeBuildInputs = [ + python311.pkgs.setuptools + python311.pkgs.wheel + ]; # has no tests + doCheck = false; + meta = { + homepage = "https://github.com/pytoolz/toolz/"; + description = "List processing tools and functional utilities"; + # [...] + }; + }; +in python311.withPackages (ps: with ps; [ numpy my_toolz ]) ).env +``` + + The [[Import]] is required here because imports a nix expression from another source, in this case nixpkgs. +It is not required at line two, because python310Packages itself is already in the local scope.
\ No newline at end of file diff --git a/daily/16-Apr-2025.md b/daily/16-Apr-2025.md new file mode 100644 index 0000000..2d22b55 --- /dev/null +++ b/daily/16-Apr-2025.md @@ -0,0 +1,15 @@ +1op1 rutger: niet echt iets besproken. + +***Interview Prep Isabel*** +*Do you live in Amsterdam? If yes, how long? plans to stay?* + +*Very shortly worked for ING (2025 january until now). What happened?* + +*At Civir you mention "deployent & administration of cloud technologies" including openstack, does this mean you deplmoyed an openstack cloud or were you a user of an openstack deployment?* + + +*You mention "24/7 support for troubleshooting issues" on multiple positions. What kind of issues?* + +***Isabel Q to us*** + +**Isabel kwam niet opdagen**
\ No newline at end of file diff --git a/daily/17-Apr-2025.md b/daily/17-Apr-2025.md new file mode 100644 index 0000000..7a0a296 --- /dev/null +++ b/daily/17-Apr-2025.md @@ -0,0 +1,2 @@ +`puppet-neutron` gemerged; gezeik met updaten dependency, uiteindelijk commit hash in lock geupdate. Zie [[Debugging issues with updating Puppet dependency]]. + diff --git a/daily/18-Apr-2025.md b/daily/18-Apr-2025.md new file mode 100644 index 0000000..2b9620d --- /dev/null +++ b/daily/18-Apr-2025.md @@ -0,0 +1,6 @@ +Encountered oom on lxchosts. Turned out that octavia wsgi was using huge amounts of ram. +First we disabled the apache on all octavia to prevent more oom kills. +After that Erik limited their allowed memory usage, and we turned them back on. +Found out that we can see what script is ran by apache in the vhost config. Turned out to be some CGI script. +To profile the memory usage I stopped apache and ran a memory profiler directly against the cgi script, I had to stop the LB from using TLS but apart from that it worked smoothly. +We now have a flamegraph of the memory usage, and it looks like it is something to do with ovs.
\ No newline at end of file |