I hereby claim:
- I am alastairmccormack on github.
- I am amccormack (https://keybase.io/amccormack) on keybase.
- I have a public key ASC5Len8bl7k_nzDIkwtrI-DzOWPrQqLNu2xXCmbKM_czwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Requires Python 3.6 (for fstrings) | |
import requests | |
from git import Repo | |
import jmespath | |
import os.path | |
# Create an app password. Username can be found using: https://stackoverflow.com/a/44932928/1554386 | |
username = "" | |
password = "" |
import hashlib | |
import binascii | |
password_salthash_hex = '916b8cb7de146eab16c83ac3e7cdd33751a4cb19dced8da5aab38d94ebebcff968ca5099cfccf28d' | |
password_salthash = binascii.a2b_hex(password_salthash_hex) | |
password_hash = password_salthash[8:] | |
password_salt = password_salthash[:8] | |
password = b'11111' |
# Branch name accessible via: ${data.external.git-branch.result.branch} | |
data "external" "git-branch" { | |
program = ["/bin/bash", "-c", "jq -n --arg branch `git rev-parse --abbrev-ref HEAD` '{\"branch\":$branch}'"] | |
} | |
# When using raw RSA key calculations, it sometimes necessary to see the | |
# verification detail created as a result of a .sign() process (or encryption | |
# using the private key, which Java let's you do!) | |
# Pycrypto .verify() method only allows you to check a known value, where as | |
# openssl let's you see the verification response. I.e | |
# > openssl rsautl -inkey pub_key.pem -raw -verify -pubin -in mysig.txt | |
# The following code was found by digging into the Pycrypto innards: |
import org.bouncycastle.cert.X509CertificateHolder; | |
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; | |
import org.bouncycastle.openssl.PEMParser; | |
import java.security.cert.X509Certificate; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.security.cert.CertificateException; | |
public class PEM2X509Certificate { |
import com.igormaznitsa.jbbp.JBBPCustomFieldTypeProcessor; | |
import com.igormaznitsa.jbbp.compiler.JBBPNamedFieldInfo; | |
import com.igormaznitsa.jbbp.compiler.tokenizer.JBBPFieldTypeParameterContainer; | |
import com.igormaznitsa.jbbp.io.JBBPBitInputStream; | |
import com.igormaznitsa.jbbp.io.JBBPBitOrder; | |
import com.igormaznitsa.jbbp.io.JBBPByteOrder; | |
import com.igormaznitsa.jbbp.model.*; | |
import java.io.EOFException; | |
import java.io.IOException; |
import xattr | |
import plistlib | |
x = xattr.xattr('mydownloaded.file') | |
where_from_plist = x['com.apple.metadata:kMDItemWhereFroms'] | |
where_from = plistlib.loads(where_from_plist) | |
# list object of URLs. Presumably right most is original URL and left most is the redirected location(s) | |
print(where_from) |
# 99.99 based on https://wiki.openmrs.org/display/docs/Check+Digit+Algorithm | |
def get_checkdigit(id_without_check): | |
# allowable characters within identifier | |
valid_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVYWXZ_" | |
# remove leading or trailing whitespace, convert to uppercase | |
id_without_checkdigit = id_without_check.strip().upper() |
{ | |
"Audio": {"AudioPackingMode": null, | |
"BitRate": "96", | |
"Channels": "2", | |
"Codec": "AAC", | |
"CodecOptions": {"BitDepth": null, | |
"BitOrder": null, | |
"Profile": "AAC-LC", | |
"Signed": null}, | |
"SampleRate": "48000"}, |