Trans: Latin prefix implying "across" or "Beyond", often used in gender nonconforming situations – Scend: Archaic word describing a strong "surge" or "wave", originating with 15th century english sailors – Survival: 15th century english compound word describing an existence only worth transcending.

Category: Featured (Page 1 of 5)

I wrote a mutual aid mental health service

Check out this project here: https://tetrahedron.gay/

 

There are a few goals of this experimental humanitarian project:
  • recreate the structure group therapy offers; to do this, we host a daily wakeup call at ~8:30 every day via Discord.   Any member with the ‘wakeup-call’ attribute is empowered to initiate, join and call (and- if needed- delegate further wakeup calls, via any means necessary- phone call, discord, email, DMs, doordash coffee delivery to your peer, knock on their door, call their neighbors, drone strike etc) .   I intend to write a utility to automate wakeup phone calls and allow users to securely wake each other up without having their personal info (phone #, address etc).
  • recreate and extend the social and interpersonal aspects of a group therapy program through in-person activities as well as virtual, peer led group sessions
  • experiment with horizontal organization structures with minimal hierarchical organization in  a traditionally stratified space; enable the trusting reliance of individuals to guide group moderation while protecting personal info.

Lets write a simple, efficient and fast flask-based image server in an afternoon

….that uses lanczos resampling to serve optimized cached photos.

Find this project on GitHub here: jesssullivan/FastPhotoAPI

Interact with this API graphically here (hosted on koyeb via Docker): https://api.birdphoto.website/

Structure:

This application adopts the factory pattern; `flask run` instantiates the built-in development server by executing `create_app()` at the root of the `app/` package, while `python application.py` creates a new production application, served by waitress.

git clone https://github.com/Jesssullivan/FastPhotoAPI && cd FastPhotoAPI
python3.12 -m venv fast_photo_venv
source fast_photo_venv/bin/activate
pip install -r requirements.txt

Structure:

├── app
├── __init__.py # create and serve development application
└── main
├── config
│ │ └── config.cfg # set directories, max image dimensions, etc
│ ├── fullsize
│ │ └── routes.py # Blueprint routing for serving verbatim image files
│ ├── __init__.py # `create_app()` entrypoint
│ ├── resampled
│ │ ├── model.py # Image resampling methods
│ │ └── routes.py # Blueprint routing for `/image/`
│ └── static
│ └── routes.py # Blueprint routing for `/static/`
├── application.py # create and serve production application w/ waitress
├── cache # resampled images are dynamically generated adn stored here
├── Dockerfile # currently deployed at Koyeb
├── pictures # full res pictures go here
├── README.md # you are here
├── static
│ └── style.css # index styling
└── templates
├── index.html
└── upload.html

Build:

Locally:

# dev WSGI:
flask run # 0.0.0.0:5000
# waitress WSGI:
flask run # 0.0.0.0:8000
Production via Docker:

## build production docker image:
# docker build -t <srv>.

## serve production docker image locally:
docker run -d -p 8000:8000 <srv>:latest

## stop local image:
# docker ps
# docker stop

## push image to a container registery:
# docker push <srv>

Basic Usage:
– Fetch a resampled & cached image `/image/<yourimage>`
– Fetch the original, unmodified image `/full/<yourimage>`

Makerspace financial reporting w/ ipython

Visit this project on github here

  • Merge PayPal & Membershipworks members in a sorta intelligent way to create kinda accurate financial reports
  • Convert a PayPal transaction export into an upsert-able csv to import into membershipworks
  • Keep tabs on PayPal memberships as they become deprecated

(note, you’ll need nbconvert, pandoc, TeX to write to pdf)

…If all goes well, the output will look something like:

loaded **** paypal records
loaded ** existing membershipworks records
converted Date column to datetime objects
kept *** records processed between 01/01/22 and 22/11/21; discarded **** records
discarded **'s Donation Payment record for **, continuing...
discarded **'s PreApproved Payment Bill User Payment record for **, continuing...
** ** already in member list! continuing...
discarded ** **'s Payment Refund record for -**.00, continuing...
discarded ** **'s Donation Payment record for **.00, continuing...
exported: ** Members!
 - ** Standard Members
 - ** Offline Standard Members
 - ** Extra Members
 - ** Offline Extra Members
 ...to a membershipworks-readable format at ./csv/membershipworks_import.csv

This and that, bits and bobs…

Afternoon scribbles & prints:
…Continuing to fix Jess and Cloud’s New York nest with PLA:
…Experimental microphone hardware for Merlin Sound ID:
YMMV, but YOLO: 3d printing @ IG repo and docs:
…A variety of improvements and updates to the chrome remote desktop automatic patching repo for Ubuntu Budgie

Continue reading

Annotators, interpreters & audio demo stuff

…Notes, Repo

….Even more demos @ ai.columbari.us

miscellaneous dregs, bits, bobs, demos in this playlist on youtube

Continue reading

Chindōgu ASCII art

A ridiculous Chindōgu utility prompt & CLI for fetching private releases & files from GitHub & BitBucket

  • Fetch, unpack, extract specific releases & files or a complete master branch from a private GitHub repo with an api access token
  • Fetch and extract specific files or complete branches from a private BitBucket account with user’s git authentication
  • Prefill default prompt values with a variety of console flags
  • Save & load default prompt values with a file of environment variables, see templates FetchReleasegSampleEnv_GitHub, FetchFilegSampleEnv_BitBucket, FetchEverythingSampleEnv_BitBucket, FetchEverythingSampleEnv_GitHub; pass as an argument with the -e flag, (./LeafletSync -e YourEnvFile) or provide one on launch.
curl https://raw.githubusercontent.com/Jesssullivan/LeafletSync/main/LeafletSync --output LeafletSync && chmod +x LeafletSync && ./LeafletSync

Continue reading

naive distance measurements with opencv

Knowing both the Field of View (FoV) of a camera’s lens and the dimensions of the object we’d like to measure (Region of Interest, ROI) seems like more than enough to get a distance.

Note, opencv has an extensive suite of actual calibration tools and utilities here.

…But without calibration or much forethought, could rough measurements of known objects even be usable? Some notes from a math challenged individual:

# clone:
git clone https://github.com/Jesssullivan/misc-roi-distance-notes && cd misc-roi-distance-notes

Most webcams don’t really provide a Field of View much greater than ~50 degrees- this is the value of a MacBook Pro’s webcam for instance. Here’s the plan to get a Focal Length value from Field of View:

So, thinking along the lines of similar triangles:

  • Camera angle forms the angle between the hypotenuse side (one edge of the FoV angle) and the adjacent side
  • Dimension is the opposite side of the triangle we are using to measure with.
  • ^ This makes up the first of two "similar triangles"
  • Then, we start measuring: First, calculate the opposite ROI Dimension using the arbitrary Focal Length value we calculated from the first triangle- then, plug in the Actual ROI Dimensions.
  • Now the adjacent side of this ROI triangle should hopefully be length, in the the units of ROI’s Actual Dimension.

source a fresh venv to fiddle from:

# venv:
python3 -m venv distance_venv
source distance_venv/bin/activate

# depends are imutils & opencv-contrib-python:
pip3 install -r requirements.txt

The opencv people provide a bunch of prebuilt Haar cascade models, so let’s just snag one of them to experiment. Here’s one to detect human faces, we’ve all got one of those:

mkdir haar
wget https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_alt2.xml  -O ./haar/haarcascade_frontalface_alt2.xml

Of course, an actual thing with fixed dimensions would be better, like a stop sign!

Let’s try to calculate the distance as the difference between an actual dimension of the object with a detected dimension- here’s the plan:

YMMV, but YOLO:

# `python3 measure.py`
import math
from cv2 import cv2

DFOV_DEGREES = 50  # such as average laptop webcam horizontal field of view
KNOWN_ROI_MM = 240  # say, height of a human head  

# image source:
cap = cv2.VideoCapture(0)

# detector:
cascade = cv2.CascadeClassifier('./haar/haarcascade_frontalface_alt2.xml')

while True:

    # Capture & resize a single image:
    _, image = cap.read()
    image = cv2.resize(image, (0, 0), fx=.7, fy=0.7, interpolation=cv2.INTER_NEAREST)

    # Convert to greyscale while processing:
    gray_conv = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    gray = cv2.GaussianBlur(gray_conv, (7, 7), 0)

    # get image dimensions:
    gray_width = gray.shape[1]
    gray_height = gray.shape[0]

    focal_value = (gray_height / 2) / math.tan(math.radians(DFOV_DEGREES / 2))

    # run detector:
    result = cascade.detectMultiScale(gray)

    for x, y, h, w in result:

        dist = KNOWN_ROI_MM * focal_value / h
        dist_in = dist / 25.4

        # update display:
        cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2)
        cv2.putText(image, 'Distance:' + str(round(dist_in)) + ' Inches',
                    (5, 100), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)
        cv2.imshow('face detection', image)

        if cv2.waitKey(1) == ord('q'):
            break

