Skip to content

Instantly share code, notes, and snippets.

Avatar

John Mitsch johnpmitsch

  • Red Hat
  • Norwalk, CT
View GitHub Profile
View gist:97213f1f4a6b27f8e17f21d96cdd01de
error
```
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.*,
CASE
WHEN katello_content_view_repositories.content_view_id = 4 THEN 1
ELSE 0
END AS "added_to_content_view"
, "katello_repositories"."id" FROM katello_repositories LEFT JOIN katello_content_view_repositories ON (katello_repositories.id = katello_content_view_repositories.repository_id) LEFT JOIN katello_content_views ON (katello_content_view_repositories.content_view_id = katello_content_views.id) WHERE ( katello_content_views.id = 4 OR katello_content_views.id IS NULL
) ORDER BY added_to_content_view DESC, katello_repositories.id
@johnpmitsch
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(
component,
{
- namespace, // redux namespace
- initialState = { response: {}, status: STATUS.PENDING },
@johnpmitsch
johnpmitsch / steps.md
Last active Jun 4, 2020
Set up ubuntu for katello test env
View steps.md
  • 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
johnpmitsch / os.md
Created May 13, 2020
Operating System course
View os.md

Operating System

Introduction to OS

@johnpmitsch
johnpmitsch / foremantests.md
Last active May 12, 2020
Katello tests with Foreman, running independently
View foremantests.md

Goals:

  • 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
johnpmitsch / spa.md
Last active Mar 13, 2020
Multiple SPAs with Foreman research
View spa.md

Goal:

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.

Challenges:

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

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
johnpmitsch / f-maintain.md
Last active Feb 6, 2020
Run foreman-maintain on a dev box
View f-maintain.md
  • cd ~ on dev box as vagrant user
  • git clone https://github.com/theforeman/foreman_maintain.git
  • 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
johnpmitsch / focaccia.diff
Created Jan 29, 2020
run focaccia locally with `RACK_ENV=production bundle exec rackup config.ru`
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
johnpmitsch / test.md
Last active Jan 27, 2020
hammer testing probs
View test.md
You can’t perform that action at this time.