Skip to content

Instantly share code, notes, and snippets.

View morkai's full-sized avatar

Łukasz Walukiewicz morkai

View GitHub Profile
@morkai
morkai / results.txt
Created February 26, 2024 16:19
MongoDB v7 compression method comparison
# MongoDB v7 compression method comparison
Collection with 1_000_000 documents and 7 indexes.
## insertMany() 1000x1000 documents
source storageSize=1443.0 MB (100.000%)
none d=111.254s storageSize=1423.9 MB ( 98.677%)
snappy d=110.791s storageSize= 404.9 MB ( 28.065%)
zlib d=113.979s storageSize= 269.5 MB ( 18.680%)
@morkai
morkai / get_point.ino
Created April 10, 2022 14:04
Arduino Adafruit Touch Screen TSPoint Point Rotation Orientation
#define ROTATION 0
TSPoint getPoint()
{
TSPoint p = ts.getPoint();
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if (p.z <= ts.pressureThreshhold)
@morkai
morkai / BalluffProcessorController.js
Last active July 16, 2020 11:38
Balluff RFID processor controller
'use strict';
const logger = require('h5.logger');
const {BufferQueueReader} = require('h5.buffers');
const TcpConnection = require('./TcpConnection');
const MIN_ID_OCCURENCES = 3;
const STX = 0x02;
const EOT = 0x04;
@morkai
morkai / build.sh
Created February 3, 2020 21:57
Build CA and server certificates
#!/usr/bin/env bash
# Source: https://stackoverflow.com/a/50788371
find . \( -name "$1.*" -o -name "*.srl" \) -type f -delete
cp /usr/lib/ssl/openssl.cnf $1.cnf
python <(
cat << "END"
import sys
from ConfigParser import ConfigParser
#Region
#AutoIt3Wrapper_Change2CUI=y
#EndRegion
#include <StringConstants.au3>
#include "_Common.au3"
$outputPath = ReadIni("T_MD04", "OutputPath", ReadIni("Transactions", "OutputPath", "C:\SAP\Output"))
$outputFile = ReadIni("T_MD04", "OutputFile", "T_MD04.txt")
$codePage = ReadIni("T_MD04", "OutputEncoding", ReadIni("Transactions", "OutputEncoding", "4110"))
@morkai
morkai / _enter.sh
Last active November 27, 2019 18:12
Custom Ubuntu Image Builder scripts
#!/bin/bash
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C
dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
@morkai
morkai / client.js
Last active February 8, 2019 00:47
Readable stream state (1=true 0=false n=null)
const net = require('net');
const READABLE = 1;
const client = new net.Socket();
const oldRead = client.read;
let connected = false;
client.on('error', (err) => log('error'));
@morkai
morkai / client.js
Created February 6, 2019 22:03
No readable events in v10
const net = require('net');
const client = new net.Socket();
let connected = false;
client.on('error', (err) => console.error('client#error', err.message));
client.on('close', () =>
{
console.log('client#close');
@morkai
morkai / wfirma-koszty-uboczne-zakupu.user.js
Last active January 20, 2019 04:04
Dodaje pole Koszty uboczne brutto do formularza wydatku Faktura VAT ułatwiający dodanie kosztów transportu. https://youtu.be/GCNu5bHyVkQ
// ==UserScript==
// @name wfirma-koszty-uboczne-zakupu
// @namespace https://miracle.systems/
// @version 0.1
// @description Dodaje pole Koszty uboczne brutto do formularza wydatku Faktura VAT ułatwiający dodanie kosztów transportu.
// @author morkai
// @match https://wfirma.pl/*
// @grant none
// ==/UserScript==
Statistical profiling result from isolate-1234567-v8.log, (26390 ticks, 0 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
26352 99.9% C: WS M32
tdll.dll
35 0.1% C: am Files
odejs
ode.exe
1 0.0% C: WS m32LBASE.dll