Tuesday, 26 March 2013

Centos 6/RHEL install Java JDK 6

You may find that sometimes you need to use the Sun Java 6 version of the JDK as opposed to version 7 on your Centos box. Some projects may require the older version, additionally there are still some potential security issues in version 7 which regularly render Oracle as reminiscent of the boy with his finger in the dam. Until these are properly fixed you may wish to use JDK6 instead of or at least alongside JDK7. Well this is easy enough to do on Centos 6/RHEL with a few commands.

First install jpackage-utils if not already installed

$ sudo yum -y install jpackage-utils

Now we have to download JDK6 from Oracle's Web site.
The latest version is 1.6.0_43 so download the bin version for Linux to your home directory. First change the permissions.

$ chmod +x jdk-6u43-linux-i586.bin        (or x64)

Extract the bin file

$ ./jdk-6u43-linux-i586.bin

Move extracted folder to its location, usually /usr/java

If you don't aready have a java version installed, then you might want to make a directory for it.

$ sudo mkdir /usr/java
                                      
$ sudo mv jdk1.6.0_43 /usr/java/jdk1.6.0_43

If you have already installed JDK7 then you will have a new folder next to it with version 6 inside, that is fine.

Install the new java 6 source in system

$ sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_43/bin/javac 1

$ sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_43/bin/java 1

$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.6.0_43/bin/javaws 1

Choose default java from the versions you now have, repeat with javac and javaws.

$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws

    Selection    Command
-----------------------------------------------
   1           /usr/java/jdk1.7.0_10/bin/java
*  2           /usr/java/jdk1.7.0_10/jre/bin/java
 + 3           /usr/java/jdk1.6.0_43/bin/java

Enter to keep the current selection[+], or type selection number: 

Test which version you are now running


$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) Server VM (build 20.14-b01, mixed mode)

Verify the symlinks all point to the new java location

$ ls -la /etc/alternatives/java*

lrwxrwxrwx. 1 root root 30 Mar 17 12:47 /etc/alternatives/java -> /usr/java/jdk1.6.0_43/bin/java
lrwxrwxrwx. 1 root root 31 Mar 16 23:59 /etc/alternatives/javac -> /usr/java/jdk1.6.0-43/bin/javac
lrwxrwxrwx. 1 root root 32 Mar 16 23:59 /etc/alternatives/javaws -> /usr/java/jdk1.6.0_43/bin/javaws

Now set up the $JAVA_HOME path.

$ sudo vi/home/<user>/.bashrc

export JAVA_HOME="/usr/java/jdk1.6.0_43/bin/"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"
       
$ source /home/<user>/.bashrc

Enable Java plugin for Mozilla Firefox (and Chrome)

32bit

sudo alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 20000

64bit

sudo alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.7.0_06/jre/lib/amd64/libnpjp2.so 20000


You can now switch between JDK7 and JDK 6 using the update-alternatives command above.

Friday, 15 March 2013

Centos 6/RHEL install Digikam Digital Photo & Image Processing

We have seen a wider range of Digital Image Processing apps become available on Linux as coders and developers find that there is a growing demand within the community for quality programs. Whilst Gimp and Cinepaint have been around for a while, digiKam is a relatively new kid on the block, packing considerable functionality within its multi colored GUI.

digiKam is an open source cross platform photo management program designed to import, organize, enhance, search and export your digital images to and from your computer. The design is inspired by photographers with real needs not addressed in other applications, and solutions which are implemented with aplomb.


