Minggu, 05 November 2017

How to Install JAVA 8 on Ubuntu

Java is the widely used programming language used by billion of application. Generally, every system required Java installed there. You may also need to Install Oracle Java 8 on your Linux system. You will require the PPA maintained by Webupd8 Team to Install Oracle JAVA 8 on Your Ubuntu and Linux System.

Read this => Install Java 8 on Debian
>Read this => Install Java 8 on CentOS, RHEL & Fedora
Use this tutorial to install Oracle JAVA 8 (JDK 8u144) on Ubuntu 17.10, 17.04, 16.04, 14.04 and 12.04 LTS and LinuxMint 18, 17 systems using PPA.

Step 1 – Install JAVA 8

First of all, you need to add webupd8team Java PPA repository in your system. After that install, Oracle Java 8 using following a set of commands.

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Step 2 – Verify Installed Java Version

After successfully installing Oracle Java using above step verify installed version using the following command.

rahul@tecadmin:~$ java -version 

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Step 3 – Setup Java Environment

Also, install Java configuration package. It seems like below package is already installed with latest operating systems during installation of JAVA packages. But you can still make sure by running below command.

$ sudo apt-get install oracle-java8-set-default

Now add the JAVA_HOME and JRE_HOME environment variable in /etc/environment configuration file using following command.

$ cat >> /etc/environment <<EOL
JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
EOL

atau bisa menggunakan metode ini

$ sudo add-apt-repository ppa:openjdk-r/ppa

jika ada pesan error spt ini

Cannot add PPA: 'ppa:openjdk-r/ppa

maka jalankan perintah ini

$ sudo apt-get install --reinstall ca-certificates

lalu jalankan kembali 

$ sudo apt-get update

selanjutnya jalankan perintah ini

$ sudo apt-get install openjdk-8-jdk

lalu chek versi javanya

$ java -version 

openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~14.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)


 

ADD-APT-REPOSITORY: COMMAND NOT FOUND

The last time I encountered the add-apt-repository: command not found error I was using Ubuntu Server 12.4 Lucid. The solution then was to install python-software-properties as follows:

$ sudo apt-get install python-software-properties


This did not resolve the issue on my minimal virtual machine installation on Trusty so I installed apt-file – which is an apt package searching utility:

$ sudo apt-get install apt-file


Update apt-file:

$ apt-file update


Finally use apt-file to search for the add-apt-repository package:

$ apt-file search add-apt-repository


As you can see add-apt-repository is in software-properties-common:

software-properties-common: /usr/bin/add-apt-repository
software-properties-common: /usr/share/man/man1/add-apt-repository.1.gz


After installing software-properties-common I was able to use add-apt-repository without any further issue:

$ sudo apt-get install software-properties-common

Rabu, 05 Juli 2017

1548 Cannot load from mysql.proc. The table is probably corrupted

error seperti ini biasanya terjadi pada saat restore database dari Engine database yang lebih tinggi ke Engine database dengan versi lebih rendah misal database MySQL versi 5.5 di restore ke database MySQL versi 5.1

MySQL will sometimes return the error message “Cannot load from mysql.proc. The table is probably corrupted”. This happens due to schema changes required for different MySQL server versions. The simple fix to this problem is to run the mysql_upgrade command from the command line.

About mysql_upgrade

mysql_upgrade examines all tables across all databases for incompatibilities with the current version of MySQL Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.

mysql_upgrade should be executed each time you upgrade MySQL. It supersedes the older mysql_fix_privilege_tables script, which should no longer be used.

mysql_upgrade executes the following commands to check and repair tables and to upgrade the system tables:

mysqlcheck --all-databases --check-upgrade --auto-repair

mysql < fix_priv_tables

Run mysql_upgrade From Command Line

To use mysql_upgrade, make sure your MySQL server is running and then invoke mysql_upgrade from the command line tool:

mysql_upgrade -uroot -p --force

