Skip to content

Instantly share code, notes, and snippets.

View EionRobb's full-sized avatar
👍

Eion Robb EionRobb

👍
View GitHub Profile
@EionRobb
EionRobb / speakercraft.php
Created May 31, 2020 11:26
PHP script for Speakercraft MZC control via 3.5mm control port
<?php
//Script to control a SpeakerCraft MZC via the 3.5mm control port
// Requires a Serial/USB to quad 3.5mm adapter, eg
//https://www.aliexpress.com/item/2017184095.html
// Requires php and php-dio module
// Tested working on Windows and Linux
@EionRobb
EionRobb / googlechat-dynamite.proto
Last active June 26, 2021 11:25
hand crafted reverse engineering of Google Chat's protobuf
syntax = "proto2";
enum UserType {
HUMAN = 0;
BOT = 1;
}
@EionRobb
EionRobb / couchbase-php-session-handler.php
Created August 7, 2021 01:39
PHP session handler for couchbase 7
<?php
// auto_prepend_file = /path/to/couchbase-php-session-handler.php
class CouchbaseSessionHandler implements SessionHandlerInterface {
/**
* The prefix to be used in Couchbase keynames.
*/
protected $_keyPrefix = 'session:';
syntax = "proto2";
// Hand coded protobuf based on reverse engineering the web interface of google messages. Internally called Bugle or DITTO or something.
// Generally uses https://instantmessaging-pa.googleapis.com/$rpc/google.internal.communications.instantmessaging.v1.Pairing/ or https://instantmessaging-pa.googleapis.com/$rpc/google.internal.communications.instantmessaging.v1.Messaging/ for all the comms
// When sending/receiving JSON, the bytes values are sent base64 encoded
// Looks pretty similar to https://github.com/avaidyam/GoogleAPIProtobufs/blob/master/google.internal.communications.instantmessaging.v1.proto
// dont seem to quite line up though
@EionRobb
EionRobb / index.cjs
Created April 11, 2024 09:32
AWS Lambda@Edge script for CloudFront to replace square brackets in inertiajs when using laravel-vapor
'use strict';
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
headers['x-forwarded-host'] = [{
'key': 'X-Forwarded-Host',
'value': headers['host'][0].value,
}];
@EionRobb
EionRobb / Readme.md
Last active April 29, 2025 09:10
Potential slack-libpurple doc update

To create the login token for the Slack plugin.

  1. Login to Slack in Chrome
  2. Open the developer tools (either press F12, or menu -> More Tools -> Developer Tools)
  3. Enter into the console Object.values(JSON.parse(localStorage["localConfig_v2"]).teams).find(a => a.domain == 'myslackdomain').token replacing myslackdomain with the part of your Slack that's before the .slack.com website url eg, for https://example.slack.com you would use example This should start with "xoxc-..." image
  4. Switch to the 'Application' tab, then expand the 'Cookies' menu on the left and click on the first domain in the list
  5. Look for a cookie with a name of 'd' which should have a value that starts with "xoxd-"