Skip to content

Instantly share code, notes, and snippets.

View mrts's full-sized avatar

Mart Sõmermaa mrts

  • Tallinn, Estonia (EET, UTC +2 hours)
View GitHub Profile
mrts /
Created December 24, 2023 12:10
Get customer emails from Merit using Merit API
import hmac
import datetime
import json
from base64 import b64encode
from urllib.parse import urlencode
import requests
API_KEY = b'...'
API_ID = '...'
mrts /
Created April 11, 2023 18:02
Deploy a Maven package to GitLab Packages
cat << 'EOF' > gitlab-mvn-settings.xml
<settings xmlns="" xmlns:xsi=""
mrts /
Last active January 15, 2023 21:17
Add copyright license headers with author information from Git commits to source code files
mrts / App.vue
Last active November 3, 2022 22:04
A simple app for creating slide presentations with Vue.js
<script setup lang="ts">
import { $ref } from "vue/macros";
import { onMounted, onUnmounted } from "vue";
import { SLIDE_TEXTS } from "./assets/slides/slideTexts";
import PresentationSlide from "./components/PresentationSlide.vue";
// Width of the slide images in pixels, change this if the images are of different width
const IMAGE_WIDTH_PX = 1024;
const MAX_INDEX = Object.keys(SLIDE_TEXTS).length;
mrts /
Created June 25, 2022 17:42
List all DigitalOcean Spaces files with Python
import boto3
SPACE = "space-name"
def main():
session = boto3.session.Session()
mrts /
Created April 26, 2022 18:00
Recover KeePass password that was entered with a typo with John the Ripper.
Generate wordlist for recovering a password that was entered with a typo.
Assume the password consists of three elements of random words generated by gpw,
separated by punctuation marks and numbers.
python > passwords.txt
sudo snap install john-the-ripper
john-the-ripper.keepass2john Database.kdbx > passwordhash.txt
john-the-ripper --wordlist=passwords.txt passwordhash.txt
mrts /
Last active April 26, 2022 20:19
A simple Python HTTP proxy that forwards all requests to to enable Cypress download from NPM behind a Nexus proxy.
A simple Python HTTP proxy that forwards all requests to
to enable Cypress download from NPM behind a Nexus proxy.
This is to work around Nexus proxy limitations, see
- and
Requires Python 3.
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
mrts / CMakeLists.txt
Last active February 11, 2021 16:14
Print VCPKG OpenSSL path with CMake
# 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
find_package(OpenSSL REQUIRED)
get_filename_component(SSL_PATH "${SSL_PATH}/../bin" ABSOLUTE)
mrts /
Created November 20, 2020 21:39
Unblock PIN with pkcs15-tool
pkcs15-tool --unblock-pin -a 01 --puk 12345678 --new-pin 1234