Skip to content

Instantly share code, notes, and snippets.

View martin-kokos's full-sized avatar

martin-kokos martin-kokos

View GitHub Profile
@martin-kokos
martin-kokos / kravi_hora_server.py
Last active August 31, 2020 18:48
Kravi hora occupancy provider
'''
Provides occupancy number http://localhost:8080/kravi_hora
'''
import logging
import re
import requests
from bs4 import BeautifulSoup
from aiohttp import web
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
JAVA_ANT_ENCODING=UTF-8
ESVN_REPO_URI="https://josm.openstreetmap.de/svn/trunk"
inherit eutils java-pkg-2 java-ant-2 subversion desktop
@martin-kokos
martin-kokos / task_manager.py
Last active January 8, 2021 14:40
Simple multiprocessing task manager
'''
If the tasks are inequally sized, it may happen with starmap and similar schedulers
which schedule tasks ahead of time, that some workers are lucky and finish early and some unlucky
and finish much later having the effect of the task batch using all CPU cores at first,
but then lucky workers finishing and core sitting idle.
This task manager serves as an example on how to have workers fetch tasks from a Queue.
Joblib, Pool.starmap or something else might be better, but maybe this is useful.
'''
@martin-kokos
martin-kokos / distcc_ubuntu.md
Last active June 1, 2024 09:58
Install gcc-14 and distcc on Ubuntu

Install gcc

apt install software-properties-common  # installs apt-add-repository
# apt-add-repository ppa:ubuntu-toolchain-r/test
apt-add-repository universe
apt update
apt install gcc-14 g++-14
ll /usr/bin/gcc-14
ll /usr/bin/g++-14
update-alternatives --display gcc