Skip to content

Instantly share code, notes, and snippets.

View mariusvniekerk's full-sized avatar

Marius van Niekerk mariusvniekerk

View GitHub Profile
@mariusvniekerk
mariusvniekerk / gist:8062244
Created December 20, 2013 21:50
BitMaskEnum helper
from itertools import chain
from enum import Enum
class BitMaskEnum(object):
def __init__(self, base_enum, iterable=None, value=None):
if not isinstance(base_enum, Enum):
raise TypeError('base_enum {!r} is not derived from {!r}'.format(base_enum, Enum))
self._base = base_enum
if iterable is not None:
@mariusvniekerk
mariusvniekerk / Dockerfile
Last active November 7, 2024 08:07
Jupyter Docker Kernel
FROM jupyter/demo
USER root
EXPOSE 6000 6001 6002 6003 6004
@mariusvniekerk
mariusvniekerk / DockerWorking.md
Last active November 16, 2016 15:34
Getting DNS forwarding working with docker inside vm.

Run this to get your DNS server that your vm is using.

$ nmcli dev show | grep DNS

edit /etc/docker/daemon.json and replace the 10.0.0.2 with the dns found.

@mariusvniekerk
mariusvniekerk / readme.md
Created November 29, 2017 15:05
binderhub-test-public

This is a test gist for public binderhub gists

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mariusvniekerk
mariusvniekerk / profiler.txt
Created March 5, 2018 21:40
s3fs callgraph
418 function calls in 0.006 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.006 0.006 /Users/mvanniekerk/src/dask/s3fs/s3fs/core.py:777(copy)
1 0.000 0.000 0.006 0.006 /Users/mvanniekerk/src/dask/s3fs/s3fs/core.py:757(copy_managed)
1 0.000 0.000 0.006 0.006 /Users/mvanniekerk/miniconda3/envs/s3fs/lib/python3.6/site-packages/boto3/s3/inject.py:209(copy)
14 0.005 0.000 0.005 0.000 {method 'acquire' of '_thread.lock' objects}
2 0.000 0.000 0.005 0.002 /Users/mvanniekerk/miniconda3/envs/s3fs/lib/python3.6/threading.py:533(wait)
@mariusvniekerk
mariusvniekerk / poormansdag.ipynb
Created May 10, 2018 23:21
How to make a simple task execution engine in basically no code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mariusvniekerk
mariusvniekerk / MyFeedstocksNeedingAttention.ipynb
Created June 7, 2018 19:54
Feedstocks on conda-forge with mergable things
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mariusvniekerk
mariusvniekerk / run-container.sh
Created June 13, 2018 20:27
Run a container and have psutil work properly
docker run --memory 128mb \
-v /var/lib/lxcfs/proc/meminfo:/proc/meminfo:rprivate \
--cpus 1 \
-v /var/lib/lxcfs/proc/cpuinfo:/proc/cpuinfo:rprivate \
-it \
ubuntu

Keybase proof

I hereby claim:

  • I am mariusvniekerk on github.
  • I am mariusvniekerk (https://keybase.io/mariusvniekerk) on keybase.
  • I have a public key ASAV4z2GhLl8ZKkn35TU5RrdtUv1M-xYS2bm3rdIOT7rSQo

To claim this, I am signing this object: