Getting Started with Matrix

When a small organization that I’m involved with wanted to move from text messages or Telegram to a more robust real-time chat platform, we had a few options. There’s Slack, of course, and Discord, but we’re geeks and wanted to look to open-source solutions. The open-source aspect was appealing for a few reasons—no corporate overloads involved, able to tweak/hack things that didn’t quite work for us, and it was a chance to explore something none of us have worked on before.

After using Matrix a bit with the organization, I realized the power of bridging, where you interlink other chat tools into the Matrix instance, and decided to create my own personal instance as well. I took two different approaches to setting up Matrix for each.

The Hard Way

Initially, I did it manually. I started a 1 GB Linode running Debian 11 and followed the instructions for installing Synapse. Additionally, since the group already had a Telegram chat, I installed the Mautrix Telegram bridge. This was a bit of work getting everything working just right. I did modify the Synapse settings to restrict new users to only those with a verified e-mail address on a particular domain and auto-add all new members to a particular room.

The positive is you really know everything going into setting up the server. The negative is it is a lot of steps for each bridge, keeping things up to date, etc.

The Simpler Way

When wanting to setup a personal server, I decided to try out the Ansible playbook. The biggest thing I noticed it that it is more resource intensive than the manual setup I had, in particular I’m running on a 2 GB Linode on Debian 11 instead, granted I ended up having a lot more running because it was just so easy to setup compared to the manual viersion.

What is nice about the Ansible playbook is that you setup everything with the proper keys, settings, etc in a config file, then the playbook automatically installs/upgrades everything. It just works.

Some notes that helped me. This particular playbook is meant to run on your own machine and it’ll SSH into the target server to run the various commands to setup everything. Additionally, you can run the commands again to reconfigure if you make changes to the config file (ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start).

Server and Clients

For both the hard and simpler way, Synapse is the server-side component for Matrix. There are other servers out there as Matrix is simply a protocol, but Synapse is the most battle-tested. For clients, you can install the client to your own server or you can use Element which is available for various device platforms or a web version. Using the https://app.element.io web version, you can still log into your own homeserver.

If you want to self-host your client as well, the Ansible playbook provides a handful of different options.

Bridging

The Ansible playbook makes adding the various bridges relatively easy compared to installing them each individually. I’ve setup my personal instance to bridge between Telegram, WhatsApp, Facebook Messages, Twitter DM, and Signal. In practice, this means that I can use Element (web, desktop, or on my mobile devices) as the single client I use for any of those systems. No matter how you message me, if it is one of the above platforms, it all is loaded in Element.

Simplified, this works by having a special room on my server to house each chat on another service. There’s a bot that interfaces both systems and passes the data between them, whether that is actual messaging or “so and so is typing…” information. It’s not 100% perfect—I’m not sure how to start a new conversation in Element with someone on a bridged tool—but I’m no longer opening 5 different apps to catch any conversation that happened while my phone was put away.

Have you tricked out Matrix?

What’s something cool that you’ve done or seen done?

News Only on The iPad

I’m going to experiment with an attempt of a lifehack to only consume news when I’m using my iPad—not at my regular work computer.

Usually, I’ll browse the news sites while waiting for something to build or tests or run, but too often, something will be “breaking” that catches my attention. In reality, it doesn’t really need or deserve my attention. The world would be perfectly the same if I read about it after the event had ended at the end of the day on the iPad.

I’m intentionally not saying my phone either, since that’s easy to get sucked into at the wrong time too. My iPad is an everyday device, but it isn’t an all-the-time one. I only pull it out intentionally—usually to put on something to watch or listen to while doing the dishes.

I have an Apple News+ subscription (cheapest way to get the WSJ I’ve found), so the iPad makes the most sense for this experiment.

What are some hacks y’all have put in place to help keep you from getting sucked into the wrong things at the wrong time?

Mozilla Layoffs

From the Mozilla Blog, they announced they are laying off more folks. They had a restructure at the start of the year and, sadly, more people gone now.

I’ve always liked Mozilla. Their open-source credentials are strong, MDN is my source for web docs, and I feel like they’re trying to make the web a better place.

Always painful to see company like that struggle. I hope they figure out their path.

🧁 WordPress Adds Emoji 11 Support

Note: This post is regarding upcoming WordPress 4.9.8 and this is not applicable to production sites… yet.

