Skip to content

Instantly share code, notes, and snippets.

import sys
import xml.etree.ElementTree as ET
tree = ET.parse(sys.argv[1])
root = tree.getroot()
root.findall('properties')
attrib1 = {'name': 'polarion-group-id', 'value': sys.argv[2]}
ET.SubElement(root.findall('properties')[0],'property',attrib1)
tree.write(sys.argv[1])
"Modified from project : https://pypi.org/project/PyHatch/"
import requests
import os
import datetime
import getpass
GITHUB_USER = 'ntkathole'
here = os.path.abspath(os.path.dirname(__file__))
@ntkathole
ntkathole / find_satellite_snap.py
Last active April 23, 2019 14:15
This script helps you to find which satellite snap you have installed.
import os
import requests
ohsnap=""
satellite="6.5.0"
def main():
for i in range(1,50):
flag = 0
release = "{0}/api/releases/{1}/snaps/{2}.0/srpms".format(ohsnap,str(satellite),str(i))
@ntkathole
ntkathole / custom_certs.sh
Created September 23, 2018 12:59
Script to generate custom certs
#! /bin/bash
name=${hostname}
mkdir ownca
pushd ownca
wget https://raw.githubusercontent.com/ntkathole/ownca/master/openssl.cnf
wget https://raw.githubusercontent.com/ntkathole/ownca/master/generate-ca.sh
wget https://raw.githubusercontent.com/ntkathole/ownca/master/generate-crt.sh
echo 100001 >> serial
chmod 744 *.sh
yes "" | ./generate-ca.sh
@ntkathole
ntkathole / satellite_cert_generator.sh
Last active November 19, 2020 13:53
Script to generate certificates for satellite server
country=IN
state=Maharashtra
locality=Pune
organization=redhat
organizationalunit=QE
commonname=$(hostname)
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname"
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname"