Skip to content

Instantly share code, notes, and snippets.

View gdamjan's full-sized avatar

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

View GitHub Profile
@gdamjan
gdamjan / README.md
Last active December 29, 2023 18:25

Network topology

[Router] === wifi nework domain 1 === [VM server] === bridge0, network domain 2 === VM1, VM2, Container1, Container2
  • VM Server is Archlinux with systemd networkd
  • Router is Edgerouter X with Openwrt

TODO:

  • mDNS with Avahi Reflector
@gdamjan
gdamjan / keybindings.json
Last active December 9, 2023 14:02
vscode settings
// Place your key bindings in this file to override the defaultsauto[]
// ~/.config/Code/User/keybindings.json
[
{
"key": "ctrl+g",
"command": "editor.action.nextMatchFindAction",
"when": "editorFocus"
}
]
@gdamjan
gdamjan / languages.toml
Created December 7, 2023 17:03
helix + pyright and ruff
# ~/.config/helix/languages.toml
# add the language server
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
# will get "Async jobs timed out" errors if this empty config is not added
config = {}
# tie python files to pyright
@gdamjan
gdamjan / README.md
Last active October 9, 2023 12:48 — forked from gdamjan-loka/README.md
Local Docker registry running in Kubernetes

Install a docker registry in a k3s kubernetes cluster

k3s doesn't have a builtin plugin for a local registry, so this is how to install the docker registry. The registry will be exposed via the default traefik ingress (on port 80 and 443).

Assumes

  • resolvectl query registry.localhost returns 127.0.0.1 - on most Linux distros it does. If not, enable and configure systemd-resolved
  • K3s comes with traefik by default, so this ingress is pre-configured for that.
@gdamjan
gdamjan / ssh-agent.service
Created August 11, 2023 18:11
ssh-agent.service
[Unit]
Description=SSH key agent
Documentation=man:ssh-agent(1)
# Configure ssh to use the socket:
# cat ~/.ssh/config
# Host *
# IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket
# ...
#
# /etc/soju/config
# only accept connections from nginx, so insecure is fine
accept-proxy-ip localhost
listen irc+insecure://127.0.0.1:12000
listen ws+insecure://127.0.0.1:12001
hostname <my-hostname>
@gdamjan
gdamjan / default-2.nix
Last active July 30, 2023 12:34
matrix-appservice-irc nix build
# nix-build -E 'with import <nixpkgs> {}; callPackage ./default-2.nix {}'
{ stdenv
, fetchFromGitHub
, fetchYarnDeps
, fixup_yarn_lock
, nodejs
, nodejs-slim
, matrix-sdk-crypto-nodejs
}:
@gdamjan
gdamjan / README.md
Last active July 5, 2023 17:23
fastapi and proxies

Quickstart

pdm install

These are equivalent (given the main.py code)

UVICORN_ROOT_PATH=/api/ pdm run uvicorn main:app
FASTAPI_ROOT_PATH=/api/ pdm run uvicorn main:app
@gdamjan
gdamjan / zz-update-systemd-boot
Last active February 16, 2023 14:26
kernel postinstall script to update systemd-boot on debian/ubuntu
#!/bin/bash
#
# /etc/kernel/postinst.d/zz-update-systemd-boot
# 0755 root:root
#
# This is a simple kernel hook to populate the systemd-boot entries
# whenever kernels are added or removed.
#
set -euo pipefail
@gdamjan
gdamjan / pleroma.service
Last active December 15, 2022 18:18
pleroma setup
# /etc/systemd/system/pleroma.service
[Unit]
Description=Pleroma is a federated social networking platform
Documentation=https://docs-develop.pleroma.social/
After=network.target
[Service]
Type=simple
DynamicUser=yes
StateDirectory=pleroma