Skip to content

Instantly share code, notes, and snippets.

View JarbasAl's full-sized avatar
🏠
Working from home

JarbasAI JarbasAl

🏠
Working from home
View GitHub Profile
@JarbasAl
JarbasAl / ha_sensors.py
Last active August 3, 2023 12:52
rest_system_monitor.py
import json
from threading import Lock
import requests
import time
from zeroconf import ServiceBrowser, ServiceStateChange
from zeroconf import Zeroconf
IDENTIFIER = "restsysadmin"
HA_URL = "http://192.168.1.8:8123"
@JarbasAl
JarbasAl / parallel.py
Created July 10, 2023 18:12
example for doing heavy work in parallel via concurrent.futures
import concurrent.futures
import random
import time
class ParallelWorkers:
workers = 12
def do_work(self, arg_list, match_func):
import random
from functools import wraps
import requests
from ovos_solver_openai_persona.engines import OpenAIChatCompletionsSolver
def rewrite(prompt: str):
def layer_handler(func):
@JarbasAl
JarbasAl / llama_intents.py
Created October 6, 2023 20:51
a intent parser using llama.cpp and mistral-7b
import json
from typing import List
from llama_cpp import ChatCompletionMessage, Llama, LlamaGrammar
TRAINING_INTENTS = [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
@JarbasAl
JarbasAl / occupancy.md
Last active October 29, 2023 23:43
occupancy.md

House Tree View

     WC da Dii
       |
 Escritorio da Dii
       |
    Marquise
       |
    Cozinha 
@JarbasAl
JarbasAl / cam_send.py
Last active November 2, 2023 10:43
zmq2mjpeg
from time import sleep
import imagezmq
import zmq # needed because we will be using zmq socket options & exceptions
from imutils.video import VideoStream
time_between_restarts = 5 # number of seconds to sleep between sender restarts
def sender_start(connect_to=None):
@JarbasAl
JarbasAl / cam_detect.py
Last active November 2, 2023 21:39
obj detect ssd mobilenet
# adapted from https://github.com/kaka-lin/object-detection
# MIT License
import colorsys
import random
import time
import cv2
import numpy as np
import tensorflow as tf
@JarbasAl
JarbasAl / docs_view.py
Created November 12, 2023 03:21
terminal documentation viewer for ovos
import os
import os.path
import shutil
import zipfile
from pathlib import Path
from typing import Iterable
import click
import requests
from textual.app import App, ComposeResult
@JarbasAl
JarbasAl / output.txt
Created December 6, 2023 22:08
finding media streams in wikidata
# AUDIOBOOK
The Giver http://commons.wikimedia.org/wiki/Special:FilePath/The%20Giver.ogg
The Legend of Sleepy Hollow http://commons.wikimedia.org/wiki/Special:FilePath/LibriVox%20-%20Sleepy%20Hollow%20-%20Washington%20Irving.ogg
['The Wizard of Oz', 'The Wonderful Wizard of Oz'] http://commons.wikimedia.org/wiki/Special:FilePath/En%20the%20wonderful%20wizard%20of%20oz.ogg
Ozymandias http://commons.wikimedia.org/wiki/Special:FilePath/Percy%20Shellys%20Ozymandias.ogg
竹取物語 http://commons.wikimedia.org/wiki/Special:FilePath/Japanesefairytales%2009%20ozaki%2064kb.ogg
The Nameless City http://commons.wikimedia.org/wiki/Special:FilePath/LibriVox%20-%20nameless%20city%20lovecraft%20sc.ogg
Dagon http://commons.wikimedia.org/wiki/Special:FilePath/Dagon%20lovecraft%20mras.ogg
Polaris http://commons.wikimedia.org/wiki/Special:FilePath/LibriVox%20-%20polaris%20lovecraft%20jp.ogg
An Occurrence at Owl Creek Bridge http://commons.wikimedia.org/wiki/Special:FilePath/Owlcreekbridge%20bierce%20ab.ogg