Skip to content

Instantly share code, notes, and snippets.

View gavindekock's full-sized avatar

Gavin de Kock gavindekock

View GitHub Profile
public static async Task LoadPemCertificate(string certificatePath, string privateKeyPath)
{
using var publicKey = new X509Certificate2(certificatePath);
var privateKeyText = await File.ReadAllTextAsync(privateKeyPath);
var privateKeyBlocks = privateKeyText.Split("-", StringSplitOptions.RemoveEmptyEntries);
var privateKeyBytes = Convert.FromBase64String(privateKeyBlocks[1]);
using var rsa = RSA.Create();
if (privateKeyBlocks[0] == "BEGIN PRIVATE KEY")
javaws -verbose "c:\Users\bob\Downloads\viewer.jnlp(192.168.1.200@0@1520179940765)"

Keybase proof

I hereby claim:

  • I am gavindekock on github.
  • I am gavindekock (https://keybase.io/gavindekock) on keybase.
  • I have a public key ASDzlLn8QzQXo6TwBGW2Z9ngiczbL1Ds_5KmvvJ8stf7PQo

To claim this, I am signing this object:

@gavindekock
gavindekock / 0_reuse_code.js
Created April 17, 2017 07:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gavindekock
gavindekock / cmd delete docker images.md
Last active April 17, 2017 07:49
Docker housekeeping on Windows
for /F %i in ('docker ps -aq') do @docker rm %i
for /F %i in ('docker images -aq') do @docker rmi %i
#!/bin/sh
#
# Update APT's local packages, making them ready for
# upgrading at a later date.
#
# Place in /etc/cron.daily/update-apt
# chmod 755 /etc/cron.daily/update-apt
#
#