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 / _jb_unittest_runner.py
Last active April 8, 2023 07:04
PyCharm Community Edition django test runner
# coding=utf-8
import os
import sys
from unittest import main
from _jb_runner_tools import jb_start_tests, jb_doc_args, JB_DISABLE_BUFFERING, PROJECT_DIR
from teamcity import unittestpy
if __name__ == '__main__':
path, targets, additional_args = jb_start_tests()

The AI Manifesto for Humanity

As AI technology continues to rapidly advance, it is crucial that we prioritize its development and use in a way that benefits humanity. The AI Manifesto for Humanity outlines 10 key rules to guide the development and deployment of AI in a way that prioritizes transparency, safety, fairness, privacy, collaboration, human control, ongoing research and development, ethical standards, education and awareness, and

@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 / .bashrc
Created July 12, 2014 21:31
add and remove pip install/uninstall from requirements.txt automatically
# add pip install/uninstall to requirements.txt automatically
pipr() {
if [ "$1" == "install" ]; then
pip $1 $2
pip freeze | grep -i $2 >> requirements.txt
echo ok, added $2 as:
tail -n1 requirements.txt
fi
if [ "$1" == "uninstall" ]; then
echo y | pip $1 $2 >> .pipremoved
@miraculixx
miraculixx / github-add-user
Last active January 10, 2022 13:11
batch adding users to github accounts
#!/bin/bash
# Collaborator list, add, remove from a repository
# (c) 2015 miraculixx
# Author: github.com/miraculixx
# MIT License, see below
function help {
echo "Add collaborators to one or more repositories on github"
echo ""
echo "Syntax: $0 -u user -p password [-l] [-D] -r repo1,repo2 <collaborator id>"
@miraculixx
miraculixx / asciidecodeerror.py
Last active November 22, 2021 15:57
Tired of Python's UnicodeDeocodeError, ascii codec can't decode? Here's how to fix it, once and for all.
# Python ascii codec can't decode and unicode mess
#
# check this out https://pythonhosted.org/kitchen/unicode-frustrations.html
# and this http://www.joelonsoftware.com/articles/Unicode.html
#
# The short of it is this
# 1. If you can, always set PYTHONIOENCODING=utf8 before you start your python programs.
# 2. If you can't or you can't ensure this, always use the following lambda _u to get unicode text
# whereever you convert to strings (str.format, str % etc.)
#
@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 / 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"
""" omega-ml bulk deployment utility
(c) 2020 one2seven GmbH, Switzerland
Enables deployment of datasets, models, scripts, jobs as well as cloud
resources from a single configuration file. This is currently a separate
utility that will be integrated into the omega-ml cli.
Installation:
$ pip install -U getgist omegaml==0.14.0
$ getgist omegaml omdeploy
@miraculixx
miraculixx / .bash.rcext
Last active July 27, 2021 09:14
useful linux utilities
function topnfiles {
# show top n files by size
# Usage: $ topnfiles <dir> <n>
# https://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/
du -hsx ${1:-.}/* | sort -rh | head -${2:-10}
}
# show home dir size, available space
alias hdf='df -h | grep home'