Install Brother P-Touch QL-500 / QL-550 / QL-560 / QL-570 under Ubuntu

wget https://raw.github.com/panticz/installit/master/hardware/install.brother-ql-labelprinter.sh -O - | bash -

#!/bin/bash

[ ! -d /usr/share/cups/model ] && mkdir /var/spool/lpd
[ ! -d /usr/share/cups/model ] && mkdir /usr/share/cups/model
#ln -s /etc/init.d/cups /etc/init.d/cupsys

# create outdated cupsys init script
cat < /etc/init.d/cupsys
#!/bin/bash

/etc/init.d/cups \$@
EOF
chmod a+x /etc/init.d/cupsys

cat < /var/lib/dpkg/info/ql570cupswrapper.list
./
./usr/
./usr/local/
./usr/local/Brother/
./usr/local/Brother/PTouch/
./usr/local/Brother/PTouch/ql570/
./usr/local/Brother/PTouch/ql570/cupswrapper/
./usr/local/Brother/PTouch/ql570/cupswrapper/cupswrapperql570pt1
./usr/local/Brother/PTouch/ql570/cupswrapper/brcupsconfpt1
EOF

mkdir -p /var/spool/lpd/ql570

wget http://www.brother.com/pub/bsc/linux/dlf/ql570lpr-1.0.1-0.i386.deb -P /tmp
dpkg -i --force-all /tmp/ql570lpr-*.i386.deb

wget http://www.brother.com/pub/bsc/linux/dlf/ql570cupswrapper-1.0.1-0.i386.deb -P /tmp
dpkg -i --force-all /tmp/ql570cupswrapper-*.i386.deb

# connect and power-on the printer

# delete default printer
lpadmin -x QL-570

# create new printer (example for QL-500)
lpadmin -p Brother_P-Touch -E -v usb://Brother/QL-500 -P /usr/share/cups/model/Brother/brother_ql570_printer_en.ppd

# recreate printer
lpadmin -x QL-500
lpadmin -p Brother_QL-500 -E -v usb://Brother/QL-500 -P /usr/share/cups/model/brql500.ppd

lpadmin -p Brother_38x90 -v socket://PRINTSERVER_IP:9100 -E -P /usr/share/cups/model/Brother/brother_ql570_printer_en.ppd -o PageSize=38x90 -o PageRegion=38x90 -o ImageableArea=38x90 -o PaperDimension=38x90

# set Label to 38x90 mm
lpadmin -p Brother_38x90 -v usb://Brother/QL-500 -E -P /usr/share/cups/model/Brother/brother_ql570_printer_en.ppd -o PageSize=38x90 -o PageRegion=38x90 -o ImageableArea=38x90 -o PaperDimension=38x90 -o BrPriority=BrQuality -o orientation-requested-default=4

# test
sudo apt-get install -y psutils

# LINKS
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_esp.html
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_esp1.html
http://solutions.brother.com/linux/en_us/download_esp.html#QL-500
http://welcome.solutions.brother.com/bsc/public_s/es/os/linux/linux_ql500550.html