Some of the features in the latest release of digiKam include:

  • Designed from the ground-up for KDE4, using KDE4 technology:
  • Hardware handling with Solid interface;
  • More comprehensive multimedia file handling using Phonon interface;
  • Easy Geolocation with Marble interface;
  • Social Semantic Desktop synchronization using Nepomuk interface.
  • XMP metadata support;
  • TIFF/EP RAW metadata editing;
  • Customizable file storage for the digiKam database, supporting remote albums;
  • Support of multiple root album paths (no more importing into one giant album);
  • Thumbnail-bar integration for easy navigation and editing;
  • Supports the latest camera RAW files using LibRaw;
  • New/revamped tools:
  • Batch queue manager;
  • Revamped camera import wizard;
  • LensFun integration: auto-correction of lens distortion;
  • Fuzzy searches based on hand-drawn sketches;
  • Advanced searches using image meta-information, such as keywords and dates;
  • User-friendly map searching that gives you the power to search for global photo locations;
  • Advanced searches for duplicate and similar images;

Using two modes, View and Edit, it defaults to the View mode.


With Color, Enhance, Transform, Decorate and Filters tabs (accessed via Image, then Edit tab) in the Edit mode, I would recommend taking a look at the program if you are a photo enthusiast using Linux, as there will be features of it you are bound to like. As inferred in the opening paragraph, multiple themes are available from the settings menu and it can be made to suit the majority of color schemes, both light and dark. It is no Photoshop but has some pretty powerful and impressive features for a free program.


Having only basic photography skills I nonetheless managed to find some useful features in digiKam and I'm sure the more inquisitive, adventurous and professional user would find more.

Installing is easy on Centos 6/RHEL as it is in the Epel repo, so make sure you have it enabled and issue

$sudo yum -y install digikam digikam-devel digikam-libs

To obtain all packages, and run it with 

$ digikam

See Fluxbox key bindings if you are using Fluxbox, for shortcuts.

Example of a Charcoal Drawing simulation.
Digikam makes a useful addition to your Centos/RHEL box and is easy to install, being in the Epel repo.


Sunday, 10 March 2013

Centos 6/RHEL install Cinepaint

According to Robin Rowe at the Greater London Linux Users Group in Dec 2012, Linux is the #1 operating system for feature animation and visual effects. It is used by all the major studios for their film making, and Cinepaint is the most popular image editing software in the industry after Photoshop.


Now based on GTK as opposed to the earlier FLTK, release's for Linux, Mac and Windows see Cinepaint solidify it's place in the Open Source community whilst retaining its individual idiosyncratic persona.


CinePaint was created by using an existing open source paint app which had been abandoned by the developers, cleverly replacing its old low fidelity 8-bit core with an image engine that handles 8-bit, 16-bit and 32-bit high dynamic range channels. Some of the features include
  • Support for 8-bit, 16-bit and 32-bit color channels of deep paint.
  • High fidelity image file types such as DPX, OpenEXR and 16-bit TIFF. These files can’t be opened in ordinary 8-bit image applications without crushing them.
  • High Dynamic Range. HDR images can go brighter than white. Ordinary images can’t be brighter than a white sheet of paper (0=black, 1.0=white).
  • Gallery-quality printing. B&W photographs have only one color channel and degrade quickly when manipulated as 8-bit images.CinePaint has higher fidelity and offers a 16-bit printing path to the print-head using GutenPrint.
  • Color Management System. CinePaint uses LittleCMS.
  • Flipbook. Movie playback of short sequences of images in RAM.
  • Innovation. CinePaint offers features that go beyond ordinary painting programs.
  • Open Source. With various OSS licenses, as it uses code from various sources, including GPL, LGPL, BSD, and MPL.
  • Free.
With a large selection of tools for deep paint manipulation and image processing it is quite a useful program and one of the better ones you will find for use on Linux.
CinePaint is used for motion picture frame-by-frame retouching, dirt removal, wire rig removal, render repair, background plates, and 3d model textures. 

It has been deployed on a number of feature films, including The Last Samurai, in which it was used to add the flying arrows. It's also being used by pro photographers who need better color fidelity than is available in other tools.


Installation on Centos is simple thanks again to the guys at Nux Dextop, with a simple binary package download, the nux-dextop version is currently 0.25.0.


To obtain nux-dextop first install wget if not installed.


