Skip to content

Instantly share code, notes, and snippets.

View eddienko's full-sized avatar
🕊️
Stand with Peace

Eduardo Gonzalez eddienko

🕊️
Stand with Peace
View GitHub Profile
@eddienko
eddienko / casuauthenticator.py
Last active October 10, 2022 14:10
CASU Authenticator
"""
Custom Authenticator to use generic OAuth2 with JupyterHub
"""
import sys
import json
import os
import base64
import urllib
#!/bin/sh
errorExit() {
echo "*** $*" 1>&2
exit 1
}
APISERVER_VIP=xxx.xxx.xx.xx
APISERVER_DEST_PORT=6443
global_defs {
router_id LVS_DEVEL
}
vrrp_script check_apiserver {
script "/etc/keepalived/check_apiserver.sh"
interval 3
weight -2
fall 10
rise 2
}
distributed:
version: 2
scheduler:
bandwidth: 1000000000 # 100 MB/s estimated worker-worker bandwidth
worker:
memory:
target: 0.90 # target fraction to stay below
spill: False # fraction at which we spill to disk
pause: 0.80 # fraction at which we pause worker threads
terminate: 0.95 # fraction at which we terminate the worker
#!/usr/bin/env python3
"""
Update Dask configuration based on the configuration
of the running Pod.
To be run at startup.
"""
import os
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eddienko
eddienko / Makefile
Created May 2, 2018 07:45 — forked from maartenbreddels/Makefile
Makefile for converting GaiaDR2 cvs files to a single hdf5 file
# Makefile for converting the CSV files from http://cdn.gea.esac.esa.int/Gaia/gdr2/gaia_source/csv/
# to a single (vaex) hdf5 file
# * https://docs.vaex.io
# * https://github.com/maartenbreddels/vaex/
# It is multistage to work around opening 60 000 files at once.
# Strategy is
# * stage1: convert all cvs.gz to csv to hdf5
# * do this via xargs and calling make again, since gmake has trouble matching 60 000 rules
# * stage2: Create part-<NUMBER>.txt files containing max FILES_PER_PART per file
# * stage3: convert the list of hdf5 files to single hdf5 files (part-<NUMBER>.hdf5)
@eddienko
eddienko / Image pipeline (delayed).ipynb
Created April 1, 2018 06:22
Dask/Image pipeline (delayed).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eddienko
eddienko / pcap.py
Created March 12, 2018 15:04 — forked from mrocklin/pcap.py
import pandas as pd
def parse(line):
words = line.split()
time = words[0]
protocol = words[1]
if protocol == 'IP':
src_ip, src_port = words[2].rsplit('.', 1)
dst_ip, dst_port = words[4].strip(':').rsplit('.', 1)