You should then be prompted to enter the MySQL root's password and mysql_upgrade will check all the databases and tables and fix them where appropriate. You may need to specify the full path to the above command if it's not in the shell's search path.

On Debian 6 it should be loacted at:

/usr/bin/mysql_upgrade -uroot -p --force

On Mac's MAMP the default path is:

/Applications/MAMP/Library/bin/mysql_upgrade -uroot -p --force

On Windows it'll be where MySQL is installed and contained in the bin subdirectory. By default it should be located at:

"C:\Program Files\MySQL\MySQL Server\[*CHANGE TO MySQL SERVER*]\bin\mysqladmin" -u root shutdown

VICTORY!

After running mysql_upgrade, stop the server and restart it so that any changes made to the system tables are ensured to take effect.

All checked and repaired tables are marked with the current MySQL version number. This ensures that next time you run mysql_upgrade with the same version of the server, it can tell whether there is any need to check or repair the table again.

URL Sumber : http://www.myguysolutions.com/2013/10/30/how-to-resolve-mysql-error-code-1548-cannot-load-from-mysql-proc-the-table-is-probably-corrupted/

Selasa, 18 April 2017

Load Balance 2 ISP PCC Mode - Mikrotik

LOAD BALANCING PCC MODE

IP Gateway :

ISP 1 = 192.168.62.82
ISP 2 = 192.168.5.1

/ip firewall mangle
add action=mark-connection chain=input comment="" connection-state=new \
disabled=no in-interface="ether1-citranet" new-connection-mark=isp-1 passthrough=yes

add action=mark-connection chain=input comment="" connection-state=new \
    disabled=no in-interface="ether5-indihome" new-connection-mark=isp-2 passthrough=yes

add action=mark-routing chain=output comment="" connection-mark=isp-1 \
    disabled=no new-routing-mark=jalur-1 passthrough=no

add action=mark-routing chain=output comment="" connection-mark=isp-2 \
    disabled=no new-routing-mark=jalur-2 passthrough=no

add action=mark-connection chain=prerouting comment="" disabled=no \
    dst-address-type=!local in-interface="ether2-lokal" new-connection-mark=\
    isp-1 passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0

add action=mark-connection chain=prerouting comment="" disabled=no \
    dst-address-type=!local in-interface="ether2-lokal" new-connection-mark=\
    isp-2 passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1

add action=mark-routing chain=prerouting comment="" connection-mark=isp-1 \
    disabled=no in-interface="ether2-lokal" new-routing-mark=jalur-1 passthrough=yes

add action=mark-routing chain=prerouting comment="" connection-mark=isp-2 \
    disabled=no in-interface="ether2-lokal" new-routing-mark=jalur-2 passthrough=yes

/ip firewall nat
add chain=srcnat action=masquerade out-interface="ether1-citranet" comment="" disabled=no
add chain=srcnat action=masquerade out-interface="ether2-indihome" comment="" disabled=no
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.62.82 \
    routing-mark=jalur-1
add disabled=no distance=2 dst-address=0.0.0.0/0
gateway=192.168.5.1 \
    routing-mark=jalur-2

SELESAI !

Kamis, 09 Maret 2017

Enable php5 mcrypt pada Linux Ubuntu 14.04

Terkadang aplikasi php yang kita buat menggunakan tombol atau menggunakan menu-menu yang tidak dapat muncul pada halaman web padahal perintah a2enmod rewrite sudah di aktifkan dan Overrride all pada apache2.conf sudah di buka, dimana web server yang digunakan adalah linux ubuntu server 14.04.
ada cara yang harus aktifkan terlebih dahulu yaitu pada php5 mcryptnya, adapun caranya adalah sebagai berikut :

Login ke server Linux Ubuntu baik sebagai user biasa maupun sebagai super user ( root )
lalu jalankan perintah :

$ sudo php5enmod mcrypt && sudo service apache2 restart

atau

$ sudo php5enmod mcrypt
$ sudo service apache2 restart
 
selanjutnya refresh pada web browsernya