Skip to content

Instantly share code, notes, and snippets.

🎉
Making things for Matrix

Travis Ralston turt2live

🎉
Making things for Matrix
View GitHub Profile
@tulir
tulir / .checkroom.sh
Last active Apr 9, 2020
Matrix room server version checker
View .checkroom.sh
#!/bin/bash
if [[ -z "$HOMESERVER" ]]; then
echo "Please set the HOMESERVER environment variable to the C-S API URL (e.g. https://matrix.org)"
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
ara4n / perl.md
Last active Feb 12, 2020
Everything you need to know about Perl5
View perl.md

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
Matrixcoffee / HOW_TO_SCALAR_RSSBOT.md
Last active May 14, 2018
How to configure RSS Bot via Scalar without a client
View HOW_TO_SCALAR_RSSBOT.md

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 testclient.sh -i -d
Connecting to https://matrix.org as @Coffee:matrix.org
View riot-color-scheme.md

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
ara4n / dendrite-install.sh
Last active Jun 27, 2017
Build guide/script for Dendrite experimentation
View dendrite-install.sh
# 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'
View tag_room.sh
# This should be the public-facing name (ie: dns name)
HOME_SERVER_URL="https://matrix.org"
# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in riot-web
ROOM_ID="!AbCDef823s:matrix.org"
# This is your user ID and access token. The access token must match the user.
USER_ID="@turt2live:matrix.org" # The home server should match this domain as well (ie: t2l.io as a HS should be :t2l.io in the user)
ACCESS_TOKEN="token_here"
@voxxit
voxxit / USING-VAULT.md
Last active Sep 2, 2019
Consul + Vault + MySQL = <3
View USING-VAULT.md
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

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.