run demo with:

python3 measure.py

-Jess

Client-side, asynchronous HTTP methods- TypeScript

…Despite the ubiquitousness of needing to make a POST request from a browser (or, perhaps for this very reason) there seems to be just as many ways, methods, libraries, and standards of implementing http functions in JavaScript as there are people doing said implementing. Between the adoption of the fetch api in browsers and the prevalence and power of Promises in JS, asynchronous http needn’t be a hassle!

/*
...happily processing some data in a browser, when suddenly...
....panik!
you need to complete a portion of this processing elsewhere on some server...:
*/

Continue reading

Obliterate non-removable MDM profiles enforced by Apple’s Device Enrollment Program

Or, when life gives you apples, use Linux

Seemingly harder to remove with every eye-glazing gist and thread… A mac plagued with an is_mdm_removable=false Mobile Device Management profile: the worst! 🙂

First, boot into recovery mode by rebooting while holding down the Command & R keys.

At this stage, you’ll need to connect to the internet briefly to download the recovery OS. This provides a few tools including like disk utility, support, an osx reinstaller- at the top menu, you’ll find an option to access a terminal.

Once in there, you’ll want to:

Disable SIP:

csrutil disable

Then reboot:

reboot now

While holding down Command + Option + P + R to start afresh with cleared NVRAM.

