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 / pytry
Created November 19, 2024 07:26
try a python package in its own venv
#!/bin/bash
function setup() {
python -m venv .pytry
source .pytry/bin/activate
pip install $packages
}
function tryimport() {
toimport=$1
@miraculixx
miraculixx / LICENSE
Last active November 7, 2024 23:45
ML drift statistics calculator and plots
Copyright (c) 2024 miraculixx
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT
@miraculixx
miraculixx / LICENSE
Last active June 8, 2024 15:10
mount multiple longhorn replicas from a single command
MIT NON-AI License
Copyright (c) 2024, miraculixx
Permission is hereby granted, free of charge, to any person obtaining a copy of the software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@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()