Skip to content

Instantly share code, notes, and snippets.

Install QEMU support for the target image platform -
For binary support only -
apt-get install qemu-user-static
For full system emulation - where supported -
apt-get install qemu-system
Note: Qemu provides full support for some platforms e.g. RPi2/3 but not for RPi4/5 however binary support is sufficient for
@edharman
edharman / gist:fe647e88bb4610a461c4803d2b3cbfab
Last active March 29, 2024 14:50
Running containers using systemd-nspawn
Containers provide a quick way to configure and test new operating system versions, deployment scripts etc in minimal containers which
are merely files stored on your container host.
One aspect that some folk may find daunting is the networking aspect, to make containers useful the default networking which will allow
- Container->Internet connectivity means that the container will not be visible to your local network so say ssh'ing in from say your
desktop machine or launching Xsessions just won't work.
So before you start we need to configure a bridged network on the principle lan interface on your host and then that bridged interface
can be shared by your containers and will allow unfettered inbound and outbound connectivity to your other local hosts and devices.
Unfortunately setting this up can be confusing because each linux distro will have it's own preferred method for controlling the network
and even these will vary across Desktop and Server variants of the same distro...
My approach to this is simple
#!/bin/bash
# read the PID's of all RMS processes into an array and then read the number of running stations into
# array RunList so that after killing the instances we can then update RMS and then restart the stations.
# Default behaviour if called with no arguments, - capture all the running RMS processes, kill them, update RMS, then start
# all that are configured within directory ~/source/Stations -
# we need the following in either case
PidList=( $(ps -ef|awk '/[S]tartC/ {print $2}') ) # create an array of the running RMS processes
#!/bin/bash
if [[ "$#" -eq 0 ]] #called with no arg
then
RMS_data=~/RMS_data
else
RMS_data=${1}
fi
# cleanup erroneous Desktop shortcuts
if [[ -f ~/Desktop/RMS_FirstRun.sh ]]
then
#!/bin/bash
#
# This script automates the trasnsfer of the 3 RMS station configuration files and places these into the correct Stations folder on this host
# It prompts the user for the target hostname and copies this hosts public to the targert host to enable passwordless authentication host using ssh keys,
# and if that fails will prompt for a password to install this hosts public key on the target host.
# Since presumably this is a new host it will likely not have it's public keys loaded on your target host and also the host id keys will also not be known to
# this host so you will be prompted to accept and trust each new host..
# It then will copy those config files to a temporary dir, parse the .config.tmp for the hostname and check if that station exists within ~/source/Stations
# and if it does then it will transfer them all to the appropriate Stations dir, it then finaly edits in-place the .config to update the new RMS_data dir.
# The script will continue to prompt for additional hosts and repeat t
#!/bin/sh
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then
echo "Usage: $0 VIRTUALENV_PATH" >&2
exit 1
fi
# The script takes the path to the virtual environment directory as the argument
# Configuration
HOME_DIR=$HOME
#!/usr/bin/bash
# set -e
mkdir source
cd source
sudo apt-get install -y git
git clone https://github.com/CroatianMeteorNetwork/RMS.git
sudo apt-get update
sudo apt-get -y upgrade
if grep -Fq Debian /etc/issue; then
# ..might need to fix for Bullseye..
@edharman
edharman / gist:2ab7976a71c413e9617add12dc94b278
Last active June 10, 2021 13:59
Setup Windows X-Server
As with most things under linux there are many ways to acheive the same thing so here is my recipe for launching X applications
from the numerous headless hosts I run at home onto my Windows desktop.
Download and launch the installer VcXsrv - this is the more modern incarnation of mingw or Cygwins xwin
https://sourceforge.net/projects/vcxsrv/files/latest/download
Accept the default features to be installed
Accept the default location directory
You will find a new icon on your desktop - XLaunch, double click it to run
In the display settings I select the default multiple windows, Next
Start no client, Next
In Extra settings I select Clipboard, Primary Selection and native opengl
@edharman
edharman / Dockerfile
Created March 17, 2021 14:50
Running RMS within a Docker container
FROM scratch
LABEL "version=0.1"
FROM dorowu/ubuntu-desktop-lxde-vnc
RUN apt-get update && apt-get install -y git \
git mplayer python3 python3-dev python3.8-tk python3-pip libblas-dev libatlas-base-dev \
liblapack-dev at-spi2-core libopencv-dev python-imaging-tk libffi-dev libssl-dev socat ntp \
libxml2-dev libxslt-dev imagemagick ffmpeg cmake unzip \
--no-install-recommends
@edharman
edharman / gist:2eb2f019131109191c4e626f815d25a0
Last active July 15, 2021 16:41
HowTo run multiple RMS cameras from a single host
This is a very much WIP -
From a default RMS install –
Open a terminal
$: ‘sudo pip3 install virtualenv-clone’
$: virtualenv-clone vRMS <new env-name>
Note: the new env directory must reside at the same directory level as your base RMS install, e.g.