Skip to content

Instantly share code, notes, and snippets.

View jlsherrill's full-sized avatar

Justin Sherrill jlsherrill

View GitHub Profile
@jlsherrill
jlsherrill / fixtures.json
Created November 27, 2023 15:02
fixtures.json
{
"rpm-advisory-diff-repo":"https://fixtures.pulpproject.org/rpm-advisory-diff-repo/",
"rpm-advisory-diffpkgs":"https://fixtures.pulpproject.org/rpm-advisory-diffpkgs/",
"rpm-advisory-incomplete-package-list":"https://fixtures.pulpproject.org/rpm-advisory-incomplete-package-list/",
"rpm-advisory-no-update-date":"https://fixtures.pulpproject.org/rpm-advisory-no-update-date/",
"rpm-alt-layout":"https://fixtures.pulpproject.org/rpm-alt-layout/",
"rpm-complex-pkg":"https://fixtures.pulpproject.org/rpm-complex-pkg/",
"rpm-distribution-tree":"https://fixtures.pulpproject.org/rpm-distribution-tree/",
"rpm-distribution-tree-changed-addon":"https://fixtures.pulpproject.org/rpm-distribution-tree-changed-addon/",
"rpm-distribution-tree-changed-main":"https://fixtures.pulpproject.org/rpm-distribution-tree-changed-main/",
@jlsherrill
jlsherrill / header_org_admin.sh
Created August 29, 2023 12:24
org_admin header script
#!/bin/bash
ORG_ID="$1"
USER_NAME="$2"
ACCOUNT_ID="$3"
function print_out_usage {
cat <<EOF
Usage: ./scripts/header.sh <org_id> [user_name]
@jlsherrill
jlsherrill / main.go
Created August 28, 2023 13:31
testing for tasks
package main
import (
"encoding/json"
"time"
"github.com/content-services/content-sources-backend/pkg/api"
"github.com/content-services/content-sources-backend/pkg/config"
"github.com/content-services/content-sources-backend/pkg/dao"
"github.com/content-services/content-sources-backend/pkg/db"
@jlsherrill
jlsherrill / main.go
Created July 20, 2023 17:49
go file to hammer a content-sources with requests
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"sync"
"github.com/content-services/content-sources-backend/pkg/config"
@jlsherrill
jlsherrill / openapi-debug.md
Created February 13, 2023 14:04
openapi generator debug
mvn clean package --projects org.openapitools:openapi-generator-cli,org.openapitools:openapi-generator
# run it in debug mode on port 8888
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8888 -jar  modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i api.json.1 -g ruby         -o pulpcore-client         --additional-properties=gemName=pulpcore_client,gemLicense="GPL-2.0+",gemVersion=3.17.1         --library=faraday              --skip-validate-spec         --strict-spec=false
{
"openapi": "3.0.2",
"info": {
"title": "SimpleTest",
"version": "1.0.0",
"description": ""
},
"paths": {
"/testresponses": {
"summary": "Path used to manage the list of testresponses.",
Katello::ContentView.non_default.each do |cv|
Katello::Repository.in_default_view.each do |library_instance|
cv.versions.with_library_repo(library_instance).each do |version|
if version.archived_repos.find_by(:library_instance_id => library_instance.id).nil?
found = version.repositories.find_by(:library_instance_id => library_instance.id)
puts "#{cv.name} #{version.version}: #{library_instance.name} : env repo: #{found.id} in #{found.environment&.name}"
end
end
end
end ; nil
$ cat ~/bin/rails-start
#!/usr/bin/bash
cd ~/git/foreman
rm log/development.log
export DISABLE_SPRING=1
export NOTIFICATIONS_POLLING=999999
be puma -b 'tcp://0.0.0.0' -p 3000 #-w 1
#rails s -b '0.0.0.0'
@jlsherrill
jlsherrill / gist:8cde84fa7a39913c29b10ecb15996591
Created March 2, 2022 14:43
Mirror on sync vs mirroring policy
Mirror on sync in 6.9 and earlier: Would make sure content is added/removed to match upstream repo, would generate new metadata
Mirror on sync in 6.10.0-6.10.2: Would make sure content is added/removed to match upstream repo, would mirror metadata from upstream
Mirroing policy additive: Only adds content, doesn't mirror metadata (The same as mirror on sync off)
Mirroing policy Content Only: Same as "Mirror on sync in 6.9 and earlier"
Mirroing policy Complete: Same as "Mirror on sync in 6.10.0-6.10.2"
@jlsherrill
jlsherrill / delete_repo_reference.md
Created January 18, 2022 21:46
delete repository references on 404
foreman-rake console
Katello::Pulp3::RepositoryReference.all.select do |ref|
  api = Katello::RepositoryTypeManager.repository_types[ref.root_repository.content_type].pulp3_api_class.new(SmartProxy.pulp_primary)
  api.repositories_api.read(ref.repository_href)  
rescue => e
 if e&amp;.code == 404