środa, 19 listopada 2014

Installing R tools in Ubuntu 14.04

First of all you need to instal R programming language.
Then you can install R Studio program.

In order to intall R from package you need to install
prerequisites:
fort77; f2c; gfortran 
Type the following:

sudo apt-get install fort77 f2c gfortran libreadline-dev

You can think about installing gfortran-4.8-doc as well.

And I had already java installed on my system with paths set:
JAVA_HOME        : /usr/lib/jvm/java-1.7.0-openjdk-amd64
Java library path: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server


Then you can download R tarball package from r-project.org site.
tar -xzvf R-3.1.1.tar.gz

Then type
 ./configure --with-x=yes --enable-R-shlib

(previous ./configure --with-readline=no)
make
make install
Other makes in my case did not work e.g. make pdf.


In order to install RStudio the best way is to install already precompiled packages:

libjpeg62 is required
sudo apt-get install lipjpeg62

sudo dpkg -i  rstudio-0.98.1073-amd64.deb

With tarball you need to unpack and build with Cmake
In unpacked folder you do:

mkdir build && cd build
cmake -G "Unix Makefiles" -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release ..

But first you need to make sure you have CMakeFiles.txt set up properly.

This was not in my case





niedziela, 12 października 2014

Imagemagick howto

Recently I have tried to install imagemagick application on Ubuntu.

I tried to download it from home page and install the latest version of it.

However it did not actually worked as planned.

So the easiest way is to just install from ppa

sudo apt-get install imagemagick

Other ways may require to install some extra stuff to make it work

e.g.
jpeg libraries or png ones in order to make convert or other executable binaries to make it work as expected.

wtorek, 22 lipca 2014

Installing printer driver for HP Deskjet 4260

Message from installation script for configuring HP printer drivers.


http://sourceforge.net/projects/hplip/?source=navbar

From there you can download hplip-3.14.6.run binary and run it on Ubuntu Linux or Debian distros.

Trace from this binary after changing mode to x looks like this

Creating directory hplip-3.14.6
Verifying archive integrity... All good.
Uncompressing HPLIP 3.14.6 Self Extracting Archive...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

HP Linux Imaging and Printing System (ver. 3.14.6)
HPLIP Installer ver. 5.1

Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Installer log saved in: hplip-install_Sun-29-Jun-2014_22:49:01.log

\
note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.


INSTALLATION MODE
-----------------
Automatic mode will install the full HPLIP solution with the most common options.
Custom mode allows you to choose installation options to fit specific requirements.

Please choose the installation mode (a=automatic*, c=custom, q=quit) : c

Initializing. Please wait...


INTRODUCTION
------------
This installer will install HPLIP version 3.14.6 on your computer.
Please close any running package management systems now (YaST, Adept, Synaptic, Up2date, etc).


DISTRO/OS CONFIRMATION
----------------------
Distro appears to be Ubuntu 13.10.

Is "Ubuntu 13.10" your correct distro/OS and version (y=yes*, n=no, q=quit) ? y


SELECT HPLIP OPTIONS
--------------------
You can select which HPLIP options to enable. Some options require extra dependencies.

Do you wish to enable 'Network/JetDirect I/O' (y=yes*, n=no, q=quit) ? y
Do you wish to enable 'Graphical User Interfaces (Qt4)' (y=yes*, n=no, q=quit) ? y
Do you wish to enable 'PC Send Fax support' (y=yes*, n=no, q=quit) ? n
Do you wish to enable 'Scanning support' (y=yes*, n=no, q=quit) ? y
Do you wish to enable 'HPLIP documentation (HTML)' (y=yes*, n=no, q=quit) ? y


ENTER USER PASSWORD
-------------------

INSTALLATION NOTES
------------------
Enable the universe/multiverse repositories. Also be sure you are using the Ubuntu "Main" Repositories. See: https://help.ubuntu.com/community/Repositories/Ubuntu for more information.  Disable the CD-ROM/DVD source if you do not have the Ubuntu installation media inserted in the drive.

Please read the installation notes. Press <enter> to continue or 'q' to quit:


RUNNING PRE-INSTALL COMMANDS
----------------------------
OK


