This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A small utility that creates OCSP responses for testing for the web-eid-authtoken-validation-java library. | |
Run it as follows: | |
python -m venv venv | |
. venv/bin/activate | |
pip install asn1crypto | |
python ocsp.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Install VCPKG and the OpenSSL package | |
# 2. Run CMake: cmake -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake . | |
# 3. Run print-ssl-path target: cmake --build . --target print-ssl-path | |
project(PrintOpenSSLPath) | |
find_package(OpenSSL REQUIRED) | |
get_filename_component(SSL_PATH "${OPENSSL_CRYPTO_LIBRARY}" DIRECTORY) | |
get_filename_component(SSL_PATH "${SSL_PATH}/../bin" ABSOLUTE) | |
message(STATUS "SSL_PATH: ${SSL_PATH}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkcs15-tool --unblock-pin -a 01 --puk 12345678 --new-pin 1234 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See API docs at http://nexus-url/#admin/system/api | |
import requests | |
USERNAME = 'user' | |
PASSWORD = 'password' | |
NEXUS_BASE_URL = 'http://nexus-url/service/rest/beta' | |
REPOSITORY = 'some-project-snapshots' | |
GROUP_FILTER = 'com.some.group' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Translates Markdown syntax to Slack, replaces: | |
# | |
# - hyphened lists with bullet symbols | |
# - double bold marker asterisks `**` with single asterisk `*` | |
# - headers `#` with bold marker asterisks `*` | |
# | |
# Run with | |
# | |
# python markdown-to-slack.py filename.md | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisites: | |
# sudo apt install build-essential swig python-dev | |
# virtualenv venv | |
# source venv/bin/activate | |
# pip install pyscard | |
from __future__ import print_function | |
from smartcard.System import readers | |
SELECT_EE_FOLDER = [0x00, 0xA4, 0x01, 0x0C, 0x02, 0xEE, 0xEE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.css" rel="stylesheet"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> | |
</head> | |
<body> | |
<p style="margin: 20px"></p> | |
<canvas id="gitGraph" style="padding: 20px"></canvas> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
See https://www.pangaliit.ee/settlements-and-standards/reference-number-of-the-invoice/check-digit-calculator-of-domestic-account-number | |
""" | |
def calculate_reference_number(n): | |
""" | |
Calculates Estonian bank invoice reference number. | |
Argument: | |
n - a string of numbers, e.g. invoice number or any other identifier chosen by the invoicer. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import datetime | |
import json | |
from base64 import b64encode | |
from urllib.parse import urlencode | |
import requests | |
from customers.models import Customer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merit API spec: | |
// https://www.merit.ee/juhend/muud/Merit_Aktiva_API_specification.pdf | |
// Install required packages: | |
// npm install crypto-js moment request request-debug | |
const CryptoJS = require('crypto-js'); | |
const moment = require('moment'); | |
const axios = require('axios') | |
const json2csv = require('json2csv').parse; |