Skip to content

Instantly share code, notes, and snippets.

View kousu's full-sized avatar

Nick Guenther kousu

  • Asymmetric Research
  • Canada
View GitHub Profile
@kousu
kousu / README.md
Created March 19, 2021 20:17
Repo splitting with git filter-repo

To split the GUI plugin, spread over two branches (1 2) and two folders (shimmingtoolbox/gui/, shimmingtoolbox/fsleyes-plugin-shimming-toolbox), out from git@github.com:shimming-toolbox/shimming-toolbox.git to git@github.com:shimming-toolbox/fsleyes-plugin-shimming-toolbox.git:

  1. sudo pacman -S git-filter-repo [or your local option]
@kousu
kousu / README.md
Created November 28, 2020 06:22
http cert pinning

Generate certificate pins for your apps.

For all of you wanting this feature there's a great option out there if you're willing to step beyond Signal: Conversations. There's no primary/secondary distinction: it does true-multi-device multi-key encryption (they adopted libsignal and built on it and I'm very grateful that OWS developed and released it so it could be built upon), as well as video chat, file attachments (encrypted, of course), and cross-device history syncing, and all that at 1/3rd the size of Signal, and without a dependency on push notifications. And you can pretty easily set up alt identities and use them on the same devices so there's no need to worry about [giving out a private number](https://www.vice.com/en_us/article/9kaxge/how-to-use-signal-without-giving-out-your-phone-number-a-gender

#!/usr/bin/env bash
# upload a file to neuropoly's wiki's filestore at https://www.neuro.polymtl.ca/lib/exe/mediamanager.php
# public domain
# author: nguenthe@uwaterloo.ca
#
# TODO: be fully scp compatible: we should be able to specify the target filename, disambiguating between DESTs ending in / or not
set -eo pipefail # crash on sub-errors; pipefail is a bashism, but sooo useful
set -u # crash on missing vars
This file has been truncated, but you can view the full file.
This file has been truncated, but you can view the full file.
@kousu
kousu / test.py
Last active February 7, 2020 09:25
Better python breakpoint()
# Try 'python test.py' with the above breakpoint hook loaded. Try adding/removing/editing the variables.
def g(a,b,c):
print(locals())
print()
print(globals())
print()
a+=b+c
print("Before the breakpoint", locals())
@kousu
kousu / README.md
Last active April 14, 2024 00:55
Using jose-util with ed25519 (aka EdDSA), PEM-formatted, keys

Using jose-util with ed25519 (aka EdDSA), PEM-formatted, keys

Using go-jose takes a bit of a knack. And it turns out there's a snag if you want to use the latest and greatest crypto.

I installed jose-util from the latest git version:

$ pwd
/Users/kousu/src/go-jose
anaesthetic-mac:go-jose kousu$ git log HEAD~1..HEAD
@kousu
kousu / README.md
Created May 4, 2019 01:35
Bridging WhatsApp to XMPP
@kousu
kousu / base64.js
Last active March 31, 2019 03:46
nu-book's zxing demo, updated to use a webcam
// https://gist.github.com/jonleighton/958841
// bytes: Uint8Array
function uint8ArrayToBase64(bytes) {
var base64 = ''
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
var byteLength = bytes.byteLength
var byteRemainder = byteLength % 3
var mainLength = byteLength - byteRemainder
var a, b, c, d
var chunk