$ sudo yum -y install wget                           


$ wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-1.el6.nux.noarch.rpm


or


$ wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm


for the repo pack       


$ sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm


to install it.


$ sudo vi /etc/yum.repos.d/nux-dextop.repo   


set 'enabled' to '0'


$ sudo yum -y --enablerepo=nux-dextop install cinepaint



Setting up Install Process
Package cinepaint-0.25.0-0.1.el6.nux.i686 already installed and latest version
Nothing to do

I already have it but you should get 2 packages and be done.


Simply run it with


$ cinepaint


See Fluxbox key bindings if you are using Fluxbox.


Cinepaint is a pretty useful addition to your Centos/RHEL box

with a wide range of innovative and interesting features.

More repos



Monday, 4 March 2013

Centos 6/RHEL install Arista Video Transcoder

Many people treat their viewing of the fiction and fantasy turned out by the Movie and TV industries as a religious ceremony, kitting themselves out with all sorts of state of the art sound equipment and the now obligatory enormous screens.

Others, like me, don't find it so interesting to watch just another remake of an old remade remake from early last century which doesn't really tell us anything about what is actually happening in the world and are more likely to just watch the occasional clip to help them get to sleep.

Whichever of the two categories you place yourself in, if you are using Centos 6/RHEL then you will probably be interested in Arista Video Transcoder, a nice little program based on GTK and Gstreamer written in Python by Daniel Taylor.

It has been available for a while, appearing on Ubuntu Desktop versions but makes a nice addition to Centos 6/RHEL.

FFmpeg afficiados may frown upon the idea, but Arista is a clever little encoder for busy people, and boasts a LARGE range of presets covering practically every device on the planet and a fair proportion of devices available on OTHER planets.

Features include
  • Automatically discover available DVD drives and media
  • Rip straight from DVD media easily
  • Automatically discover and record from Video4Linux devices
  • Support for H.264, WebM, FLV, Ogg, DivX and more
  • Batch processing of entire directories easily
  • Simple terminal client for scripting
  • Nautilus extension for right-click file conversion
It can be used at the terminal as well as with the GTK interface, The GUI is very simple to use, you simply load the file and select the preset. Video purists may be disappointed by the limited user control in the GUI, and the not so great HD quality, but the arista-transcode command in a terminal offers a few more options for tweaking.

It is the GTK interface, however, which is probably of more interest to the majority of users, with its quick and easy conversion and wide choice of device settings. Considerably more presets are available from the web site in tar.gz format and they can be installed in a couple of clicks. You can download the binaries foe Linux from there in tar.gz but you may still have dependency issues, so I'd recommended following the procedure described below to obtain it from the nux-dextop repo.


Presets include

Android Phone, Apple AppleTV, Apple iPad, Apple iPhone/Pod

Archos 3 Vision, Archos 5 Internet Tablet, Blackberry, 
Computer, Computer (Advanced), Cowon D2, Cowon S9, Creative ZEN DVD Player, DVD Player SVCD, HTC Desire, HTC Touch (Elf), 
LG GS290, Netbook, Nintendo Wii, Nokia 5230, 5530, 5800, 
Nokia N Series, Nokia N97, Nokia S60v3 5320, PDA Generic, 
Palm Pre/Pre Plus, Samsung F-480, Samsung Galaxy Tab, 
Samsung Jet S8000, Sony Ericsson K850i, Sony Ericsson Naite Sony Ericsson Vivaz, Sony Ericsson W995, Sony NWZ-818, Sony PSP Sony Playstation 3, Sony Xperia, Vimeo Plus and more.

Installing Arista on your Centos 6/RHEL box is simple thanks to the guys at nux-dextop and I'd recommend this way using Yum.

To obtain nux-dextop first install wget if not installed.

$ sudo yum -y install wget                           

$ wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-1.el6.nux.noarch.rpm

or

$ wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-1.el6.nux.noarch.rpm

