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 / print256colours.sh
Created January 31, 2024 17:36
Console print out 256 colours, with each number printed in its corresponding colour
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@byates
byates / install-dpdk.sh
Last active June 17, 2025 20:50
Installs DPDK from source
#!/bin/bash -e
# Prevent script from being run as root
if [[ "$(id -u)" == 0 ]]; then
echo "ERROR: This script must NOT be run as root. Please run it as a normal user."
exit 1
fi
mkdir -p ~/tools && cd ~/tools
if [ ! -d dpdk-stable ]; then
@byates
byates / install-huge-pages.sh
Last active June 17, 2025 21:05
Changes GRUB to enable Linux cmdline for hugepages
#!/usr/bin/env bash
set -euo pipefail
GrubConfigFile="/etc/default/grub.d/50-cloudimg-settings.cfg"
VERBOSE=1
# Parse arguments
for arg in "$@"; do
case "$arg" in
--verbose)
@byates
byates / install-build-tools.sh
Last active June 17, 2025 20:49
Install build tools
#!/bin/bash -e
# Prevent script from being run as root
if [[ "$(id -u)" == 0 ]]; then
echo "ERROR: This script must NOT be run as root. Please run it as a normal user."
exit 1
fi
Distro=$(awk -F= '/^NAME/{print tolower($2)}' /etc/os-release)
VersionID=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release)
@byates
byates / .gitconfig.inc
Last active February 2, 2023 02:48
gitconfig include file with useful alias commands
[core]
editor = vim
autocrlf = false
#pager = delta --theme="DarkNeon" --file-style=box
[diff]
wsErrorHighlight = all
[alias]
tree = log --all --graph
unstage = reset HEAD --
discard = checkout
@byates
byates / .tmux.conf
Last active August 31, 2025 10:23
tmux, vim, and bashrc configurations
#
# KEY BINDINGS (Prefix is 'C-a')
#
# - `prefix + r` - reload tmux config
# - `prefix + v` - capture text to vim !!!
# - `prefix + I` - Installs new plugins
# - `prefix + U` - Updates plugin(s)
# - `prefix + C-s` - save tmux window layout
# - `prefix + C-r` - restore tmux window layout
#
@byates
byates / vim-build-and-install.sh
Created February 1, 2023 22:57
Builds and installs VIM on ubuntu
sudo apt install ncurses-dev make build-essential unzip -y
wget https://github.com/vim/vim/archive/master.zip
unzip master.zip
cd vim-master
cd src/
./configure
make
sudo make install
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
#
# Test ssh connection speed by uploading and then downloading a 10MB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in MBs]
#
@byates
byates / wsl_ubuntu_setup.sh
Last active January 20, 2021 19:18
Ubuntu dev setup for WSL 2.0
#!/bin/bash
# Modify .bashrc to startup the ssh agent
tmpFile=/tmp/__setup.tmp
cat > $tmpFile << 'BASHRC'
# JBY-SSH-AGENT
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
@byates
byates / install_vim_plugins.sh
Last active February 2, 2023 02:26
VIM plugins
#!/usr/bin/env bash
git clone https://github.com/vim-airline/vim-airline ~/.vim/pack/plugins/start/vim-airline
git clone https://github.com/vim-airline/vim-airline-themes ~/.vim/pack/plugins/start/vim-airline-themes
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/pack/plugins/start/nerdtree
git clone https://github.com/ConradIrwin/vim-bracketed-paste.git ~/.vim/pack/plugins/start/vim-bracketed-paste
git clone https://github.com/markonm/traces.vim.git ~/.vim/pack/plugins/start/traces.vim
git clone https://github.com/tpope/vim-fugitive.git ~/.vim/pack/plugins/start/vim-fugitive