Reboot once again while holding down the Command & R keys to return to the recovery OS. Reinstall whatever version of OSX it offers- instead of trying to deal with the slippery, network connected DEP plists & binaries contained within the various LaunchAgents and LaunchDaemons found in the /System/Library directories directly, we’ll let Apple finish with the ConfigurationProfiles first, then sneak in and remove them.

While this stuff is cooking, get yourself a usb stick and a penguin, such as Budgie:

wget -nd http://cdimage.ubuntu.com/ubuntu-budgie/releases/20.04.1/release/ubuntu-budgie-20.04.1-desktop-amd64.iso
umount /dev/sdc 2>/dev/null || true
sudo dd if=ubuntu-budgie-20.04.1-desktop-amd64.iso of=/dev/sdc bs=1048576 && sync

Boot up again, this time holding the Option key for the bootloader menu. Once in the live usb system, make sure you can read Apples HFS filesystem:

sudo apt-get install hfsprogs

For me at least, I needed to run a quick fsck to fix up the headers before I could mount the osx filesystem living at /dev/sda2 (sda1 is the efi partition):

sudo fsck.hfsplus /dev/sda2

Now, lets go in there and remove those ConfigurationProfiles:

mkdir badapple
sudo mount -o force /dev/sda2 badapple
cd badapple
sudo rm -rf private/var/db/ConfigurationProfiles/*

🙂

KVM does Fruit: Xcode from QEMU

The digression starts over here:

https://github.com/kholia/OSX-KVM

Hmmmm…..

?

…In the mean time...
./OpenCore-Boot.sh:

#!/usr/bin/env bash

# setup tap0 if haven't already for $session:
sudo ip tuntap add dev tap0 mode tap
sudo ip link set tap0 up promisc on 
sudo ip link set dev virbr0 up 
sudo ip link set dev tap0 master virbr0

REPO_PATH="./"
OVMF_DIR="."

args=(
  -enable-kvm -m 24000 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check
  -machine q35
  -smp 4,cores=2,sockets=1
  -device usb-ehci,id=ehci
  -device usb-kbd,bus=ehci.0
  -device usb-mouse,bus=ehci.0
  -device nec-usb-xhci,id=xhci
  -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
  -drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
  -drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
  -smbios type=2
  -device ich9-intel-hda -device hda-duplex
  -device ich9-ahci,id=sata
  -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore-nopicker.qcow2"
  -device ide-hd,bus=sata.2,drive=OpenCoreBoot
  -device ide-hd,bus=sata.3,drive=InstallMedia
  -drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
  -drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
  -device ide-hd,bus=sata.4,drive=MacHDD
  -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
  -vga vmware
)

qemu-system-x86_64 "${args[@]}"

…Ever tried to Chrome Remote ➡️ Ubuntu Budgie?

Check out this project on my Github over here 🙂

Fully automated patching for Chrome Remote Desktop on Ubuntu Budgie.

Chrome remote desktop is fantastic, but often clashes with Xorg nuances from a variety of desktop environments in Ubuntu. This chrome-remote-desktop script extends and replaces the version automatically installed by Google in /opt/google/chrome-remote-desktop/chrome-remote-desktop. This stuff is only relevant for accessing your Ubuntu machine from elsewhere (e.g. the "server", the client machine should not be installing anything, all it needs is a web browser).

Set up the server:

Before patching anything or pursuing other forms of delightful tomfoolery, follow the installation instructions provided by Google. Set up everything normally- install Google’s .deb download with dpkg, set up a PIN, etc.
The trouble comes when you are trying to remote in- some problems you may encounter include:

  • none of the X sessions work, each immediately closing the connection to the client
  • the remote desktop environment crashes or becomes mangled
  • odd scaling issues or flaky resolution changes

Patch it up:

# get this script:
# wget https://raw.githubusercontent.com/Jesssullivan/chrome-remote-desktop-budgie/master/chrome-remote-desktop

# or:
git clone https://github.com/Jesssullivan/chrome-remote-desktop-budgie/ 
cd chrome-remote-desktop-budgie 

# behold:
python3 chrome-remote-desktop

# ...perhaps, if you are keen (optional):
sudo chmod u+x addsystemd.sh
sudo ./addsystemd.sh

What does this do?

We are primarily just enforcing the use of existing instances of X and correct display values as reported by your system.

  • This version keeps a persistent version itself in /usr/local/bin/ in addition updating the one executed by Chrome in /opt/google/chrome-remote-desktop/.
  • A mirror of this script is also maintained at /usr/local/bin/chrome-remote-desktop.github, and will let the user know if there are updates.
  • The version distributed by google is retained in /opt/ too as chrome-remote-desktop.verbatim.
  • Each of these versions are compared by md5 hash- this way our patched version of chrome-remote-desktop will always make sure it is where it should be, even after Google pushes updates and overwrites everything in /opt/.

This, That, etc

….Updated 07/19/2020

Bits & bobs, this & that of late:

…In effort to thwart the recent heat and humidity here in the White Mountains (or, perhaps just to follow the philosophy of circuitous overcomplication… 🙂 ) here are some sketches of quick-release exhaust fittings of mine for a large, wheeled AC & dehumidifier unit (these have been installed throughout my home via window panels).

…Sketching out a severely overcomplicated "computer shelf", rapid-fab style:
(plasma cut / 3d printed four-post server rack == RepRapRack?? xD) 🙂

…Also, Ryan @ V1Engineering recently released his new MPCNC Primo here, should anyone be keen. Long Live the MPCNC! 🙂

…Oodles of fun everyday over in the clipi project- check it out!

xD

« Older posts

© 2024 Trans Scend Survival

α wιρ Σ ♥ by Jess SullivanUp ↑