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 / virtualpet.py
Last active June 19, 2021 11:35
virtual pet
import random
from time import sleep
from threading import Thread
from datetime import datetime
class VirtualPet(Thread):
def __init__(self, name="VirtualPet", speed=1.0, lifespan=1):
"""
@JarbasAl
JarbasAl / information_extraction.py
Last active April 15, 2020 18:46
lilacs snippets
from lilacs.reasoning.extraction import LILACSextractor
LILACS = LILACSextractor()
test_text = """London is the capital and most populous city of England and the United Kingdom.
Standing on the River Thames in the south east of the island of Great Britain, London has been a major settlement for 2 millennia.
It was founded by the Romans, who named it Londinium.
London's ancient core, the City of London, which covers an area of only 1.12 square miles (2.9 km2), largely retains its medieval boundaries.
Since at least the 19th century, "London" has also referred to the metropolis around this core, historically split between Middlesex, Essex, Surrey, Kent and Hertfordshire, which today largely makes up Greater London, a region governed by the Mayor of London and the London Assembly."""
@JarbasAl
JarbasAl / bandwidth_monitor.py
Last active April 8, 2020 01:57
check which process is connecting to where
import time
import glob
import re
import os
import curses
import socket
refresh = 5
@JarbasAl
JarbasAl / bluetooth_raspi.md
Last active March 7, 2020 06:40
raspberry pi bluetooth speaker setup

install

alsa

sudo apt install bluealsa
@JarbasAl
JarbasAl / readme.md
Last active October 1, 2019 05:04
intent assistanr - sketch
@JarbasAl
JarbasAl / local_listener.py
Created June 5, 2019 02:34
use kaldi for keyword detection
#!/usr/bin/env python
# -*- coding: utf-8 -*-
DEFAULT_VOLUME = 150
DEFAULT_AGGRESSIVENESS = 2
DEFAULT_MODEL_DIR = '/opt/kaldi/model/kaldi-generic-en-tdnn_250'
DEFAULT_ACOUSTIC_SCALE = 1.0
DEFAULT_BEAM = 7.0
DEFAULT_FRAME_SUBSAMPLING_FACTOR = 3
#!/usr/bin/env python
import pyaudio
import socket
class AudioStreamer(object):
def __init__(self, host='0.0.0.0', port=50000, backlog=5, chunk=1024,
channels=1, rate=16000, pa=None):
self.rate = rate
self.channels = channels
@JarbasAl
JarbasAl / mic_feed.py
Created December 14, 2018 19:17
tap detector
import pyaudio
import numpy as np
from collections import namedtuple
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
Chunk = namedtuple('Chunk', 'data time')
@JarbasAl
JarbasAl / configure-driver.sh
Created December 8, 2018 16:25
Aiy_asound.conf
#!/bin/bash
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#