Page 1 of 1

Ubuntu tips

Posted: Sat May 08, 2021 10:32 am
by wbartels
Reduce MySQL backup size

Code: Select all

#!/bin/bash
export MYSQL_PWD=password
nice -n +19 mysqldump -uusername --no-data --databases netjukebox > /tmp/netjukebox.sql
nice -n +19 mysqldump -uusername --no-create-info --ignore-table=netjukebox.track --ignore-table=netjukebox.bitmap --ignore-table=netjukebox.country_ipv4 --ignore-table=netjukebox.country_ipv6 netjukebox >> /tmp/netjukebox.sql
echo "UPDATE \`server\` SET \`value\` = '0' WHERE \`name\` = 'geolite2_version' LIMIT 1;" >> /tmp/netjukebox.sql
nice -n +19 gzip -f /tmp/netjukebox.sql
mv -f /tmp/netjukebox.sql.gz /BACKUP_LOCATION/netjukebox.sql.gz
After restoring a backup an update is required to rebuild data.




Improve Music Player Daemon update speed

For netjukebox there is no need to read the metadata.
To improve MPD update speed metadata can be disabled.

Update /etc/mpd.conf with:

Code: Select all

metadata_to_use			"none" 



Music Player Daemon SPDIF output

With Ubuntu Server I had a hard time to get SPDIF output working.
Here is the solution I found on http://mpd.wikia.com/wiki/Alsa#ALSA_sel ... perfect.29.

Update /etc/mpd.conf with:

Code: Select all

audio_output {
        type                    "alsa"
        name                    "SPDIF"
        device                  "cards.pcm.iec958"
}
To find the right device name use:

Code: Select all

aplay -L
For more info read: https://alsa.opensrc.org/DigitalOut