Skip to content

Instantly share code, notes, and snippets.


John Mitsch johnpmitsch

  • Red Hat
  • Norwalk, CT
View GitHub Profile
View gist:97213f1f4a6b27f8e17f21d96cdd01de
2020-08-10 14:51:58 UTC ERROR: subquery has too many columns at character 79
2020-08-10 14:51:58 UTC STATEMENT: SELECT COUNT(*) FROM "katello_repositories" WHERE "katello_repositories"."id" IN (SELECT DISTINCT katello_repositories.*,
WHEN katello_content_view_repositories.content_view_id = 4 THEN 1
END AS "added_to_content_view"
, "katello_repositories"."id" FROM katello_repositories LEFT JOIN katello_content_view_repositories ON ( = katello_content_view_repositories.repository_id) LEFT JOIN katello_content_views ON (katello_content_view_repositories.content_view_id = WHERE ( = 4 OR IS NULL
) ORDER BY added_to_content_view DESC,
johnpmitsch / a.diff
Created Jul 8, 2020
r-t-lib refactor
View a.diff
diff --git a/webpack/test-utils/react-testing-lib-wrapper.js b/webpack/test-utils/react-testing-lib-wrapper.js
index 7562bc4..c3a023f 100644
--- a/webpack/test-utils/react-testing-lib-wrapper.js
+++ b/webpack/test-utils/react-testing-lib-wrapper.js
@@ -22,8 +22,9 @@ process.env.DEBUG_PRINT_LIMIT = 99999;
function renderWithRedux(
- namespace, // redux namespace
- initialState = { response: {}, status: STATUS.PENDING },
johnpmitsch /
Last active Jun 4, 2020
Set up ubuntu for katello test env
  • Install ruby
sudo snap install ruby --classic
sudo snap switch ruby --channel=2.3/stable
sudo snap refresh
  • Install system deps: sudo apt-get install libsystemd-dev make postgresql git ruby-libvirt build-essential patch ruby-dev zlib1g-dev liblzma-dev libxml2-dev libcurl4-openssl-dev libpq-dev
  • sudo apt install qemu-kvm libvirt-daemon-system libvirt-dev (some might not be needed)
  • sudo apt install nodejs needs a JS runtime for some reason
  • git clone foreman + katello (as siblings)
johnpmitsch /
Created May 13, 2020
Operating System course

Operating System

Introduction to OS

johnpmitsch /
Last active May 12, 2020
Katello tests with Foreman, running independently


  • Match setup to dev and production environment
  • Not duplicate packages in Katello, use them from Foreman, same as we do in production

Steps to set up on a plain centos7 box:

johnpmitsch /
Last active Mar 13, 2020
Multiple SPAs with Foreman research


Have Foreman, Katello, and plugins manage their own React SPAs that look and feel like one application. This would be done using single-spa which can send routes to different SPAs and even load different SPAs on the same page.


  • Sharing authentication between SPAs
  • Sharing components
  • Managing "global" state like organization selection
  • Having the same menu
johnpmitsch /
Last active Feb 20, 2020
Katello stable box demo

Katello stable development environment

First things first

Spin up the box time vagrant up centos7-katello-devel-stable

What is it?

The katello devel stable box is a forklift box that is guaranteed to spin up successfully with the most recently working Katello development environment.

Why create it?

johnpmitsch /
Last active Feb 6, 2020
Run foreman-maintain on a dev box
  • cd ~ on dev box as vagrant user
  • git clone
  • sudo scl enable rh-ruby25 -- gem install bundler
  • sudo scl enable rh-ruby25 -- bundle install
  • Add to .bashrc and run source ~/.bashrc or open up a new terminal
alias foreman_maintain_scl="sudo scl enable rh-ruby25 -- ./bin/foreman-maintain "
  • Run foreman_maintain_scl with foreman maintain arguments in ~/foreman_maintain
johnpmitsch / focaccia.diff
Created Jan 29, 2020
run focaccia locally with `RACK_ENV=production bundle exec rackup`
View focaccia.diff
diff --git a/focaccia/bot.rb b/focaccia/bot.rb
index 7ccdf4d..f279cdd 100755
--- a/focaccia/bot.rb
+++ b/focaccia/bot.rb
@@ -3,7 +3,7 @@
require 'cinch'
# load enviroment variables from .env in development
-require 'dotenv/load' if ENV['RACK_ENV'] == 'development'
+require 'dotenv/load'
johnpmitsch /
Last active Jan 27, 2020
hammer testing probs
You can’t perform that action at this time.