Skip to content

Instantly share code, notes, and snippets.


Travis A. Everett abathur

View GitHub Profile
View resholved_shunit2.diff
--- /nix/store/1nqnzfqzxsxrwafksffj78w48jc1iah8-shunit2-2.1.8/bin/shunit2 1969-12-31 18:00:01.000000000 -0600
+++ /nix/store/zh0ac2n6wyff2kpxc32wai8szhj4mk8z-resholved-shunit2-2.1.8/bin/shunit2 1969-12-31 18:00:01.000000000 -0600
@@ -29,15 +29,15 @@
# Logging functions.
_shunit_warn() {
+ echo -e \
"${__shunit_ansi_yellow}shunit2:WARN${__shunit_ansi_none} $*" >&2
View 0_j2cli_layout
dr-xr-xr-x - abathur 31 Dec 1969 /nix/store/p0876isrv4gi1pbfkc6bms737grzwjlj-python3.8-j2cli-0.3.10
dr-xr-xr-x - abathur 31 Dec 1969 ├── bin
.r-xr-xr-x 964 abathur 31 Dec 1969 │ ├── .j2-wrapped
.r-xr-xr-x 371 abathur 31 Dec 1969 │ └── j2
dr-xr-xr-x - abathur 31 Dec 1969 ├── lib
dr-xr-xr-x - abathur 31 Dec 1969 │ └── python3.8
dr-xr-xr-x - abathur 31 Dec 1969 │ └── site-packages
dr-xr-xr-x - abathur 31 Dec 1969 │ ├── j2cli
.r--r--r-- 261 abathur 31 Dec 1969 │ │ ├──
dr-xr-xr-x - abathur 31 Dec 1969 │ │ ├── __pycache__
View djvu2pdf
# (c) Christoph Sieghart <> 2007 - 2011
# Flags for commandline options
trap 'if [ $S_FLAG -eq 1 ]; then clean_temp_dir; clean_cursor; fi' 0 1 2
View pdf2odt
# Usage: pdf2{odt,ods} [ options ] input.{jpg,pdf,png} ... output.{odt,ods}
# This script converts one or more PDF, JPG, or PNG files to an ODT or ODS
# file. The contents of any PDF file(s) is first converted to a set of image
# files. These files are then inserted as background images in the ODT or
# ODS file.
# Copyright (c) 2011 Markus Gutschke. All rights reserved.
abathur /
Last active June 20, 2021 19:36
braindumping ideas about different kinds of discovery in the Nix ecosystem

I've had a few different ideas kicking around that boil down to finding one or more places/formats for documenting parts of the known nixiverse (at least nix + nixpkgs + ecosystem/toolchain projects).

(each of these would need software and interested parties/personalities to drive them...)

A massive living differential-diagnosis-style flowchart of the ecosystem

  • Basically, everything official is fair game: concepts, official commands, config, modules, packages, error messages, best practices, and many third-party projects/resources (but I guess curation should be empowered to filter out self-promo/obsolete stuff).
  • Most importantly, the thing that drives linking those resources into the flowchart should be linking them to plausible questions/decisions.
  • Very specific details should probably be version-tagged?
  • When people ask novel questions, those questions/answers should go into the map.
  • Longer-term aspirations are things like:
abathur /
Created June 20, 2021 18:37
braindump nix-ecosystem idea (I've had my head in the sand--maybe flakes break off part of this problem?)

There's a gap between what we can do well within Nix builds and other stateful ~project-management tasks that people need to do if Nix is a critical part of their project.

Because Nix doesn't cover these cases gracefully/fluently, there's an awkward liminal zone on the project where even though they've bothered nailing down all of their preconditions for the .nix builds, they still have things like Makefiles that use dependencies they need to provide. So they're either weirdly invoking make inside a Nix shell, or they're using invoking nix-shell/run a dozen times inside the Makefile.

So I wondered if there's good case for like a nix-make/nix make core command/util that interprets a nix-shell or nix-shell-esque shebang specifying the Makefile's dependencies and supplies them before invoking gnumake/bin/make.

abathur /
Last active June 14, 2022 13:44
some sort of hierarchical shell-esque language?

I'm just ~braindumping something to (hopefully) get it out of my head.

status quo

Part of what I like about shell is how squishy/pliable the language is. For a while I've had the nagging sense that it is really close to being an interesting format for a lot of different kinds of plain-text ~DSLs...

  • go to the store later is a perfectly-good shell invocation. If you wanted some little task/TODO DSL, you could dive right in by writing
abathur /
Last active January 10, 2022 22:21
Confirming how portable this diff invocation is/isn't on any OS you can/want to install Nix on that isn't already in reports! This tries each diff on PATH, but I'm interested in default and common user-installed diffs (leave out any uncommon build you have). See 1st comment for a screenshot of expected output.
#!/usr/bin/env bash
readonly ESC='\033[0m'
readonly GREEN='\033[32m'
readonly RED='\033[31m'
printf -v _UNCHANGED_GRP_FMT "%b" $'\033[2m%='"$ESC" # "dim"
# bold+invert+red and bold+invert+green just for the +/- below
# red/green foreground for rest of the line
printf -v _OLD_LINE_FMT "%b" $'\033[1;7;31m-'"$ESC ${RED}%L${ESC}"
abathur /
Last active June 26, 2020 23:03
refactoring to fix aliases finally bearing fruit...
# don't try to run me; I'll probably crash or hang or something
# I'm just a succinct test for complex resolution logic...
alias ls="ls -l" # the function
alias stat="stat -f" # external!
function ls(){
ls -a # the alias :P
ls # I'm the alias
abathur / test
Last active June 2, 2020 19:52
Test procedure for exploring impact of Catalina's networked executable assessments on Nix build times.
View test


In Catalina, it appears that there's a networked assessment of new executables (including scripts). Nix is constantly generating new executables during a build, so I'm trying to get a bead on how stable/variable this effect is. (AFAIK, it's only meaningful to test this on single-user installs. We have yet to identify any way to successfully exempt builds under multi-user/daemon installs.)


Open 2 terminal tabs/windows and set up the first to monitor the relevant logs by running:

log stream --debug --info --predicate 'process == "syspolicyd" AND subsystem == "" AND category == "gk"'