Skip to content

Instantly share code, notes, and snippets.

View KurtJacobson's full-sized avatar

Kurt Jacobson KurtJacobson

View GitHub Profile
@KurtJacobson
KurtJacobson / transparent_window.py
Last active July 28, 2021 08:25
Transparent Window in Gtk+ 3, python
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import cairo
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@KurtJacobson
KurtJacobson / hidepyc.py
Last active May 7, 2021 10:26
Simple python script to write .hidden files to hide all the annoying .pyc files in a project directory
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import os
import sys
import mimetypes
try:
@KurtJacobson
KurtJacobson / pygraphviz_error.md
Last active June 25, 2020 00:46
pygraphviz installation error and resolution

Error when trying to install pygraphviz on Linux Mint 19.3.

Resolution

sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config
pip install pygraphviz

Error

pip install pygraphviz.

@KurtJacobson
KurtJacobson / speed-up-debian9-boot.md
Last active March 15, 2019 14:36
Fix Debian 9 (Stretch) "A start job is ruining for Raise network interfaces" hang at boot

This fixes A start job is ruining for Raise network interfaces hang

sudo nano /etc/network/interfaces.d/setup

change:

auto lo
iface lo inet loopback

auto eth0
@KurtJacobson
KurtJacobson / app.py
Created September 30, 2017 15:25
SO Colored Logging Formatter Example files
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import logging
from colored_log import ColoredFormatter
# Create top level logger
log = logging.getLogger("main")
@KurtJacobson
KurtJacobson / pokeys.comp
Created December 14, 2018 16:16
LinuxCNC HAL pokeys.comp, edited per Andy P to support scaled anolog outputs
component pokeys "PoKeys IO driver, by Mit Zot";
option userspace yes;
pin out bit in-# [55];
pin out float ain-# [3];
pin out bit err;
pin in float analog-scale-# [3];
pin in unsigned devSerial;
@KurtJacobson
KurtJacobson / lcnc_rip.sh
Last active October 1, 2018 19:11
Script to clone, checkout and build a LinuxCNC branch RIP
#!/bin/bash
# default options
BRANCH="master"
DIRECTORY="$PWD/linuxcnc-dev"
# constants
BOLD=`tput bold`
RED=`tput setaf 1`
GREEN=`tput setaf 2`
@KurtJacobson
KurtJacobson / building 4.16.8 RT kernel.md
Last active May 25, 2018 16:27
Building 4.16.8 kernel with RT patch on Stretch
@KurtJacobson
KurtJacobson / index.html
Created January 22, 2018 20:36
WebSocket server extension for WeeWx for real time weather data without having to refresh web page.
<!DOCTYPE html>
<html>
<head>
<title>WebSocket</title>
</head>
<body>
<h2>WeeWx WebSocket Example</h2>
<p>Example of real time weather data display using WebSockets. The data is
updated on each LOOP packet.
</p>
@KurtJacobson
KurtJacobson / module_watcher.py
Created October 17, 2017 22:46 — forked from eberle1080/module_watcher.py
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <eberle1080@gmail.com>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""