Skip to content

Instantly share code, notes, and snippets.

Making things for Matrix

Travis Ralston turt2live

Making things for Matrix
View GitHub Profile
tulir /
Last active Apr 9, 2020
Matrix room server version checker
if [[ -z "$HOMESERVER" ]]; then
echo "Please set the HOMESERVER environment variable to the C-S API URL (e.g."
exit 1
elif [[ -z "$ACCESS_TOKEN" ]]; then
echo "Please set the ACCESS_TOKEN environment variable to your access token"
exit 1
elif [[ -z "$1" ]]; then
echo "Usage: $0 <alias without #>"
exit 1
ara4n /
Last active Feb 12, 2020
Everything you need to know about Perl5

I once wrote one of these before for @NegativeMjark but I think I lost it. So here's another.

All you need to know is:

  • $foo is a scalar (i.e. a single dimensional variable)
  • @foo is an array. $foo[n] is the element of an array.
  • %foo is a hash. $foo{'moo'} aka $foo{moo} is the element of a hash.
  • \ is the reference operator. it returns a scalar which points to the address of the variable (like & in C).
  • (1, 2, 3) is a list. (an array is a variable which contains a list).
  • [1, 2, 3] (rarely: \(1,2,3)) is a reference to a list - aka arrayref
  • $foo->[n] gives an element of an arrayref
Matrixcoffee /
Last active May 14, 2018
How to configure RSS Bot via Scalar without a client

How to configure RSS Bot without a client

If you've always wanted to know how Scalar works behind the scenes, here's a demo where I configure RSS bot via Scalar, using matrix-client-core. We are abusing the test client here to set everything up for us.

Now matrix-client-core has been set up with urllib-request-adapter so you can see what's happening. When using requests itself, you can skip the debug bit.

Big thanks to TravisR for assistance and doing the research on Scalar.

$ /bin/sh -i -d
Connecting to as

Setting a default color scheme (tint) for Riot on your account

Caution: This requires some amount of technical knowledge about how matrix/riot works.

For reference, the original grey color scheme in Riot had a primary color of #595959 and a secondary color of #ececec

  1. Open the developer tools by typing /devtools
  2. Click the "Explore Account Data" button
  3. Click the "im.vector.web.settings" button (if you don't have this button, use the instructions below instead)
ara4n /
Last active Jun 27, 2017
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'
# This should be the public-facing name (ie: dns name)
# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in riot-web
# This is your user ID and access token. The access token must match the user.
USER_ID="" # The home server should match this domain as well (ie: as a HS should be in the user)
voxxit /
Last active Sep 2, 2019
Consul + Vault + MySQL = <3
git clone vault
cd vault
docker-compose up -d
export VAULT_ADDR=

Initializing a vault:

vault init
View gist:893878
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;
You can’t perform that action at this time.