Skip to content

Instantly share code, notes, and snippets.

View kng's full-sized avatar

Daniel Ekman kng

  • Umeå, Sweden
View GitHub Profile
@kng
kng / psu.py
Created October 12, 2023 20:49
measure cpu thread time on a satnogs flowgraph with psutil
#!/usr/bin/python3
import sys
import psutil
if(len(sys.argv) != 2):
print("supply process ID")
exit(1)
p = psutil.Process(int(sys.argv[1]))
print("cpu times {}".format(p.cpu_times()))
@kng
kng / 60-uhd-usrp.rules
Created June 24, 2023 11:46
UHD rules for SatNOGS, added group plugdev
# /etc/udev/rules.d/60-uhd-usrp.rules
# Copyright 2011,2015 Ettus Research LLC
# Copyright 2018 Ettus Research, a National Instruments Company
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#USRP1
SUBSYSTEMS=="usb", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0002", MODE:="0666", GROUP="plugdev"
@kng
kng / README.txt
Created May 19, 2023 19:15
Radiosonde auto rx under docker compose
Fetch the https://github.com/projecthorus/radiosonde_auto_rx/blob/master/auto_rx/station.cfg.example as station.cfg and edit.
Create log dir.
Start with: docker compose up -d
@kng
kng / process_memory.py
Created May 19, 2023 16:16
Dump process memory with psutil
#!/usr/bin/env python3
import psutil
import sys
if len(sys.argv) != 2:
print('supply pid to connect')
exit(-1)
p = psutil.Process(int(sys.argv[1]))
print(p.memory_info())
@kng
kng / test-bpsk.sh
Created May 11, 2023 18:55
dry run satnogs flowgraph
#!/bin/bash
# test run high baud with: BAUD=10000000 ./test-bpsk.sh
# It will raise AttributeError and quit
if [ -f /.env ]; then
source /.env
fi
if [ -z "${RX_FREQ}" ]; then
@kng
kng / docker_run_gnuradio.sh
Created April 16, 2023 17:40
Run gnuradio-companion in docker on Debian
#!/bin/sh
DOCKER_XAUTH=/tmp/.docker.xauth
touch ${DOCKER_XAUTH}
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $DOCKER_XAUTH nmerge -
docker run -it --rm \
--net=host \
-e DISPLAY=$DISPLAY \
-e XAUTHORITY=$DOCKER_XAUTH \
-v /tmp/.docker.xauth:/tmp/.docker.xauth:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
@kng
kng / update-flowgraphs.sh
Created January 1, 2023 16:36
Workaround for old flowgraphs with satnogs-client
#!/bin/bash
#SATNOGS_RIG_IP=rigctld
CLIENT=satnogs-client
RIGIP=$(getent hosts "$SATNOGS_RIG_IP" | awk '{ print $1 }')
FLOWGRAPHS=(/usr/bin/satnogs_*.py)
OUTPATH=~/.local/bin
if [ -z "$RIGIP" ]; then
echo "Warning: unable to resolve SATNOGS_RIG_IP"
exec $CLIENT
@kng
kng / docker-compose.yml
Created December 30, 2022 19:12
SatNOGS librespace docker client with addons, running rigctl mods for doppler control
version: '3.8'
services:
rigctld:
image: 'librespace/hamlib:4.0'
user: '999'
read_only: true
environment:
MODEL: '1'
restart: 'unless-stopped'
@kng
kng / docker-compose.yml
Last active December 28, 2022 14:39
SatNOGS librespace docker client with addons
version: '3.8'
services:
rigctld:
image: 'librespace/hamlib:4.0'
user: '999'
read_only: true
environment:
MODEL: '1'
restart: 'unless-stopped'
@kng
kng / reset_rtlsdr.sh
Created December 25, 2022 19:11
Reset RTL-SDR that is hacing issues otherwise solved with reboot
#!/bin/bash
DEV=$(usbreset|grep RTL2838|awk '{print $2}')
for RTL in $DEV; do
echo "Resetting device $RTL"
usbreset $RTL
done