Skip to content

Instantly share code, notes, and snippets.

View BruceDone's full-sized avatar
:octocat:

Bruce Tang BruceDone

:octocat:
View GitHub Profile
@pachadotdev
pachadotdev / 00-install-intel-mkl-64bit
Last active February 4, 2021 07:59
Install Intel MKL (64 bit) on Ubuntu 17.10
# Option 1: Use apt-get
# keys taken from https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-apt-repo
cd ~/GitHub/r-with-intel-mkl/
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update && sudo apt-get install intel-mkl-64bit
@hynek
hynek / gunicorn_callbacks_for_worker_id.py
Last active March 6, 2024 04:55
This is an attempt to emulate uWSGI’s uwsgi.worker_id() that ensures that I have worker IDs from 1…--workers which is useful in logging and instrumentation where changing PIDs are annoying.
import os
def on_starting(server):
"""
Attach a set of IDs that can be temporarily re-used.
Used on reloads when each worker exists twice.
"""
server._worker_id_overload = set()