Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🔨
Fixing code things with finger hammers.

Andy Piper andypiper

🔨
Fixing code things with finger hammers.
View GitHub Profile
@stdlogicvector
stdlogicvector / lorenz.py
Created April 21, 2024 12:04
Hackaday Vectorscope Badge Lorenz Attractor Code
import random
import math
from vectorscope import Vectorscope
from vos_state import vos_state
import vectoros
import keyboardcb
import keyleds
import asyncio
_abort = False
@thesamesam
thesamesam / xz-backdoor.md
Last active May 11, 2024 07:48
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@OrionReed
OrionReed / dom3d.js
Last active May 11, 2024 01:22
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
#!/usr/bin/env bash
# webfinger
if [ ! `which jq` ]
then
echo Installing 'jq'
sudo apt-get install jq -y
fi
set -euo pipefail
#!/bin/bash
OUTPUT_DIR=""
INPUT_FILE=""
ZOOM=0.7
WIDTH=1080
HEIGHT=1080
ROTATE_X=0
ROTATE_Z=45
ROTATION=360 # Total rotation angle

There's some weird stuff in some server responses to /api/v1/instance and /api/v2/instance.

Here's some I've seen in the wild. Format is:

  • Heading with server type (e.g., "akkoma") and whether this was v1 or v2
  • Then the error when trying to parse the data
  • Then a list of all the servers that triggered the same parse error, with their reported version number

Some of these have been fixed in newer versions of the servers but the fixes haven't fully rolled out.

@insidegui
insidegui / devicectl.sh
Created October 19, 2023 21:58
Helper functions for using devicectl to kill processes on connected iOS devices
# Add to your zsh profile
function devicepid() {
if [ -z "$1" ]; then
echo "Usage: devicepid <device-name> <search>"
echo "Example: devicepid 'iPhone 15 Pro Max' SpringBoard"
return 1
fi
if [ -z "$2" ]; then

Clients should be able to determine the operations the server supports

Version Date Changes
3.0 2024-01-22 Re-write; include the operation information in the nodeinfo
2.0 2023-09-25 Re-write; replace the original suggestion to use the OpenAPI definition with a simpler specification
1.0 2023-08-14 Initial draft
@aallan
aallan / bmp280.py
Last active September 12, 2023 08:05
Vindriktning webserver for Raspberry Pi Pico W written in MicroPython
from micropython import const
from ustruct import unpack as unp
# Author David Stenwall (david at stenwall.io)
# See https://github.com/dafvid/micropython-bmp280
# SPDX-License-Identifier: MIT
# Power Modes
BMP280_POWER_SLEEP = const(0)
BMP280_POWER_FORCED = const(1)
@Nitrousoxide
Nitrousoxide / lemmyfollowbookmarklet
Last active June 29, 2023 09:02
Lemmy Follow Bookmarklet
javascript:(function() {
var currentUrl = window.location.href;
var instanceUrl = 'https://beehaw.org'; /*replace this with your local instance's URL with no ending '/' */
var communitySlug = currentUrl.split('/c/')[1];
var originalUrl = currentUrl.split('/')[2];
var subscribeUrl = instanceUrl + '/c/' + communitySlug + '@' + originalUrl;
window.location.href = subscribeUrl;
})();