Skip to content

Instantly share code, notes, and snippets.

#!/bin/env python3
import pyasn1
from pyasn1.type import constraint, namedtype, namedval, univ
from pyasn1.codec.ber.decoder import decode
from uuid import UUID
# These come from Python-LDAP's syncrepl module.
# They're definitions for pyasn1 to understand what it's parsing.
@akkornel
akkornel / 102217.txt
Created October 23, 2017 05:49
Git commit & tag re-certification from October 22, 2017
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Here is the table referred to in my blog post at
http://karl.kornel.us/2017/10/welp-there-go-my-git-signatures/
Last commit signed by my revoked sub-key First commit signed using my new sub-key
2af1083219692bf5046bac2c815656358fcda71f 4793f2c8fa5a69dcc351927039724704fca5dac0
bedb51ebee32838e0c9359fcca044e97ff1c3677 ccf9d4e03d757759c4b34579dad763be4e1cf21d
0473090599c505e78dd9fa8399d4b858e2ecc653 bf148ded0854093e0e4ce05c81210583b193997d
@akkornel
akkornel / globus-connect-server.conf
Created March 18, 2018 19:39
Globus Connect Server configuration (Stanford-specific), part 1
; vim: filetype=dosini : nospell :
;------------------------------
; Globus Configuration, Part 1
;------------------------------
; This is the part of /etc/globus-connect-server.conf that is common to all
; authentication methods. You can fill it out even if you haven't decided on
; an authentication method to use.
@akkornel
akkornel / globus-endpoint_cert-demo.py
Created March 23, 2018 05:27
Show the Globus endpoint_cert API used to fetch an endpoint key & cert
# vim: ts=2 sw=2 et
# To use this, first, install the `globus-sdk` package via pip.
# Next, go to https://developers.globus.org
# Choose "Register your app with Globus".
# Make a new project, with whatever name & email you want.
# Then, go to the "Add…" menu, and choose "Add a new app".
# Choose whatever app name you want.
# For _Redirect URLs_, enter `http://localhost:4000`.
# For _Scopes_, choose `urn:globus:auth:scope:transfer.api.globus.org:all`.
@akkornel
akkornel / globus-connect-server.conf
Created April 6, 2018 05:08
Globus Connect Server configuration (Stanford-specific), part 2 for legacy MyProxy authentication
; vim: filetype=dosini : nospell :
;------------------------------
; Globus Configuration, Part 2
; Legacy MyProxy Authentication
;------------------------------
; This is the part of /etc/globus-connect-server.conf that is specific to the
; legacy MyProxy authentication method. You should add this content to the
; end of the file, after you have filled in the content for Part 1.
@akkornel
akkornel / globus-connect-server.conf
Created April 6, 2018 06:33
Globus Connect Server configuration (Stanford-specific), part 2 for CILogon authentication
; vim: filetype=dosini : nospell :
;------------------------------
; Globus Configuration, Part 2
; CILogon Authentication
;------------------------------
; This is the part of /etc/globus-connect-server.conf that is specific to the
; CILogon authentication method. You should add this content to the end of
; the file, after you have filled in the content for Part 1.
@akkornel
akkornel / globus-connect-server.conf
Last active May 12, 2018 21:31
Globus Connect Server configuration (Stanford-specific), part 2 for MyProxy OAuth authentication
; vim: filetype=dosini : nospell :
;------------------------------
; Globus Configuration, Part 2
; MyProxy OAuth Authentication
;------------------------------
; This is the part of /etc/globus-connect-server.conf that is specific to the
; MyProxy OAuth authentication method. You should add this content to the
; end of the file, after you have filled in the content for Part 1.
@akkornel
akkornel / globus_sub_api.txt
Created October 10, 2018 20:18
Globus Subscription API suggestion
This is a request for a completely new Globus API. API credentials come from Globus Auth, but a new scope is used.
The idea behind this API is two-fold:
1. Allow the subscription to take place without having to pass credentials around.
2. Give Subscription Managers an easy way to list all the endpoints covered under a subscription, and see their details.
The last point is important: This API would give subscription managers access to endpoint details, even if the endpoint is marked private.
@akkornel
akkornel / output.txt
Created November 2, 2018 08:39
Errors and warnings when trying to build py-libzfs on Linux
$ make clean ; PYTHON=`which python` CFLAGS='-I/usr/include/libzfs -I/usr/src/zfs-0.7.11/include -I/usr/include/libspl' make
rm -rf build libzfs.c
/usr/bin/python setup.py build
WARNING: '' not a valid package name; please use only .-separated package names in setup.py
running build
running build_py
running build_ext
cythoning libzfs.pyx to libzfs.c
/home/akkornel/.local/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: ./pxd/libzfs.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
@akkornel
akkornel / file.py
Created May 28, 2021 06:51
Given a GCSv5 (Globus Connect Server version 5) endpoint UUID, look up the IP addresses of its DTNs.
#!/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
# Given a GCSv5 endpoint UUID, look up the IP addresses of its DTNs.
# WARNING: Although this is more than bare-bones code, in that it
# does have a fair amount of error checking, you should not consider
# it production-ready. In particular because it relies GCSv5
# endpoint APIs that aren't documented.
# © 2021 A. Karl Kornel