Scanner + Printer = Copy Machine

Multi-functional printer is just a combination of printer and scanner.
So, why don’t you make DIY copy machine in Linux if you have a printer and scanner?
Make sure your scanner is supported in SANE in Linux, and install scanbuttond for scanner’s button control.
scanbuttond seems no longer in active development, but it works OK in CentOS.

I added these commands in /usr/local/etc/buttonpressed.sh as follows:

In the button pressed event,

scanimage --mode lineart --resolution 300 -x 215 -y 297 > test.pnm
pnmtops -scale 1000 -dpi 300 test.pnm | lpr -PHL-2040
convert test.pnm /some/archive/`date + %Y%m%d%H%M`.pdf

So, whenever I press the button, it automatically starts scanning, then prints it out and archives as PDF.
The only thing that bugs me is the slow scanning time…

Advertisements

Xen Paravirtualized CentOS domU on CentOS 5.3 dom0

How to install paravirtualized CentOS 5.3 x64 as domU

# virt-install --paravirt \
               --name centosx64 \
               --ram 512 \
               --file /home/xen/images/centosx64.img \
               --file-size 10 \
               --nographics \
               --location http://mirrors.kernel.org/centos/5.3/os/x86_64/

It means Memory: 512MB, Disk Image: 10GB and No Graphics
Check the comment if you want to make use of pre-downloaded iso image or dvd.

If you want to add Desktop environment after instrallation, just add these.

# yum groupinstall "X Window System" 
# yum groupinstall "GNOME Desktop Environment"

Reference: http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-howto.html