Skip to content

Instantly share code, notes, and snippets.

Avatar

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

View GitHub Profile
@gdamjan
gdamjan / XCompose
Created Feb 25, 2021
my own $HOME/.XCompose
View XCompose
include "%L"
# see also https://github.com/kragen/xcompose/
<Multi_key> <y> <y> : "✓" U2713 # checkmark
<Multi_key> <x> <x> : "✗" U2717 # BALLOT X
<Multi_key> <o> <minus> <plus> : "♀" U2640 # FEMALE SIGN
<Multi_key> <o> <minus> <greater> : "♂" U2642 # MALE SIGN
<Multi_key> <t> <e> <l> : "☎" U260E # BLACK TELEPHONE
@gdamjan
gdamjan / README.md
Last active Feb 14, 2021
pep-0370 vs virtualenv
View README.md
  1. bog standard, pep-0370 python:
$ PYTHONUSERBASE=$PWD/pep-370-env pip install --user flask
…
$ du -sh pep-370-env/
3.1M    pep-370-env/
  1. virtualenv (and we need this installed before-hand):
View gist:b30b9295c452b844134db694e0fb5672
-- Journal begins at Fri 2021-01-08 10:06:30 CET, ends at Thu 2021-01-28 19:59:21 CET. --
Jan 26 15:50:45 archless kernel: iwlwifi 0000:29:00.0: enabling device (0000 -> 0002)
Jan 26 15:50:45 archless kernel: iwlwifi 0000:29:00.0: api flags index 2 larger than supported by driver
Jan 26 15:50:45 archless kernel: iwlwifi 0000:29:00.0: TLV_FW_FSEQ_VERSION: FSEQ Version: 89.3.35.22
Jan 26 15:50:45 archless kernel: iwlwifi 0000:29:00.0: loaded firmware version 59.601f3a66.0 cc-a0-59.ucode op_mode iwlmvm
Jan 26 15:50:46 archless kernel: iwlwifi 0000:29:00.0: Detected Intel(R) Wi-Fi 6 AX200 160MHz, REV=0x340
Jan 26 15:50:46 archless kernel: iwlwifi 0000:29:00.0: base HW address: e0:d4:e8:18:7a:1d
Jan 26 18:26:18 archless kernel: iwlwifi 0000:29:00.0: Microcode SW error detected. Restarting 0x0.
Jan 26 18:26:18 archless kernel: iwlwifi 0000:29:00.0: Start IWL Error Log Dump:
Jan 26 18:26:18 archless kernel: iwlwifi 0000:29:00.0: Status: 0x00000040, count: 6
View gist:4d75d7d9716a9f03a0129d264973ee5b
$ NIX_PATH=nixpkgs=/nixpkgs nix-build -E 'with import <nixpkgs> {}; php.override {embedSupport = true; apxs2Support = false;}'
Number of tests : 237 228
Tests skipped : 9 ( 3.8%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 5 ( 2.1%) ( 2.2%)
Tests passed : 223 ( 94.1%) ( 97.8%)
---------------------------------------------------------------------
Time taken : 8 seconds
View convertor.ini
[uwsgi]
ini = :convertor
http-socket = :8080
static-check = %(convertor_dir)/static
static-skip-ext = .py
[service]
ini = :convertor
plugin = systemd_logger
logger = systemd
@gdamjan
gdamjan / installkernel
Last active Nov 10, 2020
installkernel - script to install kernel when compiling from source, for use with systemd-boot
View installkernel
#! /bin/bash
# /root/bin/installkernel called automatically by `sudo make modules_install install`
# makes an initramfs, and then packs it with the kernel, command line etc…
set -Eeuo pipefail
KVER=$1
KIMAGE=$2
INITRAMFS=`mktemp -d`/initramfs.img
View cpuinfo.txt
processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 24
model name : AMD Ryzen 5 3400G with Radeon Vega Graphics
stepping : 1
microcode : 0x8108109
cpu MHz : 1656.911
cache size : 512 KB
physical id : 0
@gdamjan
gdamjan / test.c
Created Oct 21, 2020
signal handling wl_event_loop after daemon() is broken
View test.c
/*
* compile with: gcc test.c -o test -l wayland-server
*
*/
#define _DEFAULT_SOURCE
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
View autoscroll.ts
import { beforeUpdate, afterUpdate } from 'svelte';
let autoscroll = true;
let prevHeight = 0;
let footer = document.querySelector('footer');
beforeUpdate(() => {
prevHeight = document.body.scrollHeight;
// autoscroll if the footer is visible
let footerTop = footer?.offsetTop ?? document.body.scrollHeight;
@gdamjan
gdamjan / iwd.diff
Created Oct 1, 2020
NameResolvingService=none
View iwd.diff
diff --git a/src/resolve.c b/src/resolve.c
index 066e4c87..3e105ad5 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -60,6 +60,9 @@ static inline void _resolve_init(struct resolve *resolve, uint32_t ifindex,
void resolve_add_dns(struct resolve *resolve, uint8_t type, char **dns_list)
{
+ if (resolve == 0)
+ return;