Skip to content

Instantly share code, notes, and snippets.

@ara4n
ara4n / gist:875b5e8b66be3617efb7
Created December 17, 2014 19:47
OSX snippet for using GL to transfer full-frame video (without head-tracking) to Oculus Rift via libovr
uint8_t* EyeBuffer[2]; // raw per-eye data;
void onIdle() {
HmdFrameTiming = ovrHmd_BeginFrame(Hmd, 0);
// ...normal frame management from OculusWorldDemoApp::OnIdle goes here..
// ...and then immediately before you EndFrame:
// just transfer directly onto the eye textures
@ara4n
ara4n / kamailio-matrix.patch
Created June 1, 2015 21:55
WIP diff against kamailio-basic.cfg for SIP->Matrix bridging
--- kamailio-basic.cfg 2015-05-19 14:45:13.000000000 +0100
+++ kamailio-matrix.cfg 2015-06-01 22:53:52.000000000 +0100
@@ -1,6 +1,7 @@
#!KAMAILIO
#
-# Kamailio (OpenSER) SIP Server v4.2 - default configuration script
+# Kamailio (OpenSER) SIP Server v4.2 - default configuration script for Matrix
+# forked off kamailio-basic.cfg
# - web: http://www.kamailio.org
# - git: http://sip-router.org
@ara4n
ara4n / get-topic.js
Created October 27, 2015 20:39
Example of how to read a state event of a room (in this instance, the topic of #matrix:matrix.org)
var sdk = require("matrix-js-sdk");
var myUserId = "@matthew:matrix.org";
var myAccessToken = "s3cr3t";
var matrixClient = sdk.createClient({
baseUrl: "https://matrix.org",
accessToken: myAccessToken,
userId: myUserId
});
matrixClient.on("syncComplete", function() {
Verifying that +arathorn is my blockchain ID. https://onename.com/arathorn
From secret@yahoo.co.uk Wed Jun 15 16:46:43 2016
X-Apparently-To: secret@yahoo.co.uk; Wed, 15 Jun 2016 16:49:35 +0000
Return-Path: <secret@yahoo.co.uk>
Received-SPF: pass (domain of yahoo.co.uk designates 67.195.87.170 as permitted sender)
X-YMailISG: 36JxtZUWLDvAeUWhjxdeMyorhJWxwbZd_eYjD_IoH9MrExwJ
jnWAeQFrqnrLsnykBS51dkXH719gz11yC9F.4U7XShQpAor0f1rQGv94EWQm
Szmo9xk5pm_LIOupqXy.M_e8LAlSNNoFxwZxuwynASBMBCkecda9yeJ00C2z
f95hV5MdgH_.Bd23MAc7JQbw41vhxGoyE4pyRb.adQ6uAo60idT9AeMRxoua
u2PsVVrCalkjlHrJFoK3UONOi6wMxmHsM1YYGO8k6TIlqp3cnUbu.pr8Mf8v
nr1WpIF1MHXoCSp1nWSXQTMYmp2b5tCIjBh.47DMXB3kV3zxDOInjZS0coqv
@ara4n
ara4n / e2e-backup.js
Last active December 6, 2016 22:49
Backup & restore of E2E session data
// backup (tested in Chrome console...). N.B. this does *NOT ENCRYPT THE SESSION KEYS!*
Object.keys(window.localStorage).forEach(k=>{
if (k.match(/^session\.e2e\.sessions\/|^session\.e2e\.inboundgroupsessions\//)) localStorageCopy[k] = window.localStorage[k];
});
blob = new Blob([JSON.stringify(localStorageCopy, null, '\t')], { type: "text/plain;charset=utf-8" });
fetch('https://raw.githubusercontent.com/eligrey/FileSaver.js/master/FileSaver.js')
.then(response => response.text())
@ara4n
ara4n / dendrite-install.sh
Last active June 27, 2017 16:20
Build guide/script for Dendrite experimentation
# Dendrite guide
# start with Debian Stretch
apt-get install golang-1.8 postgresql
apt-get install openjdk-8-jre-headless # needed for kafka (which in future will be an optional dependency)
# Set up DBs
su postgres -c 'createuser dendrite'
@ara4n
ara4n / nheko-mobile.md
Last active September 28, 2017 15:58
Making a Librem5 Prototype out of an Ubuntu Phone

Making a Librem5 Prototype out of an Ubuntu Phone using Nheko

Starting point: one old BQ Aquaris E5 ubuntu phone, running some old version of Ubuntu Touch which had got completely stuck (UI only unfreezing for 2-3 seconds every 2-3 minutes).

Step one: flash to latest UBPorts image:

@ara4n
ara4n / matrix ansibles.md
Last active January 17, 2018 16:05
Quick review of synapse ansible playbooks on github as of Jan 17 2018

https://github.com/7adietri/ansible-synapse - installs a virtualenv'd synapse from source into /opt/synapse, and maintains a templated config file with a bunch of variables. Last updated Jan 9 2018

https://github.com/atb00ker/ansible-matrix-synapse - installs debian packaged synapse, with nginx + letsencrypt (certbot) Last updated Jan 15 2018

https://github.com/Sifungurux/ansible-matrix-synapse - installs debian packaged synapse with minimal configuration options Last updated Dec 20 2017

https://github.com/binRick/ansible-deploy-synapse - not a playbook; installs via pip into a venv; lots of other stuff too

@ara4n
ara4n / AVCaptureDepthDataOutput.patch
Created January 25, 2018 20:42
wip experimentation with AVCaptureDepthData in webrtc
diff --git a/sdk/objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.h b/sdk/objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.h
index 8b73a8086..6b23e8a81 100644
--- a/sdk/objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.h
+++ b/sdk/objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.h
@@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCAVFoundationVideoCapturerInternal
: NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
+@interface RTCAVFoundationVideoCapturerInternal
+ : NSObject <AVCaptureDepthDataOutputDelegate>