Skip to content

Instantly share code, notes, and snippets.

View byates's full-sized avatar
🗻

Brent Yates byates

🗻
  • Atlanta GA, USA
View GitHub Profile
@byates
byates / brent-starship.toml
Last active August 31, 2025 10:21
Brent's starship config (simple)
"$schema" = 'https://starship.rs/config-schema.json'
format = """
[](bg:color_black fg:color_bblue)\
$hostname\
[](bg:color_green fg:color_bblue)\
$username\
[](bg:color_yellow fg:color_green)\
$directory\
[](fg:color_yellow bg:color_aqua)\
@byates
byates / test-24-bit-color.sh
Created June 16, 2025 18:09
This file echoes a bunch of 24-bit color codes to the terminal to demonstrate its functionality.
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
@byates
byates / setup-network-for-vpp.sh
Created June 16, 2025 13:50
Helper to setup network interface for VPP/DPDK
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <interface-name>"
exit 1
fi
INTERFACE="$1"
@byates
byates / private_fork.md
Created March 27, 2025 15:43 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@byates
byates / dpdk-bind-and-record.py
Last active May 26, 2025 12:42
Tool to bind and unbind a DPDK driver to a network interface
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
#
# This utility will attempt to bind a network interface to a dpdk
# compatible driver (dpdk_default_driver). The network interface
# must be bound to the OS for this utility to work as this utility:
# 1. records the current interface parameters to a file
# 2. unbinds the interface from the OS
# 3. binds the interface to the dpdk driver
@byates
byates / install-gtest.sh
Last active June 17, 2025 20:27
Install GTest library in Ubuntu
#!/bin/bash -e
if [[ $(id -u $USER) = 0 ]]; then
# If we are running as root, then we don't need (and may not have) sudo
echo "Userid=$(id -u $USER)"
SUDO=
else
SUDO=sudo
fi
@byates
byates / make_and_load_uio.sh
Created June 24, 2024 13:12
This script performs the initial installation for the igb_uio driver in AWS and GCP
#!/usr/bin/env bash
# This script performs the initial installation for the igb_uio driver in AWS and GCP
CURRENT_DIR=$(pwd)
if [ ! -d "./dpdk-kmods" ]; then
# Make sure the correct dependencies are installed
sudo apt update
sudo apt install -y git gcc make
@byates
byates / force-clean-repo.sh
Created June 24, 2024 13:05
Cleans and resets a git repo and its submodules
#!/bin/bash
#Cleans and resets a git repo and its submodules
#https://gist.github.com/nicktoumpelis/11214362
git reset --hard
git submodule sync --recursive
git submodule update --init --force --recursive
git clean -ffdx
git submodule foreach --recursive git clean -ffdx
@byates
byates / update_termsize.sh
Created February 23, 2024 14:04
Fixes a serial console's terminal size when broken by ncurses, etc.
#!/bin/bash
set -eu
# Reset term to initial state on exit
stty_ori=$(stty -g)
function atexit {
stty $stty_ori
}
trap atexit EXIT
@byates
byates / fix_clang_install.sh
Created February 20, 2024 20:13
Fixes clang install versions
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--verbose \