Skip to content

Instantly share code, notes, and snippets.

View planetceres's full-sized avatar

Matt Shaffer planetceres

View GitHub Profile
@planetceres
planetceres / RESET_USB_KERNEL_MODULE.md
Last active January 25, 2026 08:28
Restart/reset USB kernel module in Ubuntu 18.04 without rebooting
@planetceres
planetceres / install_pipenv.md
Created February 3, 2019 21:31
pipenv installation notes Ubuntu 18.04

Installation Notes for pipenv on Ubuntu 18.04

1. Add ~/.local/bin to PATH

pypa/pipenv#2122 (comment)

echo 'export PATH="${HOME}/.local/bin:$PATH"' >> ~/.bashrc
@planetceres
planetceres / rgb_from_prob.py
Created August 17, 2018 04:16
RGB values from probability value in range (0,1)
def rgb_from_prob(value, minimum=0, maximum=1):
'''
Based on: https://stackoverflow.com/a/20792531/3450793
'''
minimum, maximum = float(minimum), float(maximum)
ratio = 2 * (value-minimum) / (maximum - minimum)
g = int(max(0, 255*(1 - ratio)))
r = int(max(0, 255*(ratio - 1)))
b = 255 - g - r
@planetceres
planetceres / get_intrinsic_matrix.py
Created April 11, 2019 17:28
Realsense Intrinsic Matrix
import pyrealsense2 as rs
import numpy as np
'''
Intrincs and Exrinsic information available from command line with RealSense SDK
$ rs-enumerate-devices -c
'''
config = rs.config()
config.enable_stream(rs.stream.depth, 1280, 720, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 1920, 1080, rs.format.bgr8, 30)
@planetceres
planetceres / install_pcl_vtk.sh
Created April 5, 2020 21:09
Install PCL and VTK Ubunt 18.04
#!/usr/bin/env bash
# PCL
sudo apt install libpcl-dev
# VTK
# Ref: https://discourse.vtk.org/t/installing-vtk-in-ubuntu-18-04/2147/4
sudo apt install cmake \
@planetceres
planetceres / README.md
Last active September 2, 2021 15:15
Simple depth image viewer

Simple depth image viewer

pip3 install open3d

To run:

@planetceres
planetceres / TRACE_PYTORCH.md
Last active July 3, 2021 10:24
Show stack trace with warnings pytorch
@planetceres
planetceres / DEEPKIT.md
Last active July 8, 2020 16:46
Install Deepkit Linux

Install Deepkit

curl https://gist.githubusercontent.com/planetceres/454a110f2440304563179fec6488ecaa/raw/be076725bc1b61c2e422d781379fedaba6e4868a/install_deepkit.sh > install_deepkit.sh
sudo chmod +x ./install_deepkit.sh
bash install_deepkit.sh
@planetceres
planetceres / retry.sh
Created July 6, 2020 02:47 — forked from sj26/LICENSE.md
Bash retry function
# Retry a command up to a specific numer of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
# $ retry 5 false
# Retry 1/5 exited 1, retrying in 1 seconds...
# Retry 2/5 exited 1, retrying in 2 seconds...
# Retry 3/5 exited 1, retrying in 4 seconds...
@planetceres
planetceres / VOLUME.md
Last active June 22, 2020 21:45
Capture Volume controls from python

Capture Volume controls from python

pip install pynput

Key object:

Volume Down