Posts

Wireguard VPN Notes

Notes on how to put multiple peers in the same virtual private network with Wireguard on Linux. Install the Wireguard tools, including wg-quick and probably some service definitions for it for the computer's service supervision suite. Its configuration seems to lie in /etc/wireguard/wg0.conf by default. That folder should exist with appropriate permissions, but the file probably won't. If running wg-quick manually, the wg0 portion must be specified explicitly anyway, so it could be different. When needed, generate private keys with $ wg genkey pre-shared keys with $ wg genpsk and public keys from private keys with $ wg pubkey <the private key> ^D (CTRL+D) or something like $ echo <the private key> | wg pubkey but only on a trusted machine, and it's still best to make sure it stays out of the command history, e.g.: $ HISTCONTROL=ignorespace $ <some whitespace> echo <the private key> | wg pubkey Being careless with public keys is mostly fine, but pr

Trying to Make Sense of Monads

I'm not really a functional programming person, so when I read that "For a monad m , a value of type m a represents having access to a value of type a within the context of the monad." (C. A. McCann) as on the Wikipedia page, I can confidently say that I understood what a monad was exactly as much before and after that explanation. The only thing this led me to conclude was that a monad must be some really simple thing if so many of the explanations I've found of it are barely a step beyond "it is what it is". After digging around, though, I think I've made some sense of things. In order to compute some output (a result ), we need some input ( arguments or a state ) and some algorithm to feed those inputs through (a function ). So, we have something like      algorithm: input -> output or     function: state -> result Easy enough, right? However, we usually think of the function as something permanent, something that might get put into a libr

Annoying Things about Python

There's a lot of commentary out there on whether Python is good or bad and what's good and bad about it and so on. The thing is, when you want to grab data from some hardware that was never meant for what you're using it for, do some on-the-fly DSP you've just made up in the last few days on it, shoot it across a network, save it, and then analyze it properly later, you're pretty much out of luck with anything else. That is, R and Julia (and Matlab, Octave and a few others, I guess, but I try never to touch them) are great for the analysis part, and you can tie them in with C (or anything that'll produce C bindings) and Python code, but every language has its quirks, and having to think about two or three languages at once is far too distracting when the work you're trying to do is fundamentally challenging. Python will kind of work for all this stuff and has worked well enough for a long time, so there's a lot of good software out there to help. How goo