Skip to content

Instantly share code, notes, and snippets.

View ross-newman's full-sized avatar
🎯
Focusing on computer vision.

Ross Newman ross-newman

🎯
Focusing on computer vision.
View GitHub Profile
#!/usr/bin/python3
import subprocess
import os
import sys
SECONDS=5
if len(sys.argv) > 1:
print("Recording topics...", )
topics = ["/an_device/sync/Imu", \
#!/bin/bash -e
## Setup as per https://docs.graylog.org/en/4.0/pages/installation/os/ubuntu.html
## Dependancies
apt-get update && sudo apt-get upgrade -y
apt-get install apt-transport-https openjdk-8-jre-headless uuid-runtime pwgen -y --no-install-recommends
add-apt-repository universe
apt-get update && sudo apt-get upgrade -y
apt-get install apt-transport-https openjdk-8-jre-headless uuid-runtime pwgen -y --no-install-recommends
#!/bin/bash
REMOTE_IP=192.168.0.123
echo "Staring stream..."
gst-launch-1.0 rtspsrc location="rtsp://${REMOTE_IP}:554/h264?username=admin&password=123456" ! \
rtph264depay ! \
h264parse ! \
avdec_h264 ! \
videoconvert ! \
xvimagesink sync=true
@ross-newman
ross-newman / camera-correct-opencv.ipynb
Last active April 20, 2020 06:07
Camera-correct-OpenCV.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ross-newman
ross-newman / idt_switch_probe.sh
Created August 22, 2019 14:34
IDT PCIe Switch probing with busybox
#!/bin/bash
## Determine architecture
arch=$(arch)
if [ "$arch" == "ppc" ]; then
echo "PowerPC Host detected"
## When one card installed
dev0mem0=0xf80300000
## When no card installed
# dev0mem0=0xf80100000
@ross-newman
ross-newman / mirror.list
Last active July 18, 2019 12:18
UK apt mirrors list example for LTS releases
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
@ross-newman
ross-newman / cairo-text.cpp
Created June 20, 2019 11:51
Cairo text alignment using cairo_text_extents
#include <cairo.h>
// gcc main.cpp -o test $(pkg-config cairo --cflags) $(pkg-config cairo --libs) $(pkg-config --cflags gtk+-3.0) $(pkg-config --libs gtk+-3.0)
#include <cairo.h>
#include <gtk/gtk.h>
static void do_drawing(cairo_t *, int align);
static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
@ross-newman
ross-newman / docker-ubuntu-minimal.sh
Last active June 19, 2019 15:12
Setting up Docker for Ubuntu X11 applications
#!/bin/bash
# Example for Precise (Ubuntu 12.04)
sudo debootstrap --no-check-gpg precise precise http://archive.ubuntu.com/
tar -C precise -c . | docker import - precise
docker run precise cat /etc/lsb-release
#docker run -it --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" precise "bash"
@ross-newman
ross-newman / ubuntu-alias.sh
Last active June 19, 2019 15:12
My ubuntu alias/s
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'
## get rid of command not found ##
@ross-newman
ross-newman / QEMU PPC Setup for Debian
Last active June 9, 2024 18:51
Building PPC Linux code using QEMU on Ubuntu 18.04 LTS
#!/bin/bash
echo "Building Debina 10 QEMU instance..."
wget https://cdimage.debian.org/cdimage/ports/10.0/powerpc/iso-cd/debian-10.0-powerpc-NETINST-1.iso
sudo apt install qemu
# Create new disk for install
qemu-img create -f qcow2 debian10.qcow2 2000M
# Boot the install image
qemu-system-ppc -L pc-bios -boot d -M mac99 -m 1024 -net nic,model=sungem -net user -hda debian10.qcow2 -cdrom ./debian-10.0-powerpc-NETINST-1.iso -g 1024x768x8
# Run the image
qemu-system-ppc -L pc-bios -boot c -prom-env "boot-device=hd:,\yaboot" -prom-env "boot-args=conf=hd:,\yaboot.conf" \