You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🍾
Celebrating the launch of Wsprry Pi 2!
Lee Bussy
lbussy
🍾
Celebrating the launch of Wsprry Pi 2!
A nerd, homebrewer, father and grandfather who dabbles and tries to stay out of trouble.
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.
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.
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).
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.
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/*.
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.
ssh-copy accepts a Raspberry Pi's IP address, DNS name, short hostname, or existing SSH alias, 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
Enter an existing SSH alias, an IPv4 address such as 192.168.1.50, a DNS name such as wspr2.local, or a short hostname such as wspr2. A new short hostname uses .local; an IP address is used directly.
For a new host, choose a name to use with ssh and an SSH port (default 22). Existing aliases retain their configured destination and port.
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.
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.
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.
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.