Skip to content

Instantly share code, notes, and snippets.

class MemoryEndpoint
def call(env)
time_str = Time.now.strftime('%Y-%m-%d_%H-%M-%S')
File.open("/tmp/dump-#{Process.pid}-#{time_str}.json", 'w') do |file|
dump_memory(file)
end
[200, { 'Content-Type' => 'text/plain' }, ["Dumped Memory #{Process.pid}"]]
end
private
@jturel
jturel / setup_iss.sh
Created October 27, 2021 14:24
ISS setup script
#!/bin/bash
set -x
HAMMER_USER=admin
HAMMER_PASSWORD=changeme
DEFAULT_ORG=Default_Organization
ISS_ORG=ISS
ISS_CA=ISS_CA
ISS_TOKEN=ISS_TOKEN
ISS_SERVER=$(hostname)
@jturel
jturel / foreman_plugin_registry_loading.md
Created May 18, 2025 20:03
Foreman Plugin Registry Loading

Observations

One

(Some/all?) plugins call Foreman::Plugin.register in a reloader.to_prepare callback which could imply a few things:

  • this needs to happen on app startup
  • this needs to happen on code reload
  • this involves application code

Two

Plugin registration is not consistent across plugins. Katello calls Foreman::Plugin.register via a required file which won't be executed again on reload!. REX and Foreman Tasks do invoke register on dev code reload and that's why reload! is broken.

@jturel
jturel / partha-cv-auto-publish.sh
Created January 20, 2026 01:36
CV auto publish testing
#!/bin/bash
shopt -s expand_aliases
#alias hammer='BUNDLE_GEMFILE=~/git/hammer-cli-katello/Gemfile bundle exec hammer'
set -e
set -x
ORG="org-$RANDOM"
PRODUCT="test_product"
hammer organization create --name=$ORG
@jturel
jturel / partha-cv-autopublish-concurrent.sh
Last active January 23, 2026 16:52
partha-cv-autopublish-ten-async
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
COMPONENT_COUNT=3
ORG="org-$RANDOM"
PRODUCT="test_product"