Wednesday, 17 October 2012

Centos 6/RHEL install Canon Lide 20 Scanner

If you use a Canon USB scanner, then it should be easy to set up in Centos 6/RHEL

$ yum search all sane

sane-backends-devel.i686 : SANE development toolkit
sane-backends-libs.i686 : SANE libraries
sane-backends-libs-gphoto2.i686 : SANE libraries for gphoto2
xsane.i686 : X Window System front-end for the SANE scanner interface
xsane-common.i686 : Common files for xsane packages
xsane-gimp.i686 : GIMP plug-in providing the SANE scanner interface
libsane-hpaio.i686 : SANE driver for scanners in HP's multi-function devices
sane-backends.i686 : Scanner access software
sane-frontends.i686 : Graphical frontend to SANE


Xsane
I use the Xsane program as it is in the repo and has a plugin for Gimp although you should just be able to use the sane backend if you prefer

Check your device is detected with a Linux command.

$ sudo lsusb

Bus 006 Device 002: ID 04a9:220d Canon, Inc. CanoScan N670U/N676U/LiDE 20

Now install the packages

$ sudo yum -y install xsane xsane-common xsane-gimp

Reboot the computer and check for your device using Xsane.


$ scanimage -L

device `plustek:libusb:006:002' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner

Now you can open up Gimp and run it from there using the create dialogue, or issue the command

$ xsane

See Fluxbox key bindings for more if using it.

Sunday, 7 October 2012

Centos 6/RHEL install/compile Python3.3


You might want to use Python3.3 on your Centos 6 box and it doesn't ship as standard so needs to be compiled from source.

Fortunately, this is easy to do if you have Centos 6 set up properly as in the Centos 6 minimal tutorial. It is important that you do not remove python 2.6 as it is needed by many system files.

You will need some dependencies to enable the compilation and for python to function correctly.

$ sudo yum -y install wget gcc gcc-c++ autoconf automake make zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel

$ wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2

Download the Gzip source file to your home directory

$ cd /tmp

$ sudo tar xvf /home/<user_name>/Python-3.3.0.tar.bz2

$ cd Python-3.3.0/

$ ./configure --prefix=/usr/local

$ sudo su

# make && make install

# cd

# rm -rf /tmp/Python-3.3.0/

Run it with

$ python3.3 

[anton@Centos ~]$ python3.3
Python 3.3.0 (default, Oct  5 2012, 19:37:37) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Just 'python' will invoke the 2.6 version as below


[anton@Centos ~]$ python
Python 2.6.6 (r266:84292, Sep 11 2012, 08:28:27) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

3.3 was installed on Oct 5th whereas 2.6 was part of the actual system installation when I built the computer in September, so you can run both.

Running three versions

You can also install Python 2.7.3 for example along with Python 3.3 above AND still keep the system version 2.6. Just repeat the process above but download the 2.7.3 version. You must change the line 'make install' to 'make altinstall' on both the 2.7 and the 3.3 installations to avoid naming conflicts.

Virtualenv provides a way of managing multiple Python installations whilst keeping headaches to a minimum.