Showing posts with label Server Stuff. Show all posts
Showing posts with label Server Stuff. Show all posts

Wednesday, December 30, 2020

LVM GUI Tools

LVM is not simple to deal with. And although I do believe that I must know how to deal with it by using CLI environment, it's always a good thing to know how to use some LVM GUI tools. This article presents some good ones. Just remember: first and foremost, you must understand how it works under the hoods, and then dare to test some of these good tools.

Read the article at https://www.linuxjournal.com/content/review-gui-lvm-tools

bpytop – Awesome Linux, macOS and FreeBSD resource monitor

It is always a good idea to keep a resource monitor open. HTop has been my pet for years. But now, I guess it is time to change. 

BPyTop is an awesome alternative, lightweight, and fully featured. Excellent job, written in Python. After that, I haven't seen my Htop interface for days! Read this concise article, and give BPyTop a try, if you haven't already!

Read more here: https://www.cyberciti.biz/open-source/command-line-hacks/bpytop-awesome-linux-macos-and-freebsd-resource-monitor/

Saturday, June 20, 2015

Installing Java 8 in Ubuntu

I have another post here about how to do this. But it is outdated, and I decided to rewrite it.

There are more simple ways to have Java installed on your Linux. But I do prefer do make it step by step, in the command line. Let's suppose that we are installing version 8.45 of Java
  1. Download Java 8 JDK from Oracle. Accept it's License Agreement, and select jdk-8u45-linux-x64.tar.gz to be downloaded, if your system is 64bits or jdk-8u45-linux-i586.tar.gz if it is 32 bits.
    If you are in doubt about your system, you may confirm with the following command:


    uname -m

    If the answer is x86_64, you have a 64 bits Ubuntu. If the answer is  i686, you have a 32 bits Ubuntu.
  2. Create a variable jv that will point to the installation directory of Java. By downloading the jdk-8u45-linux-x64.tar.gz, we will have /usr/lib/jdk1.8.0_45 as the installation directory.
    We need to create another variable ub, that will point to the the system binaries.
    We do that with the following command:

    jv="/usr/lib/jdk1.8.0_45"
    ub="/usr/bin"
    ATTENTION:
    Not only copy and paste above lines.
    Update Java version in variable jv.
     
  3. I usually do not use the previous versions, so I do remove them Since I always install them in /usr/lib, I will remove them with the following command:
    sudo rm -rfv /usr/lib/jdk* /usr/lib/jvm/jdk*
    

    It is important to repeat to the novice: The command above wil permanently delete the contents of
     /usr/lib/ e /usr/lib/jvm/ that start with jdk. Be sure you do not have in there any other files or directories that may be deleted.
    ATTENTION:
    In case you are not sure whether you may delete this files or not, just do not do it.
      
  4. Open the file you have downloaded from Oracle in /usr/lib/:

    sudo tar xf jdk-8u45-linux-x64.tar.gz -C /usr/lib/
  5. Update alternatives system with the binaries of this version of Java:

    sudo update-alternatives --install ${ub}/java java ${jv}/bin/java 1
    sudo update-alternatives --install ${ub}/jcontrol jcontrol ${jv}/bin/jcontrol 1
    sudo update-alternatives --install ${ub}/javac javac ${jv}/bin/javac 1
    sudo update-alternatives --install ${ub}/javaws javaws ${jv}/bin/javaws 1
    sudo update-alternatives --install ${ub}/keytool keytool ${jv}/jre/bin/keytool 1
    sudo update-alternatives --install ${ub}/pack200 pack200 ${jv}/jre/bin/pack200 1
    sudo update-alternatives --install ${ub}/rmid rmid ${jv}/jre/bin/rmid 1
    sudo update-alternatives --install ${ub}/rmiregistry rmiregistry ${jv}/jre/bin/rmiregistry 1
    sudo update-alternatives --install ${ub}/unpack200 unpack200 ${jv}/jre/bin/unpack200 1
    sudo update-alternatives --install ${ub}/servertool servertool ${jv}/jre/bin/servertool 1
    sudo update-alternatives --install ${ub}/tnameserv tnameserv ${jv}/jre/bin/tnameserv 1
    sudo update-alternatives --install ${ub}/jexec jexec ${jv}/jre/lib/jexec 1

    The following command only applies to 32 bits desktop systems:

    sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so ${jv}/jre/lib/i386/libnpjp2.so 1

    The following command only applies to 64 bits desktop systems:

    sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so ${jv}/jre/lib/amd64/libnpjp2.so 1
     
  6. In case of having more than one Java version installed, only one will be the default version. The following command will perform this action:

    for i in keytool jcontrol pack200 rmid rmiregistry unpack200 servertool tnameserv jexec java javac mozilla-javaplugin.so javaws; do sudo update-alternatives --config ${i}; echo; done

    The above instruction will list all available versions of each binary, if they exist. Choose those listed in step 2. If not, you will obviously have nothing to choose.
After that, we should test the installation to confirm that it is all ok:
java -version
javac -version
Now, we need to set the environment variables correctly. I adapted it from WikiHow. You must edit /etc/profile, adding the following lines by the end of it:
# Environment Java Variables defined IF Java is listed in "alternatives"
if [ -h /etc/alternatives/java ]; then
     a=$(/bin/ls -l /etc/alternatives/java | cut -d \> -f2|cut -d' ' -f2)
     export JAVA_HOME=${a%/bin/java}
     export PATH=${PATH}:${JAVA_HOME}/bin
fi
After editing /etc/profile, we need to close this user section and open it again. Finally, to check it use the following commands:
echo $JAVA_HOME
You will have /usr/lib/jdk1.8.0_45 as answer, according to the version you installed.
echo $PATH
Will give you the whole PATH, and by the end the Java directory. On mine the answer was /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jdk1.8.0_45/bin


Most of this article was written after studying Ubuntu Documentation and resolving some problems on Tomcat7 instalation at a Ubuntu Server.

If you liked it, please write a comment or click on "+1" button.