Skip to content

Instantly share code, notes, and snippets.

View benley's full-sized avatar
🐈

Benjamin Staffin benley

🐈
View GitHub Profile
@benley
benley / NOTES.md
Last active October 31, 2025 18:34 — forked from mrcjkb/NOTES.md
crowdstrike falcon-sensor on nixos

Notice

(from @mrcjkb)

I am sharing this for educational purposes only.

I DO NOT recommend using crowdstrike falcon-sensor. It is proprietary garbage that has caused overheating issues on two of my NixOS machines. Please do not ask me to help you troubleshoot this or add this to your nixos system.

curl https://updates.cdn-apple.com/2021/macos/031-0627-20210614-90D11F33-1A65-42DD-BBEA-E1D9F43A6B3F/InstallMacOSX.dmg --output ~/Desktop/InstallMacOSX.dmg
@benley
benley / freeipa-server.nix
Created February 7, 2024 18:38 — forked from s1341/freeipa-server.nix
working freeipa config
{
config,
lib,
...
}: let
cfg = config.services.freeipa-server;
in {
options.services.freeipa-server = {
enable = lib.mkEnableOption "freeipa service";
router = lib.mkOption {
(require 's)
(defun count-leading-whitespace (str)
"Count leading indentation chars in STR."
(let ((trimmed (string-trim-left str)))
(- (length str) (length trimmed))))
(defun unindent-string (str)
"Remove common leading whitespace from each line in STR."
(let* ((str-as-lines (s-lines str))
@benley
benley / org-to-gfm.el
Last active May 1, 2019 00:13
org-to-gfm.el
;;; org-to-gfm --- Export a org-mode file to Github-flavored Markdown
;;;
;;; Commentary:
;;; To convert INPUT_FILE.org and produce OUTPUT_FILE.md, run something like:
;;;
;;; emacs -q --no-splash --no-x-resources --batch --script org-to-gfm.el INPUT_FILE.org OUTPUT_FILE.md
;;;
;;; Code:
(unless (require 'use-package nil t) (package-install 'use-package))
#+NAME: diff
#+BEGIN_SRC bash :results verbatim :exports results :wrap example diff
# macro used to generate inline diffs in this document
diff --new-line-format='+%L' \
--old-line-format='-%L' \
--unchanged-line-format=' %L' \
<(echo "$in") <(echo "$out") ;:
#+END_SRC
#+NAME: a
local string = import "string.libsonnet";
local
parseKey(x) = string.strip(
local x_ = std.splitLimit(x, " ", 1);
if std.length(x_) == 1 then x
else x_[std.length(x_) - 1]
),
parseValue(x) = (
@benley
benley / .nixpkgs.json
Created February 11, 2019 23:55
nix monorepo example layout
{ "url": "https://github.com/nixos/nixpkgs/archive/804c227b83faa017c377eb899d18e5931e0ad936.tar.gz" }
From 3f369cf8b9f7134d0792f6b141d39b5342a8274f Mon Sep 17 00:00:00 2001
From: Benjamin Staffin <[email protected]>
Date: Mon, 14 Jan 2019 17:27:06 -0500
Subject: [PATCH] Vastly simplify setup.py for distro compatibility
---
setup.py | 81 +-------------------------------------------------------
1 file changed, 1 insertion(+), 80 deletions(-)
diff --git a/setup.py b/setup.py
local xorshift32(seed) = (
local maxint = (1<<32) - 1;
// seed must be non-zero
local x = if seed == 0 then 4036811160 else seed;
local x1 = x ^ (x << 13);
local x2 = x1 ^ (x1 >> 17);
local x3 = x2 ^ (x2 << 5);
x3 & maxint
);