Skip to content

Instantly share code, notes, and snippets.

💭
working on https://github.com/omegaml

miraculixx

💭
working on https://github.com/omegaml
  • Switzerland
View GitHub Profile
@miraculixx
miraculixx / README
Last active Jun 24, 2020
ffmpeg green screen chromakey virtual background for linux
View README
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 Jun 21, 2020
an extensible multi-markup reader in less than 100 lines of python code
View markup.py
# (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 Jun 10, 2020
rancher nividia docker 19.03
View nvidia-docker.sh
#!/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
View index.html
<html>
<head>
<style>
#canvas {
border-color: black;
border-style: solid;
width: 128px;
height: 128px;
}
#resized {
@miraculixx
miraculixx / README
Last active Feb 22, 2020
Celery worker blocks on rate limited task
View README
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 Mar 3, 2020
Makefile for multi-file gists using https://github.com/defunkt/gist
View .gistignore
# no blank lines!
.gist
.gistignore
.git/*
.idea/*
__pycache_/*
@miraculixx
miraculixx / docker-compose.yml
Last active Feb 9, 2020
a threaded mqtt client using the gmqtt python library
View docker-compose.yml
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 Apr 30, 2020
useful kubectl shortcuts
View .bash_k8s.rc
# 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 $*
}
View how-to-install-latest-gcc-on-linux-mint.txt
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 && \
View 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
You can’t perform that action at this time.