Skip to content

Instantly share code, notes, and snippets.

@erikson1970
erikson1970 / reader.py
Last active April 1, 2022 16:55
Textual Data Entry Reader Widget - WIP
from __future__ import annotations
from rich.panel import Panel
from rich.align import Align
from rich.pretty import Pretty
from rich import box
from rich.traceback import Traceback
from rich.console import RenderableType
import rich.repr
from textual import events
@erikson1970
erikson1970 / gnuradio-m1-macs.md
Created February 24, 2022 20:18 — forked from daniestevez/gnuradio-m1-macs.md
GNU Radio in M1 Macs (with Docker Desktop)

GNU Radio in M1 Macs (with Docker Desktop)

This note describes the steps we took with the SETI Institute summer interns 2021 to install GNU Radio in their M1 Macs (MacBook Air M1 2020 model). We used gnuradio-docker-env as a starting point, which was of invaluable help.

There might be omissions, typos, etc., in this note, so any feedback is welcome. The procedure could also be streamlined a lot by generating known-good images and pushing the to Docker Hub.

XQuartz

@erikson1970
erikson1970 / python-dockerfile
Last active January 20, 2022 15:04
Dockerfile to create a vscode remote dev container with user
# Remote Dev Container Builder
# credit to Youtube's @Astroniz for original and inspiration
#
FROM python:3-slim-bullseye
LABEL description="Remote Container Builder"
LABEL version="0.2"
ARG username=nonrootuser
To create a new Device ID (and reset configuration) after cloning a VM with Syncthing, just remove the content of this folder:
- Unix-like: $HOME/.config/syncthing
- Mac: $HOME/Library/Application Support/Syncthing
- Windows XP: %AppData%/Syncthing
- Windows 7+: %LocalAppData%/Syncthing
@erikson1970
erikson1970 / tmux-cheatsheet.markdown
Created December 29, 2021 15:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@erikson1970
erikson1970 / gatherTCPcompress.pl
Last active November 11, 2025 18:44
gathers dump1090 ADSB data line by line data from TCP socket and dumps to compressed datafile.
#!/usr/bin/perl
#
#
#
use strict;
use warnings;
use Data::Dumper;
use POSIX qw( strftime );
use Socket;
my $formatted = strftime("%Y%m%d_%H%M%S", localtime);
@erikson1970
erikson1970 / sendRandomTCPMessages.py
Created December 10, 2021 11:39
Send TCP messages to TCP client with random pauses between.
#!/usr/bin/python3
import socket
import sys
import time
import random
time.sleep(1.5)
print('1.5 seconds have passed')
@erikson1970
erikson1970 / connect_remote_Portainer_to_Docker_instance.md
Last active October 12, 2021 12:41
Connect remote Portainer to Docker instance over TLS Cert

This tutorial is about managing a Docker Engine remotely using Portainer connected to the protected Docker daemon socket (TCP port 2376). By default, you can manage Docker locally through a non-networked UNIX socket (option -v /var/run/docker.sock:/var/run/docker.sock while running Portainer). But, if you want the Docker Engine to be reachable through the network in a safe manner, you need to enable TLS by specifying the --tlsverify flag and pointing Docker’s --tlscacert flag to a CA certificate. Then, the daemon only accepts connections from clients that are authenticated by a certificate signed by that CA certificate.

This tutorial accomplishes the following:

  • Create a CA, server and client keys with OpenSSL,
  • Configure the remote API for dockerd (Docker Engine) to allow external connections,
  • Deploy Portainer and connect it to the protected Docker daemon socket.
@erikson1970
erikson1970 / rotator.py
Created October 6, 2021 14:43
Handy util for rotating a list of string.
fff="""ABCD
EFGHI
KLMNOP
QRSTU"""
lines=[ii for ii in fff.split("\n")]
def rotater(linesT, turns=1, notranspose=True,filler=""):
"""Rotate and/or transpose a list of strings"""
if turns > 1 or (turns==1 and notranspose):
linesT.reverse()
MM = [len(ii) for ii in linesT]