Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

turboss TurBoss

  • Spain
  • 06:59 (UTC +02:00)
View GitHub Profile
@TurBoss
TurBoss / README.rst
Created September 16, 2017 13:05 — forked from tonyseek/README.rst
Build Python binding of C++ library with cffi (PyPy/Py3K compatible)

Run with Python:

pip-2.7 install cffi
PYTHON=python2.7 sh go.sh

Run with PyPy:

pip-pypy install cffi
PYTHON=pypy sh go.sh
@TurBoss
TurBoss / linuxcnc-sherline.cps
Created October 8, 2017 10:27 — forked from robanonymous/linuxcnc-sherline.cps
This a custom post processor for Autodesk Fusion 360 that has more options for the Sherline mill (I'm using 5400). To add this file on Mac: Right click on Fusion360 App in Applications, Select Show Package Contents - Navigate to Contents -> Libraries -> Applications -> CAM360 -> Data -> Posts, Grab and Drop File (Authenticate)
/**
Copyright (C) 2012-2015 by Autodesk, Inc.
All rights reserved.
LinuxCNC (EMC2) Sherline post processor configuration.
$Revision: 00001 04fc0f7ff12e03d457d27cfcf3265dfc183241e5 $
$Date: 2016-10-08 13:46:56 $
FORKID {240C366F-30B2-4629-945B-8647E01614FC}
@TurBoss
TurBoss / ffmpeg4matelight.sh
Created January 11, 2018 14:12 — forked from MichaelKreil/ffmpeg4matelight.sh
using ffmpeg to stream videos, gifs, the webcam or the screen to matelight
# Stream a video
ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Loop a gif
ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Stream webcam
# Mac
ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
@TurBoss
TurBoss / gasyncspawn.py
Created April 9, 2018 23:03 — forked from fabrixxm/gasyncspawn.py
Run external process asynchronously with Python, GLib. Get stdout and stderr via signals.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#https://developer.gnome.org/pygobject/2.28/
#http://www.pygtk.org/articles/subclassing-gobject/sub-classing-gobject-in-python.htm#d0e570
from gi.repository import GObject
from gi.repository import GLib
class GAsyncSpawn(GObject.GObject):
@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:

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 / 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:
@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 / 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 / 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})