Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
# This is a anonymized version of the script I use to renew all my SSL certs
# across my servers. This will not work out of the box for anyone as your network will be
# different. But may be useful starting place for others.
#
# I use a cronjob that runs this every week. It only replaces certificates when a certificate has been renewed.
# Renews/creates cert from letsencrypt & places it where it needs to be.
# Currently, that is:
# * Nginx (local for plex)
# * Plex Media Server
@bonelifer
bonelifer / README.md
Created October 19, 2024 18:04 — forked from thereisnotime/README.md
Install Home Assistant Supervised on Debian 12

Setup HA Supervised on Debian 12

How to Run

  1. Do sudo su
  2. Copy-paste the script (it will reboot the machine)

NOTE: I am using with with Vagrat's shell provisioner as it is easier (with privileged execution).

Next Steps

@bonelifer
bonelifer / firefox-snap-apt.sh
Created June 21, 2024 18:57
Bash script to switch from Firefox Snap package to the Debian APT package from Mozilla.
#!/bin/bash
# Script to switch Firefox from Snap to Debian package from Mozilla repository
#
# Based on the Ansible playbook found here: https://www.hackitu.de/firefox_snap_apt/
# Ensure the script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
@bonelifer
bonelifer / install-themes.sh
Last active June 9, 2024 02:32
install styles
#!/bin/bash
# Script to install multiple themes for The Lounge using docker exec
# Array containing the names of the themes to be installed
themes=(
"thelounge-theme-midnight"
"thelounge-theme-socialdotlol"
"thelounge-theme-new-morning"
"thelounge-theme-catppuccin-mocha"
@bonelifer
bonelifer / upgrade.sh
Last active June 6, 2024 21:09 — forked from yhojann-cl/upgrade.sh
phpbb3 updater
#!/bin/bash
# Source: https://gist.github.com/yhojann-cl/37df5c5ee2300e7a7b3ff292703a63f3
# Define username, domain, database name, translation language, local path, and remote path variables
USERNAME="hackerdev.net"
DOMAIN="hackerdev.net"
DB_NAME="hackerdev"
TRANS_LANGUAGE="spanish_formal_honorifics"
LOCAL_PATH="/home/localuser/public_html"
@bonelifer
bonelifer / mpd-notifications.py
Created May 4, 2024 05:26
This script monitors MPD for database update events and sends notifications accordingly to a local NTFY.sh instance.
#!/usr/bin/env python3
"""
MPD Database Update Notification Script
This script monitors MPD for database update events and sends notifications accordingly to a local NTFY.sh instance.
Usage:
Run the script without any arguments to monitor MPD updates in real-time.
Use the -t or --test flag to send a test notification regardless of MPD state.
@bonelifer
bonelifer / installer.sh
Last active April 28, 2024 19:39 — forked from TehPeGaSuS/thelounge_purge.sh
Maintaince scripts for TheLounge IRC web client databases and text logs. Default systemd timer is 11pm. Includes installer script.
#!/bin/bash
################################################################################
# Name: installer.sh #
# Description: Install maintenance script for The Lounge IRC client. Cleans #
# SQLite db and text log files. #
# #
# Usage: ./installer.sh [options] #
# Describe how to use the script, including any options or flags. #
# #
@bonelifer
bonelifer / thelounge-user-managment.sh
Last active April 29, 2024 23:08
Bash script to add a user to The Lounge IRC web client Docker container, reset an existing users password, or remove a current user
#!/bin/bash
# Bash script to manage users in The Lounge IRC web client Docker container
# Function to add user to The Lounge IRC web client Docker container
add_user_to_container() {
local container_name=$1 # Name of the Docker container
local username=$2 # Username to be added to The Lounge
docker exec -it $container_name s6-setuidgid abc thelounge add $username
}
@bonelifer
bonelifer / html_mail.py
Created April 24, 2024 22:24 — forked from ehrenfeu/html_mail.py
Use Python to send HTML emails with expand/collapse boxes working in TB and Android
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_html_mail(subject, body, to_addr, from_addr):
"""Send an HTML email using the given subject, body, etc."""
# Create message container - the correct MIME type is multipart/alternative here!
message = MIMEMultipart('alternative')
message['subject'] = subject