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 / checker.sh
Last active January 26, 2026 11:43
Check System Parameters
#!/usr/bin/env bash
#
# Environment diagnostics for build failures
# Collects system, CPU, memory, swap, disk, and compiler info
#
set -e
clear
printf "%s\n\n" "=== System ==="
@lbussy
lbussy / A MOTD Manager.md
Last active March 8, 2026 19:47
Change the MOTD to include helpful informaiton, expecially on a Raspberry Pi.

MOTD Manager Documentation

Overview

motd-manager.sh is a Bash utility for managing a clean, colored dynamic MOTD (Message of the Day) on Raspberry Pi or Debian-based systems. It replaces the default kernel banner and legal boilerplate with a concise, informative, and visually distinct MOTD that includes host information, OS version, uptime, network details, and board type (if running on a Raspberry Pi).


Quick Install

@lbussy
lbussy / _Disable_sleep.md
Last active August 18, 2025 11:35
Disable Sleep/Hibernate on Debian

Disable Power Management and Graphical Login on Debian

If you use a laptop tucked away as a Linux host, you may want to disable any power manegement (sleep/hibernate) as well as any desktop environments, use this script:

disable_power_and_gui.sh

wget -qO- https://gist.githubusercontent.com/lbussy/2884187dcad127b1b9ad3bbeb5697d90/raw/disable_power_and_gui.sh | sudo bash

If you wish to reverse it:

@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: