This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. # | |
# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Script: drive-backup.py | |
Description: Downloads the entire contents of a Google Drive using Google Drive API. | |
Requirements: | |
- Google Client Library: `pip install google-api-python-client` | |
- Create a project in Google Cloud Console, enable Drive API, and generate credentials (OAuth 2.0 Client IDs). | |
- Save the credentials JSON file as 'credentials.json' in the same directory as this script. | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
helpText=" | |
# Usage:\n | |
#\n | |
# ./monitor_albums.sh -k 'apiKey' -b 'http://host:port' -t [Single|EP|Album] [-m|u|A|h][-n 'artist name'][-i artistId]\n | |
#\n | |
# Required Options:\n | |
# -k Your Lidarr API Key (defaults to \$apiKey env variable)\n | |
# -b Your Lidarr instance URL (defaults to \$baseUrl env variable)\n |