Skip to content

Instantly share code, notes, and snippets.

View Skyb0rg007's full-sized avatar
๐Ÿ˜€
Nothin' much

Skye Soss Skyb0rg007

๐Ÿ˜€
Nothin' much
View GitHub Profile
# getent initgroups alice
{
virtualisation.cores = 4;
services.userdbd.enable = true;
services.nscd.enable = true;
users.users.alice.isNormalUser = true;
users.groups.extra.gid = 1234;
environment.etc."userdb/alice:extra.membership".text = "";
}
@Skyb0rg007
Skyb0rg007 / README.md
Created August 27, 2026 20:18
SML/NJ ASDL pickling bug

ASDL Bug

To run:

  1. Run ./bin/asdlgen sml test-spec.asdl, where test-spec.asdl is part of the SML/NJ repo (./tools/asdl/src/tests/sharing/test-spec.asdl)
  2. Compile the project with CM.make "sources.cm"
  3. Observe that the round-trip is wrong
/* SPDX-License-Identifier: Apache-2.0
*
* This is the sequence keylime agent performs at startup.
*
* Build:
* cc -o repro esys-load-ek-policy-session.c $(pkg-config --cflags --libs tss2-esys)
* Run:
* TSS2_TCTI=swtpm:host=127.0.0.1,port=2321 ./repro
*/
@Skyb0rg007
Skyb0rg007 / README.md
Created August 7, 2026 02:09
landlock + securebits

Showing how Executability Checks interact with Landlock.

Landlock can prevent a program from executing a file, which can be checked without actually executing anything with execveat(fd, "", NULL, NULL, AT_EXECVE_CHECK | AT_EMPTY_PATH).

So if you want to configure a sandbox where /usr/bin/lua is available, but only globally installed lua modules should be used, you can enforce that by patching lua to perform the execveat() checks before interpreting a file, and then using landlock to block execution of files outside of /usr.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikolay Amiantov <ab@fmap.me>
Date: Tue, 11 Oct 2016 13:12:08 +0300
Subject: [PATCH] Change /usr/share/zoneinfo to /etc/zoneinfo
NixOS uses this path.
Rebased firstboot.c hunk only: upstream renamed symlinkat_atomic_full to
symlinkat_atomic_full_label (extra arg_label_context argument) after the
nixpkgs v261 tag this patch was written against; the other four files'
@Skyb0rg007
Skyb0rg007 / recursion-schemes.sml
Last active July 23, 2025 20:17
smlnj bug 2025-07-23
(** Signatures **)
signature FUNCTOR =
sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
signature RECURSIVE =
@Skyb0rg007
Skyb0rg007 / poly-rec.sml
Last active March 4, 2025 21:23
SML/NJ Compiler Bug
datatype 'a nested =
Nest of 'a * 'a list nested
| Epsilon
fun sumListWith f lst = let
fun go ([], acc) = acc
| go (x :: xs, acc) = go (xs, f x + acc)
in
go (lst, 0)
@Skyb0rg007
Skyb0rg007 / _vimrc
Last active February 10, 2025 22:54
Windows Vim Config
" vim: set ft=vim:
" Directory setup: move everything to $APPDATA\Vim and $LOCALAPPDATA\Vim
set backupdir=$LOCALAPPDATA\Vim\backup
set directory=$LOCALAPPDATA\Vim\swap
set undodir=$LOCALAPPDATA\Vim\undo
set viewdir=$LOCALAPPDATA\Vim\view
set viminfofile=$LOCALAPPDATA\Vim\viminfo
set packpath=$APPDATA\Vim,$VIM\vimfiles,$VIMRUNTIME
let g:netrw_home=expand("$LOCALAPPDATA\\Vim")
@Skyb0rg007
Skyb0rg007 / eff-test.hs
Created January 28, 2025 19:28
Different behavior of higher-order effects libraries
#!/usr/bin/env stack
{-
stack script
--resolver lts-22.14
--package freer-simple
--package fused-effects
--package hspec
--package list-t
--package mtl
--package polysemy
{
stdenv,
fetchurl,
lib,
...
}: let
arch = "64";
version = "110.99.6";
baseurl = "http://smlnj.cs.uchicago.edu/dist/working/${version}";
sources = map fetchurl [