Skip to content

Instantly share code, notes, and snippets.


Sam Pfeiffer awesomebytes

View GitHub Profile
awesomebytes /
Last active Jun 6, 2022
message_filters ApproximateTimeSynchronizer over a rosbag (without roscore or /use_sim_time)
#!/usr/bin/env python
import itertools
import sys
import time
import rospy
import rosbag
import message_filters
Example using a message_filters filter (ApproximateTimeSynchronizer) iterating
awesomebytes /
Last active Nov 8, 2021
Nvidia CUDA driver not working after suspend or hibernation workaround

How to reset the GPU to use CUDA after suspend or hibernation

I needed to do:

sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

From the nvidia forums.

I also got the following error fixed (docker-nvidia related) with these commands:

# How to play audio from inside a docker container
# Run your docker image with
-v /run/user/$UID/pulse/native:/run/user/$UID/pulse/native \
-e PULSE_SERVER=unix:/run/user/$UID/pulse/native
And you can try to use `speaker-test`.
This was found here:


DATESTAMP=$(date +"%Y_%m_%d_%H_%M")
From 466e0f57b15e11ab19af900341f98a726ad1bf73 Mon Sep 17 00:00:00 2001
From: Sammy Pfeiffer <>
Date: Wed, 8 Sep 2021 16:06:44 +1000
Subject: [PATCH] Apply from
Davide Faconti to improve Voxelgrid runtime by 20% to 1.8.1 tag (backport)
filters/include/pcl/filters/impl/voxel_grid.hpp | 7 +++++--
filters/src/voxel_grid.cpp | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
awesomebytes /
Created Aug 31, 2021
Rostopic public republisher (at higher or lower rate)
import rospy
import rostopic
import argparse
import threading
# Borrowed from
global g_msg
g_msg = None
View plotjuggler_yaw_function.lua
function yawAngleFromQ(time, value, v1, v2, v3)
M_PI = 3.14159265358979323846
a = v1
b = v2
c = v3
d = value
aa = a * a
ab = a * b
ac = a * c
awesomebytes /
Created Jul 26, 2021
Razer 15 Advanced (2021) Ubuntu 18.04 installation (working WIFI and Nvidia)
awesomebytes /
Created May 28, 2021
Parse output in real time of any program in Python efficiently
#!/usr/bin/env python
# To make Python 2.7 print an actual function
from __future__ import print_function
import subprocess
# shlex takes care of splitting a string representing a command in words for subprocess
import shlex
import os
class RealTimeProgramOutputParser(object):
awesomebytes /
Last active May 25, 2021
How to install Ubuntu 18.04.05 on Alienware 15 R3 (2020)

How to install Ubuntu 18.04.05 on Alienware 15 R3 (year 2020 edition)

Let windows install

Just next, next, next filling up your data.

I needed to shutdown the machine on a screen that seemed stuck forever. After starting again it all worked normally and got into Windows.

I found the Dell update application and installed all available updates (as I will probably never boot into Windows again).

Shrink the disk