Skip to content

Instantly share code, notes, and snippets.

View sidravic's full-sized avatar

Siddharth sidravic

View GitHub Profile
@sidravic
sidravic / loadbalancer.py
Created July 13, 2022 01:52 — forked from zhouchangxun/loadbalancer.py
a simple loadbalancer implemention with python.
import sys
import socket
import select
import random
from itertools import cycle
# dumb netcat server, short tcp connection
# $ ~ while true ; do nc -l 8888 < server1.html; done
# $ ~ while true ; do nc -l 9999 < server2.html; done
SERVER_POOL = [('10.157.0.238', 8888)]
@sidravic
sidravic / dask_cloudprovider.py
Created June 17, 2022 03:45 — forked from jcrist/dask_cloudprovider.py
Prefect Example using DaskExecutor with dask-cloudprovider
from prefect import Flow
from prefect.executors import DaskExecutor
with Flow("daskcloudprovider-example") as flow:
# Add tasks to flow here...
# Execute this flow on a Dask cluster deployed on AWS Fargate
flow.executor = DaskExecutor(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={"image": "prefecthq/prefect", "n_workers": 5}
@jcrist
jcrist / dask_cloudprovider.py
Created December 16, 2020 18:05
Prefect Example using DaskExecutor with dask-cloudprovider
from prefect import Flow
from prefect.executors import DaskExecutor
with Flow("daskcloudprovider-example") as flow:
# Add tasks to flow here...
# Execute this flow on a Dask cluster deployed on AWS Fargate
flow.executor = DaskExecutor(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={"image": "prefecthq/prefect", "n_workers": 5}
@pmav99
pmav99 / config2.json
Last active June 15, 2022 14:56
Python logging configuration using JSON. If you want an updated example also covering YAML files, check here: https://github.com/pmav99/python-logging-example
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"brief": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(name)-15s; %(message)s"
},