Skip to content

Instantly share code, notes, and snippets.

View calaveraInfo's full-sized avatar

František Řezáč calaveraInfo

View GitHub Profile
@calaveraInfo
calaveraInfo / README.md
Last active March 9, 2018 17:44
How to use Czech qualified digital signature in communication with authorities without proprietary software
@calaveraInfo
calaveraInfo / README.md
Last active August 11, 2023 09:46
Example of how to split single XML document to separate files using XSLT 2 and other advanced features

About

It is possible to create multiple output files as a result of XSL processing in XSLT 2 with tag xsl:result-document. This is usefull for example when some large database is available as a single XML document from which we need to extract only certain parts and/or modify it. This particular example takes export of accounts from the Waveset Identity Management system, filters them, modifies them and saves them in a separate file per account. This principle might be however usefull in many other cases.

This work is largely based on an example from IBM developer works

@calaveraInfo
calaveraInfo / README.md
Last active August 22, 2017 11:31
Analysis of business proposal strategies in situation of nonlinear relation between price and quality

About

Since the process of public procurement has to be transaparent, assessment of proposals is in most cases clearly defined beforehand, strictly evaluated and it is often complicated mathematical combination of multiple factors like price and quality. This opens a room for speculation about different strategies for winning a contract, for example low price and low quality vs higher price and higher quality. This is an example of analysis of such possibilities using mathematical software Octave.

I'm keeping these notes mainly as personal notes on how to use Octave.

@calaveraInfo
calaveraInfo / data.xml
Created August 28, 2017 14:52
Just a starter template for how to create simple HTML report from XML data directly in browser
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
<pozadavky xmlns="http://calavera.info">
<pozadavek id="1" subdodavka="true" md="1" submd="5">
<text>Some text</text>
</pozadavek>
<pozadavek id="2" subdodavka="false" md="10">
<text>Some other text</text>
<note>Some note</note>
@calaveraInfo
calaveraInfo / dmenu.sh
Created September 4, 2017 15:56
Dmenu parameters I like
echo -e "Hello\nHi\nGood morning\nGood afternoon\nGood evening" | dmenu -i -p "Greeting:" -b -l 5 -fn "-*-terminal-*-*-*-*-18-*-*-*-*-*-*-*" -nf green
@calaveraInfo
calaveraInfo / cardtest.sh
Created September 13, 2017 12:00
Shell script that repeats simple smart card operations many times. May be used to measure smart card performance or reliability.
#!/bin/bash
# pkcs15-tool --list-keys
# Private RSA Key [Digital Signature]: ID: 11
TEMPFILE=`mktemp`
# reading PIN into environment variable is NOT safe, DO NOT use on shared computer.
# read is built-in, manual can be shown with
# help read
read -e -s -p "PIN: " PIN
@calaveraInfo
calaveraInfo / signature.txt
Created September 19, 2017 07:33
Cory Doctorow email signature
For avoidance of doubt: This email does not constitute permission to add
me to your mailing list.
READ CAREFULLY. By reading this email, you agree, on behalf of your
employer, to release me from all obligations and waivers arising from
any and all NON-NEGOTIATED agreements, licenses, terms-of-service,
shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure,
non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have
entered into with your employer, its partners, licensors, agents and
assigns, in perpetuity, without prejudice to my ongoing rights and
@calaveraInfo
calaveraInfo / README.md
Last active December 14, 2017 12:52
Bookmarklet helper for adding global Ajax callbacks manualy from console.
@calaveraInfo
calaveraInfo / README.md
Last active March 26, 2022 08:32
Backup shell script using rsync

About

This is simplified version of script I'm using for doing my backups. I have prepared it only recently because manual invocation of rsync was enough for me. But as the number of separately rsynced folders increased I was forced to introduce some automation and I had to solve some interesting problems along the way.

Persistent SSH connection

Normally a separate SSH connection is established for each rsync invocation. That may become irritating if, for some reason, establishing an SSH connection requires

@calaveraInfo
calaveraInfo / log
Created August 23, 2018 11:26
CZ eID smartcard init fail
0x7f3ef3603700 10:30:07.180 [opensc-tool] sc.c:259:sc_detect_card_presence: called
0x7f3ef3603700 10:30:07.180 [opensc-tool] reader-pcsc.c:397:pcsc_detect_card_presence: called
0x7f3ef3603700 10:30:07.180 [opensc-tool] reader-pcsc.c:303:refresh_attributes: Gemalto PC Twin Reader (6C5795CE) 01 00 check
0x7f3ef3603700 10:30:07.181 [opensc-tool] reader-pcsc.c:323:refresh_attributes: returning with: 0 (Success)
0x7f3ef3603700 10:30:07.181 [opensc-tool] reader-pcsc.c:402:pcsc_detect_card_presence: returning with: 1
0x7f3ef3603700 10:30:07.181 [opensc-tool] sc.c:264:sc_detect_card_presence: returning with: 1
Using reader with a card: Gemalto PC Twin Reader (6C5795CE) 01 00
0x7f3ef3603700 10:30:07.181 [opensc-tool] sc.c:259:sc_detect_card_presence: called
0x7f3ef3603700 10:30:07.181 [opensc-tool] reader-pcsc.c:397:pcsc_detect_card_presence: called
0x7f3ef3603700 10:30:07.181 [opensc-tool] reader-pcsc.c:303:refresh_attributes: Gemalto PC Twin Reader (6C5795CE) 01 00 check