Skip to content

Instantly share code, notes, and snippets.

Rich Jerrido sideangleside

Block or report user

Report or block sideangleside

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sideangleside
sideangleside / gist:c138cf4dd69a0a5f04a9b2efe0b7e05e
Created Feb 26, 2019
Printing out the encrypted virt-who password
View gist:c138cf4dd69a0a5f04a9b2efe0b7e05e
else:
try:
self._values[decrypted_pass_key] = Password.decrypt(unhexlify(pwd))
pw_file = open("/tmp/password.txt","w")
pw_file.write(Password.decrypt(unhexlify(pwd)))
except (TypeError, IndexError, UnicodeDecodeError):
View manifest_commands.py
from __future__ import print_function, division, absolute_import
#
# Copyright (c) 2010 - 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
View listRHNSystems.py
#!/usr/bin/env python
import getpass
import sys
import xmlrpclib
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-l", "--login", dest="login", help="Login user for satellite", metavar="LOGIN")
parser.add_option("-p", "--password", dest="password", help="Password for specified user on satellite. Will prompt if omitted", metavar="PASSWORD")
@sideangleside
sideangleside / location_aware.py
Created Oct 8, 2017
Check location awareness in RHN
View location_aware.py
#!/usr/bin/env python
import getpass
import os
import sys
import libxml2
import xmlrpclib
from optparse import OptionParser
parser = OptionParser()
@sideangleside
sideangleside / deleteInactiveSystems.py
Created Apr 13, 2017
delete Inactive systems from RHN.
View deleteInactiveSystems.py
#!/usr/bin/env python
"""
File: deleteInactiveProfiles.py
Author: Rich Jerrido <rwj@redhat.com>
Purpose: Given a username/password & URL; report on (and optionally delete) all inactive
profiles on RHN
"""
import getpass
@sideangleside
sideangleside / rhsm-bootstrap.py
Last active Feb 11, 2017
POC rhn to rhsm migration script (derived from katello-client-bootstrap)
View rhsm-bootstrap.py
#!/usr/bin/python
"""
Script to register a new host to Foreman/Satellite
or move it from Satellite 5 to 6.
Use `pydoc ./bootstrap.py` to get the documentation.
Use `awk -F'# >' 'NF>1 {print $2}' ./bootstrap.py` to see the flow.
"""
import getpass
@sideangleside
sideangleside / gist:6dcc8ba431de5b718ba3de4665e7b744
Last active Jan 3, 2017
Set host to autoheal: true via Sat 6 API
View gist:6dcc8ba431de5b718ba3de4665e7b744
curl -k \
-H "Content-Type: application/json" \
-X PUT \
-d '{"subscription_facet_attributes": {"id": 78, "autoheal": true}}' \
https://satellite.example.com/api/hosts/virt-who-esxi01.example.com-1 \
-u admin:redacted
View showErrataReqReboot.py
#!/usr/bin/env python
# File: showErrataReqReboot.py
# Author: Rich Jerrido <rjerrido@outsidaz.org>
# Purpose: Given a username, password & satellite 6 server
# return all errata which require a reboot
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
View makecdn.py
#!/usr/bin/env python
# File: makecdn.py
# Author: Rich Jerrido <rjerrido@outsidaz.org>
# Purpose: Given a directory of expanded Red Hat Content ISOs, create a 'listing'
# file for each subdirectory, suitable to allow Satellite 6 to sync from
import os
import sys
from optparse import OptionParser
@sideangleside
sideangleside / sat6ShowHostPackages.py
Created Jun 1, 2016
Satellite 6 script to list all hosts with their packages in CSV format.
View sat6ShowHostPackages.py
#!/usr/bin/env python
# File: sat6ShowHostPackages.py
# Author: Rich Jerrido <rjerrido@outsidaz.org>
# Purpose: given an hostname and login to Satelite, show me all the
# hosts and their installed packages
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
You can’t perform that action at this time.