Mittwoch, 7. Februar 2018

Oracle Java Cloud Service - Learnings

The intent of this postings is to share learings in order to safe lifetime.

When creating an Oracle Java Cloud Service (11.1.1.7 - that might be needed for some Fusion Middleware Products) on OCI-Classic I would suggest:
  • the Database must not be 12.2.x, it can be 12.1..0.2
  • the Database name must not contain any "-"
    ( Doc ID 2214258.1 Creating new Java Cloud Service fails, if it has hyphen in DBCS name or Identity domain name.)
  • Database Password must be between 8 and 30 characters with at least one lower case letter, one upper case letter, one number, one special character (_,-,#) (these 3, only!) and no white space character. It must also not contain the following keywords or their reversed form: root, sys, system, dbsnmp, oracle. Acceptable password example, Ach1z0#d) 
  • The Oracle Database Cloud Service database deployment must have backups enabled, otherwise provisioning will fail(Doc ID 2268255.1 Unable To Create JCS Instance As It Says There Are No Oracle Database Cloud Service Instances Available)
  • Database User used to create Java Cloud Service must have the SYSDBA role and must have DBA privileges. (Doc ID 2287399.1 Creating JCS Instance Failed)
  • the Java Cloud Service - 11.1.1.7 (Version 10.3.6.1.171017) Weblogic Password must start with a lower letter
  • (otherwise error "sm.create.service.request.not.validated [DBConnectionIncorrectCredentials]"
  • plus Weblogic Password should not have any other special characters than ('$',''_,'#') 
Otherwise your service creastion might fail.
 

Mittwoch, 2. Dezember 2015

Useful Mac OS commands

This blog is a cheat slip of commands I use on a regular basis, but where I also google for all the time.

Start quick and dirty http Server to allow access to download a file
- cd to the folder you like to expose a file via http i.e.
$ cd Downloads

- identify your external IP address:
$ ifconfig

Issue the following python command:
$ python -m SimpleHTTPServer 8080

Now your file should be downloadable via
http://your-public-IP-address:8080/your-filename
 


Safely remove files in trash (esp. for El Capitan)
# srm -rfv -m  

Highlight the files in trash and drag into terminal behind the command. Remember to have a blank space behind the "m" and the path to the first file.
 

where
r  - (recursiv - removes the contents of directories)
f  - (force - never prompt, ignore non existing files)
v - (verbose - explain, what is beeing done)
m - (overrite with 7 US DoD complient passes)


Mittwoch, 11. November 2015

Usefull (Oracle) Linux commands

This blog is a cheat slip of commands I use on a regular basis, but where I also google for all the time.

  • Check the running Linux distribution / Operating system Version
    # cat /etc/issue.net | head -1
    Oracle Linux Server release 5.7
    or since Oracle Linux 6:# cat /etc/oracle-release
    Oracle Linux Server release 7.3
  • Check for ports in use
    $ netstat -nplt
  •  ssh using private key and port forewarding
    $ ssh oracle@«ipadress» -i .ssh/id_rsa -L 5503:localhost:5500
  • search for a string, i.e. "ol7.localdomain"
    $ grep -r ol7.localdomain *- if your sear phrase contains blanks, put the search term in ""
    - recursive = -r
    - case in-sensitive = -i
  • check, if a package is installed in your linux distribution (e.g. a JDK rpm):
    # rpm -aq | grep -i jdk
  • to be continued ...

Freitag, 30. Januar 2015

How to reset Mac OS iCal - Apple Calendar

Due to migrating and upgrading on mac os since some time I was facing calendar issues:
- "The URL https://<...>/ encountered HTTP error 302. Make sure the URL is correct."
- some calender subscriptions disappeared. I could not create subscriptions: "... this calender exists."

Important to mention: I had no local calender entries!

So I wanted to reset my iCal in Mac OS.

The following is a description, how I have done this.
No garantee!

MAC OS X Yosemite Version 10.10.2 - MacBook Pro - iCal Version 8.0 (2021.6.1)

1. Take a note of your calender seetings
    - open system settings - internet accounts
    - make a note or screenshot of your settings. You need it later, when you setup.
    - in calender do a right click on calender subscriptions and make note of the URLs

2. Disconnect all your attached devices
    - disconnect mouse, keyboard, disk drives etc.

3. Disconnect from Network
    - disconnect network cable
    - disable WI-FI
 
4. Close all Applications and Reboot

5. Close all applications started due to autostart operations

6. Remove calender account
    - open system settings - internet accounts
    - remove the calender account

7. Remove Caches and Calender data
    - open a finder
    - from the menue select "connect to folder":
       /Volumes//Users//Library
      where is the name of your disk, ans is your user.


    Important! Do not delete anything. Simply move the following folders to a new location
    (for example your desktop) to have a backup!

    - in the above mentioned folder ".../Library" move the following folders to the backup location:
      1. Caches
      2. Calendars
    - check the folder are no longer under ".../Library".
    - now goto folder   ".../Library/Containers" and move the following files to your backup location:
      3. com.apple.CalendarAgent
      4. com.apple.iCal
    - check the files are no longer under ".../Library/Containers".

8. Reboot again

9. Open iCal
    iCal should be reset to defaults.
    Re-create your iCal account and subscriptions.

10. Your calender should be fresh and fast.
      Remember to clean up your backed-up folders.

Freitag, 9. Januar 2015

Configure Firefox Java Browser plugin

Although Java might be installed on your Oracle Linux system, your browser might not know Java.
So, this is how to get your firefox up to speed.

1. Identify Java Install locations (Remember this document - No. 7)

Become User "root":

$ su -Password:
# 

Query the standard java directory on Oracle Linux:

# ls -l /usr/java/
total 8
lrwxrwxrwx. 1 root root   16 Jan  9 13:24 default -> /usr/java/latest
drwxr-xr-x. 8 root root 4096 Jan  9 13:49 jdk1.7.0_71
drwxr-xr-x. 9 root root 4096 Jan  9 13:40 jdk1.8.0_25
lrwxrwxrwx. 1 root root   21 Jan  9 13:40 latest -> /usr/java/jdk1.8.0_25


2. Find Mozilla Firefox Plugin Directory

2.1 Check your browser binary version
This is important, where to find the library!
(Firefox must be running.)

# ps -ef|grep firefox
root     12536 28294  0 14:53 pts/4    00:00:00 grep firefox
oracle   13105     1  6 11:51 ?        00:11:57 /usr/lib64/firefox/firefox


Mine is 64bit, so I have to use the 64bit plugin.

2.2 Navigate to standard Mozilla plugin directory

# cd /usr/lib64/mozilla/plugins

3. Check for existing symbolic links to the mozilla plugin

First check, if there is a link to the libnpjp2.so file:

# ls
libflashplayer.so  libtotem-cone-plugin.so  libtotem-mully-plugin.so
libnpjp2.so        libtotem-gmp-plugin.so   libtotem-narrowspace-plugin.so


4. Close your Firefox Browser!


5 Remove existing symbolic link

rm libnpjp2.so
rm: remove symbolic link `libnpjp2.so'? y


6 Create new symbolic link

# ln -s /usr/java/jdk1.7.0_71/jre/lib/amd64/libnpjp2.so

7 Test your Java Browser Plugin

Open Firefox and open Java Test Page:
https://www.java.com/en/download/help/testvm.xml
The output should be similar to mine:

Verified Java Version

Completion checkmark

Congratulations!

You have the recommended Java installed (Version 7 Update 71).

How To Install and manage Java JDK on Oracle Linux

Every Time I set up an Oracle Linux server, I ask myself, how have I done it last time ...

1. Check which Java Version (JDK7, JDK8, ...) is certified with your software.
e.g. Oracle Fusion Middleware supported system configurations:
http://www.oracle.com/technology/software/products/ias/files/fusion_certification.html

2. Check support policy, esp. end of life for your desired Java Version
http://www.oracle.com/technetwork/java/javase/downloads/eol-135779.html

3. Download JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html

4. Install JDK

# ls -l jdk*
-rw-r--r--. 1 oracle oinstall 126679286 Jan  9 13:01 jdk-7u71-linux-x64.rpm
-rw-r--r--. 1 oracle oinstall 142191827 Jan  9 13:06 jdk-8u25-linux-x64.rpm


# rpm -Uhv jdk-7u71-linux-x64.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
    rt.jar...
    jsse.jar...
    charsets.jar...
    tools.jar...
    localedata.jar...
    jfxrt.jar...


5. Check Java Version

# java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


If this is your expected Java Version - fine! Your are done!
If you still have a pointer to an older version, move on ...

...

6. A non expected Java Version is present?     lets say, JDK8 is still present, but you need to move back to JDK7

# java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


7. Check Java install locations

# ls -l /usr/java/
total 8
lrwxrwxrwx. 1 root root   16 Jan  9 13:24 default -> /usr/java/latest
drwxr-xr-x. 8 root root 4096 Jan  9 13:49 jdk1.7.0_71
drwxr-xr-x. 9 root root 4096 Jan  9 13:40 jdk1.8.0_25
lrwxrwxrwx. 1 root root   21 Jan  9 13:40 latest -> /usr/java/jdk1.8.0_25


8. Make use of alternatives system to switch between versions

8.1 Syntax of alternatives

# /usr/sbin/alternatives
alternatives version 1.3.49.3 - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage: alternatives --install
                    [--initscript ]
                    [--slave ]*
       alternatives --remove
       alternatives --auto
       alternatives --config
       alternatives --display
       alternatives --set

common options: --verbose --test --help --usage --version
                --altdir --admindir


8.2 Register your JDKs for alternatives

usage: alternatives --install

# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_71/bin/java 17071

(where priority represents 17071 for jdk1.7.0_71)

# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_25/bin/java 18025

(where priority represents 18025 for jdk1.8.0_25)

8.3 Now to switch between the versions

8.3.1 Check current java version, again

# java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


8.3.2 Change the current java version

 # /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/java/jdk1.7.0_71/bin/java
*+ 2           /usr/java/jdk1.8.0_25/bin/java

Enter to keep the current selection[+], or type selection number: 1


8.3.3 Check your current java version has changed

# java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


9. Keep your path JDK dynamic

The idea is, when you install for example WebLogic Server, to use a dynamic location to your JDK.
I do this with a symbolic link.
I have a folder /opt/oracle/java where I create a symbolic link, that points to the jdk.
As normal user I create the symbolic link:

$ ln -s /usr/java/jdk1.8.0_25 /opt/oracle/java/java

When an updated jdk version in available, after install I only change the symbolic link:

$ rm /opt/oracle/java/java
$ ln -s /usr/java/jdk1.8.0_31 /opt/oracle/java/java

For the WebLogic Server, the path to java will remain. No reconfiguration is needed.
So I only have to restart the WebLogic Server to use the latest JDK.

10. Tidy up! - delete out of date JDKs

10.1 Remove rpm

To delete the out-of-date versions of the JDK:
Query for all installed JDK rpms:
# rpm -aq | grep -i jdk
jdk1.8.0_31-1.8.0_31-fcs.x86_64
jdk-1.7.0_85-fcs.x86_64
jdk1.8.0_60-1.8.0_60-fcs.x86_64

In this example, I need to remove the jdk1.8.0_31:
# rpm -e jdk1.8.0_31-1.8.0_31-fcs

Check that the rpm has been deleted:
# rpm -aq | grep -i jdk
jdk-1.7.0_85-fcs.x86_64
jdk1.8.0_60-1.8.0_60-fcs.x86_64

10.2 De-register the java alternatives entry

Now we need to de-register the jdk in the alternatives configuration:
Current alternatives configuration:
# /usr/sbin/alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/java/jdk1.7.0_75/bin/java
   2           /usr/java/jdk1.8.0_31/bin/java
*+ 3           /usr/java/jdk1.8.0_60/jre/bin/java

We need to remove selection No 2:
# alternatives --remove java /usr/java/jdk1.8.0_31/bin/java

Check again:
# /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/java/jdk1.7.0_75/bin/java
*+ 2           /usr/java/jdk1.8.0_60/jre/bin/java

Enter to keep the current selection[+], or type selection number: 2


Voilà!

Samstag, 27. Dezember 2014

Rasperry PI Setup

OS
    $ cat /etc/issue.net | head -1
    Raspbian GNU/Linux 7

Updating Raspberry Firmware & Kernel Modules
    $ sudo rpi-update
    $ sudo reboot
-----
Updating Software
1. Update software catalog
    $ sudo apt-get update
2. Update installed packages
    $ sudo apt-get upgrade
    $ sudo reboot
(3.) Clean software catalog
    $ sudo apt-get autoclean
(4.) Remove unneeded packages
    $ sudo apt-get autoremove
-----
Issues I had:

HDMI of Rasperry PI not working
    RCA Video out was working
    Fix:
    # hdmi_safe=1
    Afterwarts HDMI worked fine.
-----
Upgrading OS from wheezy to jessie

1. Check OS Version
    $ cat /etc/issue.net | head -1
    Raspbian GNU/Linux 7 2. Backup your whole SD Memory card
3. Update your current wheezy OS, so it is up-2-date
    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get dist-upgrade
4. Edit /etc/apt/sources.list
    Change "wheezy" to "jessie".
5. Update & upgrade to "jessie"
    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get dist-upgrade
6. Reboot your OS.
    $ sudo reboot
7. Verify OS Version
    $ cat /etc/issue.net | head -1
    Raspbian GNU/Linux 8
8. Backup again.
    Good time to backup your upgraded system.
    I recomment to clone the whole SD Memory card, again.
9. Done.
-----
setting up X-Server on MAC OS
http://xquartz.macosforge.org/landing/
-----
Install  Oracle Java Embedded Suite 7.0
1. Download Software
http://www.oracle.com/technetwork/java/embedded/embedded-suite/downloads/index.html
2. Copy software to raspberry pi

scp USER@IP_OF_HOST:/Volumes/Macintosh_HD/Users/USER/Downloads/jes-7.0-ga-bin-b11-linux-arm-runtime-15_nov_2012.zip .

scp USER@IP_OF_HOST:/Volumes/Macintosh_HD/Users/USER/Downloads/ofm_oep_embedded_11_1_1_7_1_linux.zip

3. Unzip
sudo mkdir /opt/oracle
sudo chown pi /opt/oracle
sudo chmod 775 /opt/oracle
cd /opt/oracle/
mkdir java
cd java/
mkdir jes7.0/
cd jes7.0/
mkdir jre
cd jre/
unzip jes-7.0-ga-bin-b11-linux-arm-runtime-15_nov_2012.zip -d opt/oracle/java/jes7.0/jre
export JAVA_HOME=/opt/oracle/java/jes7.0/jre
java -version

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

4. Install Java Embedded Suite