Skip to content

Instantly share code, notes, and snippets.

View mitchellwrosen's full-sized avatar

Mitchell Dalvi Rosen mitchellwrosen

View GitHub Profile
@mitchellwrosen
mitchellwrosen / hackage-the-good-parts.md
Last active December 8, 2022 18:51
Hackage: The Good Parts

The Good Parts

ki

Version: 1.0.0.1

unboxed-ref

Version: 0.4.0.0

I recently set up a private Mastodon server for my family. I'm not a sysadmin, nor do I want to become one; I have relatively little experience managing private servers, but I knew going into this that the simplest path would involve some amount of manually `ssh`ing into servers to tweak config files and restart things. My preference, of course, would be to have a declarative, version-controlled description of how I want my Mastodon instance configured, but I'm not sure how to get started there (NixOps? Terraform? Something else?). Anyway, here's what I did.
I started out on the official [Running your own server](https://docs.joinmastodon.org/user/run-your-own/) documentation, which links to a 1-click [Digital Ocean Mastodon Droplet](https://marketplace.digitalocean.com/apps/mastodon). I hadn't heard of Digital Ocean "apps" before, but this option seemed simpler to me than manually setting up a machine with the same suite of software (Mastodon, PostgreSQL, Redis, Sidekiq, Nginx, and maybe a couple others).
@mitchellwrosen
mitchellwrosen / SketchSystems.spec
Last active March 21, 2019 18:39
Disconnected 0
Disconnected 0
request arrives -> Connecting 0
Connecting 0
Connecting-Connecting
connect fails -> Connecting-Connecting
connect times out -> Disconnected 0
connect succeeds -> Connecting-Pinging
Connecting-Pinging
#!/usr/bin/env stack
{- stack script --resolver lts-12.24 --package sdl2 -}
import Control.Concurrent
import SDL
main :: IO ()
main = do
initialize [InitVideo]
window <- createWindow mempty defaultWindow
let
Extension =
https://raw.githubusercontent.com/dhall-lang/dhall-to-cabal/1.3.0.0/dhall/types/Extension.dhall
sha256:a5451bf19663c919ba35df6ca4e9843fabef1867888feda40f13bb627dfa271c
in let
extension =
constructors Extension
in
@mitchellwrosen
mitchellwrosen / .travis.yml
Created May 8, 2018 15:40
Hasktll .travis.yml
sudo: false
language: generic
cache:
directories:
- $HOME/.stack
addons:
apt:
packages:
@mitchellwrosen
mitchellwrosen / clowns-jokers.hs
Created March 14, 2018 00:58
Clowns to the Left of me, Jokers to the Right
-- http://strictlypositive.org/CJ.pdf
{-# language DeriveFunctor #-}
{-# language FlexibleInstances #-}
{-# language FunctionalDependencies #-}
{-# language LambdaCase #-}
{-# language MultiParamTypeClasses #-}
{-# language PatternSynonyms #-}
{-# language ScopedTypeVariables #-}
{-# language TypeOperators #-}
@mitchellwrosen
mitchellwrosen / a-tour-of-go.hs
Created December 10, 2017 00:20
a-tour-of-go.hs
{-# language DeriveAnyClass #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language GADTs #-}
{-# language LambdaCase #-}
{-# language NamedFieldPuns #-}
{-# language RankNTypes #-}
{-# language ScopedTypeVariables #-}
{-# language TupleSections #-}
{-# language TypeApplications #-}

Remote terminal sharing

Some quick notes to document this somewhat tedious process.

To broadcast my terminal to the world:

1. TLS cert

If necessary, generate a self-signed TLS cert for gotty.

@mitchellwrosen
mitchellwrosen / invoker.hs
Last active September 22, 2017 22:11
A simple Invoker practice terminal app using reactive-banana
#!/usr/bin/env stack
{- stack --resolver lts-9.5 runghc
--package clock
--package fgl
--package random
--package reactive-banana
--package vty
-}
{-# language LambdaCase #-}