for the repo pack       

$ sudo rpm -Uvh nux-dextop-release-0-1.el6.nux.noarch.rpm

to install it.

$ sudo vi /etc/yum.repos.d/nux-dextop.repo   

set 'enabled' to '0'

$ sudo yum -y --enablerepo=nux-dextop install arista

Will install it, then run the GUI with

$ arista-gtk

See Fluxbox key bindings if you are using Fluxbox.

I'd also recommend disabling the preview because you simply don't need it and performance will be smoother.

Arista is a very handy encoder for quickly encoding media files.

Friday, 1 March 2013

Centos 6/RHEL install Komodo Edit

Occasionally, the need arises to use something that is a little more powerful than a typical text editor like Beaver or Gedit etc, without having to open up a full blown IDE such as Eclipse, Netbeans or IntellJIDEA.

There are plenty of decent free editors for Linux, probably more so than any other OS around, but one which seems to fall somewhere between an editor and an IDE is Komodo Edit from ActiveState.

Promoted as a 'Free, feature-rich editor for JavaScript, Perl, PHP, Python, Ruby and Tcl, on Linux, Mac OS X and Windows'
Komodo Edit is very decently equipped with some nice features to be found hidden within its functionality. Support for Node.js is a recent addition and the full list is quite impressive.


Full debugging, code intelligence and editing for Python (including Python 3), PHP, Perl, Ruby, Tcl, XSLT and Node.js.

Full code intelligence and editing for HTML (including HTML 5), JavaScript, CSS (including CSS 3), XML, XUL, and templates (ie. Twig, EJS, epMojo, RHTML, Django, Mason, Smarty, Template Toolkit).

Komodo Edit has editing for dozens of other languages, including C/C++, JSON, SQL, Erlang, CoffeeScript, LESS, SCSS and others.

Add to that Fast Open, Vi key bindings and a Toolbox and you have an extremely useful editor for your web projects.

Note, you will have to have the languages you wish to use installed on your system before they become available in Komodo.

To install Komodo Edit on your Centos 6/RHEL box first go to the ActiveState site and download the Linux version to your home directory.

Change privileges and move to the opt directory

$ sudo su

# cd /opt/

Untar the downloaded tar file.

# tar xvf /home/<user_name>/Komodo-Edit-8.0.1-12353-linux-x86.tar.gz

(or x86_64)

Move into  /opt/Komodo-Edit-8.0.1-12353-linux-x86

# cd Komodo-Edit-8.0.1-12353-linux-x86/

(or whatever version you use)

Run the install shell script

# ./install.sh

You will go through a series of questions with an option to change the install directory, change this to '/opt/komodo'. When the process is complete you will be given a $PATH variable which you can put in to your /home/<user>/.bashrc file

# vi /home/<user>/.bashrc

See vi and vim commands

Enter into it as below under user specific entries     


export PATH="/opt/komodo/bin:$PATH"

Save & exit vi then 

# source /home/<user>/.bashrc

# exit   

Run it with                               

$ komodo 

(You can also place the export line in a separate 'komodo.sh' script in the /etc/profile.d/ directory )                  


See Fluxbox key bindings if you are using Fluxbox.


To add it to your right click context menu if it isn't already there you should just right click on any text file and browse to /usr/local/bin/komodo.exe - this should add it.

There are a wide range of Plugins, Extensions and Add-ons available including an API to write your own if you wish.

If you use it with a Lamp server stack, Komodo Edit makes a decent web development tool, with a handy preview either in a Komodo tab or using your installed browsers and a mapping to your server which you can set up in the preferences dialogue, along with Remote Servers, Stackato and much more.


Overall, Komodo Edit makes a very useful addition to your Linux Desktop and while it is not a replacement for the likes of Eclipse, you will almost certainly find features of it that make it invaluable for quite a few tasks.

I would definitely recommend giving it a try if you are looking for a development tool to fill in certain gaps in your armoury.