Skip to content

Instantly share code, notes, and snippets.

View LiamPerson's full-sized avatar
⌨️
AI, Blockchain, Decentralization, Power to the People!

LiamPerson

⌨️
AI, Blockchain, Decentralization, Power to the People!
  • Australia
View GitHub Profile
@LiamPerson
LiamPerson / out-of-your-element.service
Created June 17, 2025 13:27
Out Of Your Element Systemd service file
[Unit]
Description=Starts up the bridge.chat.mydi.cc service which bridges Matrix with Discord.
After=network.target
[Service]
User=nasdac
WorkingDirectory=/mnt/ttbnvme/out-of-your-element
ExecStart=/home/nasdac/.nvm/versions/node/v22.16.0/bin/node --enable-source-maps start.js
Restart=on-failure
StandardOutput=journal
@LiamPerson
LiamPerson / synapse.service
Created June 17, 2025 13:25
Python Synapse (Matrix) Systemd service module
[Unit]
Description=Synapse service (inside venv)
After=network.target
[Service]
Type=forking
User=nasdac
WorkingDirectory=/mnt/ttbnvme/synapse
ExecStart=/bin/bash -c 'source /mnt/ttbnvme/synapse/bin/activate && synctl start'
ExecStop=/bin/bash -c 'source /mnt/ttbnvme/synapse/bin/activate && synctl stop'
@LiamPerson
LiamPerson / how-to-be-ca.md
Created June 16, 2025 12:56
How to be your own Certificate Authority

How to be your own Certificate Authority

Being your own boss!

High-level

All we need to do is create a root key (Certificate Authority key) and a descendent key (what you will use on your server). Both are just keys, nothing special. Then we need to create a root certificate, we do this by signing it with the root key. Then we need to create a descendent certificate. This is signed by both the root, and the descendent key.

Core concepts

We will use 'CSR's which are 'Certificate Signing Request's.

@LiamPerson
LiamPerson / matrix-server-install.md
Last active June 16, 2025 09:46
How to install Synapse (Matrix Server) on the Raspberry Pi

How to install Synapse (the Matrix server) on a Raspberry Pi

  1. Install RustC: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  2. Install apt dependencies:

sudo apt install build-essential python3-dev libffi-dev \
  python3-pip python3-setuptools sqlite3 \
  libssl-dev virtualenv libjpeg-dev libxslt1-dev libicu-dev
@LiamPerson
LiamPerson / steam-revoked-permissions.md
Created May 30, 2025 07:30
Permissions you can revoke from Steam without having it break

Permissions you can revoke from Steam

... without having it break

I made this list because all applications should run at their lowest privilege level ... not the highest.

What you can revoke:

  • Inter-process communications
  • Timezone
  • Development system calls
  • Bluetooth
@LiamPerson
LiamPerson / docker-stop-spamming.md
Created May 9, 2025 14:10
How to stop Docker from spamming your root filesystem

How to stop Docker from spamming your root filesystem

Docker annoyingly, by default, will spam your root filesystem and kill your operating system. Amazing software!

Change where docker spams its content.

  1. Stop docker: sudo systemctl stop docker
  2. Make a place for the data to go. For example: mkdir -p ~/docker-data
  3. Create a daemon.json in /etc/docker/ and tell it where the data-root should be: sudo nano /etc/docker/daemon.json
{
@LiamPerson
LiamPerson / install-pnpm-in-vscodium-flatpak.md
Created April 25, 2025 07:00
How to install `pnpm` in the VSCodium flatpak

How to install pnpm in the VSCodium flatpak

curl -fsSL https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
source ~/.shrc

You can now use pnpm. You can install your node version as wanted as well like so:

pnpm env use --global latest
@LiamPerson
LiamPerson / collect-all-files.js
Created April 13, 2025 04:37
Put all code in current directory into one file with markdown formatting with NodeJS
const fs = require("fs");
const path = require("path");
// Directory to search for code files
const directoryPath = "./"; // Change this to your target directory if needed
// Files to exclude from processing
const excludedFiles = ["collect-files-for-ai.js"];
// Create a new file called code-summary.md
@LiamPerson
LiamPerson / how-to-install-nvidia-debian11.md
Created April 8, 2025 12:03
How to install NVIDIA drivers on Debian 11

How to install NVIDIA drivers on Debian 11

  1. Install a bunch of dependencies: apt install libxml2 libstdc++6 linux-headers-$(uname -r) build-essential libglu1-mesa-dev libx11-dev libxi-dev libxmu-dev freeglut3 freeglut3-dev
  2. Reboot
  3. Download the cuda installer https://us.download.nvidia.com/XFree86/Linux-x86_64/570.133.07/NVIDIA-Linux-x86_64-570.133.07.run
  4. Make the installer executable: chmod +x {the-file}
  5. Run the file as the root user: su - (the - is important so you can have access to $PATH!)
  6. Accept the license. It will fail. It did some changes before it died though such as disable noveau. Just reboot and try again.

That's it!

@LiamPerson
LiamPerson / aptly-debian-arch.md
Created April 7, 2025 13:30
How I got a local Debian mirror running on Arch Linux

How I got a local Debian mirror running on Arch Linux

I want to have a local Debian mirror so my systems can run entirely off of my local network instead of needing a constant internet connection.

To get this working, I found two main packages that should support this apt-mirror and aptly.

I found apt-mirror had poor configuration and I was having extreme difficulty getting the script to run from source, so instead I opted for aptly.

How to get Aptly running on Arch Linux: