Skip to content

Instantly share code, notes, and snippets.

@rgov
rgov / Dockerfile
Created September 13, 2022 21:06
Dockerfile starter for WINE + VNC that works with Apple Silicon
# The apt repositories for ARM and Intel/AMD are hosted on different servers
# (ports.ubuntu.com vs archive.ubuntu.com), which requires some finagling to get
# apt's sources correct so we can install i386 packages regardless of our native
# platform.
#
# There are no official i386 containers for Ubuntu 20.04 "Focal" and newer, so
# we assume that we can use the amd64
ARG UBUNTU_VERSION=22.04
FROM --platform=linux/amd64 ubuntu:${UBUNTU_VERSION} AS amd64-base
@rgov
rgov / save_rtsp.py
Created August 25, 2022 02:16
Save an RTSP stream as a ISO BMFF-compliant MPEG-4 file
#!/usr/bin/env python
import argparse
import os
import subprocess
import struct
parser = argparse.ArgumentParser()
parser.add_argument('--output', '-o', type=argparse.FileType('wb'))
parser.add_argument('rtsp_stream')
args = parser.parse_args()
@rgov
rgov / Dockerfile
Last active August 17, 2022 22:57
Unofficial Dockerfile for running Triton Inference Server on a Jetson device
# NOTE:
# There are also base images l4t-ml, l4t-pytorch, etc. that might be better to
# use.
FROM nvcr.io/nvidia/l4t-base:r32.7.1
# Update CA certificates so that we don't get TLS issues downloading from GitHub
RUN apt update \
&& apt install -y \
ca-certificates \
@rgov
rgov / ModelZoo-Status.md
Last active August 17, 2022 14:36
ONNX Model Zoo to TensorFlow Lite conversion status

Report generated at 2022-08-17T07:09:44Z.

Environment

Package Version
Platform macOS-12.5-arm64-arm-64bit
Python 3.10.6 (main, Aug 11 2022, 13:36:31) [Clang 13.1.6 (clang-1316.0.21.2.5)]
onnx 1.12.0
onnx-tf 1.10.0
tensorflow 2.9.0
@rgov
rgov / Dockerfile
Created August 5, 2022 14:38
Dockerfile starter for CentOS 6
FROM centos:6.10
# Switch to using the Vault repos. The upstream image refers to package mirrors
# that no longer exist for this old release of CentOS.
RUN sed -i \
-e '/^mirrorlist/d' \
-e 's|^#baseurl=.*$releasever/|baseurl=http://vault.centos.org/6.10/|' \
/etc/yum.repos.d/CentOS-Base.repo
# Update all base image packages
@rgov
rgov / trace.py
Created April 25, 2022 17:22
trace all the python things
#!/usr/bin/env python3
# why the heck are you crashing suddenly
import datetime
import functools
import threading
import traceback
import os
import signal
import sys
#!/usr/bin/env python3
'''
This is a so-far unsuccessful script for sniffing ROS service calls.
The idea was to republish them as regular messages so they could be recorded to a rosbag.
But I had trouble getting it to work...
'''
import argparse
import io
#!/usr/bin/env python3
import argparse
import csv
import datetime
import math
import rosbag
parser = argparse.ArgumentParser()
#!/usr/bin/env python3
import math
from scipy.integrate import quad
# Starting distance (in meters)
start = 2.0
# Target distance (in meters)
# As of Linux version 3.7, we must provide a device tree blob on boot so that
# the kernel understands our hardware configuration.
#
# However, the version of U-Boot currently in use predates the use of device
# trees, and provides no way of specifying the DTB to load. Therefore, there
# exists a configuration option CONFIG_ARM_APPENDED_DTB=y which instructs the
# kernel to find the DTB immediate following the kernel image itself.
#
# To produce a uImage file with the combined kernel + DTB, we just concatenate
# the two before running mkimage. (Note, the uImage file header includes a