Skip to content

Instantly share code, notes, and snippets.

View patrl's full-sized avatar

Patrick Elliott patrl

View GitHub Profile
@schar
schar / Heim.hs
Last active April 9, 2018 11:03
Heim (1983) monadically
import Control.Applicative
import Control.Monad
import Data.List
data Atom = P | Q | R | Top
deriving (Show, Eq, Enum)
type W = [Atom]
type C = [W]
type Upd m = m C -> m C
use glium::{self, Surface};
use glium::backend::Context;
use glium::index::PrimitiveType;
use glium::texture::SrgbTexture2dArray;
use std::cell::{RefCell, RefMut};
use std::default::Default;
use std::rc::Rc;
use std::ops::Range;
@pkazmierczak
pkazmierczak / aws-openvpn-cf.json
Last active December 15, 2019 20:03
Cloudformation template for creating a simple OpenVPN server
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "OpenVPN server template",
"Mappings": {
"AWSRegion2AMI": {
"ap-northeast-1": {
"AMI": "ami-5ea72b5e"
},
"ap-southeast-1": {
"AMI": "ami-365c5764"
% requires the booktabs package
\newcommand\semtower[2]{% a 2-level semantic tower
\begin{tabular}[c]{@{\,}c@{\,}}
\(#1\)
\\
\midrule
\(#2\)
\\
\end{tabular}
}
@masaeedu
masaeedu / init-haskell.sh
Last active May 20, 2021 15:24
Basic nix haskell setup
#!/usr/bin/env bash
set -Eeuxo pipefail
# Set up git
git init
gitignore haskell
echo '*.cabal' >> .gitignore
# Set up niv
niv init
@gutoandreollo
gutoandreollo / arch_setup.sh
Last active April 6, 2022 18:18
Installing Arch Linux with an encrypted btrfs root, with GPT and UEFI support
# Install arch linux in an encrypted btrfs partition with GPT and UEFI support, gummiboot and hibernate/resume support
# sources:
# http://hole.tuziwo.info/install-arch-linux-on-uefi-gpt-computer-with-btrfs-support.html
# http://www.brunoparmentier.be/blog/how-to-install-arch-linux-on-an-encrypted-btrfs-partition.html
# https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
# Take note of this:
# - The first thing you need is to identify which disk you're going to use. For the purpose of this guide, it will be /dev/sda
# Be VERY CAREFUL if you have more than one disk on your computer, and DOUBLE CAREFUL if one of them is the one with your backups
# - Since btrfs does not support swapfiles (yet), we'll create a swap partition. In this guide, it will NOT be encrypted
@dysinger
dysinger / configuration.nix
Last active December 28, 2022 18:39
Basic Full-Disk Encrypted ZFS Thinkpad (w/ 512 sector SSD) booted from USB key
# Basic Full-Disk Encrypted ZFS Thinkpad (w/ 512 sector SSD) booted from USB key
# EFI/BOOT:
# export BOOT=/dev/disk/by-id/usb-SanDisk_Ultra_Fit_4C530001011030101042-0\:0
# parted --script $BOOT -- \
# mklabel gpt \
# mkpart esp fat32 1MiB 512MiB \
# mkpart primary 512MiB 100% \
# set 1 boot on
# mkfs.vfat -n BOOT $BOOT-part1
{-# language KindSignatures #-}
{-# language PolyKinds #-}
{-# language DataKinds #-}
{-# language TypeFamilies #-}
{-# language RankNTypes #-}
{-# language NoImplicitPrelude #-}
{-# language FlexibleContexts #-}
{-# language MultiParamTypeClasses #-}
{-# language GADTs #-}
{-# language ConstraintKinds #-}
@dysinger
dysinger / nixos-encrypted-zfs.sh
Last active March 7, 2023 14:51
How I installed Encrypted ZFS root on NixOS
# MOVED HERE https://gist.github.com/dysinger/2a768db5b6e3b729ec898d7d4208add3
@radiosilence
radiosilence / gist:3946121
Created October 24, 2012 13:43
Outputs some files that WMs can import and colourify everything with.
import sys
import colorsys
from colorz import colorz
WALLPAPER = '/home/james/.wallpaper'
COLORS = '/home/james/.colors'
XRESOURCES = '/home/james/.Xresources'
cols = ''
xres = """