Skip to content

Instantly share code, notes, and snippets.

@kgadek
kgadek / note.md
Last active July 24, 2022 10:57
Debian on ZFS root on Raspberry Pi 4

Note

I'm no longer be maintaining this, as I'm no longer using Raspberry Pi 4 + ZFS.

My case was:

  • Raspberry Pi 4 8GB
  • Debian 11 Bullseye
  • native ZFS encryption
@kgadek
kgadek / zdb.sh-session
Last active February 5, 2021 01:31
ZoL RPi4 debugging
root@spongebob:~# zdb -l /dev/mmcblk1
failed to unpack label 0
failed to unpack label 1
------------------------------------
LABEL 2
------------------------------------
version: 5000
name: 'rpool'
state: 1
txg: 78726
@kgadek
kgadek / boot0.sh
Last active December 14, 2020 16:14
#!/usr/bin/env sh
# vim: foldmethod=marker
# ------------------------------------------------------------------------------
# Run in cloud-init.
# ------------------------------------------------------------------------------
# {{{ Configuration
: "${user:=konrad}"
# }}}---------------------------------------------------------------------------
#{{{ users: add $user
@kgadek
kgadek / bumpme
Last active January 16, 2019 16:31
Wed Jan 16 16:30:53 UTC 2019
@kgadek
kgadek / core.hs
Last active February 21, 2017 16:41
stuff :: Maybe Int
stuff = return (456 :: Int)
main :: IO ()
main = do
let Just x = stuff
print x
-- stack --resolver nightly-2017-02-08 ghc --package hashtables -- -O2 harrop_ghc.hs
import Control.Monad
import qualified Data.HashTable.IO as H
type HashTable k v = H.BasicHashTable k v
main = do
m <- H.new :: IO (HashTable Int Int)
forM_ [1..10000000] $ \n -> H.insert m n n
v <- H.lookup m 100
runWithMock :: MockDirectoryTree -> FSops r -> [String]
runWithMock mockTree = cata eval
where
eval :: TF.FreeF FSopsF r [String] -> [String]
eval (TF.Free x@ListDir{}) = msg : cont
where
msg = printf "LISTDIR: %s\n RESULT: %s\n" (x ^. dirName) (show dirListing)
dirListing = DirectoryListing immediateDirs immediateFiles
immediateDirs = mockTree ^.. unFix2 . mDirs . each . rootDirName
immediateFiles = mockTree ^. unFix2 . mFiles
@kgadek
kgadek / imad.sh
Last active December 15, 2016 13:45
# Przygotowanie
xcode-select --install # akceptacja licencji Xcode
curl -sSL https://get.haskellstack.org/ | sh # alternatywnie: brew install haskell-stack
git clone https://github.com/kgadek/novelist.git
cd novelist
stack setup # instalacja kompilatora lokalnie, w ~/.stack
stack build --bench --no-run-benchmarks # kompilacja programu
# Uruchamianie testów
stack bench
@kgadek
kgadek / 0_reuse_code.js
Created November 21, 2016 15:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kgadek
kgadek / anaconda-ks.cfg
Last active May 28, 2016 16:11
Simple kickstart for VMs (insecure as hell)
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="http://mirror.onet.pl/pub/mirrors/centos/7/os/x86_64"
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda