Skip to content

Instantly share code, notes, and snippets.

View jdiverp's full-sized avatar

Jonathan Pass jdiverp

View GitHub Profile
@jdiverp
jdiverp / uforward_deptofmed.py
Created December 17, 2024 21:44
Department of Medicine email compliance parser
#!/usr/bin/python
import fileinput, string, sys, re, httplib, json
import time, datetime, os
GWS_HOST = 'groups.uw.edu'
GWS_PORT = '443'
GWS_BASE = '/group_sws/v3'
KEY_FILE = ''
#!/bin/bash
die () { echo >&2 "$@";exit 1; }
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
GROUP=$1
curl -K $HOME/.curlrc_gwsjq -s -w "" "https://groups.uw.edu/group_sws/v3/group/$GROUP/member" | jq -c '.data[] |select ([.type] | inside(["uwnetid"])) | .id' | sed -e 's/[^a-z0-9_-]//' -e 's/,$//' -e 's/"//g'
#!/usr/bin/perl
## Must be set to where the bounces are to go..
my $SENDMAILBOUNCE = 'me@me.com';
print "usage: $0 <message> <recipients>\n" if($#ARGV ne '1');
exit if($#ARGV ne '1');
{
open( MSG, "<$ARGV[0]" ) or die ("message text could not be opened\n");
SELECT distinct u.uwnetid
FROM uwnetid u
join validation v on v.validation_id = u.validation_id and u.status_code=30
where
(v.status_code = 1 and v.source_code=1 and v.category_code <> 34)
OR (v.status_code =1 and v.source_code=2 and v.category_code <> 20)
OR (v.status_code =1 and v.source_code=3 and v.category_code <> 17)
OR (v.status_code =1 and v.source_code=4 and v.category_code <> 10)
order by 1
;
@jdiverp
jdiverp / gws_put-members.py
Last active October 24, 2025 19:26
Ubuntu/Red version
#!/usr/bin/python3
import sys
import time
import json
import argparse
import urllib3, urllib.parse
import csv
GWS_HOST = 'eval.groups.uw.edu'
GWS_HOST = 'groups.uw.edu'
@jdiverp
jdiverp / gws_get-eff-members.py
Last active April 16, 2026 21:53
requests version
#!/usr/bin/python3
import argparse
import requests
import sys
import time
import json
GWS_HOST = 'eval.groups.uw.edu'
GWS_HOST = 'iam-ws.u.washington.edu'
GWS_HOST = 'groups.uw.edu'
#!/usr/bin/python
import httplib
import xml.dom.minidom
import sys
import time
GWS_HOST = 'eval.groups.uw.edu'
GWS_HOST = 'iam-ws.u.washington.edu'
GWS_HOST = 'groups.uw.edu'
GWS_PORT = 443
#!/usr/bin/python
import argparse
import httplib
import sys
import time
import json
NWS_HOST = 'uwnetid.washington.edu'
NWS_PORT = '443'
NWS_BASE = '/nws/v1'
#!/usr/bin/perl
# would prefer to use IRWS instead of TSC stuff for the report
my $mango = '';
$mango= 'mango-eval.u.washington.edu';
$mango= 'mango.u.washington.edu';
my $MU = "/usr/local/bin/mu -c ~pass/.cconfig -h $mango -a 4";
#create a select for records updated before today's import
@jdiverp
jdiverp / stilpo_compare.sh
Last active March 7, 2023 23:06
check all 5 stilpos
#!/bin/bash
HOSTBASE=stilpo31
HOSTLIST='stilpo32 stilpo33 stilpo34 stilpo35 stilpo36 stilpo37'
export LDAPRC=.ldaprc_grp
export HOME=~pass
LDAPSEARCH='/usr/bin/ldapsearch -Q -LLL -o ldif-wrap=no'
SEARCH="$1 $2 $3"
echo ldapsearch $SEARCH