You probably know about Grammarly and other web browser add-ons that basically act as fancier spell checkers. They’re expensive, a bit opaque, and you can’t really integrate them into whatever you want.
Well today, I’ll talk about LanguageTool. Despite offering full-blown plans, what is little known is that you can use it locally and host your own spell checker for free!
Setting this up
I personally use Fedora Linux, so this tutorial will assume you have a similar setup. This particular one should work for any Systemd-enabled distribution.
First, you’ll need to download the latest LanguageTool HTTP server snapshot from their mirror which should be in the form of a zip file, then unzip it which should leave you with a file named something like LanguageTool-6.6-SNAPSHOT (replace the 6.6-SNAPSHOT by the version you downloaded).
For simplicity’s sake, let’s rename LanguageTool-6.6-SNAPSHOT into languagetool and move it to our own folder with:
You can also go in that directory using cd ~/languagetool and type pwd to get the full path to there, we’ll need it a bit later.
Now, time to create a systemd service to start it automatically. First, we’re gonna have to create the folder ~/.config/systemd/user/ using mkdir -p ~/.config/systemd/user/.
Once this is done, you can then edit the languagetool.service file using your favourite editor, in my case, Sublime Text: subl ~/.config/systemd/user/languagetool.service.
In there, you can put the following sample service file, feel free to tweak it accordingly to your needs, but this should be good for most use cases (replace jae by your user):
And there you go, your local LanguageTool server will be started automatically when you log into your session.
Now you, as a finishing touch, you can install the Firefox add-on, and once install, go in the settings, scroll all the way at the bottom, click on the “advanced settings” tab, and swap the “LanguageTool server” option to “local server”.
Congratulations, you now have an amazing spell checker in your browser for 100% free.
If the second command fails, this means your ISP doesn’t supports IPv6. In any case, write those IPs down in a notepad and let’s move on.
You will then need to add a DNS record on your domain to point to your server. To do this, log onto your registar and direct yourself to the DNS control panel.
When adding a record, you will have a few properties to fill:
name – Which subdomain you want to use. Setting this to @ will mean the root of the domain, in our case example.com, setting this to anything else, for instance awoo will “create” the subdomain awoo.example.com and make it point to your IP instead of the root
type – We’ve seen this earlier, we want this to be A or AAAA depending of if we’re adding an IPv4 or IPv6 (both can be present at the same time)
ttl – This is the time (in seconds) the record will stay cached. Leave it as-is. This is how long you will have to wait when you do a change to this record for you to see it
data – The IP address you want the record to point to
proxy status – This is for CloudFlare only, this setting controls if we want our site to be through CloudFlare, let’s disable this for now
Note: you do not need to specify the port of your application in the record. It is up to the app you are using (for instance, a web browser) to query the right ports. Adding a record to 95.217.179.88:8080 will be invalid for instance.
In our example, we can set everything (once again replace with your own data):
Name: @
Type: AAAA
TTL: 60 (default)
Data: 2a12:4946:9900:f00::f00
Meaning our root domain example.com will resolve to 2a12:4946:9900:f00::f00.
We can also add a A record to provide IPv4 connectivity:
Name: @
Type: A
TTL: 60 (default)
Data: 95.217.179.88
Opening ports
Now that your domain is pointing to your home server, you will need to open a few ports to make it accessible from the outside.
First, here are the list of ports you need:
80 is the default HTTP port that you will need to later to obtain SSL certificates
443 is the default HTTPS port that you will need to serve your corner
You will then need to allow those two ports in two places:
Your OS firewall, can be done through ufw usually
Your router’s settings (also called “port opening”, “port redirection” and a lot of other names), make sure the two ports are open on both TCP and UDP and pointing to your home server
Warning: in some countries, some ISPs will not allow you to open those two ports. It’s probably because you are behind something called CGNAT which allows ISPs to share the same IP address between multiple customers. If this is the case call your ISP to get a proper IP that is not behind CGNAT. If this is not possible, you will have to either rent a server at a hosting provider, or get a tunnel.
Once this is done, congratulations, the external world can now reach you.
Web server shenanigans
Now, to serve your corner to the external world, you will need a web server. In this case, we will use Caddy which is really easy to use and takes care of HTTPS renewals for you.
Installing a web server
First, we’re gonna need to install Caddy, it goes a bit like this:
Now, create the directory /var/www/corner and add your website files in there, for instance an index.html.
Restart Caddy using sudo systemctl restart caddy, wait a minute for the HTTPS certificate to be issued and you’re in business, you now have your own corner on the internet!
Have fun editing it and sharing it to your friends. A blog post will be published later this month on how to create your own blog (for free) using GitLab pages!
Reading more
Here are some links to help you get started with your newfound internet home:
Today, from approximately 16:30 UTC to 17:45 UTC, the Resostats Dashboard which provides various public metrics on Resonite was offline.
Background
Routine maintenance was being done on the machine hosting Resostats, namely updating the packages, containers, cleaning up some debugging tools. Configuration changes were committed to try and have the TSDB sync faster to the S3 storage bucket that backs the whole instance.
Metrics stored on the Mimir instances do not have any set expiration.
The S3 bucket itself is fully replicated and backed up using Restic in multiple places, including rsync.net as an external one.
The cause
While committing changes to the mimir configuration, the compactor_blocks_retention_period configuration key was swapped from 0 to 12h.
The compactor_blocks_retention_period configuration key in mimir specifies the retention period for blocks. Anything older than the set amount will get marked for deletion, then cleaned up. You can read more about this in the official mimir configuration documentation.
This prompted the mimir instances to start marking blocks older than 12h for deletion, thus cleaning inadvertently years of historical data.
Restoration
The error in the configuration was quickly spotted and corrected, but the blocks already marked for deletion were already being cleaned up regardless. Given the backup hosted on rsync.net was the closest and fastest for this available server, the decision was taken to restore everything from there.
The restoration process was easy enough, given Restic provides a nice command for this:
Most of the time spent was the stressful wait for the backup to be downloaded onto the machine.
In the end, about 12h of metrics were lost, which is not that much considering the scale of the outage.
Learnings
From now on, a backup will be done before starting any maintenance. The current backup strategy has also been proven robust enough to withstand an event like this one.
Turns out having a proper backup strategy is damn effective.
A few months ago, I started using Signal again. The messenger evolved quite a lot since I last used it, for instance, usernames weren’t even a thing back then, and this is mainly what drove me out of the platform.
If you don’t know what Signal is, it’s quite simple: it’s an encrypted chat app. As it stands, it’s also the safest (broad sense there, please don’t hurt me) option at the moment as it has the most eyeballs on it and sane encryption. Soatok talks about that quite often on his blog as well.
Because I have no imagination whatsoever, here is how I use Signal (basically, the configuration keys I use for it in the “Privacy” section, please note that this is basically for the iOS version, no clue if the Android one has the same configuration keys).
Privacy
Phone number:
Who can see my phone number: nobody
Who can find me by number: nobody
Advanced:
Always relay calls: on
General:
Read receipts: off
Typing indicators: off
Disappearing messages: 4w
Hide screen in app switcher: on
Screen lock: on
Lock screen timeout: 5 minutes
Show calls in recent: off
Chats
General:
Generate links previews: off
Share contacts with iOS: off
Use phone contacts photos: off
Stories
General:
Turn off stories
Data usage
General:
Sent media quality: high
Coinciding with this post, I turned off the ability for new people to DM me on Telegram, from now on, personal contacts will have to be done through Signal.
If we have an existing DM and you want to switch to Signal, use that DM thread to ask me for my username. Otherwise, either email me yours or ping me on a common chat platform. Remember, none of us have to know each other’s phone number anymore, just setup a username if you haven’t already.
This means you can now build ARM programs natively on Linux without having to fiddle with weird cross-compilation.
One way to achieve that is through a Matrix. Considering the following workflow to build, then upload an artifact (taken from the YDMS Opus workflow I wrote):
And the same step is used by the ARM workflow, we will get an error that the artifact matching the name opus-linux already exists for this workflow run.
This is where a small conditional step can be added to set an environment variable with the desired name:
-name:Setdistnamerun:| if ${{ matrix.osver == 'ubuntu-24.04-arm' }}; then echo "distname=opus-linux-arm" >> "$GITHUB_ENV" else echo "distname=opus-linux" >> "$GITHUB_ENV" fiCode language:YAML(yaml)
We can then change our artifact upload step to use these new names:
As a bit of a sidetrack, you can also use checks like this to conditionally skip (or execute) steps depending on the architecture, using a if statement:
As I often mention, I use .NET a lot in general, as it’s fairly easy to use, has a huge ecosystem, and has evolved really positively in the past years (long gone are the days of Mono :D).
Another component of this is that .NET projects are incredibly easy to build and publish using GitLab CI/CD. Today, we’re gonna explore some ways of building and publishing a .NET project using just that.
Docker
Probably the most straightforward, considering a simple Dockerfile:
This will build, then publish the image to the GitLab container registry of the repo. It’s possible to also specify a different registry, but kinda useless as the default one is already excellent for most cases.
Regular build / NuGet build
This type of build just requires source itself without much additional configuration.
It will build the software, then either upload the resulting files as an artifact or publish it into the GitLab NuGet registry.
For those two, I can recommend setting up a cache policy like:
In this case, we use ** to avoid having to update the path every time we upgrade the .NET version (for instance, .NET 8 will put the build in the net8.0 directory, .NET 9 in net9.0, etc).
Now, we can also build and publish the solution to the NuGet registry:
As seen in this definition, this publish stage will only run on tag pushes, but it’s also possible to generate a version string with the current commit and pushing this as a nightly release.
As an additional step, but not really related to the build itself, I often activate the Secret, SAST and dependencies scanning as it can prevent really obvious mistakes. Doing so is also really trivial:
Given sessions in Resonite are hosted by the players themselves, IPv6 is very useful in this context as there are no needs to battle with CGNAT or other network shenanigans and restrictions ISPs might put in place to save up on IP space.
As full native IPv6 support is currently being worked on (see GH-143 for a more in-depth status), some parts already do support it.
Joining any session using a network string like lnl://[<IPv6 address>]:<port>/ is already supported, which only leaves the relays and bridges needing IPv6 support, a mod made by a community member already existing to solve this issue until official support is added.
In the end, I’m very confident that we will see full native IPv6 support land in Resonite this year, if not already in Q1, given this is actively being worked on.
Once those those two issues (relays and bridges + AAAA records missing) are addressed, the only thing missing IPv6 will be… the bug tracker, GitHub, which I already talked about in this article (spoiler, we ain’t seeing IPv6 from them anytime soon).
Also special thanks to ProbablePrime for looking into it!
If you are a Resonite player and are in the Discord guild, you might be familiar with the #active-sessions channel, in which a bot displays the 10 most popular sessions on Resonite as well as some stats.
What you might not know, is that I’m the author of this bot, that I originally started as just a small oneshot project to have some fun.
For some background, when Neos was still a thing (technically still is, but in what state), a bot like this was in the Discord guild, showing sessions and game stats like server metrics and session counts.
When Resonite was released, the channel was there, however, no metrics or posts were ever made, saying that the bot would be revived at some point in the future(TM).
At the time, I was a bit bored and wanted a new project, so I decided to start experimenting with .NET Discord bots and in term set myself the objective to re-create the original bot.
Why .NET? One reason being that I use .NET all the time as it’s fairly easy to use, the other one being that most of the Resonite community also knows .NET due to being used to make mods and whatnot.
The bot itself is fairly simple and divided in multiple parts built around the .NET Hosted Services:
Discord client service – handles the connectivity to Discord
Interaction service – provides the command handler for the few commands the bot has
Startup service – sets up some bot must-haves like the logger and other data
Message service – the core functionality of the bot that runs all the logic that makes the magic happen
Healthcheck service – this one is optional, but important when hosting the bot in Docker
Let’s go through all of those in detail and see why they were made that way.
The Discord-related services
I’m gonna group those together as they belong to the same component really: handling Discord-related shenanigans.
The bot has a few commands:
/info which shows some info about the bot
/setchannel which sets the channel in which you want the notifications
/which which shows which channel is set as the notification one
/unregister which unsets the notification channel
/setting allows you to toggle some settings like if you want thumbnails or not
All of those commands (with the exception of /info) are admin-only.
This part is honestly fairly boring and straightforward, the rest just passes a Discord bot token, connects to the chat service and tries to log in.
First off, the bot uses a relatively simple SQLite DB to avoid everything being hardcoded. The first versions were using direct channel IDs, but this is far from ideal if you want something modular without having to host multiple copies.
The DB basically stores the guild ID, channel ID and settings for the bot to send the updates in the right place, containing what we want.
Speaking of settings, there is only one so far: show the session thumbnails or not. The reason for this is a difference between the Discord & Resonite ToS. While nipples aren’t considered sexual on Resonite, they are on Discord, meaning having a session thumbnail showing nipples on Discord without gating the channel to 18+ users would be violating the ToS of the platform.
One thing I am quite proud of is how stable the bot it, nowadays it rarely, if ever, crashes alone, which it used to do quite often.
The bot is made to handle errors gracefully and never shut down or crash the program unless something really, really warrants it. When running this bot, all the errors that would normally crash it are instead logged with an error message and stacktrace to make it easy to debug.
Another thing to note is that the database schema hasn’t been updated since the bot basically released and touching it is considered a very last resort thing. Having the DB break during an upgrade would be disastrous, requiring all admins to re-set the notifications channel. As they say, if it ain’t broken, don’t fix it.
Out of all the variables in the mix, Discord is the most unstable one, having lots of outages, sometimes lasting hours at a time, just being slow for no reason whatsoever or thinking existing things (such as channels or messages) don’t exist even though they do.
This is why the whole checking logic exists, it will first check if the channel exists, if it does will check if the message exists, and if it does, try to update it. If it fails at any point, it will try again for a while then delete the message, try to re-send it, and ultimately, if this fails, delete the channel from the DB and the admin will have to re-set the notification channel again.
The re-try was implemented after some issues raised from Discord:
The bot would forget about the message (because Discord said it didn’t exist anymore) and would send a second one in the same channel or over and over until restarted
Sometimes the checks would fail on first try and delete everything gracefully without notifying anybody
Bot would crash because everything “ceased” to exist
On the Resonite side, if an error happens while contacting the API, the bot will just skip this cycle and try updating the next time (one minute by default). This used to crash the bot (whoops) in the early days.
The latest addition made was the Docker healthcheck, given recently the bot crashed in the main Resonite guild (GH-3521) and no monitoring was triggered.
Now the bot has a small HTTP server running, simply returning the date that a curl instance will check every 30 seconds.
The CI/CD
It’s no secret that I love GitLab as a software. I also work daily on and with it in my day-to-day job.
The CI/CD used in this project is extensive, but classic:
Secret detection
SAST scan
Dependency scanning
NuGet build
NuGet deployment
ARM64 and x86 Docker builds
Release publishing
The first three are kinda explicit, and will warn if any secrets have been pushed, if any unsafe codepaths are detected or if any dependencies needs updating.
Now the most important thing to highlight are the separated Docker builds for the two architectures. I originally tried combining the builds into a single one as you would do by specifying multiple architectures in buildx, however this did not work.
An error when building ARM on x86 (with virtualization) and vice versa would always arise, though the same command would work for other projects.
To avoid errors when doing things manually, the release process is also automated, triggering when a tag is detected. It will basically build as usual with the version tag and then publish the release following a markdown template. It will also automatically fill-in some details like image tags, etc from the changelog.
Now for the self-criticism: if I had to restart the project from scratch, I would probably opt into an even less complex design. Some services are really huge files that only increased in complexity with time.
Currently nothing too bad, but I think a refactor would be warranted to decrease complexity and make it more maintainable.
I wouldn’t touch the language though, since the bot’s footprint is really small, only about 30Mb to 50Mb of RAM used total during normal runtime.
In the end, this bot is a really fun project to make and maintain, and I’m extremely happy that it got canonized and used in an official manner.
The main difference from years ago is that now, we have fully-featured (and maintained) Docker images for Hugo, the one being selected in this instance being ghcr.io/hugomods/hugo, maintained by HugoMods.