Skip to content

Instantly share code, notes, and snippets.

View Shulyaka's full-sized avatar

Denis Shulyaka Shulyaka

  • Hellas Planitia, Hellas quadrangle, Iapygia
View GitHub Profile
@protrolium
protrolium / ffmpeg.md
Last active July 12, 2024 17:37
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@harperreed
harperreed / emfitqs-local-api.md
Created February 17, 2018 20:08
EMFIT QS Sleep tracker location API

EMFIT Local API

There is a functional http server running on the device that can be crawled for realtime data. It runs on port 80 and uses plain http.

You will need to know the IP address if your emfit device.

shortdvm.htm

For demoing / testing with a web browser there is an auto-refreshing page that contains only HR and RR values, it’s name is shortdvm.htm

@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active April 16, 2024 02:30
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@Shulyaka
Shulyaka / review.py
Created January 13, 2024 09:37
Interaction of two AI agents
#!/usr/bin/env python3
"""
This is an example of a team work of two OpenAI Assistants. They have been given a task to review a test of a new employee candidate. The 'Reviewer' (aka Junior hiring manager) is given the instructions to review the test, and the 'Supervisor' (aka Senior hiring manager) is given the instructions to guide the Reviewer throug the process, to ask him to review section by section, and to check his work. User and Reviewer only talk to Supervisor and not to each other.
As of Jan 2024, it is not perfect and the AI Agents do make mistakes and still require human intervention to complete the task correctly. Howewer this approach significantly reduces the number of interventions required and provides better results because of self-check. The downside is the number of tokens required is several times greater than with a single agent approach.
The instructions are very custom and thus not included. But here is an example:
```supervisor_instructions.md
You are a senior hiring manager of a te