My (current) Picard naming scheme

This is my MusicBrainz Picard file naming scheme.
See this page for details.


$if($eq(%compilation%,1),

$noop(Various Artist Albums)

$if2(%albumartist%,%artist%)/

$left($if2(%originaldate%,%date%),4) %album%/

$if($gt(%totaldiscs%,1),

$noop(Various Artist Albums multiple discs)

CD %discnumber%$if(%discsubtitle%,: %discsubtitle%,)/,)

$num(%tracknumber%,2). %artist% - %title%,

$noop(Single Artist)

$firstalphachar($if2(%albumartistsort%,%artistsort%,%albumartist%,%artist%))/

$if2(%albumartist%,%artist%)/

$if(%album%,

$noop(It's An Album)

$if($eq($or(%originaldate%,%date%),1),

$left($if2(%originaldate%,%originalyear%,%date%,%year%),4) %album%/,%album%)/

$noop(Album Tracks multiple discs)

$if($gt(%totaldiscs%,1),

CD %discnumber%$if(%discsubtitle%,: %discsubtitle%,)/

$noop(Album Tracks single discs))

$num(%tracknumber%,2). %title%,

$noop(Non-Album Tracks)

%title%)

)

 

My car hi-fi makes a mess with with multi-disc albums because it doesn’t recognize discnumber tags. This script changes track numbers XX to include the disc numbers Y. The result is a 3 digit track number YXX:


$if($gt(%totaldiscs%,1),$set(tracknumber,%discnumber%$num(%tracknumber%,2)))

Advertisements

Recover GRUB bootloader

If GRUB gets wiped by other operating system or is installed in the wrong disk, do this:

-> Boot from a live Debian USB

-> Start a console/terminal.

-> Find the disk where you want to install GRUB (sdX):

# lsblk -f

-> Create a mountpoint (/ospart) where you are going to mount your system partitition (sdXY)

# mkdir /ospart
# mount /dev/sdXY /ospart

-> Change root to the system partition (/ospart)

# for i in /sys /proc /dev; do mount --bind $i /target$i; done
# chroot /ospart /bin/bash

-> (Re)Install GRUB on your desired disk (sdX)
# grub-install /dev/sdX
# update-grub

> Reboot!

Colored prompts in bash

To get colored prompts in bash shells, all we have to do is to change the PS1 line in each user’s .basrc file:
nano ~$USER/.bashrc

If necessary uncomment the line:
force_color_prompt=yes

I have a green prompt for the main user:
PS1='${debian_chroot:+($debian_chroot)}\[33[01;32m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ '
which is the default if you enable color prompts.

a red one for root:
PS1='${debian_chroot:+($debian_chroot)}\[33[01;31m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ '

and a purple one for my NAS:
PS1='\[33[01;35m\]\h\[33[00m\]:\w\$ '