Skip to content

Instantly share code, notes, and snippets.

View jeremylenz's full-sized avatar

Jeremy Lenz jeremylenz

  • New York, NY
View GitHub Profile

Technically, a more correct name for an SSL certificate is a "PKI (public key infrastructure) certificate using the TLS protocol"

On a Satellite,

  • /etc/pki/katello/certs contains all of the Katello's certs, including server and CA
  • /etc/rhsm/ca/katello-server-ca.pem can be ignored - this is on the system if it is a client of another katello #KatelloInception

On a Katello client,

  • /etc/rhsm/ca/katello-default-ca.pem contains the pki certificate from Katello downloaded with
openssl x509 -noout -text -in /etc/rhsm/ca/katello-server-ca.pem | grep Public-Key
# make a new product from an existing custom product
# and attach an existing pool
def make_new_product(product, pool, ak)
new_prod = product.dup
new_prod.name += ' ' + SecureRandom.uuid
new_prod.label = new_prod.name.gsub(/ /, '_').gsub(/[()]/, '_')
new_prod.save!
new_prod.pools << pool
# ak.products << new_prod
# enabled = 1 means it's enabled; enabled = 0 means disabled
cat /etc/yum.repos.d/redhat.repo
katello-enabled-repos-upload --force
# Change Foreman's logging gem settings to log the full logger name instead of just the first 3 characters
# config/logging.yaml#L94
:pattern: "%d [%.1l|%c|%.8X{request}] %m\n"
# Log the line, file, and method that calls logger.debug (useless because it's always method_missing):
log_trace: true # can also use %F, %L, %M in the pattern now
// redux index.js
// allow stack trace in Redux devtools for any Redux action
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace: true}) || compose;
params = { format: 'html', template_id: 138, input_values: { '23' => { value: '180' } } }
# OR params = { format: 'html', template_id: '138-Subscription%20-%20Entitlement%20Report', input_values: { '23' => { value: '180' }
composer = ReportComposer.new(params)
composer.valid?
# => true
job = composer.schedule_rendering
# #<TemplateRenderJob:0x000000001131fbf8
# @arguments=[{"format"=>"html", "template_id"=>138, "input_values"=>{"23"=>{"value"=>"180"}}}, {:user_id=>2}],
# @executions=0,
# @job_id="c69d83ef-5432-49e3-9e3b-1fd93be6ccb2",
@jeremylenz
jeremylenz / virsh-snapshot-commands.sh
Last active January 31, 2020 19:44 — forked from johnpmitsch/blah.sh
vagrant/virsh snapshot commands bashrc
# Add to your ~/.bashrc, then run source ~/.bashrc
# virsh-snapshot-create mybox mysnap
# Run in forklift directory
function virsh-snapshot-create {
vagrant halt $1
virsh snapshot-create-as forklift_$1 $2
vagrant up $1
}
@jeremylenz
jeremylenz / restart_candlepin.sh
Created January 28, 2020 22:56
Restart Candlepin
#!/usr/bin/env bash
sudo service tomcat restart