Tag Archives: linux

Installing rJava in RHEL

Installing rJava on Ubuntu is a piece of cake. All you have to do the code below, and boom!!! You got rJava working in R.

 sudo apt-get install openjdk-7-jdk
 sudo apt-get install r-cran-rjava
 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
 export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client

Now, the challenge was trying to get rJava working on RHEL. I could not find any proper documentation that worked. Instead, I ran into a bunch of posts and pointing to things that worked in their environment, but not on mine (so, this might not work on yours as well, but I hope it does). I usually like to give credit to the sources, but this time, they were so many over a long time span, that I could not remember what came from where anymore. So, I apologize for that. Below are the things that I did to get rJava working.

packages need

$ sudo yum install gcc-c++ gcc-gfortran R R-core R-core-devel R-devel R-java R-java-devel java-1.7.0-openjdk-devel
$ sudo yum list install gcc*

Once, you have installed the necessary packages; then it is time to

configure your environment

$ sudo /usr/sbin/alternatives --config java #select openjdk
$ sudo /usr/sbin/alternatives --config javac #select openjdk
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre
$ export PATH=$PATH:$JAVA_HOME/bin
$ sudo /usr/bin/R CMD javareconf
$ R
> install.packages("rJava") #install rJava on R console

And that is it! If you got the install.packages(“rJava”) to work on R, that means that now you can call Java from within R console.

How to install a new version of python in RHEL 6

So, if you have RHEL 6, you might be stuck with Python 2.6.  But, not really.  Even though you might not be able to install a new version of python using yum, you can still download a new version of python and install it in your environment.  Now, you can install it and replace the current version or you can install another version and have two python in your system.

  1. Install GCC by typing
    sudo yum install gcc
  2. Go to
    cd /usr/src/
  3. Now, let’s download a release from python.org. In this example we will be using Python 3.5.0.

    sudo wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz sudo tar xf Python-3.5.0.tar.xz sudo cd Python-3.5.0
  4. Let’s compile
    sudo ./configure
  5. Let’s build the package
    sudo make
  6. Now, to install it you have two options.  You can either overwrite the python executable or you can install as concurrent instance.
    1. If you want to overwrite the OS python executable
       sudo make install
    2. If you want to install concurrent (not overwritting the OS executable)
       sudo make altinstall
  7. Now let’s link it so others could use it
     sudo ln -s /usr/local/bin/python3.5 /usr/bin/python3.5
  8. Now test it by invoking the following command
    python3.5 -V

    You should have the following result

    "Python 3.5.0"
  9. If you get that result let’s continue, otherwise look back and see what step you missed.
  10. Now that you have python 3.5 install along with 2.7, you might want to install pip to handle package installations.
  11. In order to do that, let’s first download pip.
    cd ~/Downloads
    wget https://bootstrap.pypa.io/get-pip.py
  12. Now, let’s install it
     sudo python3.5 get-pip.py

    If setuptools is not installed, get-pip.py will automatically install setuptools.

  13. To check pip if installed successfully
     pip3.5 -V

    You should have the following result

     "pip 7.1.2 from /usr/local/lib/python3.5/site-packages (python 3.5)"
  14. If you want others to use pip with sudo command, you probably want to do this
  15. sudo ln -s /usr/local/bin/pip3.5 /usr/bin/pip3.5
  16. And there you go!  Now you have two python versions and two pip versions running concurrently on your OS.

Sources

https://www.python.org/

https://pip.pypa.io/en/stable/installing/

http://stackoverflow.com/questions/8087184/installing-python3-on-rhel

http://stackoverflow.com/questions/6587507/how-to-install-pip-with-python-3

How Linux is Built | The Linux Foundation Video Site

Do you think that Microsoft is dominating still? Do you think that you don’t need or use Linux OS?  Learn more on how you are using Linux OS on your daily basis and you don’t even know it.  This is an OS that is so stable that needs to be more marketable so you know that you are using it.
How Linux is Built | The Linux Foundation Video Site.

System Monitor Indicator For Unity Panel In Ubuntu 11.10 Oneiric Ocelot

If you install the new version of Ubuntu 11.10 Oneiric Ocelot you will notice that it comes with Unity installed in order to make a better OS experience.  That could be very well true, but I do like to see my system monitor and see how my PC is behaving.  Now, it can not be easily done with unity, but if you would like to do it, go to the link below and you will be able to find steps by using PPA in order to get your system monitor on unity.  Also, if you don’t like unity you could go back to gnome, but that is something different that is not being cover in this article. 🙂

Source http://www.linuxnov.com/system-monitor-indicator-for-unity-panel-in-ubuntu-11-04-natty-narwhal/

untangle linux protecting me from virus

i have been having utangle for a while now and i did not know how useful it was to protect my gateway until today.  out of 52072 files that the clamav antivirus look for 25761 were blocked :o.  that is about 49% of the files that would of probably infect my computer were blocked at the gate making by only windows pc safe.  so, if you are thinking about safety on a windows environment, maybe utangle might be the solution :).

for more information about untangle visit the following site http://www.untangle.com/.

Splitting in Linux and Combining in Windows

i don’t know if you do this on a daily, monthly, yearly, or never basis, but i do some times.  what is it that i do?!