In WordPress 4.9.8, among the improvements will be support for the latest Emoji 11 release. WordPress, technically, has already supported it—you’ve been able to add a 🦸 or 🦹 character even since general emoji support was added. One of the pieces of emoji support within WordPress was using the Twemoji library to polyfill emoji that your operating system didn’t support.

In other words, while you can add any Unicode character to your post, it is generally up to your operating system to support it, except for emoji, which WordPress provides a backwards-compatible way for them to display. Emoji 11 went live in early June and WordPress 4.9.7 adds support for the polyfill for these new emoji. Have an old computer? Apple hasn’t released a new version of OS X yet? You’re not on Android P, which is only in development anyhow? No problem, WordPress has your back.

So, no matter if you’re in the heat of summer 🥵 or the dead of winter 🥶, or if you’re 🥺 or 🥳, WordPress is here for you. There are a lot more than just a few smileys or the all-important cupcake 🧁. There are a ton of science-related emoji 🧬 and 🥎 to supplement the existing ⚾️.

If you’re reading this while, um, doing something else ( 🧻 ), Emojipedia has a great run down of the new emoji, specifically as presented by Twemoji.

I’m a little excited by the cupcake emoji, so I decided to use real cupcakes to help make it happen…. These baked goods would be from my wife, Vanessa’s own Qué Bueno Bakery, which is a bronze level Unicode sponsor for the cupcake emoji.

Okay, maybe I’m more than a little excited.

If you’re a 🦸 and testing out Gutenberg, the emoji won’t yet render when editing a post. There’s an issue for it—need to find a good way to ensure the emoji aren’t saved as images when they’re rendered via Twemoji.

What is your favorite new emoji coming soon to your WordPress site?

Have A Cupcake From Qué Bueno!

Vanessa’s Qué Bueno Bakery is the latest Unicode Adopt-a-Character sponsor!

Unicode is the non-profit responsible for coordinating the Unicode Standard, which specifies how to encode text in virtually every modern electronic system. It is how every computer knows that when I type an “A” it should be an “A” everywhere. In addition to the standard alphabets that most English or Romantic language speakers are used to, the Standard sets Han characters (the unified character set for Korean, Japanese, and Chinese) and fun stuff like Emoji. More importantly, Unicode also standardizes a lot of far lesser-used text characters that helps promote continued scholarship and electronic usage for languages and character sets most of us have never heard from.

Just from Unicode 11, announced the first week of June, there were a number of areas with added support:

  • For the Mazahua language, a Mesoamerican language recognized by law in Mexico
  • For Mayan numerals used in printed materials in Central America
  • For Sanskrit manuscripts written in Bengali
  • For Gurmukhi manuscripts
  • For historic documents of the Buryats of the Barguzin Steppe

While people love emoji these days and they would likely get made either way, supporting Unicode enables support for these lesser-known scripts, which is pretty darn cool in my book.

Customizing the Privacy Policy link in Genesis eNews Extended

You put together a brand new fancy Privacy Policy page on your WordPress 4.9.6+ site and are ready to include a link to is using the latest version of Genesis eNews Extended. That’s great!

This is a brand new feature, though, so themes aren’t styling for it yet. What can you do?

Styling

Using the Customizer via Apperarance->Customize within WP-Admin, you can add a small bit of “Additional CSS” to change this link’s styling however you’d like. The link is within a small html tag with a class of enews-privacy  with the a tag itself having the WordPress-wide privacy-policy-link class.

In other words, you can target specifically the eNews privacy link with something like:

.enews-privacy a.privacy-policy-link {
color: green;
}

Other CSS selectors, such as the a:focus and so on can be used too.

Changing the text

The text and the link itself is set by WordPress. You can use the the_privacy_policy_link filter (inline docs) to update the entire HTML block or the privacy_policy_url filter (inline docs) to update the overall link or only the URL. Alternative, you can update only the text by using the gettext filter (docs).

For example:

<?php // do not include in an existing php file

// This one works great if this is a secondary site of a company with one central privacy page. Example: Jetpack's site might want the link to always go to automattic.com/privacy/
function bk_change_the_url_only( $url ) {
return 'https://example.com/privacy/';
}

add_filter( 'privacy_policy_url', 'bk_change_the_url_only' );