Skip to content

Instantly share code, notes, and snippets.

1. Install displaylink driver: http://www.displaylink.com/downloads/ubuntu
(Install might keep on running without finishing. I guess this is because the kernel module is unable to load.
I killed the process after a while)
2. Sign the binary with kmodsign
`sudo kmodsign sha512 /var/lib/shim-signed/mok/MOK.priv /var/lib/shim-signed/mok/MOK.der /lib/modules/4.15.0-22-generic/updates/dkms/evdi.ko`
3. Make sure the `.der` key is valid (should be availble in `mokutil --list-enrolled`)
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Eff.Random (RANDOM, random)
main :: forall e. Eff (random :: RANDOM, console :: CONSOLE | e) Unit
main =
_main r l
@sgillis
sgillis / Component.elm
Last active June 2, 2016 12:46
Elm message
module Component exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Message
type alias Model =
{}
@sgillis
sgillis / Sierpinski.hs
Created December 31, 2014 13:48
Sierpinski's Gasket
module Sierpinski where
import Data.List
sierpinski :: Integral a => a -> String
sierpinski = intercalate "\n" . listSierpinski
listSierpinski :: Integral a => a -> [String]
@sgillis
sgillis / WeightLeftistHeap.hs
Last active August 29, 2015 14:12
Weight biased leftist heap
module WeightLeftistHeap (WeightLeftistHeap, fromList) where
import Heap
import Data.Monoid
import Data.Foldable
data WeightLeftistHeap a = E | T a (WeightLeftistHeap a) (WeightLeftistHeap a)
deriving Show
instance Heap WeightLeftistHeap where
@sgillis
sgillis / cvimrc
Created October 15, 2014 08:02
cvimrc
let blacklists = ["https://mail.google.com/*"]
@sgillis
sgillis / confmat.hs
Last active August 29, 2015 14:01
Process a confusion matrix in Haskell
import Data.Char (isSpace)
import Data.List.Split (splitOn)
-- Trim the right side of the string from extraneous whitespace (\r)
trim :: String -> String
trim str | all isSpace str = ""
trim (c:cs) = c : trim cs
-- Process a single row of the matrix.
rowToString :: String -> [String] -> [Int] -> [String]