Skip to content

Instantly share code, notes, and snippets.

@jcaesar
jcaesar / trace.py
Last active April 7, 2022 08:22
Snippet to paste before your python code to get a call graph
# Place at the head of your main file
import sys
import atexit
def function_identifier(frame):
code = frame.f_code
name = code.co_name
file = code.co_filename
return "{}:{}".format(file, name)
@jcaesar
jcaesar / .gitignore
Last active October 6, 2022 13:35
By the grace of Lord dtolnay
/target
@jcaesar
jcaesar / .SRCINFO
Last active March 11, 2023 13:50
prometheus-node-exporter-rapl-cfg
pkgbase = prometheus-node-exporter-rapl-cfg
pkgdesc = powercap group and read access for intel_rapl_common /sys files
pkgver = 0.1.0
pkgrel = 1
arch = any
license = Apache
makedepends = rust
source = modules-load.d
source = prometheus-node-exporter.d
source = sysusers
/target
/Cargo.lock
@jcaesar
jcaesar / .gitignore
Last active December 3, 2023 11:33
a
result
*.bsp
@jcaesar
jcaesar / .envrc
Last active February 17, 2024 06:47
rust-nix-musl-dyn
use flake
@jcaesar
jcaesar / .gitignore
Last active November 29, 2024 14:42
cjdns node daisychain
*
!flake.nix
!flake.lock
@jcaesar
jcaesar / apply.nu
Created December 12, 2024 13:14
copy flake and apply
#!/usr/bin/env nu
def main [target: string] {
cd $env.FILE_PWD
let flakemeta = nix flake metadata --json | from json
let flakepath = $"path:($flakemeta.path)?($flakemeta.locked | select -i lastModified narHash rev revCount | url build-query)"
let sshopts = [-q -oCompression=yes -oControlMaster=auto -oControlPath=/tmp/ssh-check-nix-build-%C -oControlPersist=60]
$env.NIX_SSHOPTS = $sshopts | str join " "
nix copy --to ssh://($target) $flakemeta.path