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 / util.py
Created April 5, 2024 10:27
drop-in replacmement for time.sleep (python)
def wait(s, delay=1):
"""
drop-in for time.sleep() with status updates and Ctrl-C support
Usage:
for delay in wait(seconds):
print(f'waiting for {delay} seconds')
"""
import time
@miraculixx
miraculixx / LICENSE.md
Last active February 27, 2024 22:50
Python Plotting Interaktive Beispiel

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

Thinkfan Configuration for Lenovo X-Series

Why?

X-Series seems to have an issue with the fan control on suspend. In particular when thinkfan is active during suspending, the fan will continue to run indefinitely, even in suspended state.

@miraculixx
miraculixx / example.py
Created January 11, 2024 13:45
trace manipulations to os.environ in python
# to investigate which code is manipulating os.environ
class trace(dict):
def __delitem__(self, k):
self._trace(k)
super().__delitem__(k)
def _trace(self, k):
import inspect
curframe = inspect.currentframe()
calframe = inspect.getouterframes(curframe, 2)
@miraculixx
miraculixx / greplogs.sh
Created July 22, 2023 16:07
grep all docker logs
#!/bin/bash
# Get a list of running container IDs
container_ids=$(docker ps -q)
# Loop through each container and retrieve its logs
for container_id in $container_ids; do
container_name=$(docker inspect -f '{{ .Name }}' "$container_id" | cut -d'/' -f2)
echo "Container: $container_name"
docker logs "$container_id" 2>&1 | grep "$1" # Replace "SEARCH_PATTERN" with your desired pattern
@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