Skip to content

Instantly share code, notes, and snippets.


Arti Zirk artizirk

Block or report user

Report or block artizirk

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
artizirk /
Last active Feb 4, 2020
Atlassian Bitbucket Server (Stash) OAuth1 example with Python

Based on this

generate private key

openssl genrsa -out jira_privatekey.pem 1024

generate public key

openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365
openssl pkcs8 -topk8 -nocrypt -in jira_privatekey.pem -out jira_privatekey.pcks8
artizirk /
Last active Feb 3, 2020
Debug WireGuard Linux kernel module
artizirk /
Created Dec 24, 2019
Generate WireGuard IP Addresses from public key, compatible with wg-ip bash script
#!/usr/bin/env python3
from hashlib import sha256
from ipaddress import ip_address, ip_network
def gen_ip(pubkey, subnet=ip_network('fe80::/64')):
"""Generate wg-ip compatible addresses from WireGuard public key"""
prefix_bytes = subnet.network_address.packed
mask_bytes = subnet.netmask.packed
artizirk /
Last active Nov 10, 2019
Postgresql ZFS optimize

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 12, 2019
Create a debian container on a zfs pool for usage with systemd-nspawn and machinectl
set -e
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 22, 2020
Apple macOS Catalina under Linux KVM with GVT-g Intel GPU passthrough notes
You can’t perform that action at this time.