Skip to content

Instantly share code, notes, and snippets.

@zmousm
zmousm / jira.sieve
Last active December 29, 2015 10:39
jira mail address header sanitization
require [ "regex", "editheader", "relational", "variables" ];
if header :regex "X-JIRA-FingerPrint" "^(jira-server1-fingerprint|server2-fingerprint)$" {
# assumption: common mail domain
set "msfx" "@example.com";
# match up to 3 g.assignees
if header :regex "X-JIRA-GroupAssignee" "^(([^ ]+) ?)(([^ ]+) ?)?(([^ ]+) ?)?$" {
set "gass" "${2}${msfx}";
if string :count "ne" "${4}" ["0"] {
set "gass" "${gass}, ${4}${msfx}";
@zmousm
zmousm / fed-edugain-idp-stats.py
Last active December 27, 2015 03:59
Naive attempt at counting IdPs in eduGAIN federations vs. IdPs published by these federations to eduGAIN.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml.objectify import parse
import urllib2
request = urllib2.Request
urlopen = urllib2.urlopen
xpath_ns = {'ds': 'http://www.w3.org/2000/09/xmldsig#',
'md': 'urn:oasis:names:tc:SAML:2.0:metadata',
@zmousm
zmousm / gist:5108930
Last active December 14, 2015 15:38 — forked from aduitsis/gist:5101097
#!/usr/bin/perl -w
use strict;
use warnings;
use Carp;
use MIME::Base64;
use Compress::Zlib;
use URI;
use URI::QueryParam;
use XML::Canonical;