whenever i want to email or upload gigs of information over the net usually takes for ever.  the file might be upload it incorrectly or the file won’t go through because is too big.  well, there are applications out there that you can use in order to be able to split files.  for example, if you are compressing an application using WinRar, it will automatically create *.rar-xxx which it will have your files separated depending on the size that you specified.  well, i believe there is a easier way to be able to perform this.

OK, now lets say that you are using Linux and you would like to split a 1GB file into 100MB files.  the way to do this is using the split command… and it will go like this:

split --bytes=100mb file1 file_

where you will replace file1 with the actual name of the file (e.g. MyFamilyDVD.iso) and file_ will be how the files will be renamed (e.g. MyFamilyDVD.iso_)

now, lets say that you upload these files to a server and your friend download them.  your friend will need the following command in order to be able to combine the files:

cat file_* > file1

where file_* are all the files that were created (e.g. MyFamilyDVD.iso_*) and file1 is the actual name of the file to be created (e.g. MyFamilyDVD.iso).

so, lets say that your buddy doesn’t have Linux and they have Windows instead.  here is the command that they will need in order to combine all of those files.

copy /B file_1+file_2+file_3 file1

where file_1+file_2+file_3 (e.g. MyFamilyDVD.iso_*)will be all the files created and file1 will be the actual name of the file to be created. the bad thing in windows is that you won’t be able to use the asterisk and you will need to type file per file.

any ways i hope this helps!!!

Facebook On Your Messenger

alright… i know that i am currently working on a paper but i had to do this.  just as it right now i just experience the best application that i could ever imagine.  i really hate people that chat through facebook chat and i really hate to be bother while i am stalking others :D.  so what it is what i am talking about… the facebook integration to pidgin in order to use it as a instant message application, just like if you were using yahoo, msn, icq and others.

now i will be able to chat with my friends with no problem from my instant messenger.  that is why i love open source applications, it gives you the freedom  to use it which ever way you want it.

so in order to have facebook on your im you will need to get…

  1. pidgin at http://pidgin.im/
  2. facebook add-in at http://www.getdeb.net/release/3699

and that is it… NOTE: that this was tested on ubuntu (linux os).

Fix NTFS Hard Drive

so the other day my friend lend me his external hard drive so i could import some big files that he had on it.  apparently he didn’t click on safe remove drive under windows and he disconnected the hard drive just like that.  i say this because when ever i was trying to open the hard drive windows was saying that the drive still being used by another application.  i couldn’t started in windows for nothing.

so i decided to move do the same thing in linux (ubuntu).  apparently i was receiving the same error.  after 30 minutes of trying i was getting tired and i was about to return his drive back and make him eject safely his hard drive.  well… before doing that i thought… mmmnnn i wonde if there any free app that i could use in linux in order to fix this problem.  guess what? YES, there is.

this app is called ntfs fix, and what it does is, fixes your ntfs drive.  i installed in ubuntu using the following command:
$ sudo apt-get install ntfsfix

then after installing this app all i had to do was running the following commands:
$ sudo ntfsfix /dev/sdc1
$ sudo ntfs /dev/sdc1

where sdc1 is the external hard drive.  then i mounted the drive and it load like a baby.  well, i hope that this helps 😉

XAMPP

XAMPP is an application that it would help you to facilitate the hassle of installing Apache web server, MySQL, Perl and PHP individually. This tutorial will show you step by step on how to install XAMPP in Lunix and have it auto started with your computer. This tutorial was tested on Ubunut and Fedora. Replace x.x.x for the XAMPP version.

Steps:

  1. Go to http://www.apachefriends.org/en/xampp-linux.html and download “XAMPP Linux x.x.x”
  2. Open up the “Termial
  3. Become a root user bu typing “su
  4. Type the administrator password
  5. Go to where the file “xampp-linux-x.x.x.tar.gz” is downloaded
  6. Extract the files by typing this “tar xvfz xampp-linux-1.6.7.tar.gz -C /opt

Now XAMPP will be under “/opt/lampp” folder. In order to run XAMPP you will need to run this… “/opt/lampp/lampp start” as a root. If you want to stop it just replace start for stop.

To test whether your server is up go and open your web browser and type “http://localhost“. If it works you are now good to go to the next step.

This step is setting up XAMPP security. In order to do that being the root type “/opt/lampp/lampp security“.

To remove XAMPP from your system type “rm -rf /opt/lampp

If you want to have XAMPP starting with your machine when it turns on follow this steps.

  1. Find out your default runlevel type “egrep :initdefault: /etc/inittab
    You should no see a line containing a number between two colons. In most cases 3 or 5 (2 if you’re using Debian).
  2. Go into the directory which configures this runlevel. If for example your runlevel is 3, then you have to change directory into the “/etc/rc.d/rc3.d” directory.If your system didn’t provide /etc/rc.d/rc3.d please try also /etc/init.d/rc3.d and /etc/rc3.d.
  3. Now setup XAMPP to start when your computer turns on type”ln -s /opt/lampp/lampp S99lampp
    ln -s /opt/lampp/lampp K01lampp

    Now XAMPP should start and stop automatically if you boot or shutdown your machine.

And that’s it.  Hopefully you had success like I did 😛