Skip to content

Instantly share code, notes, and snippets.

View matyasselmeci's full-sized avatar

Matyas Selmeci matyasselmeci

  • University of Wisconsin-Madison Computer Sciences Department
  • Madison, WI
  • 12:05 (UTC -05:00)
View GitHub Profile
@matyasselmeci
matyasselmeci / checkmodulus.sh
Created August 31, 2022 15:08
Compare the modulus of two X.509 (cert, key, or csr) files
#!/bin/bash
# checkmodulus
#
# Usage: checkmodulus <file1> <file2>
#
# Compares the modulus of two X.509 files (cert, key, or CSR)
# Returns 0 if they match, 1 if they do not, or something else on error
fail () {
ret=$1
#!/usr/bin/python3
import re
import shlex
import json
def expand_backslashn(mystr):
try:
return re.sub(r'[\\]n', "\n", mystr)
@matyasselmeci
matyasselmeci / contactlist-transform.py
Created August 16, 2018 20:04
script for transforming ContactLists formats
#!/usr/bin/env python3
# this leaves comments and ordering alone. It does however mess up strings with non-ASCII characters
import sys
import ruamel.yaml as yaml
with open(sys.argv[1]) as s:
yy = yaml.load(s, Loader=yaml.RoundTripLoader)
if "Resources" not in yy:
@matyasselmeci
matyasselmeci / mockup-vo-atlas.yaml
Created April 24, 2018 16:23
Mockup of VO yaml files
Active: True
AppDescription: ATLAS Production and Analysis
CertificateOnly: False
Community: The ATLAS physics community.
Contacts:
Security Contact:
- John Hover
Administrative Contact:
- John Hover
Miscellaneous Contact:
@matyasselmeci
matyasselmeci / kojid_scmbuild_check_spec_after_running_sourcecmd.patch
Created September 12, 2017 14:05
Patch to kojid to check spec file after running the command to fetch sources
From da3dc7e9b7ba17d8448a00eacab9adfc6a75b444 Mon Sep 17 00:00:00 2001
From: Matyas Selmeci <matyas@cs.wisc.edu>
Date: Thu, 8 Sep 2016 11:12:23 -0500
Subject: [PATCH] kojid_scmbuild_check_spec_after_running_sourcecmd
Check that the spec file is present and valid _after_ using the
source_cmd to fetch it (for VCS builds).
---
builder/kojid | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
@matyasselmeci
matyasselmeci / IniConfigurationOptions3b
Created September 12, 2017 13:52
IniConfigurationOptions section that hangs
---++ RSV
This section handles the configuration and setup of the RSV services This section is contained in =/etc/osg/config.d/30-rsv.ini= which is provided by the =osg-configure-rsv= RPM.
| Option | Values Accepted | Explanation |
| *enabled* | =True=, =False=, =Ignore= | This indicates whether the rsv service is being used or not. |
| *rsv_user* | String | This gives username that rsv will run under. If this is blank or set to =UNAVAILABLE=, it will default to rsv. |
| *gratia_probes* | String | This settings indicates which rsv gratia probes should be used. It is a list of probes separated by a comma. Valid probes are metric, condor, pbs, lsf, sge, managedfork, hadoop-transfer, and gridftp-transfer |
| ce_hosts | String | This option lists the serviceURI of the CEs that generic RSV CE probes should check. This should be a list of serviceURIs =(hostname[:port/service])= separated by a comma (e.g. my.host,my.host2,my.host3:2812). This must be set if enable_ce_probes is set. If this is left blank or
@matyasselmeci
matyasselmeci / naughtyvoms.sh
Created March 2, 2017 22:14
Generates a fake VOMS proxy for any VO (and optionally VO-group) we want
#!/bin/bash
# naughtyvoms.sh
# Generates a fake VOMS proxy for any VO (and optionally VO-group) we want
vo=${1?Which VO do you want to be in?}
vogroup=${2:-$1}
sudo true || { echo "Need sudo privs"; exit 1; }
uid=`id -u`