Skip to content

Instantly share code, notes, and snippets.

View oldmud0's full-sized avatar

oldmud0

  • Austin, TX
View GitHub Profile
@oldmud0
oldmud0 / zink.md
Created June 27, 2024 19:09
Kodak/Prinics Zink photo printer reverse engineering overview

I don't have much to share, since I only spent about an hour on it, but here is an overview of what it would take to interface a Prinics-based printer with third-party software. I reverse engineered com.prinics.kodak.photoprinter to get some information about the protocol. Some older portable photo printers used Bluetooth OBEX to stay widely compatible with as many devices as possible, including flip phones, but it seems that this is no longer the case.

These printers do not support any standard printer protocols. Instead, they use a custom protocol that is transported through Bluetooth Serial Port Profile (SPP), a Wi-Fi ad-hoc access point (app listens on port 56065), or Wi-Fi Direct (app connects to peer on port 56067).

Each message consists of:

  • u8 - msg id
  • u8 - unknown
  • u8 - unknown
  • u8 - padding (0)
@oldmud0
oldmud0 / wifi.cpp
Last active June 19, 2024 17:13
Maximize Wi-Fi performance on ESP32
constexpr auto WIFI_CHANNEL = 9; // Find a relatively quiet channel
constexpr auto WIFI_DATA_RATE = WIFI_PHY_RATE_24M;
void initFastWifi() {
// Set up Wi-Fi with a faster data rate by disabling AMPDU
// and setting a very fast fixed rate.
// https://www.esp32.com/viewtopic.php?t=9965
// We also need delays to work around races between each step:
// https://esp32.com/viewtopic.php?t=2512
WiFi.disconnect();
@oldmud0
oldmud0 / binlookup.md
Created June 4, 2022 15:36
NIC BIN lookup API

BIN lookup api

$ http post https://securecheckout.cdc.nicusa.com/Checkout/Payment/BinLookup prefix="5149"
HTTP/1.1 200 OK
Cache-Control: private,no-cache, no-store, must-revalidate 
Content-Length: 303
Content-Type: application/json; charset=utf-8
Date: [redacted]
@oldmud0
oldmud0 / foobar.md
Created June 10, 2021 02:07
Google Foobar API v1

Base URL: https://foobar.withgoogle.com/api/v1

Supports HTTP/3. Server name is "Google Frontend." You will need a sessionid and SACSID cookie.

All POST requests use form data.

POST /commands/save

request

@oldmud0
oldmud0 / widgetdumper.cpp
Last active December 21, 2020 04:21 — forked from pjwhams/qtdumper.cpp
Dump size and position of Qt QWidgets and QLayouts
#include "widgetdumper.h"
#include <sstream>
#include <string>
#include <iostream>
#include <stdio.h>
#include <QtWidgets/QLayout>
#include <QtWidgets/QWidget>
#if _MSC_VER
@oldmud0
oldmud0 / ao2-rite-of-passage.md
Last active February 5, 2021 23:37
The AO2 Rite of Passage

THE AO2 RITE OF PASSAGE

For epochs, the secrets of how to correctly compile AO2 was buried in the mind of its creator. After over 12 painstaking hours experimenting, compiling, and pacing around my room aimlessly, I succeeded the rite of passage, and I, too, gained the power to compile AO2 into a single executable of less than 10 MB in size.

I shared this power with great care. But as my involvement in AO2 dwindles and the community yearns for their own clients and their own features, and I look through ZIP files in disgust as dozens of DLLs are strewn all over, I have decided to divulge the secrets of how to compile AO2 statically.

With this powerful guide, you can complete the AO2 rite of passage in three hours or less.

Dependencies

@oldmud0
oldmud0 / client.js
Created July 8, 2018 04:08
node-ipc example with high client->server reliability (no dropped messages)
const ipc = require("node-ipc");
const async = require("async");
const queue = async.queue((data, cb) => {
// There is no way of checking if client is connected so just
// catch and put it back in the queue if a bad happens.
try {
ipc.of.test.emit("message", data);
} catch (err) {
console.error(err);
@oldmud0
oldmud0 / gh-pages-old.md
Created May 1, 2018 22:16
Old GitHub Pages IP addresses for A records

On May 1, 2018, GitHub changed the suggested IP addresses to put on the A records for domains that use GitHub Pages. The new ones now support HTTPS for custom domains, but the old ones did not. Here are the old ones for historical purposes:

  • 192.30.252.153
  • 192.30.252.154

Here are the new ones:

  • 185.199.108.153
  • 185.199.109.153
  • 185.199.110.153
@oldmud0
oldmud0 / music2yaml.py
Last active September 6, 2019 07:38
Extracts songs from the AO2 music folder into a YAML file for tsuserver3
"""
Extracts songs from the AO2 music folder into a yaml file for tsuserver3.
This script will look through the music files present in the given music folder
and add/update the respective song lengths in the music.yaml. It will preserve
the category and positioning of existing tracks, while new tracks are added
to the "Uncategorized" category.
You can also create a fresh music.yaml with this script.
@oldmud0
oldmud0 / aorules.md
Last active July 12, 2017 00:42
Attorney Online Discord Rules

New general rules:

  • Apply common sense, if you have any.
  • Keep trolling contained. This means when there is a serious conversation going on, you keep it serious.
  • Criticism must be constructive, except in dire cases of irony.
  • No spamming, except in #spam.
  • No excess memery or dead, unfunny memes except in #memes.
  • No NSFW content in any channel, except for role-playing in #nsfw-erp.
  • No stalking, harassment, or excess profanity.