INSTALL MISSING REQUIRED DEPENDENCIES
-------------------------------------
warning: There are 6 missing REQUIRED dependencies.
note: Installation of dependencies requires an active internet connection.
warning: Missing REQUIRED dependency: python-devel (Python devel - Python development files)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency: cups-devel (CUPS devel- Common Unix Printing System development files)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency: libusb (libusb - USB library)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency: libtool (libtool - Library building support services)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency: cups-image (CUPS image - CUPS image development files)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency: libjpeg (libjpeg - JPEG library)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y


INSTALL MISSING OPTIONAL DEPENDENCIES
-------------------------------------
warning: There are 4 missing OPTIONAL dependencies.
note: Installation of dependencies requires an active internet connection.
warning: Missing REQUIRED dependency for option 'network': libcrypto (libcrypto - OpenSSL cryptographic library)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency for option 'network': libnetsnmp-devel (libnetsnmp-devel - SNMP networking library development files)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing REQUIRED dependency for option 'scan': sane-devel (SANE - Scanning library development files)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y
warning: Missing OPTIONAL dependency for option 'scan': xsane (xsane - Graphical scanner frontend for SANE)

Would you like to have this installer install the missing dependency (y=yes*, n=no, q=quit) ? y


CHECKING FOR NETWORK CONNECTION
-------------------------------
Network connection present.


RUNNING PRE-PACKAGE COMMANDS
----------------------------
sudo dpkg --configure -a (Pre-depend step 1)
sudo apt-get install --yes --force-yes -f (Pre-depend step 2)
sudo apt-get update (Pre-depend step 3)
OK


DEPENDENCY AND CONFLICT RESOLUTION
----------------------------------
Running 'sudo apt-get install --assume-yes python-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libcups2-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes cups-bsd'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes cups-client'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libusb-1.0.0-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libtool'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libcupsimage2-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libjpeg-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes openssl'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libsnmp-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes snmp-mibs-downloader'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes libsane-dev'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes gtk2-engines-pixbuf'
Please wait, this may take several minutes...
Running 'sudo apt-get install --assume-yes xsane'
Please wait, this may take several minutes...
HPLIP-3.13.9 exists, this may conflict with the new one being installed.
Do you want to ('i'= Remove and Install*, 'o'= Overwrite, 'q'= Quit)?    :o


RUNNING POST-PACKAGE COMMANDS
-----------------------------
OK


RE-CHECKING DEPENDENCIES
------------------------


READY TO BUILD AND INSTALL
--------------------------
Ready to perform build and install. Press <enter> to continue or 'q' to quit:


PRE-BUILD COMMANDS
------------------
OK


BUILD AND INSTALL
-----------------
Running './configure --with-hpppddir=/usr/share/ppd/HP --libdir=/usr/lib --prefix=/usr --enable-udev-acl-rules --enable-qt4 --disable-libusb01_build --enable-doc-build --disable-cups-ppd-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-hpijs-install --disable-udev_sysfs_rules --disable-policykit --enable-cups-drv-install --enable-hpcups-install --enable-network-build --enable-dbus-build --enable-scan-build --disable-fax-build'
Please wait, this may take several minutes...
Command completed successfully.

Running 'make clean'
Please wait, this may take several minutes...
Command completed successfully.

Running 'make'
Please wait, this may take several minutes...
Command completed successfully.

Running 'sudo make install'
Please wait, this may take several minutes...
Command completed successfully.


Build complete.


POST-BUILD COMMANDS
-------------------


CLOSE HP_SYSTRAY
----------------
Sending close message to hp-systray (if it is currently running)...


HPLIP UPDATE NOTIFICATION
-------------------------
Do you want to check for HPLIP updates?. (y=yes*, n=no) : y


RESTART OR RE-PLUG IS REQUIRED
------------------------------
If you are installing a USB connected printer, and the printer was plugged in when you started this installer, you will need to either restart your PC 
or unplug and re-plug in your printer (USB cable only). If you choose to restart, run this command after restarting: hp-setup (Note: If you are using a
parallel connection, you will have to restart your PC. If you are using network/wireless, you can ignore and continue).                                

Restart or re-plug in your printer (r=restart, p=re-plug in*, i=ignore/continue, q=quit) : i


PRINTER SETUP
-------------
Would you like to setup a printer now (y=yes*, n=no, q=quit) ? y
Please make sure your printer is connected and powered on at this time.
Do you want to setup printer in GUI mode? (u=GUI mode*, i=Interactive mode) : u


