Skip to content

Instantly share code, notes, and snippets.

View aakropotkin's full-sized avatar

Alex Ameen aakropotkin

View GitHub Profile
@aakropotkin
aakropotkin / TEMPLATE.sh
Created May 1, 2023 16:54
A starter bash script. Just change `FILE` and fill in the rest
#! /usr/bin/env bash
# ============================================================================ #
#
#
#
# ---------------------------------------------------------------------------- #
set -eu;
set -o pipefail;
@aakropotkin
aakropotkin / flox.yml
Last active April 13, 2023 20:31
flox install in github actions
# ============================================================================ #
#
#
#
# ---------------------------------------------------------------------------- #
#
name: "Flox Tests"
on:
push:
@aakropotkin
aakropotkin / foldl-listToAttrs.md
Last active April 4, 2023 13:21
Compare performance of foldl' and listToAttrs in nix
@aakropotkin
aakropotkin / create-img.nix
Last active April 18, 2022 01:14
Create a NixOS image ( in one line )
let sources = import ./nix/sources.nix; eval = import "${sources.morph}/data/eval-machines.nix" { networkExpr = ./deploy/morph.nix; }; pkgs = import sources.nixpkgs {}; inherit (eval) uncheckedNodes nodes; inherit (pkgs) lib; in
nodes.cookiemonster.config.system.build.vm
# https://i.ckie.dev/enEbAOg.mp4
# Look upon my works, ye Mighty, and despair!
# Nothing beside remains.
# Round the day of that colossal wreck, boundless and bare the lone and level sands stretch far away.
# - P.B.Shelley
#
# This pipe has come to drain your harbor so that we might play in the sand.
jobs:
- name: nixly-job
plan:
- task: hello-world-task
@aakropotkin
aakropotkin / README.md
Last active January 28, 2021 07:10
List all ELF files recursively from a set of directories

Note:

Parts of this snippet were taken from the Open Source utility "pax-utils" https://pax.grsecurity.net/, this gist not intended for distribution or packaging into commercial software without the consent of the original authors. These are the portions related to processing AR archives, which were slighly modified to make them usable outside of the scanelf utility.

This clipping is intented for individual use.

The code which was expropriated from grsecurity's open source project is under GNU Public License V2

#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
/* Type Compatibility */
#define is_compatibleT(_CX, _CT) _Generic((_CX), _CT:1, default: 0)
#define is_compatibleV(_C2X, _C2V) is_compatibleT (_C2X, typeof (_C2V))
#ifndef MACROS_H
#define MACROS_H
/* Assert the use of GCC so we can use extension. */
#ifndef __GNUC__
#error "__GNUC__ not defined"
#else /* def __GNUC__ */
/* ======================================================================== */
/* -*- mode: c; -*- */
/* ========================================================================= */
#include "pokedex.h"
#include "moves.h"
#include "ptypes.h"
#include <stdlib.h>
#include <stdint.h>
/* -*- mode: c; -*- */
/* ========================================================================= *
*
* This file has been written in order to easily wrap existing C programs,
* and test their runtime.
*
* It simply runs `main' of the wrapped program repeatedly, and provides an
* average of timed runs. Whatever it is that you actually want to time
* should be placed there, which is not always ideal for large existing