Skip to content

Instantly share code, notes, and snippets.

View jjeffers's full-sized avatar

James Jeffers jjeffers

View GitHub Profile
gem install brakeman
brakeman
Gem::Specification.new do |s|
s.name = "wiw"
s.version = "0.9.0"
s.homepage = "https://github.com/jjeffers/wiw"
s.add_runtime_dependency "rest-client"
s.add_runtime_dependency "activemodel"
s.add_development_dependency "minitest"
s.add_development_dependency "minitest-vcr"
s.add_development_dependency "fakeweb"
s.add_development_dependency "vcr"
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="backgroundTable" st-sortable="banner">
<tbody>
<tr>
<td>
<table width="600" bgcolor="#d3d3d3" cellpadding="0" cellspacing="0" border="0" align="center" class="devicewidth">
<tbody>
<tr>
<td width="100%">
<table width="600" align="center" cellspacing="0" cellpadding="0" border="0" class="devicewidth">
<tbody>
public static Company CreateCompany(string name)
{
if (name == null) throw new ArgumentNullException("name");
var company = new Company {Name = name, Address = "100 My Address, SomeWhere NC"};
using (var pe = DBContextFactory.Instance.Create())
{
pe.Company.Add(company);
pe.SaveChanges();
return company;
}
@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
)
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 / 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)
@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 / 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 / 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