Skip to content

Instantly share code, notes, and snippets.

View jjeffers's full-sized avatar

James Jeffers jjeffers

View GitHub Profile
sudo yum install rh-python38-python-pip
scl enable tfm-pulpcore 'pip install pulp-ostree'
mkdir /etc/pulp/certs
openssl rand -base64 32 | tr '+/' '-_' > /etc/pulp/certs/database_fields.symmetric.key
sudo yum install ostree
scl enable tfm-pulpcore 'PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager migrate'
@jjeffers
jjeffers / gist:8f8bd8161757180730d4539cbdd9522e
Created October 19, 2021 13:05
Debian repos for testing
http://deb.tuxedocomputers.com/ubuntu/
using distributions="bionic focal", components="main", and architectures="i386 amd64"
for a more interesting test (medium repo size).
centos7-proxy-devel:
box: centos7
memory: 9000
nfs:
host_path: '/home/jjeffers/projects'
guest_path: '/home/vagrant/projects'
ansible:
playbook: 'playbooks/foreman_proxy_content_dev.yml'
group: 'foreman-proxy-content'
server: centos7-katello-devel-stable
curl
--proxy http://squid.corp.redhat.com:3128
-u insights-qa:redhatqa
--url https://console.stage.redhat.com/api/edge/v1/images/609/repo
@jjeffers
jjeffers / vsphere.txt
Created March 3, 2021 15:36
Provisioning a katello instance on vSphere
login to https://vcenter.toledo.satellite.lab.eng.rdu2.redhat.com/
Create a new VM using RHEL7
Select supermicro datastore
When completed, select CDROM and pick ISO of CentOS, enable "power on when connected"
boot vm
install OS
when the vm finishes installation and reboots, begin katello install
https://theforeman.org/plugins/katello/3.18/installation/index.html
@jjeffers
jjeffers / gist:40a40e0f8718094184eeb5abebb9a868
Created January 28, 2021 17:23
update local Katello branch name
git fetch upstream ; git co -b main upstream/main; git branch -D master
@jjeffers
jjeffers / smart_proxy_container_gateway_setup.md
Last active April 16, 2021 11:46
proxy devel pulpcore smart proxy container gateway setup for testing plugin

On the proxy:

  • yum group install "Development Tools"

  • yum install rh-ruby27-ruby-devel

  • scl enable tfm bash

  • yum install sqlite-dev

  • gem install sqlite

  • gem build smart_proxy_container_gateway.gemspec

  • gem install smart_proxy_container_gateway-x.x.x.gem

  • edit /etc/foreman-proxy/settings.d/container_gateway.yml:

@jjeffers
jjeffers / 503.py
Created January 19, 2021 18:35
Simple web application that always returns a 503, useful for testing.
# Python 3 server example
from http.server import BaseHTTPRequestHandler, HTTPServer
import time
hostName = "localhost"
serverPort = 8080
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(503)
foreach ($query->result() as $row)
{
//$gri = $row->id;
//$willthisfixit=0;
//if($gri==292){
//echo '<option value="'.$row->id.'" selected="selected">'.$row->name.'</option>';
//}else{
//if($willthisfixit==0){
//echo '<option value="">'.lang_key('select_one').'</option>';
//}
@jjeffers
jjeffers / .rb
Created September 2, 2015 15:35
charge = Stripe::Charge.create(
amount: amount_in_cents,
currency: "usd",
source: token,
description: description,
metadata: charge_metadata,
destination: destination_account
)