Skip to content

Instantly share code, notes, and snippets.

View michaelbeaumont's full-sized avatar

Mike Beaumont michaelbeaumont

View GitHub Profile
@michaelbeaumont
michaelbeaumont / mkosi.build.chroot
Last active May 24, 2024 13:25
Using mkosi and AUR to install packages
#!/usr/bin/env bash
set -ex
PACKAGES=(
neovim-git
)
# All this is basically to get around makepkg calling pacman with sudo
# Otherwise we could just call `aur sync` and be done with it
@michaelbeaumont
michaelbeaumont / service-as-tailscale-node-docker-compose.yaml
Last active July 3, 2023 13:59
Single service tailscale node with docker compose
version: "3.8"
services:
# all services share a networking namespace
tailscale:
restart: always
# machine name
hostname: passwords
cap_add:
- net_admin
image: tailscale/tailscale:latest
use std::io;
use std::net;
use native_tls::TlsConnector;
use futures::{Future, sink, Sink};
use futures::future::ok;
use tokio_core::io::{Io, Framed};
use tokio_core::reactor::Handle;
use tokio_core::net::TcpStream;
use tokio_proto::BindClient;
@michaelbeaumont
michaelbeaumont / AVLTree.hs
Last active August 29, 2015 14:11
Liquid AVL
{- Example of AVL trees by michaelbeaumont -}
{-@ LIQUID "--totality" @-}
module AVL (Tree, singleton, insert) where
-- Basic functions
{-@ data Tree [ht] a = Nil | Tree (x::a) (l::Tree a) (r::Tree a) @-}
data Tree a = Nil | Tree a (Tree a) (Tree a) deriving Show
{-@ measure ht @-}