chrisspeck.com

Chris' random ramblings

Setting up a Brother HL-2140 printer on Ubuntu 11.04 64bit

This took a bit of detective work and piecing of various posts together, but basically:

sudo apt-get install ia32-libs
sudo mkdir /usr/share/cups/model/
mkdir ~/scratch
mkdir ~/scratch/brother
cd ~/scratch/brother
wget http://www.brother.com/pub/bsc/linux/dlf/brhl2140lpr-2.0.2-1.i386.deb
wget http://www.brother.com/pub/bsc/linux/dlf/cupswrapperHL2140-2.0.2-1.i386.deb
dpkg -x brhl2140lpr-2.0.2-1.i386.deb common
dpkg --control brhl2140lpr-2.0.2-1.i386.deb
vim DEBIAN/control #(remove the "Dependency: libc ..." line)
cp -a DEBIAN/ common/
dpkg -b common brhl2140lpr-2.0.2-1.i386.deb
sudo dpkg --force-all -i brhl2140lpr-2.0.2-1.i386.deb
rm -rf common/ DEBIAN/
dpkg -x cupswrapperHL2140-2.0.2-1.i386.deb common
dpkg --control cupswrapperHL2140-2.0.2-1.i386.deb
vim DEBIAN/control #(remove the "Dependency: libc ..." line)
cp -a DEBIAN/ common/
dpkg -b common/ cupswrapperHL2140-2.0.2-1.i386.deb
sudo dpkg --force-all -i cupswrapperHL2140-2.0.2-1.i386.deb
posted by specky in IT and have Comment (1)

BASH script to photocopy a page and scan to a PDF

I have been using an Epson TX110 for all of my at home printing needs for about three years. While its scanning function is good, I am absolutely sick of the way I need to keep on replacing colour cartridges even though I only ever print in black and white. My colour usage has, in fact, almost entirely been taken up by routing cleaning of the printer heads.

So, rather then spend another dollar on colour cartridges I will never use, I finally bit the bullet and purchased a laser printer.

Being a linux-geek, the first thing I did was connect it to my home server and share it with my laptop and desktop.

The next thing I wanted was the ability to link the scanner function on the Epson TX110 with the Brother laser printer, to be able to quickly photocopy a page. This is amazingly easy with bash and the right tools installed:-

#! /bin/bash
#Find the default printer, or set printer with a literal string e.g. PRINTER="HL2140"
PRINTER=`lpstat -d | awk '{print $NF}'`              
scanimage --mode gr --format tiff --resolution 300 -x 210 -y 290 | lpr -P$PRINTER -oscaling=100

All that remains is to have the ability to scan documents to PDFs…and again, bash and the command line comes to the rescue…you can download my scanpdf.bsh. It is designed for flatbed only scanners. Try running it with --help to see available options. You may click here to view the code.

posted by specky in Downloads,IT and have Comment (1)

Setting Default Printer in Thunderbird

Saved here so I never need to look any further, instructions for setting/resetting the default printer in Thunderbird:

This worked for me:

If you can’t print from Thunderbird, or if Thunderbird won’t recognize the computer’s default printer:

1. In Thunderbird, go to Tools – Options.
2. Under Advanced, on the General tab, click on the Config Editor button.
3. Scroll down to the line starting with print.print_printer. If you don’t have that line, then everything should already be set correctly.
4. Right-click on the print.print_printer line & choose Reset.
5. Close the configuration window, then click OK to close the Options window.
6. Close Thunderbird.
7. Make sure that the correct default printer is selected. To do so, go to Start – Settings – Printers and Faxes. The one with the small checkmark is the default. To set a different printer as the default, right-click on it & choose Set as Default Printer.
8. Reopen Thunderbird.

Note that at step 4, if you name a specific printer printer at this step, then Thunderbird will ignore whatever the system default printer is.

Advice graciously taken from a post at this forum (Ars Technica).

posted by specky in Uncategorized and have No Comments