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
Created August 22, 2026 15:27
Safely inspect or suppress Ubuntu Pro/ESM login MOTD notices while retaining package update counts

Ubuntu Pro/ESM MOTD notice manager

This script suppresses the Ubuntu Pro/Expanded Security Maintenance promotional notices printed during login. It does not disable Ubuntu Pro services, uninstall packages, change APT sources, or hide ordinary package and security update counts.

It uses Ubuntu's marker file:

@lbussy
lbussy / 1_Mount_Pi.md
Last active August 23, 2026 12:32
Safely Mount Raspberry Pi Directories on macOS

Safely Mount Raspberry Pi Directories on macOS

mount-pi mounts a Raspberry Pi directory under $HOME/mnt with SSHFS and can open it in VS Code. SSH connection details come from aliases in ~/.ssh/config.

The script deliberately manages only direct child directories of $HOME/mnt. It rejects path traversal, absolute mount names, and unmount requests outside that root.

Safety behavior

  • Host aliases and mount names must contain only letters, numbers, dots, underscores, and hyphens, and must start with a letter or number.
  • Remote paths must be absolute.
@lbussy
lbussy / MOTD Manager Documentation.md
Last active August 22, 2026 13:35
MOTD Manager Documentation

MOTD Manager Documentation

Overview

motd-manager is installed from the motd-manager.sh Bash script and is a 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 / 00-README.md
Last active August 22, 2026 13:46
Safely Disable Sleep and Graphical Boot on Debian and Ubuntu

Safely Disable Sleep and Graphical Boot on Debian and Ubuntu

power-gui-control.sh converts a Debian or Ubuntu desktop into a headless-style system without guessing how to undo the change. It records the machine's exact starting state, applies a verified transaction, and restores only that recorded state.

The default disable operation affects subsequent boots but deliberately leaves the current graphical session running. Stopping the current GUI requires the separate, explicit --stop-gui-now option. Neither operation reboots the host.

@lbussy
lbussy / README.md
Last active August 23, 2026 12:26
Safely Synchronize All Git Branches

Safely Synchronize All Git Branches

sync_all.sh synchronizes local branches with branches of the same name on origin. It can clone a repository, create missing local tracking branches, update submodules, and offer to remove local branches absent from origin.

The script is conservative, but it is not risk-free. Review these notes before using it on important work.

Behavior

  • Fetches and prunes origin only.
  • Enumerates remote branches explicitly under origin/*.
@lbussy
lbussy / _Clean_Whitespace.md
Last active August 23, 2026 12:39
Safely Remove Trailing Whitespace

Safely Remove Trailing Whitespace

whitespace_clean removes trailing spaces and tabs from selected text files. It supports recursive traversal, dry-run previews, extension filters, directory exclusions, and per-file backups.

This is a file-rewriting utility. Run a dry run first and review version-control changes afterward.

Safety behavior

  • Dry-run mode performs no file or backup writes.
  • Every changed file receives a uniquely named backup before replacement.
@lbussy
lbussy / SSH_Copy.md
Last active August 23, 2026 13:44
Interactive and Safer SSH Key Setup

Interactive Raspberry Pi SSH Key Setup

ssh-copy asks for a Raspberry Pi's short hostname, selects a public key, handles the common host-key change caused by re-imaging, installs the key when needed, verifies login, and creates the SSH alias when it is missing.

Intended environment: This convenience utility is designed for personally managed Raspberry Pis that are frequently re-imaged. Automatic removal of a changed saved host key may be inappropriate or unsafe in production, shared, regulated, or high-assurance environments. Use formal identity verification and change control there.

Workflow

  1. Enter the short hostname, such as wspr2; the script uses wspr2.local.
  2. Reuse an existing alias of that name or prepare a new alias automatically.
@lbussy
lbussy / 00_README.md
Last active August 23, 2026 15:00
Debian, Ubuntu, and Raspberry Pi OS Setup

Debian, Ubuntu, and Raspberry Pi OS Setup

setup_debian_family.sh installs command-line tools, Bash aliases, and helpers on Debian, Ubuntu, and Raspberry Pi OS/Raspbian.

The canonical installation is piped through sudo bash. That is explicit permission for the default system changes, so no second confirmation is requested. The validated SUDO_USER account—not root—receives user files.

Default behavior

By default, the installer:

@lbussy
lbussy / README.md
Last active August 23, 2026 13:17
Safely Switch GitHub Remotes Between HTTPS and SSH

Safely Switch GitHub Remotes Between HTTPS and SSH

This Gist provides two focused commands:

  • git-https-to-ssh converts a GitHub HTTPS remote to SSH.
  • git-ssh-to-https converts a GitHub SSH remote to HTTPS.

Both commands default to origin, accept another remote name, show the exact proposed and rollback commands, support dry-run, require an exact confirmation by default, and verify the stored URL after changing it.

Safety behavior

@lbussy
lbussy / generator.md
Last active August 23, 2026 13:51
Raspberry Pi PWM Generator

Raspberry Pi PWM Generator

raspi-pwm generates a PWM waveform on a Raspberry Pi GPIO output. It defaults to physical pin 12 (GPIO18), 190 Hz, and a 10% duty cycle, matching the original signal-injection use case.

pic_6_1

This is a bench utility, not a precision waveform generator. RPi.GPIO produces software-timed PWM, so frequency and duty-cycle accuracy can vary with system load.

Electrical safety