Skip to content

Instantly share code, notes, and snippets.

View Sherex's full-sized avatar
:octocat:

Ingar Helgesen Sherex

:octocat:
View GitHub Profile
@Sherex
Sherex / README.md
Created December 11, 2025 22:50
A script to parse the build output from nix build and determine which DRVs were built successfully.

Nix Build Log Parser

The script parses Nix build logs to identify successfully completed derivations (skipping failed ones) and writes them to an output file. It tracks which derivations are expected to be built and correlates build start/end events to determine which ones completed successfully.

  1. Read all input files and process their lines
  2. Create a Set to store derivations that will be built (from the "these N derivations will be built" section)
  3. Track the currently building derivation in currentBuilding
  4. For each line:
@Sherex
Sherex / README.md
Last active April 22, 2025 20:04
A script to delete files and directories from archives specified with a glob pattern

Borg Delete Paths

A simple utility to delete paths from archives to save space in Borg repositories.

Warning

While I have used it a few times on one of my repositories it still should be considered untested. There is NO guarantee that it's bug-free and should be treated like that. Be careful, take measures, keep multiple backups.

I managed to backup several hundred GBs of podman layers over months... (I should monitor my backups more closely..) So I needed a tool to delete the whole podman directory from my archives, while also ensuring I deleted only the files I expected to be deleted.

@Sherex
Sherex / Generic-snake_case-to-camelCase.ts
Last active December 19, 2021 14:22
A Typescript generic that converts properties (or just a string) from snake_case to camelCase
type SnakeToCamel<S extends string> =
S extends `${infer T}_${infer U}`
? `${T}${Capitalize<SnakeToCamel<U>>}`
: S
type ObjectSnakeToCamel<Type> = {
[Property in keyof Type as Property extends string ? SnakeToCamel<Property> : Property]: Type[Property]
}
const snakeObject = {
@Sherex
Sherex / README.md
Last active February 18, 2025 22:34
A script for the Wireguard config options PostUp/PostDown entries. It will allow peers to connect to the Wireguard interface and do IP forwarding (port forwarding will be added later)

IfScript

Hi, I made this for my use-case, but feel free to use it :)
This is currently only handling the NAT side of things, not PAT!
The from-to port options is just a placeholder it will use the first port specified.

route_port 80 80 tcp $vpn_ip $server_ip

How to use?

Download and make executable

@Sherex
Sherex / wikijs-keycloak-config-guide.md
Last active June 20, 2025 01:33
A guide for configuring Keycloak as a authentication provider in WikiJS | https://wiki.js.org | Feature request for adding this to the docs: https://requarks.canny.io/wiki/p/keycloak-auth-docs-proposal-for-a-guide-written
#!/bin/bash
# This was created to be used as a service overview in the motd on a Debian system.
# But use it as you like.
# Add service names in this array
services=( "videoserver" "hostapd" "isc-dhcp-server" )
echo " "
echo "SERVICES"