Skip to content

Instantly share code, notes, and snippets.

View lbussy's full-sized avatar
🍾
Celebrating the launch of Wsprry Pi 2!

Lee Bussy lbussy

🍾
Celebrating the launch of Wsprry Pi 2!
View GitHub Profile
@lbussy
lbussy / README.md
Last active June 6, 2025 12:45
Git Pull and Fetch All

Sync All Branches

This script automates the process of synchronizing a Git repository by ensuring all remote branches are tracked locally, pulling updates with fast-forward-only behavior, updating submodules (when present), and optionally deleting local branches that no longer exist on the remote.

Features

  • Clones the repo (with submodules) if not already present
  • Fetches and prunes all remote branches
  • Tracks all origin/* branches as local branches if missing
  • Checks out each branch:
@lbussy
lbussy / rename_git_branch.sh
Last active May 19, 2025 12:27
Rename a Git branch locally and push changes to GitHub
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# -----------------------------------------------------------------------------
# @file rename_git_branch.sh
# @brief Script to rename a Git branch both locally and on the remote
# repository.
#
# @details
@lbussy
lbussy / Makefile
Last active June 5, 2025 12:45
Generic C and C++ Makefile
# -----------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2025 Lee C. Bussy (@lbussy)
#
# 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
@lbussy
lbussy / _Clean_Whitespace.md
Last active May 13, 2025 20:54
Clear whitespace from the end of lines and blank lines

Clean Whitespace

Overview

whitespace_clean is a Bash script designed to remove extraneous whitespace from source code and text files. It helps maintain clean, readable files by stripping trailing whitespace from supported file types.

Features

  • Processes files recursively or in a single directory
  • Supports dry-run mode to preview changes
@lbussy
lbussy / SSH_Copy.md
Last active May 26, 2025 12:30
Manage your shared SSH keys and .ssh config file
@lbussy
lbussy / Debug Print.md
Last active December 30, 2024 17:26
A framework for providing valuable debug printing during Bash developement, without having to remove it all manually when you are done.

Debug Script Example

This script demonstrates how to implement debug functionality to a Bash script in a simple, extensible manner. It provides a mechanism to enable and pass debug information throughout the script, allowing developers to trace function calls and view debug messages during execution.

How is this different than just dropping echo everywhere?

Git Functions Documentation

Overview

This script interacts with Git repositories to perform various functions such as cloning, downloading files, and updating file ownership and permissions.

Usage

To use the script, run it as follows:

Filetype Classification Script Documentation

Overview

This script, filetype.sh, is designed to classify files based on their types and extensions. It recursively examines files and directories, determines their types using the file command, and classifies them into human-readable categories.

Features

  • File Type Classification: Using an associative array (FILETYPE_MAP), the script classifies files based on their extensions.
@lbussy
lbussy / README.md
Last active December 12, 2024 13:51
Systemd .service File Generator

Systemd .service File Generator

This script automates the creation or updating of systemd service unit files. It validates user inputs, generates or modifies the service files, validates them, and enables them to start with the system.


Header

  • Purpose: Generate or update systemd service files.
  • Author: Lee Bussy
@lbussy
lbussy / ac600_rasp_32bit.md
Created December 9, 2024 20:40
Sharing: TP-Link AC600 Nano on Raspbian Bookworm 32-Bit

I figured this out, and I wanted to share how to do it.

  1. Kernel headers are not (yet?) available on 32-bit v8. To get past this:
echo "arm_64bit=0" | sudo tee -a /boot/firmware/config.txt > /dev/null
  1. Reboot
  2. Either: