Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

turboss TurBoss

  • Spain
  • 07:49 (UTC +01:00)
View GitHub Profile
@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 / 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 / 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 / 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 / GStreamer-1.0 some strings.sh
Created September 11, 2017 19:09 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@TurBoss
TurBoss / self-signed-root-ca-and-certificates.sh
Created September 9, 2017 20:12 — forked from jaymecd/self-signed-root-ca-and-certificates.sh
Create Root CA and self-signed Certificate for local TLS testing.
#!/usr/bin/env bash
set -e
# Full Qualified Domain Name
FQDN="${1:-localhost.dev}"
FQDN="$(echo "${FQDN}" | tr 'A-Z' 'a-z')"
# Optional settings
COUNTRY="DE"
#!/usr/bin/env python
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class application_gui:
"""Tutorial 01 Create and destroy a window"""
@TurBoss
TurBoss / example.py
Created September 5, 2017 20:45
GLArea example
#!/usr/bin/env python
import os
import sys
from OpenGL.GLU import *
from OpenGL import GLX
from OpenGL import GL as GL
from ctypes import *
import gi
@TurBoss
TurBoss / spads-stable.service
Created July 23, 2017 09:57
Systemd unit for SPADS
[Unit]
Description=SPADS Jauria RTS stable
After=network.target
[Service]
Type=simple
User=spring
WorkingDirectory=/home/spring/spads-stable
ExecStart=/home/spring/spads-stable/spads.pl /home/spring/spads-stable/etc/spads.conf
@TurBoss
TurBoss / upq.py
Created July 23, 2017 09:55
Downloads SpringRTS to a specific directory
#!/usr/bin/env python3
import subprocess
from xmlrpc.client import ServerProxy
path = "/home/spring/SpringRTS"
pr_downloader = "/home/spring/bin/pr-downloader"
proxy = ServerProxy('http://api.springfiles.com/xmlrpc.php')
searchstring = {"category" : "engine_linux64", "limit": 1}