Skip to content

Instantly share code, notes, and snippets.

print('Starting LoRa test script...')
"""
Minimal MicroPython example to test machine.SPI communication with the RFM95W LoRa module on the ESP32 Unphone.
On European frequencies (868 MHz), the RFM95W should be able to receive packets from nearby LoRa devices.
"""
# mpremote fs cp lora_test2.py :mpos/board/unphone.py && mpremote
import sys
import machine
@jedie
jedie / crossbar-test.py
Created February 12, 2026 20:22
Hardkernel ODROID GO Crossbar test
"""Hardkernel ODROID GO Crossbar test"""
import time
from machine import ADC, Pin
from micropython import const
# The crossbar pin numbers:
CROSSBAR_X = const(34)
CROSSBAR_Y = const(35)
@jedie
jedie / install-pyrun.py
Last active August 15, 2024 11:16
Python script to install https://github.com/eGenix/egenix-pyrun into '~/.local'
#!/bin/python3
"""
Download and setup missing Python versions using eGenix PyRun
https://github.com/eGenix/egenix-pyrun
"""
import dataclasses
import json
import shutil
#!/bin/bash
set -x
# Crate a virtual environment:
python3 -m venv .venv
# Update pip:
.venv/bin/pip install -U pip
#!/bin/bash
set -x
# Crate a virtual environment:
python3 -m venv .venv
# Update pip:
.venv/bin/pip install -U pip
@jedie
jedie / Vagrantfile
Last active January 17, 2022 19:56
Setup YunoHost "package check" via Vagrant in a Virtual box
# https://docs.vagrantup.com
# https://github.com/YunoHost/package_check
Vagrant.configure("2") do |config|
# https://app.vagrantup.com/ubuntu/boxes/focal64
config.vm.box = "ubuntu/focal64"
config.vm.provider "virtualbox" do |vb|
@jedie
jedie / mitm-redirect.py
Created January 2, 2022 18:49
Web Server to redirect YouTube to invidious ... But is practically unusable because the browser rejects the self-signed certificate ;)
import asyncio
import random
import ssl
from asyncio import StreamReader, StreamWriter
from pathlib import Path
from OpenSSL import crypto
BASE_PATH = Path(__file__).parent
...
Collecting xlwt==1.3.0
Downloading https://www.piwheels.org/simple/xlwt/xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
|████████████████████████████████| 99 kB 1.8 MB/s
Requirement already satisfied: setuptools in ./local_test/venv/lib/python3.7/site-packages (from django-axes==5.27.0->-r ./conf/requirements.txt (line 37)) (40.8.0)
Collecting tablib[html,ods,xls,xlsx,yaml]>=3.0.0
ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
tablib[html,ods,xls,xlsx,yaml]>=3.0.0 from https://www.piwheels.org/simple/tablib/tablib-3.1.0-py3-none-any.whl#sha256=41f3950bb717a7beb857ffe1ed8c18a2ea7dbb8549400446c48ff3533327d407 (from django-import-export==2.6.1->-r ./conf/requirements.txt (line 48))
#!/bin/bash
set -ex
cd /tmp
wget --timestamp https://www.zoom.us/client/latest/zoom_amd64.deb
sudo dpkg -i zoom_amd64.deb
@jedie
jedie / benchmark-rest-api.py
Created February 5, 2020 13:24
Benchmark Django REST-Framework
import cProfile
import pstats
import time
from collections import OrderedDict, namedtuple
import django
import rest_framework
from django.conf import settings
from django.test import RequestFactory
from rest_framework.response import Response