Skip to content

Instantly share code, notes, and snippets.


Arti Zirk artizirk

View GitHub Profile

PostgreSQL optimize

ZFS Config

atime = off  # Recoding access time on file open is stupid
relatime = on  # writing access time on file write is fine because we are writing anyway.
compression = lz4  # Its faster to compress/decompress on the CPU than it is to wait for the data from HDD/SSD  
recordsize = 128K  # postgres native 8k will give give horrible compression ratio, default 128k is fine
primarycache = metadata  # maybe?
artizirk /
Last active Nov 3, 2020
Create a debian container on a zfs pool for usage with systemd-nspawn and machinectl
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
View ledid.ino
// the setup function runs once when you press reset or power the board
void setup() {
// seadista kõik 10 pinni arduino peal väljunditeks
for (int i=2; i<13; i++){
pinMode(i, OUTPUT);
// the loop function runs over and over again forever
artizirk /
Last active Sep 13, 2019
k-space ascii task code for taltec/ttu orientation day
c_per_line = 4
text = """
What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.
""".strip().upper().replace(".", "").replace("\n", '')
print("64 32 16 8 4 2 1 "*c_per_line)
for word_nr, word in enumerate(text.split(" "), start=1):
artizirk / lsusb_0dba:0165.txt
Created Jul 22, 2019
Realtek Generic Smart Card Reader Interface
View lsusb_0dba:0165.txt
sudo lsusb -d 0bda:0165 -v
Bus 005 Device 069: ID 0bda:0165 Realtek Semiconductor Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
artizirk /
Last active Jan 9, 2021
Apple macOS Catalina under Linux KVM with GVT-g Intel GPU passthrough notes
artizirk /
Created Apr 23, 2019
This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
#!/usr/bin/env python3
# This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
# If you use notmuch then you could do something like this to fix mtime on new mail
# notmuch search --output=files tag:new | xargs -P0 -i ~/code/mailutils/ {}
import email
import sys
import os
from email.utils import parsedate_tz, mktime_tz
artizirk / fastmail.user.js
Created Apr 18, 2019
Fastmail monospace mail font
View fastmail.user.js
// ==UserScript==
// @name fastmail monospace
// @namespace
// @version 0.1
// @description try to take over the world!
// @author Arti
// @match*
// @grant none
// ==/UserScript==
artizirk /
Last active Apr 23, 2020
Pure python way of getting and setting input_absinfo in linux kernel evdev devices
from ctypes import *
from fcntl import ioctl
# See ioctl.h of your architecture for appropriate constants here.
# This has been tested only on x86
artizirk /
Last active Jan 18, 2021
OpenPGP SSH access with Yubikey and GnuPG

OpenPGP SSH access with Yubikey and GnuPG

Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.

Yubikey Config under Ubuntu

To reset and disable not used modes on Yubikey you need the ykman program

You can install it using those commands

You can’t perform that action at this time.