RE-STARTING HP_SYSTRAY
----------------------

HP Linux Imaging and Printing System (ver. 3.14.6)
System Tray Status Service ver. 2.0

Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


poniedziałek, 16 czerwca 2014

Ubuntu 14.04 post installation steps

This is reminder what libraries is good to set up before working with Ubuntu 14.04 LTS.
I have found this useful tips on Youtube and my own.

The only thing that bothers me is there is no working Skype for Linux.
This Skype 4.2 version for Ubuntu 12.04 does not work due to compatibility issues. So I tried to install dynamic version of Skype or more Debian one.

Anyway here are some useful tasks that you might find useful.
They help you to access more media that you think can only be available on Windows and Mac:

So :-) Install this helpful staff and find out what it can do by looking it up in desktop
search ( Alt + F2 shortcut)

 sudo apt-get install gnome-tweak-tool



 sudo apt-add-repository ppa:pipelight/stable
 sudo apt-get update
 sudo apt-get install pipelight-multi
 sudo pipelight-plugin --enable silverlight
 touch $HOME/.config/wine-wininet-installer.accept-license

sudo pipelight-plugin --enable widevine

sudo apt-get install pepperflashplugin-nonfree


sudo update-pepperflashplugin-nonfree --install
sudo apt-get install ubuntu-restricted-extras

sudo apt-get install libavcodec-extra
sudo apt-get install icedtea-7-plugin openjdk-7-jre
sudo apt-get install openjdk-7-jdk

This extra and nonfree libraries require you to accept and obey licences of Third Party software companies, so if you follow Stallman philosophy be aware !

Anyway open-JDK is more safe in way more copyleft.

 I have also downloaded Debian version of Skype, but it seems to not work correctly under Ubuntu, anyway if you want to install download it from official page and type command:

dpkg -i skype-ubuntu-precise_4.2.0.13-1_i386.deb


I have installed Ubuntu 14.04 LTS alongside with Windows 8.
Moreless I have UEFI laptop and I needed to break security in my laptop
switching off Fast Boot and Secure Boot and installing Ubuntu from USB pendrive.

That caused to build GRUB bootloader not so well so in order to repair it I have run following command to make fix for it:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get updatesudo sh -c "sed 's/trusty/saucy/g' /etc/apt/sources.list.d

There is trick in this file that you need replace text trusty with saucy and than
this application boot-repair will install properly.
If sed command does not work because of permission denied read only mode.
you can use sudo vi command but first give also write permission.

chmod +w  /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list
vi /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list

With this small change you do more steps
sudo apt-get update

 you run  this before next command if you do have dependency issues.

sudo apt-get -f install
sudo apt-get install -y boot-repair && boot-repair


I also recommend installing File manager like Midnight Commander or
better one Krusader ( this one is based on KDE environment )

You can also think of some additional lbraries tht Krusader can use like:

sudo get-apt install kompare
sudo get-apt install 7z
And so on, you will get the point when first running Krusader.

If you like strategy games I recommend to play Battle for Wesnoth:
You can download it from Software Center and save time installing this dependencies like pango, cairo, boost, Truetype and many other libraries,
which should be mentioned in readme file.

 Lastly I also recommend to install tor-browser if you think about security.

And there is also good practice to choose Password Manager.

Then you can experiment and see what other applications are there.








czwartek, 16 stycznia 2014

How to install Oracle database 11g on Ubuntu 12.04



Generally you should look at two post that help you manage this problem:
Oracle Forum how-to

Links on this topic available in one place

I used first link and it worked for me. I used other blog to resolve common problem with
ORA-00845: MEMORY_TARGET not supported on this system that can look pretty
scary.

Here are repeated steps that I did:
Before installing Oracle 11g you should preinstall packages:
sudo apt-get install alien libaio1 unixodbc

 Ubuntu does not have swap memory installed so I need to install it.
To install a 1 GB swapfile named swapfile in /, for example:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
(this may take a while)
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.orig
sudo echo '/swapfile swap swap defaults 0 0' >> /etc/fstab
Also it is good idea to create separate partition for our database and label it /u01.
 I used gparted for it and create separate partition as ext3. Currently Ubuntu 12.04 uses
filesystem ext4 as default and it can be not compatible with Oracle database.

