Skip to content

Instantly share code, notes, and snippets.

View kousu's full-sized avatar

Nick Guenther kousu

  • Asymmetric Research
  • Canada
View GitHub Profile

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

@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 / nc-chdir.py
Created April 24, 2023 22:14
Prototype a workaround for unix domain socket length limit of 107.
#!/usr/bin/env python
# this is a tiny little clone of `nc -U -l path`
# but it creates the socket *after chdir()ing in a subprocess* to avoid ENAMETOOLONG:
#
# To test the difference, get openbsd-netcat and run:
#
# mkdir -p /tmp/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz
# nc -v -U -l /tmp/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/ipc.sock
#
@kousu
kousu / README.md
Created January 12, 2023 23:50
Bridging Discord + XMPP

Just because the docs on https://github.com/42wim/matterbridge/wiki/ are a little bit obscure in some parts, here's a complete record of what I did:

  1. sudo pacman -S matterbridge
  2. Set up a generic systemd service file:
$ cat /etc/systemd/system/matterbridge\@.service 
[Unit]
Description=%I Chat Bridge
After=network-online.target
@kousu
kousu / .gitignore
Last active October 9, 2022 19:04
nifti demo
node_modules
@kousu
kousu / pip-integrity
Last active September 30, 2022 18:57
The missing `pip integrity` command
#!/usr/bin/env python3
#
# The missing 'pip integrity' command.
#
# This verifies the correctness of an unpacked pip package
# by examining the file hashes in the 'RECORD' file.
# spec at https://peps.python.org/pep-0427/#the-dist-info-directory
import sys
import base64
@kousu
kousu / README.md
Last active November 28, 2021 18:36
Linux du(1) de-duplication bug

I've found a confusing behaviour in Linux's version of du(1). du can take a single folder to recurse into, or list of files/folders either via --files0-from or in argv. But its behaviour is inconsistent if this list contains parents and children.

  1. A child given before its parent makes the parent count as empty
  2. With -s (or equivalently -d 0), a parent given before its child (vice versa) skips the child

OpenBSD's du conversely has consistent behaviour: it always outputs one line (or block of lines, if not given -s) per input, and always counts everything as full-sized, parent and child.

<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.3.0">
<info>
<name>Akai MPK Mini</name>
</info>
<controller id="AkaiMPKMini">
<scriptfiles/>
<controls>
<!-- Master -->
@kousu
kousu / README.md
Created April 11, 2021 18:13
dockerize for travis-ci
@kousu
kousu / README.md
Last active April 8, 2021 22:13
extract functions

Extract an indented block from a file, starting from a given header line.

Usage: extract.awk HEADER file

e.g.

$ ./extract.awk a t
   a() {