Monday, 31 December 2012

Centos 6/RHEL install IntelliJIDEA Java IDE

IntelliJIDEA community edition is an extremely useful free IDE for Java, Scala, Groovy,PHP, Python, Ruby, Spring MVC, Webflow, Play, Grails, Web Services, JSF, Struts, Flex and others with version control support Git, CVS, Mercurial and Subversion. 

It also has support for HTML5, CSS3, SASS, LESS, Javascript, Coffeescript, Actionscript, and others & build tools for Maven, Ant, Gradle and Gant with database functionality for SQL, PostgreSQL, MySQL, Oracle and SqlServer.

There is much more to this popular IDE though, so it is worth perusing the documentation on the web site. It has Android and Lint support and as in the snippet below, drug and drop functionality, although what drug it refers to is unclear.

A huge array of features make IntelliJIDEA an extremely useful free IDE and it's ease of installation and use means it is well suited to a minimal Centos 6 Desktop.

Obviously, first make sure you have the Sun Java JDK installed, follow the link here if not, and when that's done, continue.

The community edition is simple to install and use on Centos 6/RHEL, simply download the tarball from IntelliJIDEA  
into your home directory.

$ su                                             to root 

Move to the directory where you want to install it.

# cd /usr/local                             and untar it

# tar xzf /home/<user_name>/ideaIC-12.0.1.tar.gz

This gives you an idea directory in /usr/local

# exit                         back to unprivileged user

Now with it in place you just need a symlink to /usr/bin

$sudo ln -s /usr/local/idea-IC-123.94/bin/ /usr/bin/

(Change the path if you put it elsewhere)

With the symlink made you can now run it with 


At first run (building a Java app), you will need to set up the JDK path, and a dialogue box will appear for you to do this. Just click the add button if your JDK doesn't already show up and add it on, whereby the box will disappear.
Typically, '/usr/java/jdk1.7.0_07' will suffice and others like Android SDK can be added also, see the images below.

Testing a sample class

There are plenty of features to keep you busy for a while and I'd recommend reading through the website docs thoroughly, there are also quite a few video tutorials available from Jetbrains TV.

Fluxbox users see Fluxbox key bindings for shortcut info.

Android SDK

Below are screenshots of the first stages of creating an Android application, for which you will need to set the location of your Android SDK as shown.

Click File > New project, select Android application

Click the New tab and browse to your SDK location

Click OK if all is correct

Your SDK appears in the box so you can now continue

Friday, 7 December 2012

Centos 6/RHEL install Dr Java

Dr Java is an interactive testing environment for java actually written in java and run on Linux by invoking the jar module. It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users so many pros find it useful in a similar manner to the BlueJ ide. Additionally, it can be customized and then a new version (jar file) of the customized app can be generated for subsequent use.

It is easy to use on a Centos 6/RHEL box as long as you have the Sun Java JDK installed, so first make sure that you have by following the link and the instructions.(You might want to install Eclipse while you are there as it is very easy to do, there is also a Dr Java plugin for Eclipse, see below)

There is also a Dr Java available from Princeton University and this is the one we will try first. This sets up a working environment for projects with the Princeton version of DrJava. 

Princeton version

Make a java projects directory

$ mkdir introcs

$ cd introcs

$ mkdir bin

Download and chmod the drjava files

$ wget
$ wget
$ chmod 700 drjava
$ mv  drjava bin

Download the textbok standard library stdlib.jar

$ wget

Download Checkstyle 5.5 and Findbugs 2.0.1 from and to ~/javaproj & download the checkstyle and findbugs execution scripts from and to ~/javaproj/bin and chmod them executable

$ wget
$ wget
$ unzip
$ unzip
$ wget
$ wget
$ wget
$ wget

$ mv checkstyle findbugs bin
$ mv checkstyle.xml checkstyle-5.5
$ mv findbugs.xml findbugs-2.0.1

Add the standard libraries to the CLASSPATH environment variable and add checkstyle and findbugs to your PATH environment variable.

Download to ~/javaproj/bin

$ wget
$ mv bin

Add the following line to the end of either ~/.bash_profile or ~/.profile depending on which you have.

test -r ~/introcs/bin/ && source ~/introcs/bin/

Now you can run Dr Java with


For introductory tutorials on Java you can go to Princeton University online, where you will also find the above instructions repeated. 

Standalone version

