Skip to content

Instantly share code, notes, and snippets.

View csett86's full-sized avatar

Christoph Settgast csett86

View GitHub Profile
@csett86
csett86 / synapse-compress.sh
Created December 2, 2021 18:18
Compress Synapse
#!/bin/bash
# All thanks to https://levans.fr/shrink-synapse-database.html
# adapt as needed
API_TOKEN=<ADD API TOKEN>
HOST=http://localhost:8008
ROOMLIMIT=10000
PSQL_SYSTEM_USER=postgres
PSQL_USER=synapse
import argparse
import resource
import aiohttp
import aiodns
import asyncio
from collections import Counter
import datetime