Skip to content

Instantly share code, notes, and snippets.

View jwmatthews's full-sized avatar

John Matthews jwmatthews

View GitHub Profile
@jwmatthews
jwmatthews / sample_script_talk_to_candlepin.rb
Last active December 27, 2015 14:09
Sample to work with Candlepin and generate a v3 cert
#!/usr/bin/env ruby
#
# Sample script to use Candlepin to generate Red Hat v3 certificates for unit tests
# Using the Candlepin Ruby API from:
# https://github.com/candlepin/candlepin/blob/master/client/ruby/candlepin_api.rb
#
# Requires:
# 1) Candlepin git checkout on a peer basis with 'cloude'
# 2) A Candlepin server
#
property("findMin1") = forAll { (a: Int, b: Int) =>
(a != b) ==> {
val h = insert(b, insert(a, empty))
findMin(h) == {if (a<b) a else b}
}
}
package com.sciencebehindsweat
import scala.collection.parallel._
import scala.compat.Platform
import java.io.File
import java.io.FileWriter
object Main {
val url_athlete = "http://games.crossfit.com/athlete/"
val outputDir = "./output"
Seeing a problem where after creating a few VMs on RHEV through ComputeResource of Satellite we hit a conflict where further VMs do not get created, creation of VM triggers an immediate deletion which yields an error of "disk locked".
[W] mac 00:1a:4a:16:01:51 is already used by dgao-ose-dep-2-ose-master1.example.com
[I] Removing Compute instance for dgao-ose-dep-3-ose-master1.example.com
# cat rbo_virt_list_volumes.rb
#!/usr/bin/env ruby
require 'rbovirt'
USER="admin@internal"
PASS="dog8code"
# For 3.6 URL is just IP/api
# For 4.0 URL is IP/ovirt/api/v3
# cat rbo_virt_list_volumes.rb
#!/usr/bin/env ruby
require 'rbovirt'
USER="admin@internal"
PASS="dog8code"
# For 3.6 URL is just IP/api
# For 4.0 URL is IP/ovirt/api/v3
# cat ovirt_list_vms.sh
USER="admin@internal"
PASS="dog8code"
# For 3.6 URL is just IP/api
# For 4.0 URL is IP/ovirt/api/v3
URL="https://192.168.155.11/api"
curl -k --user ${USER}:${PASS} -i -X GET -H "Accept: application/xml; detail=disks; detail=nics; detail=hosts;" ${URL}/vms
# cat ovirt_list_volumes.sh
#!/bin/sh
if [ "$#" -lt "1" ]; then
echo "Please re-run with VM ID"
exit 1
fi
VM_ID="$1"
BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1364533#c0
Error seen:
stderr: The Route "hello-openshift" is invalid.
spec.host: Invalid value: "hello-openshift.pkpcpGALng.example.com": host must conform to DNS 952 subdomain conventions
Traced it down to the use of the uppercase is violating a check.
$ atomicapp --version
atomicapp 0.4.5, Nulecule Specification 0.0.2
$ sudo atomicapp fetch projectatomic/helloapache --destination helloapache -v
$ cd helloapache
$ sudo cp answers.conf.sample answers.conf
$ oc whoami -t