Skip to content

Instantly share code, notes, and snippets.

Avatar

Min RK minrk

View GitHub Profile
View mpiexec-exitcode.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View wurlitzer-files.py
"""
wurlitzer-lite using files instead of pipes
avoids max-pipe-size issue in exchange for dealing with files
"""
import ctypes
import os
import sys
from contextlib import contextmanager
View map_async.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View jupyter-e2e.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minrk
minrk / jupyterhub_config.py
Created May 9, 2021
example GitHubOAuthenticator with refresh_user implementation
View jupyterhub_config.py
c = get_config() # noqa
from oauthenticator.github import GitHubOAuthenticator
from tornado.httpclient import HTTPRequest, HTTPError
class RefreshingOAuthenticator(GitHubOAuthenticator):
async def refresh_user(self, user, handler=None):
self.log.debug(f"Refreshing auth for {user.name}")
View cull-kernels.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View cull-kernels.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View detect-actions.py
#!/usr/bin/env python
"""
Quickly check which github actions repos might have access to your secrets,
in case they are compromised.
- Collect github workflow files for all repos in an org with graphql
- Crude analysis of workflow yaml files to:
- look for `secrets.` indicating that a secret is used
- show all actions via `uses:` in steps
"""
View measure-preload-content
#!/usr/bin/env python3
"""Measure the cost of _preload_content=True across kubernetes versions
This has grown over time, and is *super* expensive with kubernetes 12
and lots of pods.
CSV output is produced on stdout, so call with e.g.
./measure-preload-content | tee measurements.csv
"""
View measure-preload-content
#!/usr/bin/env python3
"""Measure the cost of _preload_content=True across kubernetes versions
This has grown over time, and is *super* expensive with kubernetes 12
and lots of pods.
CSV output is produced on stdout, so call with e.g.
./measure-preload-content | tee measurements.csv
"""