Skip to content

Instantly share code, notes, and snippets.

💭
Doing DevOps stuff for Gentoo Prefix + ROS

Sam Pfeiffer awesomebytes

Block or report user

Report or block awesomebytes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@awesomebytes
awesomebytes / rtabmap_pauser.py
Last active May 16, 2019
Class to pause rtabmap
View rtabmap_pauser.py
#!/usr/bin/env python
import os
from copy import deepcopy
import rospy
from tf2_msgs.msg import TFMessage
"""
Hacky class that pauses RTABMAP nodes
View dfjhkakjsfdhjaks.py
from magic_ros import ImageTools
it = ImageTools()
it.display_image(blank_image)
View example_ipython_embed.py
#!/usr/bin/env python
import numpy as np
height = 100
width = 100
blank_image = np.zeros((height, width, 3), np.uint8)
from IPython import embed; embed()
# Check what variables are around
View test.py
import cPickle
import numpy as np
height = 100
width = 100
blank_image = np.zeros((height, width, 3), np.uint8)
my_python_data = {
'list_of_stuff': [1, 2, 3, 4, 5],
'complicated_object': blank_image
@awesomebytes
awesomebytes / monitor_cpu.py
Created Apr 23, 2019
Monitor the CPU of a process given the process name
View monitor_cpu.py
#!/tmp/gentoo/usr/bin/env python
import subprocess
import tempfile
import os
import sys
import signal
import time
import re
import rospy
@awesomebytes
awesomebytes / gstreamer_gscam_tests.md
Created Jan 19, 2019
Gstreamer and gscam tests on Pepper
View gstreamer_gscam_tests.md

Gstreamer tests

Offer video streams to mahcine 192.168.1.18.

Needs AutonomousLife disabled on boot to access top camera (video).

From Paco Dupont post:

gst-launch-0.10 -v v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640, height=480,framerate=30/1' ! ffmpegcolorspace ! jpegenc ! rtpjpegpay ! udpsink host=192.168.1.18 port=3000
@awesomebytes
awesomebytes / extract_file_remote_machine.md
Last active Feb 1, 2019
Extract/Create compressed .tar.gz file directly on remote machine
View extract_file_remote_machine.md

Extract .tar.gz directly on remote machine

cat BIG_FILE.tar.gz | ssh user@192.168.1.12 "tar xzf - -C /home/user"

This magic command uses the network to only transfer the file and as it reaches the target computer it starts getting decompressed straightaway. Minimum traffic, no temporal disk usage.

Create .tar.gz directly on remote machine

@awesomebytes
awesomebytes / disable_autonomous_life_on_boot.py
Created Jan 19, 2019
Disable AutonomousLife on boot on Pepper
View disable_autonomous_life_on_boot.py
#!/usr/bin/env python
"""
Disable autonomous life on boot on Pepper robot.
Sometimes one can't access the website of the robot
to disable the annoying Autonomous Life on boot
(http://YOUR.ROBOT.IP.HERE/#/menu/advancedSettings), so
taken from what the website is actually doing using the
inspect tool of chrome and translating it to Python...
View 002-Hardcode-BLAS.patch
From 60415f5e9f86c0e32a4c1d37eba731231ce2a980 Mon Sep 17 00:00:00 2001
From: Sammy Pfeiffer <Sammy.Pfeiffer@student.uts.edu.au>
Date: Sun, 13 Jan 2019 00:30:03 +1100
Subject: [PATCH] Hardcode blas found for debugging
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
View 001-Debug-cholmod.patch
From f522c66e6b0649311193c27933fb5f5719a7107b Mon Sep 17 00:00:00 2001
From: Sammy Pfeiffer <Sammy.Pfeiffer@student.uts.edu.au>
Date: Sun, 13 Jan 2019 00:20:29 +1100
Subject: [PATCH] Debug cholmod
---
CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
You can’t perform that action at this time.