Skip to content

Instantly share code, notes, and snippets.

@vszakats
vszakats / mk-relnotes.sh
Last active April 4, 2024 09:41
libssh2 RELEASE-NOTES helper
#!/usr/bin/env bash
# Copyright (C) Viktor Szakats
# SPDX-License-Identifier: BSD-3-Clause
# 1. $ git format-patch "$(git describe --abbrev=0)"
# 2. Move low-impact commits to a subdirectory (e.g. 'unused')
# 3. Edit subjects as needed, add module prefix, fix typos, add backtick quotes, fix casing, shorten
# 4. Fixup author names, casing, add 'on github', fixup non-standard markup
# 5. Run this script
# 6. Delete changes with `-LOCAL` references as needed
@vszakats
vszakats / apple-notes-export-from-json.py
Last active May 10, 2023 12:39
Apple Notes.app JSON to Markdown/HTML converter
#!/usr/bin/env python3
# Copyright 2022-present Viktor Szakats. The MIT License.
# SPDX-License-Identifier: MIT
# Convert 'apple_cloud_notes_parser'-made JSON into Markdown or HTML.
# The goal is to export the content losslessly and with the ability to
# continue editing them after importing or opening them in Markdown
# editors as-is.
@vszakats
vszakats / apple-notes-export.js
Last active December 10, 2022 19:41
Export Apple Notes to HTML (with formatting/pics)
#!/usr/bin/env osascript
// Export all Apple Notes.app notes to the current directory, each note
// into a HTML file that includes formatting and embedded documents, with
// creation/modification timestamps set according to Notes metadata.
// To the extent possible under law, Viktor Szakats
// has waived all copyright and related or neighboring rights to this
// script.
// CC0 - https://creativecommons.org/publicdomain/zero/1.0/
@vszakats
vszakats / codesign.sh
Last active May 9, 2024 10:23
Code-signing PE executables using OpenSSL, osslsigncode (and more)
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# shellcheck disable=SC3040,SC2039
set -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
@vszakats
vszakats / s3-upload-aws4.sh
Last active September 26, 2024 12:27
AWS S3 upload using signature v4
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,