Skip to content

Instantly share code, notes, and snippets.

@johnpmitsch
johnpmitsch / a.diff
Created Feb 5, 2021
pf 4 error diff
View a.diff
diff --git a/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js b/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js
index 6b7e4eb..bb6b6f6 100644
--- a/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js
+++ b/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js
@@ -37,7 +37,6 @@ import RepoIcon from './RepoIcon';
import SelectableDropdown from '../../../../components/SelectableDropdown';
import { capitalize } from '../../../../utils/helpers';
-
const allRepositories = 'All repositories';
@johnpmitsch
johnpmitsch / w.md
Last active Jun 28, 2021
Katello dev server hacky wepback workaround
View w.md

go to node_modules/webpack-dev-server/lib/Server.js in ~/foreman

around line 496 change protocols: ['h2', 'http/1.1'] to protocols: ['http/1.1'] (remove h2 from the array)

start dev server

NOTE: this will be overwritten when you npm install again

@johnpmitsch
johnpmitsch / a.md
Last active Oct 10, 2020
Bradfield CS Distributed Systems
View a.md

Distributed Systems

Lesson 1 - Introduction

  • Systems today are generally distributed, both in-house and third-party systems
  • Stream processing is batch processing but in smaller increments, it isn't real-time, but is quick
  • Project, work as pre and post work
  • Reliability
  • Scalability
  • Maintainability
@johnpmitsch
johnpmitsch / a.md
Last active Aug 29, 2020
Bradfield CS database notes
View a.md

Databases

Indexing

  • B+ trees are always best, but ISAM came first, ISAM is a simpler way to start learning
  • Each node is a page on disk and has a pointer to the related parts, 'block 7'
  • B+ tree, only leaf nodes matter, the rest are to direct traffic
  • binary search is really difficult, it is reads on disk, so instead of this we use an "index" file that stores key values with pointers to pages
  • B+ tree is height-balanced.
    • each node has 50% pointers on them because pages will be split in half to make space
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