If you just want a standalone DrJava go to and download the latest version of Dr Java, you will need to get the Jar file as we will be running it using the jar module
contained within the JDK.

If you have installed Eclipse along with the Java JDK then you may want to get the plug-in for it also at the same time.

Download to your home directory.

Rename it to something easier to type such as 'drjava'

$ mv drjava-stable-20120818-r5686.jar drjava.jar

Now open up a terminal and type

$ java -jar drjava.jar

This will launch Dr Java as below.

Dr Java

Dr Java Interactive Window

You can add the command to the Fluxbox keys file if using Fluxbox.

Fluxbox users see Fluxbox key bindings for more information.

Eclipse Plugin.

If you are installing the Eclipse plugin and have downloaded it, then first you need to unzip it.


Now copy the unzipped jar file into the Eclipse plugins directory

$ cp edu.rice.cs.drjava_0.9.9.20090115-r4708.jar /opt/eclipse/plugins/edu.rice.cs.drjava_0.9.9.20090115-r4708.jar

(Change the Eclipse path to suit your installation)

Now fire up Eclipse and go to Window ->Open Perspective ->Other and you will see an option for 'Dr Java', check this and the view as below should appear, with the Dr Java Interactive pane at the bottom.

Eclipse Dr Java view.

That is all there is to installing the Dr Java plugin in Eclipse.

Monday, 3 December 2012

Centos 6/RHEL install & uninstall Calibre Ebook Reader

Calibre is a fine cross platform Desktop Ebook reader developed by Kovid Goyal, available both from repos and as source files, although compiling from source is not recommended due to the large dependency requirement. 

Some of it's features include

  • Library Management
  • E-book conversion
  • Syncing to e-book reader devices
  • Download news from the web and convert into e-book form
  • Comprehensive e-book viewer
  • Content server for online access to your book collection 

Calibre supports many file formats and reading devices. The e-book formats can be edited by changing the font or the font size and by adding an auto-generated table of contents.

Conversion and editing is only possible after DRM restrictions have been removed from commercial e-book files. It doesn’t natively support this removal, but you can add plugins to accomplish this.

Calibre helps to organize the personal e-book library by allowing the user to sort and group e-books by metadata fields which can be pulled from many different sources such as,

Google_Books,, LibraryThing.

You can search for author, title or keyword in the whole library and you can import e-books either by adding files manually, or by syncing an e-book reading device. On-line content-sources can be harvested and converted to e-books. E-books can then be exported to all supported reading devices via USB or via the integrated mail-server.

Mailing e-books enables, for example, sending personal documents to the Kindle family of e-book readers.
The content of the library can be remotely accessed by a web browser, if the hosting computer is running and pushing content from content sources is supported on a regular interval.
So with Calibre you can not only read ebooks, but also convert .html documents into ebooks that can be published through both Amazon and Barnes & Noble.

It is straighforward to install using the supplied binaries on your Centos 6/RHEL box, first install the required dependencies.

$ sudo yum -y install glibc xdg-utils python

although it is likely that you have these already if you followed this tutorial to install your minimal Centos 6.

Now issue the command to download and install Calibre

$ sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('').read()); main(install_dir='/opt')"

Changing the install_dir and the end of the line from /opt to the one you require if necessary.

At the end of the download and install process you will simply see a message saying 'run with calibre'

$ calibre                      

You will find a Calibre library in your home directory and a sample Ebook to which you can add more.

To uninstall Calibre you can run the uninstaller script

$ sudo python /usr/bin/calibre-uninstall

Then delete the remaining files

$ sudo rm -rf /opt/calibre

For an Ebook program with a smaller footprint try FBReader.

Fluxbox users see Fluxbox key bindings for more information.

More repos.

Centos 6/RHEL install FBReader Ebook Reader

FBReader is a lightweight cross platform Ebook reader written by Nikolay Pultsin, originally for the Sharp Zaurus platform but now supporting multiple operating systems, including Android, Blackberry, OSX and others. Features include Network Library, Book Preview, White on Black, Text Search and more. It is not as well equipped as Calibre and doesn't have the Ebook publishing capability but is still a very useful Ebook program, especially if you are looking for one with a small footprint. 
Below are some of the features of FBReader.

  • It is a multi-platform e-book reader. Free for use, sources are available under the GPL.
  • Supports popular e-book formats like ePub, fb2, mobi, html, plain text, and a lot of other formats.
  • Provides access to popular network libraries that contain a large set of e-books. Download books for free or for a fee. Add your own catalog.
  • It is highly customizable. Choose colors, fonts, page turning animations, etc to make reading as convenient as you want.
