Skip to content

Instantly share code, notes, and snippets.

View miraculixx's full-sized avatar
💭
working on https://github.com/omegaml

miraculixx

💭
working on https://github.com/omegaml
  • Switzerland
View GitHub Profile
@miraculixx
miraculixx / README
Last active August 31, 2021 01:30
ffmpeg green screen chromakey virtual background for linux
setup
1. Install video 4 linux (v4l)
https://github.com/umlaeute/v4l2loopback
2. Install ffmpeg
https://linuxize.com/post/how-to-install-ffmpeg-on-ubuntu-18-04/
@miraculixx
miraculixx / markup.py
Last active April 12, 2023 17:13
an extensible multi-markup reader in less than 100 lines of python code
# (c) miraculixx, licensed as by the terms of WTFPL, http://www.wtfpl.net/txt/copying/
# License: DO WHATEVER YOU WANT TO with this code.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
from io import StringIO
from contextlib import contextmanager
@miraculixx
miraculixx / nvidia-docker.sh
Created June 10, 2020 09:44
rancher nividia docker 19.03
#!/usr/bin/env bash
# this is the rancher docker installation script with nvidia support
# apply to NVIDIA GPU nodes only
# sources
# https://www.tensorflow.org/install/docker
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#pre-installation-actions
# https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation
@miraculixx
miraculixx / index.html
Last active April 24, 2020 16:38
test
<html>
<head>
<style>
#canvas {
border-color: black;
border-style: solid;
width: 128px;
height: 128px;
}
#resized {
@miraculixx
miraculixx / README
Last active February 7, 2023 23:12
Celery worker blocks on rate limited task
Celery worker blocks on rate limited task
=========================================
by github.com/miraculixx
Problem:
If a worker has a rate_limit active on some task, and that task
arrives (is received) more often than the rate limit interval, all
worker processes will block on these task instances and stop
consuming other tasks as soon as the prefetch count has maxed out
@miraculixx
miraculixx / .gistignore
Last active March 3, 2020 18:17
Makefile for multi-file gists using https://github.com/defunkt/gist
# no blank lines!
.gist
.gistignore
.git/*
.idea/*
__pycache_/*
@miraculixx
miraculixx / docker-compose.yml
Last active July 29, 2021 17:51
a threaded mqtt client using the gmqtt python library
version: '3'
services:
rabbitmq:
image: rabbitmq:latest
ports:
# 5672 amqp
# 15672 mgmt ui
# 1883 mqtt
- "5672:5672"
- "15672:15672"
@miraculixx
miraculixx / .bash_k8s.rc
Last active August 12, 2023 07:34
useful kubectl shortcuts
# put in $HOME/.bash_k8s.rc
# . $HOME/bash_k8s.rc
# podlog <any pod name substring>
function podlog() {
pod=`kubectl get pods --all-namespaces | grep " $1" | tr -s ' ' | cut -d ' ' -f 2 | head -n1`
ns=`kubectl get pods --all-namespaces | grep " $1" | tr -s ' ' | cut -d ' ' -f 1 | head -n1`
shift 1
kubectl logs --namespace $ns $pod $*
}
@miraculixx
miraculixx / how-to-install-latest-gcc-on-linux-mint.txt
Created May 27, 2019 21:10 — forked from youmych/how-to-install-latest-gcc-on-linux-mint.txt
How to install latest gcc on Linux Mint 18 (18.3)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 and https://askubuntu.com/questions/26498/choose-gcc-and-g-version
To install gcc-7 (gcc-7.2.0), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@miraculixx
miraculixx / gitdeploy
Created March 8, 2019 16:01
gitdeploy
#!/usr/bin/env bash
# adopted from https://raw.githubusercontent.com/X1011/git-directory-deploy/master/deploy.sh
#
# changes
# * deploy from current directory is possible
# * set options from either .deploy file or parameters
set -o errexit #abort if any command fails
PREFIX=.
CONFIG=.deploy