Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances, AllowAmbiguousTypes, MultiParamTypeClasses, FunctionalDependencies, TypeApplications, GADTs, DataKinds, PolyKinds, ExistentialQuantification, ScopedTypeVariables, RankNTypes #-}
import Data.Monoid hiding (Last)
import Data.Semigroup
newtype EmailAddress = EmailAddress String
data Email = Email
{ typ :: Maybe (Last String)
, value :: Last EmailAddress
@arianvp
arianvp / gist:cd929da9c2d9178d1d078d71db41bbcf
Created October 22, 2019 09:08
Things that scare the fuck out of me RE kubernetes
https://github.com/kubernetes/kubernetes/issues/25379
https://github.com/kubernetes/kubernetes/issues/18982
@arianvp
arianvp / gist:9ceb9e301290907d212c480cccdb7cd0
Created October 19, 2019 16:15
Jotting down notes whilst I learn about jsonnet / nix / dhall pros cons
# Things I miss in dhall. Being able to reference variables against eachother.
E.g. say we have the hypothetical:
```
let galley
= mkWireService {
name = "galley",
port = 8080,
replicas = 3,

Keybase proof

I hereby claim:

  • I am arianvp on github.
  • I am arianvp (https://keybase.io/arianvp) on keybase.
  • I have a public key ASBLRUOk4-J73RrDRCRBQhqXv8yXRZDaaA3735EStddARAo

To claim this, I am signing this object:

@arianvp
arianvp / reproduce.md
Last active September 8, 2019 19:37
Reproduce.md
systemd.services."webserver@".serviceConfig.ExecStart = "${pkgs.python3}/bin/python -m http.server 808%i";

Start them up

$ systemctl start webserver@1 webserver@2 webserver@3

Status fails

let pkgs = import <nixpkgs> {};
in pkgs.stdenv.mkDerivation {
name = "shell-file";
buildInputs = [
pkgs.haskell.compiler.ghc864
pkgs.cabal-install
pkgs.pkg-config
];
nativeBuildInputs = [
pkgs.zlib
@arianvp
arianvp / not mounted correctly
Created August 13, 2019 12:00
/nix/store/dgq799vb7377mlxnm88pmx5nn6yacsa9-mounts.sh
specialMount "devtmpfs" "/dev" "nosuid,strictatime,mode=755,size=5%" "devtmpfs"
specialMount "devpts" "/dev/pts" "nosuid,noexec,mode=620,ptmxmode=0666,gid=3" "devpts"
specialMount "tmpfs" "/dev/shm" "nosuid,nodev,strictatime,mode=1777,size=50%" "tmpfs"
specialMount "proc" "/proc" "nosuid,noexec,nodev" "proc"
specialMount "tmpfs" "/run" "nosuid,nodev,strictatime,mode=755,size=25%" "tmpfs"
{ pkgs_ ? import <nixpkgs> {}}:
let pkgs = pkgs_.pkgsCross.aarch64-android-prebuilt;
in
pkgs.rustPlatform.buildRustPackage {
name = "cryptobox-c";
version = "v1.2.2";
src = pkgs.fetchFromGithub {
onwer = "wireapp";
repo = "cryptobox-c";
rev = "3ec5e68e8d1ac4b1fbc0fc38ab6ddfa99ad802d9";
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
# labels:
# app: nginx
spec:
replicas: 3
# selector:
# matchLabels:
@arianvp
arianvp / systemd.md
Created June 26, 2019 19:37
Systemd for github deployments

Using systemd + journald for GitHub deployments

At https://svsticky.nl/ we heavily make use of Systemd for all kinds of sysadmin tasks. We deploy the website from the https://github.com/svsticky/static-sticky repository, and people working on the website want to know why deployments failed if they do.

On https://github.com/svsticky/static-sticky/deployments you can find a list of deployments that were created for the website. If you click on the deployment, you can find the logs of the deployment. E.g. https://svsticky.nl/logs/acd2a99e348c40c58d6b13e4bd896a7c