You need to remember to modify fstab when you add swap space and add new partition.
Backup is also recommended.
Modify /etc/fstab to automatically mount the volume at system startup:
sudo cp /etc/fstab /etc/fstab.original
sudo nano /etc/fstab

(Add the following, using determined UUID, for example)

UUID=d19a2d8f-da43-4802-8bdb-0703c855e23a /u01 ext3 defaults,errors=remount-ro 0 1

(Save the file)

Create the mount-point, mount the new volume and set ownership and privileges:
sudo mkdir /u01
sudo mount -a
sudo chown root:root /u01
sudo chmod 755 /u01
After you created new partition you need to link it to your Ubuntu installation filesystem.
I use /opt/oracle-xe for my installation directory

Create a symbolic link to store the installation into an existing directory, for instance:
sudo mkdir /opt/oracle-xe
sudo ln -s /opt/oracle-xe /u01

You can download rpm version for 64 bit Oracle Express Edition 11g from here
Oracle Download Page
Here is what you need to type to convert it to Debian installation package.
sudo unzip linux.x64_11gR2_OracleXE.zip
sudo alien --to-deb --scripts oracle-xe-11.2.0-0.5.x86_64.rpm
(This may take a while)

There are 2 config file that is good to create with pico or nano as you can paste to them
from graphical terminal unlike in vim.
sudo nano /etc/sysctl.d/60-oracle.conf
(Enter the following)

# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912

(Save the file)

Note: kernel.shmmax = max possible value, e.g. size of physical RAM.

Verify: sudo cat /etc/sysctl.d/60-oracle.conf

Load new kernel parameters: 
sudo service procps start
Verify: 
sudo sysctl -q fs.file-max
-> fs.file-max = 6815744
sudo pico /sbin/chkconfig
(Cut and paste the following)

#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Debian by Dude
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
   echo >> $file
   echo '### BEGIN INIT INFO' >> $file
   echo '# Provides:             OracleXE' >> $file
   echo '# Required-Start:       $remote_fs $syslog' >> $file
   echo '# Required-Stop:        $remote_fs $syslog' >> $file
   echo '# Default-Start:        2 3 4 5' >> $file
   echo '# Default-Stop:         0 1 6' >> $file
   echo '# Short-Description:    Oracle 11g Express Edition' >> $file
   echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

(Save the file)

Set appropriate execute privileges:
chmod 755 /sbin/chkconfig

There
Now that you have swapfile, partition for oracle Database and 2 config files and converted install package you can make final installation procedures:
sudo dpkg --install ./oracle-xe_11.2.0-2_amd64.deb
/etc/init.d/oracle-xe configure
(This will take a while)

Remove the /sbin/chkconfig script, which is no longer needed.
sudo rm /sbin/chkconfig

Then you need to setup your sqlplus client by coping it to your bash shell script:
sudo echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >> /home/oracle/.bashrc

After that I downloaded also Oracle client in order to be able to connect to my database:
This are recommended package that you unpack into one folder directory:
instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm

After that you need to update path so we know where to look for sqlplus.

export PATH=<Your Oracle Home Path>/instantclient_11_2:$PATH

You can also create user dba and add it to oracle group, however I am not sure if it is essential:
sudo userdel oracle
sudo useradd -s /bin/bash -G dba -g dba -m oracle
sudo passwd oracle

You can start and stop service like this:
sudo service oracle-xe start|stop

But before that there is one more bug to fix:
I took this from this page Hardly readable fix

Do the following to avoid getting MEMORY TARGET error ( ORA-00845: MEMORY_TARGET not supported on this system ) :
sudo rm -rf /dev/shm
sudo mkdir /dev/shm
sudo mount -t tmpfs shmfs -o size=2048m /dev/shm

The reason of doing all this is that on a Ubuntu system /dev/shm is just a link to /run/shm but Oracle requires to have a seperate /dev/shm mount point.
And finally
sudo service oracle-xe start|stop

Here is permanent fix this error:
To make the change permanent do the following :

a) create a file named S01shm_load in /etc/rc2.d :


sudo vim /etc/rc2.d/S01shm_load
Now copy and paste following lines into the file :


#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;esac

b) Save the file and provide execute permissions :

chmod 755 /etc/rc2.d/S01shm_load

However I prefer first method as messing with shm can be dangerous
for your encrypted filesystem.
So you could put this 4 lines in script like config_oracle.sh and run
it every time you want to experiment with Oracle 11g database.