Skip to content

Instantly share code, notes, and snippets.

View StefanD986's full-sized avatar

Stefan Droege StefanD986

View GitHub Profile
from unittest import TestCase
from tlv_debugging import TlvDebugging
class TestHeaderObj(TestCase):
def test_read(self):
tlv = TlvDebugging.from_bytes(bytearray([0x69, 0x01, 0x01, 0x5F, 0x00]))
assert tlv.file_hdr0[0].tag == 105
assert tlv.file_hdr0[0].length == 1
assert tlv.file_hdr0[0].body == False
pyuser@8654fc6feb0a:~$ python -vv -m homeassistant
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
@StefanD986
StefanD986 / BluetoothLowEnergy.py
Last active April 26, 2024 09:03
QBluetooth Discovery Methods in pyqt
import PyQt5
from PyQt5 import QtCore
from PyQt5 import QtBluetooth
class DeviceFinder(QtCore.QObject):
def __init__(self):
super().__init__()
self.m_devices = []
@StefanD986
StefanD986 / Makefile
Created February 20, 2017 11:25
Sphinx makefiles
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# Internal variables.
@StefanD986
StefanD986 / timeout_error.py
Created November 6, 2016 18:40
timeout error
---------------------------------------------------------------------------
VisaIOError Traceback (most recent call last)
<ipython-input-20-8ed5ed3eed95> in <module>()
----> 1 device1_tcp.query('*IDN?')
/usr/local/lib/python3.5/site-packages/pyvisa/resources/messagebased.py in query(self, message, delay)
405 if delay > 0.0:
406 time.sleep(delay)
--> 407 return self.read()
408
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY samples_from_file IS
GENERIC (
filename : string; -- Name of the input file
binary_mode : boolean := false -- set to 'true' if the file
-- contains the samples bit by
@StefanD986
StefanD986 / gist:998281adb44e73afb135
Created December 3, 2015 16:27
rtl_power crop bug
stefan@Minty ~/rtl-sdr-misc/heatmap $ rtl_power -f 100M:1700M:1M -c 0.3 -i 100 -g 50 data.csv
Number of frequency hops: 1600
Dongle bandwidth: 1000000Hz
Downsampling by: 0x
Cropping by: 0.00%
Total FFT bins: 1600
Logged FFT bins: 1600
FFT bin size: -nanHz
Buffer size: 16384 bytes (8.19ms)
Reporting every 100 seconds