Skip to content

Instantly share code, notes, and snippets.

View arr2036's full-sized avatar

Arran Cudbard-Bell arr2036

View GitHub Profile
#!/usr/bin/env python3
"""
SPDX-License-Identifier: MIT
Copyright (c) 2025 Arran Cudbard-Bell
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
#include <talloc.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <inttypes.h>
int main(int argc, char **argv)
{
uint64_t i, j, max, step;
clock_t begin, end;
@arr2036
arr2036 / hex2escaped.c
Created May 7, 2014 13:16
Convert a string of hexits to FreeRADIUS escaped octal string
/** Convert hexits to FR escaped ascii string
*
* This utility is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@arr2036
arr2036 / big_red_button.c
Last active March 15, 2019 16:02
Simple program for interfacing with the Dream Cheeky Big Red Button, on any Linux/BSD type OS
/* (The MIT License)
*
* Copyright (c) 2014 Arran Cudbard-Bell <[email protected]>
*
* 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:
/** IPv6 address manipulation utility
*
* This utility is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@arr2036
arr2036 / delay.sh
Last active November 26, 2024 14:25
Simple script to introduce delay on outbound packets to one or more (run multiple times) ip addresses
#!/bin/bash
# root qdisc handle
r_handle=1
# netem qdisc handle
n_handle=2
interface=
delay=
dstip=
qdpresent=
@arr2036
arr2036 / fr_unoctal.c
Created November 4, 2012 21:55
Convert FR escaped strings to hex
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
unsigned int verbose = 0;
unsigned int octal = 0;
char *p,*q;