Skip to content

Instantly share code, notes, and snippets.

View s-kostyuk's full-sized avatar

Serhii Kostiuk s-kostyuk

View GitHub Profile
@s-kostyuk
s-kostyuk / qemu_trace_hda_to_shell.py
Last active May 31, 2020 18:51
Python3 script to convert all hda commands from qemu trace to the shell script
#!/usr/bin/env python3
"""
Copyright 2020 Serhii Kostiuk
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 T
@s-kostyuk
s-kostyuk / qemu_trace_hda_annotate.py
Last active May 31, 2020 18:52
This script annotates known hda verbs in the input file and writes the result to the output file
#!/usr/bin/env python3
"""
Copyright 2020 Serhii Kostiuk
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 T
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.10.0(devinput) on Mon Oct 15 16:45:49 2018
# Command line used: irrecord
# Kernel version (uname -r): 4.4.154
@s-kostyuk
s-kostyuk / python_property_inheritance.py
Created March 6, 2018 21:34
An example of some crazy inheritance from a build-in property class of Python
def some_decorator(to_decorate):
prop_name = to_decorate.__name__
def _internal(self, new_value):
old_value = getattr(self, prop_name)
print("Property setter called:", self, prop_name, old_value, new_value)
return to_decorate(self, new_value)
return _internal
@s-kostyuk
s-kostyuk / nrf24_demo_at89s52.c
Last active February 17, 2018 14:06
Demonstration of transreceiving with nRF24L01+ modules, AT89S52 and Arduino UNO. More info & video: https://www.youtube.com/watch?v=Uc9rZH_F2NI
/*********************************************************************
** Device: nRF24L01 **
** File: 89LV51.c **
** **
** Created by ElecFreaks Robi.W /10 June 2011 **
** **
** Description: **
** This file is a sample code for your reference. **
** **
** **
import unittest
from functools import singledispatch
class TestClass1(object):
@property
def test_prop(self):
return "tc1"
@s-kostyuk
s-kostyuk / activehdl.gitignore
Created May 27, 2017 18:53
Aldec ActiveHDL .gitignore file
# Aldec ActiveHDL .gitignore
# Sergey Kostyuk, 2017, Public Domain
*.asdb/
log/
Edfmap.ini
*.wsp
*.wsf
*.log
*.erf
// ca_sem6_lab3.cpp: определяет точку входа для консольного приложения.
//
#include <stdio.h>
#include <stdint.h>
bool check_is_32() {
bool is_32;
_asm {
@s-kostyuk
s-kostyuk / mpd_cursong_full.json
Last active February 23, 2017 19:58
mpd currentsong examples
{
"album": "Live at the IBJ Kill The Holidays Party, 1/9/2017",
"albumartist": "Holmes",
"artist": "Holmes",
"date": "2017-02-23T14:18:34",
"file": "Holmes_-_01_-_Luxury_Sedan.mp3",
"genre": "Garage",
"id": "4",
"last-modified": "2017-02-23T19:50:15Z",
"pos": "3",
# Maintainer: Radek Podgorny <radek@podgorny.cz>
pkgname=python-spidev
pkgver=3.2
pkgrel=1
pkgdesc="Python bindings for Linux SPI access through spidev"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="https://github.com/doceme/py-spidev"
license=('GPL')
depends=('python')