Skip to content

Instantly share code, notes, and snippets.

View KurtJacobson's full-sized avatar

Kurt Jacobson KurtJacobson

View GitHub Profile
@KurtJacobson
KurtJacobson / building_lcnc.md
Last active April 19, 2024 01:29
Building LinuxCNC RIP from source

Building LinuxCNC RIP

Clone the source:
git@github.com:LinuxCNC/linuxcnc.git linuxcnc-dev

Configure:
$ cd linuxcnc-dev
$ cd debian
$ ./configure sim

@KurtJacobson
KurtJacobson / touchscreen_calibration.md
Last active February 27, 2024 22:06
Touchscreen calibration procedue for Debian9 (stretch)

Touchscreen Calibration in Debian9

Unfortunately [xinput-calibrator][1] does not work at all for calibrating a touchscreen in Debian9. This is apparently because X server now uses libinput to handle input devices instead of evdev. I spent huge amount of trying to fiddling with xinput-calibrator and 99-calibration.conf files until I finely found this [issue][2] on GitHub that gave me some hints as how to proceed. This is mostly for my own reference, but I hope it might also help others in the same situation.

@KurtJacobson
KurtJacobson / building_pyqt5.md
Last active October 19, 2023 00:33
Building PyQt5 to support Python2 based QtDesigner Plugins

Building PyQt5 to support Python2 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

@KurtJacobson
KurtJacobson / drag.c
Last active March 24, 2023 21:37
Re-positioning Gtk widget with a mouse drag in C and Python
#include <gtk/gtk.h>
// Source:
// http://www.linuxforums.org/forum/programming-scripting/117713-gtk-moving-widget-mouse-post906490.html#post906490
// higher values make movement more performant
// lower values make movement smoother
const gint Sensitivity = 1;
const gint EvMask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON1_MOTION_MASK;
@KurtJacobson
KurtJacobson / bp_logo.svg
Last active March 9, 2023 02:25
Bridgeport Mill Logo SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KurtJacobson
KurtJacobson / header_bar.py
Last active August 22, 2022 10:25
Custom GTK+ HeaderBar with fullscreen toggle button
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@KurtJacobson
KurtJacobson / QtVCP_Plugins.md
Last active August 17, 2022 06:09
Installing Qt VCP Qt Designer Plugins

Installing Qt VCP Qt Designer Plugins

Fist, you need to be using Python 2.7 and PyQt4

To install PyQt4 I ran

$ sudo apt-get install python-qt4-dev

Open a root file browser and navigate to (replace x86_64 with your machine's architecture)

@KurtJacobson
KurtJacobson / sys_notify.py
Created July 29, 2018 05:41
Qt DBus sys notify module for Linux systems
#!/usr/bin/env python
# Copyright (c) 2018 Kurt Jacobson
# <kurtcjacobson@gmail.com>
#
# This program 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
# (at your option) any later version.
#
@KurtJacobson
KurtJacobson / stp.reg
Created June 29, 2022 12:42
Open STP file in active Inventor instance
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.stp]
@="stp_auto_file"
[HKEY_CLASSES_ROOT\stp_auto_file]
@=""
[HKEY_CLASSES_ROOT\stp_auto_file\shell]
@KurtJacobson
KurtJacobson / setschreenres.sh
Created May 31, 2022 17:18
Set Screen resolution 1920x1080 VirtualBox
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080