Skip to content

Instantly share code, notes, and snippets.

View gabyx's full-sized avatar
👌
More Single Layer of Abstraction please ...

Gabriel Nützi gabyx

👌
More Single Layer of Abstraction please ...
View GitHub Profile
@gabyx
gabyx / analyze-binary.sh
Created April 22, 2025 06:59
Check Nix paths in executable
#!/usr/bin/env bash
set -eu
binary="$1"
with_strings="${2:-}"
strings=$(strings "$binary")
linking=$(ldd "$binary")
rpaths=$(readelf -d "$binary")
@gabyx
gabyx / flake.lock (before)
Last active March 27, 2025 16:24
flake.nix (before)
{
"nodes": {
"cachix": {
"inputs": {
"devenv": [
"devenv"
],
"flake-compat": [
"devenv"
],
/**
* rofi -dump-theme output.
* Rofi version: 1.7.5
**/
* {
alternate-urgent-background: var(lightbg);
alternate-active-foreground: var(blue);
selected-active-background: var(blue);
selected-urgent-foreground: var(background);
fg2: rgba ( 150, 150, 150, 100 % );
configuration {
/* modes: "window,drun,run,ssh";*/
/* font: "mono 12";*/
/* location: 0;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
/* show-icons: false;*/
/* terminal: "rofi-sensible-terminal";*/
/* ssh-client: "ssh";*/
#!/usr/bin/env python3
# based on https://github.com/newren/git-filter-repo/blob/main/contrib/filter-repo-demos/insert-beginning
"""
This is a simple program that will insert some regular file into the root
commit(s) of history, e.g. adding a file named LICENSE or COPYING to the
first commit. It also rewrites commit hashes in commit messages to update
them based on these changes.
"""
import argparse
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import tempfile
import operator
from functools import partial, reduce
import subprocess
from tqdm import tqdm
#!/bin/bash
# shellcheck disable=SC2015
repoDir="$1"
example="$2"
function die() {
echo -e "$@" >&2
exit 1
}
@gabyx
gabyx / testGitExamples.sh
Last active June 4, 2020 13:55
testGitExamples.sh
#!/bin/bash
# shellcheck disable=SC2015
repoDir="$1"
example="$2"
function die() {
echo -e "$@" >&2
exit 1
}
@gabyx
gabyx / installVirtualMachine.sh
Last active July 13, 2023 00:58
Unattended installation of any virtual machine with Virtual Box 6
#!/bin/bash
#
# Unattendet installation of any virtual machine with
# Virtual Box 6.
# The script walks you through the needed options with
# default values.
#
# Usage:
# `installVirtualMachine.sh --force-delete \
# --post-script-url "https://server.com/script.sh"`
@gabyx
gabyx / StringConversion.cpp
Created February 8, 2018 22:19
Fast String Conversion
#include <iostream>
#include <type_traits>
#include <iomanip>
#define white_space(c) ((c) == ' ' || (c) == '\t')
#define valid_digit(c) ((c) >= '0' && (c) <= '9')
namespace StringConversion
{
namespace detail