Skip to content

Instantly share code, notes, and snippets.

@schwartzie
schwartzie / reviewboard
Created November 6, 2013 23:02
Configuration to deploy ReviewBoard (http://www.reviewboard.org/) via Nginx, uWSGI, and supervisord on Debian Squeeze. Nginx with WSGI support installed using nginx-full package from Dotdeb (http://www.dotdeb.org/). uWSGI installed using pip ("pip install uwsgi") as described in http://uwsgi-docs.readthedocs.org/en/latest/Install.html#installing…
# nginx configuration stored in /etc/nginx/sites-available/reviewboard and symlinked in /etc/nginx/sites-enabled
upstream reviewboard_uwsgi {
server localhost:12001;
}
server {
listen 443 ssl;
server_name reviewboard.example.com;
location / {
@schwartzie
schwartzie / monitor_dymo_s100.py
Last active April 2, 2024 15:08
Monitor output from Dymo S100 USB-connected scale
#! /usr/bin/env python3
# notes:
# - origin: https://steventsnyder.com/reading-a-dymo-usb-scale-using-python/
# - device support: https://github.com/pyusb/pyusb#requirements-and-platform-support
# - device permissions: https://stackoverflow.com/a/73357412/455641
# - kernel driver busy: https://ubuntuforums.org/archive/index.php/t-2044904.html
import usb.core
@schwartzie
schwartzie / convert_font_folder.py
Created May 5, 2024 16:48
Walks a directory tree and converts any fonts found in MacOS resource forks to modern OTFs and TTFs. Preserves the original directory structure.
#! /usr/bin/env python3
import os
import sys
import logging
import subprocess
import io
import shutil
#####################################################