Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

TurBoss TurBoss

  • Spain
View GitHub Profile
@TurBoss
TurBoss / building_pyqt5.md
Last active September 26, 2021 11:56 — forked from KurtJacobson/building_pyqt5.md
Building PyQt5 to support Python2 based QtDesigner Plugins

Building PyQt5 to support Python3 based QtDesigner Plugins

As far as I can tell, the reason Qt5 Designer does not load custom PyQt5 widgets is due to the 'stock' shared library libpyqt5.so (which comes with PyQt5) not being built for the correct combination of the Python and Qt versions. It seems the only way to get around this is to build PyQt5 from source so we will have a libpyqt5.so that is correct and will be able to load the custom widgets.

Install Python dev tools

#!/usr/bin/python2.7
"""Quick hack of 'modern' OpenGL example using pysdl2 and pyopengl
Based on
pysdl2 OpenGL example
http://www.arcsynthesis.org/gltut/Basics/Tut02%20Vertex%20Attributes.html
http://schi.iteye.com/blog/1969710
"""
import sys
@TurBoss
TurBoss / notify.py
Created July 8, 2019 23:07
python qt notifications
#!/usr/bin/env python
# Copyright (c) 2018 Kurt Jacobson
# <kurtcjacobson@gmail.com>
#
# This file is part of QtPyVCP.
#
# QtPyVCP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
@TurBoss
TurBoss / CMakeLists.txt
Created May 12, 2019 15:29 — forked from nocnokneo/CMakeLists.txt
VTK Rendered to an FBO in a Qt Quick 2 Scene Graph
cmake_minimum_required(VERSION 2.8.11)
project(VtkFboInQtQuick)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
@TurBoss
TurBoss / CMakeLists.txt
Created April 27, 2019 06:02 — forked from joinAero/CMakeLists.txt
Use Kinect with OpenCV (C++)
cmake_minimum_required(VERSION 2.8)
project(OCVSamples)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(OpenCV 3.0 QUIET)
if(OpenCV_FOUND)
add_definitions(-DUSE_OPENCV3)
else()
message(FATAL_ERROR "OpenCV > 3.0 not found.")
@TurBoss
TurBoss / camera.py
Created April 27, 2019 06:02 — forked from joinAero/camera.py
Use Kinect with OpenCV (Python)
import cv2
import sys
class Camera(object):
def __init__(self, index=0):
self.cap = cv2.VideoCapture(index)
self.openni = index in (cv2.CAP_OPENNI, cv2.CAP_OPENNI2)
self.fps = 0
@TurBoss
TurBoss / wstest.py
Created September 29, 2018 01:27 — forked from forslund/wstest.py
Connecting to the mycroft message bus.
#! /usr/bin/env python
import sys
from websocket import create_connection
uri = 'ws://' + sys.argv[1] + ':8181/core'
ws = create_connection(uri)
print "Sending " + sys.argv[2] + " to " + uri + "..."
if len(sys.argv) >= 4:
data = sys.argv[3]
else:

Install RTAI 5.0-test2 on Ubuntu 14.04 Kernel 3.18.20

Preparation

download and unzip

cd /usr/src
curl -L --insecure https://www.rtai.org/userfiles/downloads/RTAI/rtai-5.0-test2.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.20-vivid/linux-image-3.18.20-031820-generic_3.18.20-031820.201508081633_amd64.deb -o linux-image-3.18.20-generic-amd64.deb
@TurBoss
TurBoss / howto
Created April 25, 2018 01:54
D2GS under Wine
I'am using Ubuntu 16.04.3 LTS (64-bit Server) with a user, having sudo permissions. The specifications of the server are: AMD Phenom II X4 965 3.4 GHz (Black Edition), 128 GB SSD, 16 GB DDR3
/*
* PvPGN
*/
1. Install the needed software
sudo apt-get install -y build-essential git cmake zlib1g-dev mysql-server mysql-client libmysqlclient-dev
2. Download and install PvPGN
cd ~
@TurBoss
TurBoss / async.py
Created April 10, 2018 01:07 — forked from diosmosis/async.py
Asynchronous function calling with python and GTK.
import threading
from gi.repository import GObject
# calls f on another thread
def async_call(f, on_done):
"""
Starts a new thread that calls f and schedules on_done to be run (on the main
thread) when GTK is not busy.
Args: