Skip to content

Instantly share code, notes, and snippets.

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

Block or report user

Report or block gdamjan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View demo.erl
%%% export these cause they are spawned:
-export([server_loop/2, client_loop/3]).
main() ->
{ok, Pid} = server(2),
client(Pid, critical, 15),
client(Pid, normal, 10),
gdamjan /
Last active May 16, 2019
configure a wifi interface to 4add/wds mode via iwd
from gi.repository import GLib
import dbus
import dbus.mainloop.glib
import sys
if len(sys.argv) != 2:
print('Usage: {} <mac-address>'.format(sys.argv[0]))
gdamjan / buildah.yml
Last active Apr 5, 2019
ansible + podman & buildah
View buildah.yml
# works with ansible 2.7
# ansible-playbook buildah.yml
# `debian:stretch` and `image-name` should probably be extra vars
- name: bootstrap a container
hosts: localhost
become: no
gather_facts: no
gdamjan /
Last active Feb 8, 2019
try to jail yay (and similar aur helpers)
#! /bin/sh
## custom nsjail for yay
--symlink /usr/bin:/bin
--symlink /usr/lib:/lib64
--bindmount_ro /dev/null
--bindmount_ro /usr
--bindmount_ro /etc/passwd
gdamjan /
Last active Feb 7, 2019
update deb package for matrix-synapse to 0.99.0
# deps
sudo apt install python3-systemd python3-attr python3-bcrypt python3-blist \
python3-canonicaljson python3-daemonize python3-frozendict python3-jsonschema \
python3-msgpack python3-nacl python3-netaddr python3-phonenumbers python3-pil \
python3-prometheus-client python3-psutil python3-pyasn1 python3-pymacaroons \
python3-pysaml2 python3-service-identity python3-signedjson python3-sortedcontainers \
python3-treq python3-twisted python3-unpaddedbase64 python3-yaml
cd /tmp
gdamjan /
Last active Feb 1, 2019
make the most minimal portable service with alpine -
#! /bin/sh
ROOTFS=`mktemp -d rootfs.XXX -t`
[ "$URL" ] && wget -c $URL
mkdir $ROOTFS
gdamjan /
Created Jan 28, 2019
co-processes in bash
#! /bin/bash
# runs asynchronously in a subshell, named sudo_proc
coproc sudo_proc {
sudo /bin/bash -c "ls /root -ld; read _sync; ls /root -ld"
echo sleeping …
sleep 10
echo sleeped …
gdamjan /
Created Jan 27, 2019
PyQt5 QButton, emoji and QDesktopServices.openUrl
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import pyqtSlot, QUrl
class MainWindow(QWidget):
def __init__(self):
self.setWindowTitle("Button demo")
button = QPushButton('Click me \U0001F951', self)
gdamjan /
Last active Apr 7, 2019
sway experiment (it's an experiment since it's not a daily driver - many things just suck)

sway systemd integration

  • sway will exec systemctl --user start in its config file
  • has
  • and for example swayidle.service will have either or
    • same with swaybar/waybar, mako, and similar.

Timeline of events:

  • user logins
  • pam starts systemd --user
gdamjan /
Last active May 15, 2019
Get the AMI id of the latest official (owner-id 379101102735) Debian stretch image (hvm-x86_64-gp2) | awscli + jq
# Debian
aws ec2 describe-images \
--region us-east-1 \
--owners 379101102735 \
--filters 'Name=name,Values=debian-stretch-hvm-x86_64-gp2-*' |
jq '.Images | sort_by(.CreationDate) | .[-1] | .ImageId, .Name'
# additional filters:
# 'Name=name,Values=debian-stretch-*'
You can’t perform that action at this time.