Skip to content

Instantly share code, notes, and snippets.

View lbussy's full-sized avatar
🍾
Just released Keg Cop 1.2!

Lee Bussy lbussy

🍾
Just released Keg Cop 1.2!
View GitHub Profile
@lbussy
lbussy / README.md
Last active March 17, 2024 21:00
External Button Shutdown for Raspberry Pi

Shutdown Raspberry Pi with a Single Button

There are two methods:

  1. Scripted Method
  2. Boot Overlay Method (also below as "tl;dr")

tl;dr Version

Add the following to your /boot/config.txt and reboot:

@lbussy
lbussy / .bash_aliases
Last active October 28, 2023 12:59
Bash Aliases
# Add to ~/.bash_aliases
#
# Random helpers
alias cd..='cd ..' # Get rid of command not found error
alias diff='colordiff' # Colorize diff output
alias ping='ping -c 3' # Stop pings after three
# Do system update/upgrade and cleanup in one shot
alias update='sudo apt --fix-broken install -y && sudo apt update && sudo apt upgrade -y && sudo apt autoremove --purge -y && sudo apt clean && sudo apt autoclean -y'
alias upgrade='update'
@lbussy
lbussy / README.md
Last active October 12, 2023 23:54
How to create a Wireless Access Point with a, OTG connected Raspberry Pi to share your Internet Connection

Creating a Raspberry Pi Wireless Access Point Bridge (WAP) via On The Go (OTG) Connection

Issue: You are travelling and all oyu have access to is that crappy sort of Internet which requires you to hit a network login page via your laptop's web browser. You want to connect some other devices, maybe some IoT devices so you can keep up with your projects. No way to do that since they don't have a web browser. Or maybe you have access to some pay-as-you-go Internet but it only allows one device?

Solution: A Raspberry Pi Zero W (or any Pi with a WiFi).

Overview:

  1. The Raspberry Pi is connected to your computer's USB port and use what's called a Remote Network Driver Interface Specification (RNDIS) adapter to create a network between your Pi and your computer over the USB.
  2. Your main computer's network connections is then shared, allowing another network connection to use its Internet connection.
@lbussy
lbussy / README.md
Created May 13, 2023 13:24
JQuery-based File Upload Functions

File Upload

This demo file will allow uploading to a capable endpoint (in this case /api/v1/fs/upload/). It is styled with Bootstrap as an example of the integration.

@lbussy
lbussy / log_tail.php
Last active March 20, 2023 16:05
Single File PHP Log file Tail/View
<!--
PHP Log Tail
by Lee C. Bussy
A single-page log file viewer with "tail -f" capabilities.
Pass the name of the log file to be viewed as a URL parameter:
log_tail.php?logFile=my.log
For safety and to prevent breakouts, the path to the log file
@lbussy
lbussy / I2C_LCD_driver.py
Created September 4, 2021 13:01
Enable and Test I2C LCD Displays on the Raspberry Pi
# -*- coding: utf-8 -*-
# Saved from:
# https://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/
# Original code found at:
# https://gist.github.com/DenisFromHR/cc863375a6e19dce359d
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
@lbussy
lbussy / raspberry_pi_watchdog.md
Last active August 6, 2021 11:22
How to set up the Raspberry Pi Watchdog Daemon

Raspberry Pi Watchdog System

There are two parts of the Raspberry Pi's Watchdog system; the daemon and the hardware module.

First, load the watchdog module:

$ sudo modprobe bcm2708_wdog
@lbussy
lbussy / get_git_branches.md
Last active August 6, 2021 11:21
Git Fetch Does Not Get Origin Branches

Get all Git Branches

When you git fetch sometimes you may not see all origin branches when you issue the command git branch -a or git branch -r.

This happens sometimes, if you change the remote repository with:

git remote set-url origin https://github.com/{owner}/{repository}

When this happens, exit .git/config and look for a hard-coded branch name in the origin:

@lbussy
lbussy / README.md
Last active August 6, 2021 11:20
Change Git to Use SSH

Change Git to Use SSH

Here's how to change git to use SSH.

The below scripts will automate the repo changes needed.

@lbussy
lbussy / README.md
Last active December 13, 2020 20:27
Backup and Shrink Raspberry Pi Images

Backup and Shrink Raspberry Pi Images

This set of scripts will back up the Raspberry Pi SD card to local (not the same SD card) storage. It will optionally shrink the image to the minimum size possible.