Skip to content

Instantly share code, notes, and snippets.


Lubosz Sarnecki lubosz

View GitHub Profile
lubosz / org.eclipse.smarthome.core.thing.Thing.json
Created Jan 12, 2019
IKEA of Sweden TRADFRI remote control in org.eclipse.smarthome.core.thing.Thing.json
View org.eclipse.smarthome.core.thing.Thing.json
"zigbee:device:000002D1:000b57fffe4aebd4": {
"class": "org.eclipse.smarthome.core.thing.internal.ThingImpl",
"value": {
"label": "IKEA of Sweden TRADFRI remote control",
"bridgeUID": {
"segments": [
lubosz / tradfri_discovery.log
Created Jan 12, 2019
Ikea Tradfri discovery and adding in OpenHAB 2 PaperUI with com.zsmartsystems.zigbee and org.openhab.binding.zigbee set to debug.
View tradfri_discovery.log
2019-01-12 12:43:29.970 [DEBUG] [gesis.internal.TelegesisFrameHandler] - RX Telegesis Data:+N=COO,11,08,E48C,60DB07B95A834630
2019-01-12 12:43:29.971 [DEBUG] [gesis.internal.TelegesisFrameHandler] - RX Telegesis Data:OK
2019-01-12 12:43:29.972 [DEBUG] [gesis.internal.TelegesisFrameHandler] - RX Telegesis: TelegesisDisplayNetworkInformationCommand [device=COO, channel=11, power=8, panId=58508, epanId=60DB07B95A834630, status=SUCCESS]
2019-01-12 12:43:30.974 [DEBUG] [gesis.internal.TelegesisFrameHandler] - TX Telegesis queue: 1
2019-01-12 12:43:30.975 [DEBUG] [gesis.internal.TelegesisFrameHandler] - TX Telegesis: TelegesisDisplayNetworkInformationCommand [device=null, channel=null, power=null, panId=null, epanId=null]
2019-01-12 12:43:30.977 [DEBUG] [gesis.internal.TelegesisFrameHandler] - TX Telegesis Data:AT+N?
2019-01-12 12:43:31.106 [DEBUG] [gesis.internal.TelegesisFrameHandler] - RX Telegesis Data:+N=COO,11,08,E48C,60DB07B95A834630
2019-01-12 12:43:31.107 [DEBUG] [gesis.internal.TelegesisFrameHandler] - R
View gist:c43e5426f5f778621c1553779bcee537
$ vktrace -v full -p bin/cube -w . -tr frames-0-10
vktrace info: Running vktrace as parent process will spawn child process: bin/cube
vktrace info: Listening for connections on port 34201.
[w] vikApplication:191 | Failed to initialize wayland-xdg, falling back to xcb.
[d] vikRenderer:451 | instance: Enabling supported VK_KHR_surface.
[d] vikRenderer:451 | instance: Enabling supported VK_KHR_get_physical_device_properties2.
[d] vikRenderer:451 | instance: Enabling supported VK_KHR_xcb_surface.
vktrace info: vktrace_lib library loaded into PID 28711
vktrace info: Client: Connected to port 34201 successfully.
vktrace info: Connected on port 34201.
lubosz /
Created May 17, 2018
Example that shows how torch saves more float precision than it prints by default
#!/usr/bin/env python3
import torch
from torch.autograd import Variable
import numpy as np
def load_embeddings(count):
word_embeddings = {}
lubosz /
Last active May 9, 2018
RetroPie installation script of custom EmulationStation branch.
#!/usr/bin/env bash
rp_module_desc="EmulationStation with main menu loop patch"
function _update_hook_emulationstation-loop() {
View gist:cfb30b383a4cab4f9a21e084c1c04aa6
13:45:27.0765 gbp-symbol-layout-stack-addin[ 9577]: WARNING: Failed to get symbol tree: Failed to create translation unit: AST read error
13:45:28.0265 gbp-symbol-layout-stack-addin[ 9577]: WARNING: Failed to find nearest scope: Failed to create translation unit: AST read error
13:45:38.0198 gbp-symbol-layout-stack-addin[ 9577]: WARNING: Failed to find nearest scope: Failed to create translation unit: AST read error
13:45:38.0825 gbp-symbol-layout-stack-addin[ 9577]: WARNING: Failed to find nearest scope: Failed to create translation unit: AST read error
lubosz / xiSample.cpp
Last active Mar 27, 2018
xime sync sample
View xiSample.cpp
// xiSample.cpp : program that captures 10 images and finish
#include "stdafx.h"
#ifdef WIN32
#include "xiApi.h" // Windows
#include <m3api/xiApi.h> // Linux, OSX
#include <unistd.h>
lubosz / formats.txt
Created Mar 16, 2018
vive pro video formats
View formats.txt
$ v4l2-ctl --list-formats-ext -d /dev/video0
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 612x460
Interval: Discrete 0.017s (60.000 fps)
lubosz /
Created Feb 9, 2018
A fast gtk python clock
#!/usr/bin/env python3
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
from datetime import datetime
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
lubosz /
Created Oct 27, 2017
How to decode MS Mixed Reality headset IR camera signal
#!/usr/bin/env python3
# v4l2-ctl --device /dev/video1 --stream-mmap --stream-to=frame.raw --stream-count=1
import numpy as np
import os
import cv2
fd = open('frame.raw', 'rb')
cols = int(1280)
You can’t perform that action at this time.