Skip to content

Instantly share code, notes, and snippets.

@adamruzicka
adamruzicka / post.md
Created April 25, 2023 13:55
State of plugin translations

From what I've seen, strings are not getting translated in pure React pages coming from plugins. Translations work as long they are being done on the backend, but if they are done on the frontend, they end up not translated.

When updated translations are pulled in Foreman, a po_to_json rake task is called which converts the *.po files into javascript files under app/assets/javascripts/locale/$lang/app.js. These files usually look like this

var locales = locales || {}
locales['it'] = {
  "domain": "app",
  "locale_data": {
 "Failed to fetch: ": ["Recupero fallito:"],
@adamruzicka
adamruzicka / howto.md
Last active April 11, 2025 10:07
Encrypting asahi linux installation

Outline

  • Install Asahi
  • Add cryptsetup into initrd
  • Make initrd spawn a shell before mounting disk
  • Reencrypt the partition in-place
  • Configure grub and rebuild initramfs to open LUKS device during startup.
  • Cleanup

Steps

Install Asahi

def bar(a, b, c)
puts [a, b, c]
end
def foo(...)
bar(1, ...)
end
foo(1, 2)
#!/usr/bin/env ruby
# Place this into ${dynflow_checkout}/examples/cancellation.rb
# run with ruby examples/cancellation.rb
# frozen_string_literal: true
require_relative 'example_helper'
class SequentialParent < Dynflow::Action
def plan(klass, count = 10, args: [])
@adamruzicka
adamruzicka / README.md
Created June 26, 2024 13:16
Foreman remote execution concurrency tunables

Remote execution flow

When running a REX job, the flow is roughly as follows:

  1. The user triggers a job, under the hood this trigger a "parent task"
  2. The parent task goes in batches of 100 and creates a sub-task for each host in the job. The batches are processed sequentially. Inside the batches the sub-tasks are also created sequentially.
  3. After each batch from step 2 is prepared, the prepared sub-tasks are delegated to the smart proxy.
  4. The smart proxy unwraps the batch and spawns a single ssh process for each, all of these run completely independently from each other.
  5. The smart proxy reports back to Foreman as the per-host jobs finish with one request per host.
  6. When the reports come to Foreman, Foreman dispatches them to the relevant per-host sub-tasks from 2. These sub-tasks process the updates and exit.
@adamruzicka
adamruzicka / README.md
Last active September 20, 2024 13:34
Foreman, EL* and yggdrasil

Foreman, EL* and yggdrasil

Since we introduced the pull provider, we carried both yggdrasil and our own worker (foreman_ygg_worker) in our client repos. Starting with EL 9.5, yggdrasil is going to be included in EL repos. The version there (0.4.1) is much newer than the one we ship, and therefore "wins" when yggdrasil is being installed. This causes a problem, because our own worker is not compatible with this newer version of yggdrasil and because of architectural changes in yggdrasil itself.

This issue may pop up on other currently supported distributions, but for the purpose of this document we’ll limit ourselves on distributions from the EL family.

Problem statement

yggdrasil <-> worker communication

In the 0.2.z line, yggdrasil talked with workers over grpc.

In the 0.4.z line, yggdrasil talks with workers over dbus.