Skip to content

Instantly share code, notes, and snippets.

@lubosz
lubosz / weather.sh
Created April 14, 2015 19:11
display a weather gif in terminal
#!/bin/sh
DOWNLOAD_DIR=~/Downloads/weather
REGION=txgulf
# make download dir if not available
if [ ! -d "$DOWNLOAD_DIR" ]; then
mkdir -p $DOWNLOAD_DIR
fi
@lubosz
lubosz / emulationstation-loop.sh
Last active September 21, 2021 01:02
RetroPie installation script of custom EmulationStation branch.
#!/usr/bin/env bash
rp_module_id="emulationstation-loop"
rp_module_desc="EmulationStation with main menu loop patch"
rp_module_licence="MIT https://raw.githubusercontent.com/RetroPie/EmulationStation/master/LICENSE.md"
rp_module_section="exp"
rp_module_flags="frontend"
function _update_hook_emulationstation-loop() {
_update_hook_emulationstation
@lubosz
lubosz / gtksink-cairo.py
Created December 2, 2015 16:50
Python Interactive Cairo in GtkGLSink.
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
import math
import cairo
from gi.repository import Gtk, Gst, Gdk
from IPython import embed
@lubosz
lubosz / org.eclipse.smarthome.core.thing.Thing.json
Created January 12, 2019 11:59
IKEA of Sweden TRADFRI remote control in 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": [
"zigbee",
"coordinator_telegesis",
"000002D1"
]
@lubosz
lubosz / tradfri_discovery.log
Created January 12, 2019 11:57
Ikea Tradfri discovery and adding in OpenHAB 2 PaperUI with com.zsmartsystems.zigbee and org.openhab.binding.zigbee set to debug.
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
$ 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
lubosz / make.log
Created May 13, 2014 11:21
python 3 build error on mingw (windows)
$ make
x86_64-w64-mingw32-gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wall -g -O2 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -Wall -g -O2 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
In file included from Include/Python.h:50:0,
from ./Modules/python.c:3:
Include/pyport.h:223:5: error: #error "Python doesn't support sizeof(pid_t) > sizeof(long)"
Include/pyport.h:258:9: error: #error "This platform's pyconfig.h needs to define PY_FORMAT_SIZE_T"
make: *** [Modules/python.o] Error 1
[ptv] bmonkey@bcarbon:~/pitivi-git/gst-ffmpeg (master)$ make
make all-recursive
make[1]: Entering directory '/home/bmonkey/pitivi-git/gst-ffmpeg'
Making all in gst-libs
make[2]: Entering directory '/home/bmonkey/pitivi-git/gst-ffmpeg/gst-libs'
Making all in ext
make[3]: Entering directory '/home/bmonkey/pitivi-git/gst-ffmpeg/gst-libs/ext'
make[4]: Entering directory '/home/bmonkey/pitivi-git/gst-ffmpeg/gst-libs/ext'
cd libav && make
make[5]: Entering directory '/home/bmonkey/pitivi-git/gst-ffmpeg/gst-libs/ext/libav'
@lubosz
lubosz / validate_precision.py
Created May 17, 2018 00:11
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 = {}
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