It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.
This file contains hidden or 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
#!/bin/sh | |
# @raycast.schemaVersion 1 | |
# @raycast.title Summarize Safari page | |
# @raycast.mode fullOutput | |
# | |
# Optional parameters: | |
# @raycast.icon ✨ | |
# | |
# @raycast.packageName Things |
This file contains hidden or 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 requests | |
import base64 | |
import time | |
import ecdsa | |
import hashlib | |
# Monobank open API for providers - registration | |
# Docs - https://api.monobank.ua/docs/corporate.html#tag/Avtorizaciya-ta-nalashtuvannya-kompaniyi | |
# POST https://api.monobank.ua/personal/auth/registration |
This file contains hidden or 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 requests | |
import json | |
import base64 | |
import time | |
import ecdsa | |
import hashlib | |
# Docs - https://api.monobank.ua/docs/corporate.html#tag/Avtorizaciya-ta-nalashtuvannya-kompaniyi | |
if __name__ == '__main__': |
This file contains hidden or 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
// NewWrapResponseWriter wraps an http.ResponseWriter, returning a proxy that allows you to | |
// hook into various parts of the response process. | |
func NewWrapResponseWriter(w http.ResponseWriter, protoMajor int) WrapResponseWriter { | |
_, fl := w.(http.Flusher) | |
bw := basicWriter{ResponseWriter: w} | |
if protoMajor == 2 { | |
_, ps := w.(http.Pusher) | |
if fl && ps { |
This file contains hidden or 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
# MacOS smartcard | |
List tokens available in the system | |
pluginkit -m -p com.apple.ctk-tokens | |
ex: com.apple.CryptoTokenKit.setoken(1.0) | |
com.apple.CryptoTokenKit.pivtoken(1.0) |
This file contains hidden or 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
#!/bin/bash | |
# Script to use custom ssh keys for various git repositories | |
# Run without arguments to get usage info. | |
# | |
# How it works: | |
# When used with SSH, git sends the path to the repository in the SSH command. | |
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268 | |
# We extract this info and search for a key with the name. | |
# Based on the source, this seems to be used format since v2.0 at least. | |
# @see: https://github.com/git/git/commit/a2036d7 |
- Install podman-manchine from https://github.com/boot2podman/machine/releases
- Install podman via homebrew
brew cask install podman
$ export PATH=$(pwd):$PATH
$ podman-machine create box
Podman machine "box" already exists
$ podman-machine start box
Starting "box"...
This file contains hidden or 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 ( | |
"crypto/rand" | |
"crypto/sha256" | |
"crypto/subtle" | |
"encoding/base64" | |
"strconv" | |
"strings" | |
"time" | |
"golang.org/x/crypto/pbkdf2" |
This file contains hidden or 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
/* | |
* Self-Explanatory Protocol Buffer Lang Guide | |
*/ | |
/* | |
* Why Protocol Buffers? | |
* Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. | |
* You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. | |
* Protocol Buffers are Schema Of Messages. They are language agnostic. |
NewerOlder