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 / warp.sh
Last active June 24, 2023 21:49
CloudFlare WARP toggle and desktop notification
#!/bin/bash
# cloudflare warp
# https://developers.cloudflare.com/warp-client/get-started/linux/
# see https://1.1.1.1/
# Panel Icon: /bin/bash -ic ".$HOME/.bashrc.ext;warp toggle"
warp() {
case $1 in
on)
warp-cli connect
;;
@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 / barrier-suspend.sh
Last active September 26, 2023 14:29
fix barrier issue on suspend/resume on linux mint
#!/bin/bash
# run this from /usr/lib/systemd/system-sleep/pre-suspend.sh
# adopted from https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/
USER=$(ls /home | grep -v root | tail -n1)
if [ "${1}" == "pre" ]; then
killall barrier barrierc
elif [ "${1}" == "post" ]; then
# need to run in background to ensure other post resume processing happens first
sudo su - $USER -c "nohup bash -c 'sleep 10; env DISPLAY=:0 /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=barrier com.github.debauchee.barrier' &"
fi
""" 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'
@miraculixx
miraculixx / tasks.py
Last active July 1, 2021 15:43
helm update-values helper
# Details on usage see docstring
#
# Installation:
#
# $ pip install invoke
# $ (copy/paste this file to your local tasks.py)
#
# Usage:
#
# 1. amend your values.yaml with a #==tags.myfeature (at line end of line to update)
@miraculixx
miraculixx / README.md
Last active June 19, 2021 14:57
Algorithmic trading references
@miraculixx
miraculixx / README.txt
Last active April 2, 2021 18:37
coin toss sequence, probability experiment in response to @nntaleb https://twitter.com/nntaleb/status/1377576808590282761
Question by @nntaleb
Throw a coin, H=head, T= Tail. Which sequence one is more likely?
A={H,T,H,T,H,T,H,T,H,T,T,H,T,H,H,T,T,T,H,H}
B={H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H}
C={H,H,H,H,H,H,H,H,H,H,T,T,T,T,T,T,T,T,T,T}
@miraculixx
miraculixx / example.py
Created December 10, 2020 11:48
omegaml async task chaining
# this will chain the fit and predict, i.e. fit will run only on predict success
with om.runtime.chain() as crt:
crt.model('regmodelx').fit('sample[y]', 'sample[x]')
crt.model('regmodelx').predict([5], rName='foox')
result = crt.run()
# sometime later
print(result.get())