Skip to content

Instantly share code, notes, and snippets.


Дамјан Георгиевски gdamjan

View GitHub Profile
View pleroma.service
# /etc/systemd/system/pleroma.service
Description=Pleroma is a federated social networking platform
gdamjan / fetch-continuous-stream.js
Last active Nov 22, 2022
fetch couchdb changes as stream
View fetch-continuous-stream.js
function asContinuousEventStream() {
const transformer = {
start() {
this.buffer = "";
transform(chunk, controller) {
this.buffer += chunk;
while (true) {
// parse full lines only
const [line, sep, rest] = this.buffer.split(/(\n)/, 3);
View Cargo.toml
name = "rust-cgi"
version = "0.1.0"
edition = "2021"
hyper_cgi= "22.4.15"
hyper = "0.14.23"
tokio = "1.21.2"
gdamjan / default.nix
Last active Nov 26, 2022
A demo "Portable Service" for a shell program built with nix -
View default.nix
{ pkgs ? import <nixpkgs> { } }:
demo-program = pkgs.writeShellScriptBin "helloWorld" "while sleep 3; do echo Hello World; done";
demo-service = pkgs.substituteAll {
name = "demo.service";
src = ./;
demoExe = "${demo-program}/bin/helloWorld";
demo-socket = pkgs.concatText "demo.socket" [ ./demo.socket ];
gdamjan /
Last active Jul 27, 2022
Replace grub2 with systemd-boot on Ubuntu 22.04
  1. remove grub
apt purge --allow-remove-essential grub2-common grub-pc-bin grub-pc grub-gfxpayload-lists grub-efi-amd64-bin grub-efi-amd64-signed grub-common os-prober shim-signed libfreetype6 
apt-get autoremove --purge
rm -rf /boot/grub/
rm -rf /boot/efi/EFI/ubuntu
  1. make sure it's not installed back
    • edit /etc/apt/apt.conf.d/01autoremove
  • add "grub*"; at the end of the Never-MarkAuto-Sections section
View gist:ac7137bd6230b0e188b89cc5bab0eaec
sudo udevadm info -a /sys/devices/pci0000:00/0000:00:02.1/0000:16:00.2/0000:20:08.0/0000:29:00.0/ieee80211/phy0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:02.1/0000:16:00.2/0000:20:08.0/0000:29:00.0/ieee80211/phy0':


PYTHONUSERBASE=$PWD/py-env pip install --user -r requirements.txt

You should get a neksio.csv file

gdamjan /
Last active Jan 11, 2023
compile soju & znc-playback for ubuntu 22.04

podman run -v $PWD:/exfiltrate --rm -it ubuntu:22.04

export DEBIAN_FRONTEND=noninteractive
apt update
apt upgrade -y
apt install -y --no-install-recommends git ca-certificates golang gcc make libsqlite3-dev scdoc

git clone
cd soju
gdamjan / commands.load
Last active Feb 3, 2022
pgloader script to migrate tt-rss from mysql to postgresql -
View commands.load
FROM mysql://ttrss:ttrss@
INTO postgresql://tt-rss:tt-rss@
WITH include no drop, create no tables, truncate
ALTER schema 'ttrss' rename to 'public'
CAST type datetime to timestamp,
type timestamp to timestamp,
gdamjan /
Created Dec 23, 2021
futures are lazy, tasks are eager (in async python)
import asyncio
async def test(s, n):
print(f' {s} started')
await asyncio.sleep(n)
print(f' {s} ends')
async def main():