Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
test_args=(
# 1-5: Standard system/portage strings
"sys-apps/gentoo-functions"
"--verbose"
"USE=unicode"
"CHOST=x86_64-pc-linux-gnu"
"FEATURES=sandbox"
#!/bin/bash
# Generated using Google AI
# Configuration
chunks=5000
test_args=(
# 1-5: Standard system/portage strings
"sys-apps/gentoo-functions"
"--verbose"
#!/bin/bash
# Generated using Google AI
# Configuration
chunks=10000 # Number of iterations
chunk_size=15 # Average number of arguments per command
test_string="0123456789abcdef"
# Global tracking variables for results
#!/bin/bash
# Based on parona's generate-cache.sh <https://gitlab.com/Parona/parona-scripts/-/blob/master/portage-hooks/repo.postsync.d/generate-cache.sh>
set +o posix || exit
GENFUN_MODULES="rc portage"
source /lib/gentoo/functions.sh -- || exit
hash git sudo >/dev/null || exit
function git.is_git_repo {
#!/bin/bash
# Selects Ruby interpreter based on the name of the called symbolic link linked to it.
# This script was composed with significant help from Google AI.
cmd=${0##*/}
if [[ ${cmd} =~ ^([a-zA-Z_-]+)([0-9][0-9])$ ]]; then
base_cmd="${BASH_REMATCH[1]}"
ruby_ver="${BASH_REMATCH[2]}"
function get_command_string {
local string= q
for __; do
printf -v q %q "$__"
if [[ $q == "$__" ]]; then
string+=" $__"
elif [[ $__ == *\'* ]]; then
string+=" $q"
#!/usr/bin/env ruby
# Copyright (c) 2025 konsolebox
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
/* Runs command while optionally redirecting stdout,
* stderr and stdin to a file prior and not
* making any changes to the environment.
*
* Author: Grok
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
inherit toolchain-funcs
tc-get-resource-dir() {
local compiler_type=$(tc-get-compiler-type)
case ${compiler_type} in
gcc)
$(tc-getCC) -print-search-dirs | \
awk '/^install: / { print $2; r = 1 } END { exit !r }' || die
;;