Skip to content

Instantly share code, notes, and snippets.

💭
MyStatus

Arti Zirk artizirk

💭
MyStatus
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
View README.md
@artizirk
artizirk / readme.md
Last active Feb 4, 2020
Atlassian Bitbucket Server (Stash) OAuth1 example with Python
View readme.md

Based on this https://developer.atlassian.com/server/jira/platform/oauth/

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
artizirk / debug.md
Last active Feb 3, 2020
Debug WireGuard Linux kernel module
View debug.md
@artizirk
artizirk / wg-ip.py
Created Dec 24, 2019
Generate WireGuard IP Addresses from public key, compatible with wg-ip bash script
View wg-ip.py
#!/usr/bin/env python3
from hashlib import sha256
from ipaddress import ip_address, ip_network
# https://github.com/chmduquesne/wg-ip
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
artizirk / postgresql_zfs.md
Last active Nov 10, 2019
Postgresql ZFS optimize
View postgresql_zfs.md

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
artizirk / create_container.sh
Last active Nov 12, 2019
Create a debian container on a zfs pool for usage with systemd-nspawn and machinectl
View create_container.sh
#!/bin/bash
set -e
BASE="/var/lib/machines"
ZDATA="rpool/machines"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
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
artizirk / ascii.py
Last active Sep 13, 2019
k-space ascii task code for taltec/ttu orientation day
View ascii.py
#!/usr/bin/python3
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
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
artizirk / 0README.md
Last active Jan 22, 2020
Apple macOS Catalina under Linux KVM with GVT-g Intel GPU passthrough notes
View 0README.md
You can’t perform that action at this time.