- Do
sudo su
- 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).
#!/bin/sh | |
# This script interacts with the `mpc` (Music Player Client) to manage playlists in MPD (Music Player Daemon). | |
# It allows the user to perform operations such as: | |
# - Viewing the current playlist with enumerated items. | |
# - Selecting, loading, or replacing playlists interactively. | |
# - Clearing the current playlist and loading a new one. | |
# Usage: | |
# - Run the script with no arguments to execute `mpc` commands. | |
# - Use specific arguments like 'playlist', 'iload', or 'replace' to invoke specialized functions. |
#!/usr/bin/env bash | |
# Script to interact with the music queue and manage song ratings and statuses using "stickers" | |
# The stickers feature is used for marking songs with specific labels (e.g., "broken" or "rating"). | |
# This script supports rating songs, flagging songs as "bad" (broken), removing songs from the queue, | |
# listing songs flagged as bad, and jumping to a random song in the queue. | |
# Ratings are compatible with clients such as Cantata, mpedv, and myMPD. | |
# Function to display usage instructions | |
usage () { |
#!/bin/bash | |
expireTime="9200" | |
mpddir="/media/william/NewData/Music/MP3B/" | |
defaultimage="$mpddir/unknown.jpg" | |
update_cover() { | |
path=$mpddir$(mpc -f %file% current) | |
album=$(mpc -f %file% current) | |
ffmpeg -loglevel quiet -y -i "$path" /tmp/cover |
[Unit] | |
Description=MPD Song Skipper | |
After=mpd.service | |
Wants=mpd.service | |
[Service] | |
ExecStart=/usr/bin/python3 /path/to/your/script/skipdetect.py -d | |
ExecStop=/usr/bin/python3 /path/to/your/script/skipdetect.py -k | |
Restart=on-failure | |
RestartSec=5 |
#!/usr/bin/env python | |
# vim: ai ts=4 sw=4 sts=4 expandtab fileencoding=utf-8 | |
from mpd import MPDClient | |
## SETTINGS | |
## | |
HOST = 'localhost' | |
PORT = '6600' | |
PASSWORD = False |
#!/usr/bin/python3 | |
""" | |
MPD Tray application(similar to RadioTray-NG) to manage and play categorized radio station URLs. | |
Provides Stop, Stations (organized by categories), Refresh, and Exit options in the tray menu. | |
Uses `mpc load URL` equivalent functionality, ensuring reconnection to MPD. | |
Pressing Stop clears the queue. | |
""" | |
# Editable variables | |
menu_icon = False # Set to True to use system icon (XFce add-folder-to-archive icon), False for custom icon |
#!/usr/bin/bash | |
# Description: | |
# This script generates a random playlist of tracks from a local music directory using MPC. | |
# It filters tracks by artist, limits the number of tracks from each artist, and saves the | |
# generated playlist as an M3U file in the specified playlist directory. | |
# | |
# The script: | |
# - Scans the specified local music directory for MP3 tracks. | |
# - Filters tracks by artist and limits the number of tracks based on the artist's total. |
#!/usr/bin/bash | |
# Script description: Fetches similar artist tracks based on the currently playing track or all tracks in the queue. | |
# Accepts arguments: | |
# -c, --current: Retrieves similar artist tracks for the currently playing track. | |
# -a, --all: Retrieves similar artist tracks for each track in the current playlist. | |
# Configurable parameters: | |
# lastfm_api_key: Last.fm API key (replace LAST_FM_API_KEY). | |
# similar_limit: Limit for similar artists fetched. | |
# per_artist_limit: Maximum tracks per similar artist. |
# 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 |