-
On WSL2, install the Debian distribution from the microsoft store, then open
wsl.exe
in a terminal. I recommand using the Microsoft Terminal (this feels weird to say, since I'm more a linux user than a windows user, but when you NEED to use windows....)It should open the Debian distrib, with a small bootstrapping script to create a user.
-
Now update the apt package repositories with
sudo apt update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
readlinkWithPrint() { | |
link=$(readlink "$1") | |
p=$link | |
[ -n "${p##/*}" ] && p=$(dirname "$1")/$link | |
echo "$p" | |
[ -h "$p" ] && readlinkWithPrint "$p" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
minimod: A stripped down module system | |
TODO Comparison: | |
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings | |
- [ ] Write the benchmark for the module system | |
- [ ] Write the benchmark for POP? | |
- [ ] Qualitative comparison of extensibility in the context of composable | |
Nixpkgs packaging logic | |
TODO Fine-tuning: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, crystal, nix-prefetch-git, makeStaticLibraries, stdenv, glibc, pcre | |
, libyaml, boehmgc, libevent }: | |
let | |
staticStdenv = makeStaticLibraries stdenv; | |
staticGlibc = glibc.static; | |
staticPcre = pcre.override { stdenv = staticStdenv; }; | |
staticLibyaml = libyaml.override { stdenv = staticStdenv; }; | |
staticBoehmgc = | |
boehmgc.override { stdenv = staticStdenv // { isLinux = false; }; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Installs NixOS on an OVH server, wiping the server. | |
# | |
# This is for a specific server configuration; adjust where needed. | |
# Originally written for an OVH STOR-1 server. | |
# | |
# Prerequisites: | |
# * Create a LUKS key file at /root/benacofs-luks-key | |
# e.g. by copying it up. |
The CAPS
key can be mapped to an escape key when pressed once, and a super
(mod4) key when used in combination with other keys.
Create the file /usr/share/X11/xkb/symbols/custom_opts
with the following:
// Make Caps an additional Escape
hidden partial modifier_keys
xkb_symbols "super_esc" {
key { [ Escape ] };
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols | |
# wayland-scanner is a tool which generates C headers and rigging for Wayland | |
# protocols, which are specified in XML. wlroots requires you to rig these up | |
# to your build system yourself and provide them in the include path. | |
xdg-shell-protocol.h: | |
wayland-scanner server-header \ | |
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ | |
xdg-shell-protocol.c: xdg-shell-protocol.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless ARGV.size > 0 | |
puts " Missing executable file argument" | |
puts " Usage (in a Dockerfile)" | |
puts " RUN crystal run ./path/to/list-deps.cr -- ./bin/executable" | |
exit 1 | |
end | |
executable = File.expand_path(ARGV[0]) | |
unless File.exists?(executable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "../crystal/**" | |
require "../onyx/**" | |
macro dump_prop(name) | |
io << "\n" << " " * (depth+1) << {{name.stringify}}[1..-1].cyan << ": " | |
case (v = {{name}}) | |
when Nil then io << "nil" | |
else v.dump_inspect(io, terse_output, depth + 1) |
NewerOlder