Skip to content

Instantly share code, notes, and snippets.

View atopuzov's full-sized avatar
😎
Haskell, nix, functional programming

Aleksandar Topuzović atopuzov

😎
Haskell, nix, functional programming
View GitHub Profile
@atopuzov
atopuzov / covid19booster.healthservice.ie
Created January 6, 2022 14:11
DIG covid19booster.healthservice.ie
$ dig @89.101.160.4 covid19booster.healthservice.ie
; <<>> DiG 9.10.6 <<>> @89.101.160.4 covid19booster.healthservice.ie
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 38445
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
@atopuzov
atopuzov / r.hs
Last active June 28, 2019 06:41
{-# LANGUAGE DeriveFunctor #-}
newtype Fix f = Fix { unFix :: f (Fix f)}
data IntListF a =
Cons Int a
| Nil
deriving Functor
type IntList = Fix IntListF
@atopuzov
atopuzov / build-coreboot-for-chromebook-c201.md
Created May 14, 2019 15:29 — forked from markwylde/build-coreboot-for-chromebook-c201.md
Build Coreboot for ARM Chromebook - C201 Veyron Speedy

These instructions will take you through the step by step process of building and flashing a custom build of the Coreboot ROM to a Chromebook C201.

This guide expects you to have a Chromebook C201, and another ARM computer with Ubuntu installed. Specifically I used the Odroid XU2. You may be able to do this on an Intel platform, using a cross compiler. See the sidenotes section for more information.

Setting up your Ubuntu

Install dependancies

Update your Ubuntu aptitude and install the dependancies we will need.

sudo apt update
{-# LANGUAGE FlexibleContexts #-}
import Control.Monad.Writer (MonadWriter, Writer, tell, runWriter, runWriterT)
import Data.Functor.Identity (Identity, runIdentity)
import Data.Monoid (mempty)
-- manual threading of log
logSum :: [(Int, Int)] -> Int -> Int -> (Int, [(Int, Int)])
logSum log x y = (result, newlog)
where
{-# LANGUAGE FlexibleContexts #-}
-- FelixbleContexts required for MonadState
import Control.Monad.State (MonadState, State, get, put, runStateT, evalStateT, execStateT)
import Data.Functor.Identity (Identity, runIdentity)
-- Threading the state trough functions and returning vale and state product
inc1 :: Int -> (Int, Int)
inc1 state = (value, newState)
where
{-# LANGUAGE FlexibleContexts #-}
-- FelixbleContexts required for MonadReader, MonadIO
-- Based on https://hackernoon.com/the-reader-monad-part-1-1e4d947983a8
import Control.Monad.Reader (MonadReader, ReaderT, ask, runReaderT)
import Control.Monad.IO.Class (MonadIO, liftIO)
-- Need 2 files in the current directory
-- test.txt (read by the load function)
-- history5.txt (read by the loadRevsion function)
{-# LANGUAGE FlexibleContexts #-}
-- FelixbleContexts required for MonadReader
-- Based on https://blog.ssanj.net/posts/2014-09-23-A-Simple-Reader-Monad-Example.html
import Control.Monad.Reader (ask, runReader, MonadReader, Reader)
import Control.Applicative ((<*>))
import Control.Monad ((>>=))
-- Environment type
type MyEnv = String
--- before.yaml^I2017-09-29 11:44:09.000000000 +0100$
+++ now.yaml^I2017-09-29 12:18:11.000000000 +0100$
@@ -13,7 +13,7 @@$
data:$
kube-api.rules: |-$
# NOTE: These rules were kindly contributed by the SoundCloud engineering team.$
-$
+ $
ALERT K8SApiServerLatency$
IF histogram_quantile($
export ARCH=arm
export CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi-
export KERNEL_SERIES=v4.13
export KERNEL_BRANCH=v4.13-rc1
export LOCALVERSION=
export MALI_VERSION=r19p0-01rel0
export MALI_BASE_URL=https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-midgard-gpu
export DTB_FILES="
Starting Google_Veyron_Speedy firmware updater v5 (recovery)... 
 - Updater package: [Google_Veyron_Speedy.6588.197.0 / EC:speedy_v1.1.2712-242f6bd] 
 - Current system:  [RO:libreboot-r20160907 , ACT:libreboot-r20160907 / EC:speedy_v1.1.2697-faafaa5] 
 - Write protection: Hardware: off, Software: Main=ON EC=ON 
 
  Sorry, this firmware update is only for Google_Veyron_Speedy platform. 
  Your system (libreboot-r20160907) is either incompatible or using an 
 unknown version of firmware.