Installing is easy as long as you have the Epel repo enabled, so go to the repositories page if you haven't, and scroll down to third party repos.
    Once Epel is installed, a simple command (--enablerepo=epel flag if not permanently done so)

    $ sudo yum -y install fbreader-gtk

    will bring the required dependencies and install FBReader for you.

    To run it you need the first letters in upper case as in

    $ FBReader

    The Adventures of Sylvia Scarlett - Ebook

    A useful lightweight addition to your Centos/RHEL desktop.

    For other Operating Systems see the FBReader website

    For a more advanced reader see Calibre.

    Fluxbox users see Fluxbox key bindings for more information.

    Thursday, 29 November 2012

    Centos 6/RHEL install Speedcrunch and Gcalctool Calculators

    Anyone following the MIT Introduction to Computer Science and Programming course, with lectures from the superlatively knowledgeable Professor Eric Grimson will know that it is not so much an introduction, more of a repeated duckstooling into the deepest waters of abstract mathematics, incremented by doses of extreme maths for prodigies and geniuses, topped off with a subtle course of extra curricular Iterative and Recursive Algorithms, Objects, nested recursive multi-dimensioned Tuples and much more. 

    It is heavily maths orientated so realistically is aimed at high level and dedicated coders with potentially burgeoning careers in certain areas of web engineering, as you would probably expect from an institution which traditionally mentors students from within the top 1% of the worlds intellectual talent. 

    An interesting course which demonstrates crossing the line between just being an average Python programmer and being one in absolute control, Professor Grimsons mastery of the subject matter is palpable. As I have inferred, despite the name it is not entry level and it is followed by many experienced programmers.

    Those who drop out may nonetheless be interested in Speedcrunch and Gcalctool, both decent calculators for Centos 6/RHEL.

    Speedcrunch Centos 6
    Featuring sin, cos, tan, asin, acos and atan keys, views for Math book, Constants, Variables and Functions & including a full screen mode for when small just wont do, Speedcrunch is a very useful tool. Results are displayable as Binary, Octal, Hexadecimal and Decimal with Decimal being available in three formats, General, Scientific and Engineering & 50 decimal digits.

    The symbols used are computer keyboard friendly, for example the divide and multiply keys are identical to your keyboard for easy input and it has a handy exponent key. It is cross platform on Linux, Windows and Mac so users of the latter two happening upon this post can obtain it at the link above, whilst Linux users can use the rpms which I prepared, further down the page.

    It's handy if you are using the minimal Fluxbox version as I do and don't have access to Gnome desktop accessories.

    Although I believe it is now in the Epel repo I converted the supplied deb files to rpms with Alien and it runs fine on Centos 6, so get them below if you have any problems with the repo.

    Speedcrunch 64 bit_el6_rpm

    Install it with

    $ sudo rpm -Uvh <file_name>

    Run it with

    $ speedcrunch

    Gcalctool, now renamed simply 'Calculator' is another fine calc built by the people at Sun and available in the Epel repo. It has multiple modes and below is an example in the Scientific mode.
    It has a formidable array of features including a Programmers mode, user editable constants and functions & accuracy levels configurable up to 9 significant figures/places so it is extremely versatile.

    Gcalctool Centos 6
    If you have the epel repo enabled just issue

    $ sudo yum -y install gcalctool               to get it.

    Run it with

    $ gcalctool

    These are the two calculators which I use for various tasks and they cover the large majority of needs up to mid range mathematics, although professional mathematicians will no doubt use more powerful devices.

    Fluxbox users see Fluxbox key bindings for more information.

    More repos.

    Tuesday, 27 November 2012

    Centos 6/RHEL Fluxbox Key Bindings & Autostart Programs

    Fluxbox key bindings.

    Fluxbox key bindings make life easier on your Centos 6 box as you can assign your programs to be opened with just a keystroke, namely the F1 - F12 keys and Mod1 (Alt) or Mod4 (Microsoft logo) + a letter.

    If you haven't yet installed Fluxbox then as long as you have Epel repo its straighforward, so fetch it with

    # rpm –-import

    # rpm -Uvh

    (Alter the above for 64bit)

    $ sudo yum -y --enablerepo=epel install fluxbox thunar thunar-volman rxvt

    Above for Fluxbox Window Manager, Thunar File Manager and Rxvt Terminal Emulator.

    Set up your shortcuts in Fluxbox as below.

    Hit Alt+F2 to run Thunar or your chosen file manager, check the 'show hidden files' box from the 'view' menu and browse to the .fluxbox directory which is normally hidden.

    Open the 'keys' file with vi and add at the top 'F1 : ExecCommand thunar' (or your file manager) then copy/paste it 10-12 times.

    Change the other F1 entries to F2 etc and change the program it runs, for eg F2 : ExecCommand rxvt
    F6 : ExecCommand beaver
    F9 : ExecCommand google-chrome
    F10 : ExecCommand firefox

    That's fine to start with, save the file, close off file manager and restart fluxbox to register the shortcuts (right click and select restart, change styles here also - try zinek_darkblue).

    More fluxbox options available at /usr/share/fluxbox + info at 

    Fluxbox is highly customisable and the F1 - F12 shortcut keys open your most used programs very quickly. (Alt+F2 to run others or create shortcut/symlinks in the Desktop folder as below).

    $ cd Desktop 

    $ sudo ln -s /usr/bin/<prog_name>

    More keyboard shortcuts.

    You will likely run out of keys for your programs using just F1 - F12, so you can add more by using the Mod1(Alt) & Mod4(Microsoft logo) keys, for example Mod1 g : ExecCommand gimp, (Alt + g) to run Gimp, or another example Mod4 g : ExecCommand gimp, (MicroSoft logo + g) again to run Gimp.

    Mod1 and Mod4 keys + letters gives another 52 shortcuts.

    More information on this can be found at

    Fluxbox Autostart Programs

    To have a program start automatically at bootup.

    $ sudo vi /etc/X11/xinit/xinitrc              add the  line

    startfluxbox                                 save it, then

    $ vi /home/<user_name>/.fluxbox/startup        add the line

    /usr/bin/<prog_name> &                     (with ampersand) 

    just before the 'exec fluxbox' line 

    More repos

    Centos 6/RHEL install Dillo Browser

    Dillo is a fast lightweight browser based on FLTK (fast light tool kit). Written in C and C++, it is known for its small footprint and lightening fast rendering of web pages. It has a novel bug meter for detecting bugs and contributions from new developers are encouraged. Although there is deliberately no support for images and scripts it is nonetheless a useful addition if you are looking for a featherweight browser without going the text based route.

    To install Dillo on your Centos 6/RHEL box, first make sure you have kernels and compile tools sorted as in this tutorial.

    Download FLTK      (need 1.3.0 +)
    Download Dillo     (latest recommended)

    Both to your home directory, get dependencies first, you need
    openssl and an --enable-ssl flag on configuring.

    $ sudo yum -y install openssl openssl-devel

    $ sudo su

    First build the FLTK source files

    # cd /usr/src

    # tar xvf /home/<user_name>/fltk-1.3.0-source.tar.gz

    # cd fltk-1.3.0

    # ./configure

    # make && make install

    # cd              and remove the install files

    # rm -rf /usr/src/

    Now install Dillo

    # tar xvf /home/<user_name>/dillo-3.0.2.tar.bz2

    # cd dillo-3.0.2

    # ./configure --enable-ssl

    # make && make install

    # cd              and remove the install files

    # rm -rf /usr/src/dillo-3.0.2

    # exit           

    Run it with 

    $ dillo

    See Fluxbox key bindings for more information.

    Dillo's page rendering is sometimes strange due to lack of image and script support but if you can live with that it is a very fast and useful browser.

    Monday, 26 November 2012

    Centos 6/RHEL Zip a file/folder

    Like the USB format commands, I sometimes forget the Zip file/folder commands so here it is to remind me.

    First install Zip if not already there.

    $ sudo yum -y install zip 

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * Webmin:
     * base:
     * epel:
     * extras:
     * updates:
    Setting up Install Process
    Package zip-3.0-1.el6.i686 already installed and latest version

    The syntax to zip up a folder is

    $ zip -r <> <folder_to_be_zipped>

    $ zip -9 -r <> <folder_to_be_zipped>

    $ zip <> <file_to_be_zipped>

    $ zip -9 <> <file_to_be_zipped>

    -9 is to invoke the maximum compression value, you can leave it off for the default compression.

    So as an example, to zip up an xvid .avi file should the need arise.

    $ zip -r factory.avi  (avi files wont compress)

      adding: factory.avi (deflated 1%)

    So we have a look inside with Xarchiver, there it is.

    To zip up a test folder containing various compressible files and using default and maximum compression.

    $ zip -r test_folder

    $ zip -9 -r test_folder

    Although it often does not seem that the compression makes all that much difference, those are the usual commands.

    To unzip the folder or file just

    $ unzip <zip_file/folder_name>

    Zip folders in Linux are usable cross platform.

    $ zip -h for more options and flags.

    That's it, simple zipping and unzipping.

    Monday, 19 November 2012

    Centos 6/RHEL using Repoquery and Yum commands

    You can use the repoquery command to list packages, it will work with installed packages as well packages not yet installed.

    Install yum-utils            

    $ sudo yum -y install yum-utils

    Example syntax below

    $ repoquery -q -l <package_name>
    $ repoquery -q -l --plugins <package_name>
    $ repoquery -i <package_name>

    For example

    $ repoquery -q -l mysql-libs


    Or for more information

    $ repoquery -i mysql-libs

    Name        : mysql-libs
    Version     : 5.1.69
    Release     : 1.el6_4
    Architecture: i686
    Size        : 4126608
    Packager    : CentOS BuildSystem <>
    Group       : Applications/Databases
    URL         :
    Repository  : updates
    Summary     : The shared libraries required for MySQL clients
    Source      : mysql-5.1.69-1.el6_4.src.rpm
    Description :
    The mysql-libs package provides the essential shared libraries for any
    MySQL client program or interface. You will need to install this package
    to use any other MySQL package or any clients that need to connect to a
    MySQL server.

    Use it in conjunction with the yum list updates command 

    $ yum list updates
    $ yum list updates openssh
    $ sudo yum -y update openssh 

    Shows output (among other)

    [root@Centos anton]# Running Transaction Test
      Updating   : openssh-server-5.3p1-81.el6_3.i686                        2/6 
      Updating   : openssh-clients-5.3p1-81.el6_3.i686                          3/6 
      Cleanup    : openssh-clients-5.3p1-81.el6.i686                            4/6 
      Cleanup    : openssh-server-5.3p1-81.el6.i686                             5/6 
      Cleanup    : openssh-5.3p1-81.el6.i686                                    6/6 
      Verifying  : openssh-server-5.3p1-81.el6_3.i686                           1/6 
      Verifying  : openssh-5.3p1-81.el6_3.i686                                  2/6 
      Verifying  : openssh-clients-5.3p1-81.el6_3.i686                          3/6 
      Verifying  : openssh-clients-5.3p1-81.el6.i686                            4/6 
      Verifying  : openssh-5.3p1-81.el6.i686                                    5/6 
      Verifying  : openssh-server-5.3p1-81.el6.i686                             6/6 

      openssh.i686 0:5.3p1-81.el6_3                                                 
    Dependency Updated:
      openssh-clients.i686 0:5.3p1-81.el6_3   openssh-server.i686 0:5.3p1-81.el6_3  

    [root@Centos anton]# 

    Exclude Packages

    You can permanently exclude packages you do not wish to be updated with yum update, just add an entry into yum.conf

    $ sudo vi /etc/yum.conf

    and append the following in the 'main' section

    exclude=kernel*php*        to exclude kernel and php packages

    Disable the exclude if necessary by using

    $ sudo yum -y --disableexcludes=main install php

    $ sudo yum -y --disableexcludes=all update

    $ sudo yum -y --disableexcludes=repoid install php

    Other commands

    $ yum info <package_name> $ yum repolist
    $ yum list available
    $ yum list available | grep gimp

    Shows output             

    gimp-data-extras.noarch                  2.0.2-3.1.el6                   base   
    gimp-devel.i686                          2:2.6.9-4.el6_3.3               updates
    gimp-devel-tools.i686                    2:2.6.9-4.el6_3.3               updates
    gimp-help.noarch                         2.4.2-5.1.el6                   base   
    gimp-help-browser.i686                   2:2.6.9-4.el6_3.3               updates
    gimpfx-foundry.noarch                    2.6.1-3.el6                     epel   

    More repoquery commands

    More repos

    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

    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.