Saturday, December 9, 2017

How to easily install Gradle on MAC

Hello my developers friends,


How to easily install Gradle on MAC:



Helpful Links first:

http://sdkman.io/install.html

https://brew.sh/


ThiagoLeoncio:GradleHelloWorld tLeoncio$ curl -s "https://get.sdkman.io" | bash

                                -+syyyyyyys:
                            `/yho:`       -yd.
                         `/yh/`             +m.
                       .oho.                 hy                          .`
                     .sh/`                   :N`                `-/o`  `+dyyo:.
                   .yh:`                     `M-          `-/osysoym  :hs` `-+sys:      hhyssssssssy+
                 .sh:`                       `N:          ms/-``  yy.yh-      -hy.    `.N-````````+N.
               `od/`                         `N-       -/oM-      ddd+`     `sd:     hNNm        -N:
              :do`                           .M.       dMMM-     `ms.      /d+`     `NMMs       `do
            .yy-                             :N`    ```mMMM.      -      -hy.       /MMM:       yh
          `+d+`           `:/oo/`       `-/osyh/ossssssdNMM`           .sh:         yMMN`      /m.
         -dh-           :ymNMMMMy  `-/shmNm-`:N/-.``   `.sN            /N-         `NMMy      .m/
       `oNs`          -hysosmMMMMydmNmds+-.:ohm           :             sd`        :MMM/      yy
      .hN+           /d:    -MMMmhs/-.`   .MMMh   .ss+-                 `yy`       sMMN`     :N.
     :mN/           `N/     `o/-`         :MMMo   +MMMN-         .`      `ds       mMMh      do
    /NN/            `N+....--:/+oooosooo+:sMMM:   hMMMM:        `my       .m+     -MMM+     :N.
   /NMo              -+ooooo+/:-....`...:+hNMN.  `NMMMd`        .MM/       -m:    oMMN.     hs
  -NMd`                                    :mm   -MMMm- .s/     -MMm.       /m-   mMMd     -N.
 `mMM/                                      .-   /MMh. -dMo     -MMMy        od. .MMMs..---yh
 +MMM.                                           sNo`.sNMM+     :MMMM/        sh`+MMMNmNm+++-
 mMMM-                                           /--ohmMMM+     :MMMMm.       `hyymmmdddo
 MMMMh.                  ````                  `-+yy/`yMMM/     :MMMMMy       -sm:.``..-:-.`
 dMMMMmo-.``````..-:/osyhddddho.           `+shdh+.   hMMM:     :MmMMMM/   ./yy/` `:sys+/+sh/
 .dMMMMMMmdddddmmNMMMNNNNNMMMMMs           sNdo-      dMMM-  `-/yd/MMMMm-:sy+.   :hs-      /N`
  `/ymNNNNNNNmmdys+/::----/dMMm:          +m-         mMMM+ohmo/.` sMMMMdo-    .om:       `sh
     `.-----+/.`       `.-+hh/`         `od.          NMMNmds/     `mmy:`     +mMy      `:yy.
           /moyso+//+ossso:.           .yy`          `dy+:`         ..       :MMMN+---/oys:
         /+m:  `.-:::-`               /d+                                    +MMMMMMMNh:`
        +MN/                        -yh.                                     `+hddhy+.
       /MM+                       .sh:
      :NMo                      -sh/
     -NMs                    `/yy:
    .NMy                  `:sh+.
   `mMm`               ./yds-
  `dMMMmyo:-.````.-:oymNy:`
  +NMMMMMMMMMMMMMMMMms:`
    -+shmNMMMNmdy+:`


                                                                 Now attempting installation...


Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
######################################################################## 100.0%
Extract script archive...
Install scripts...
Set version to 5.6.1+290 ...
Attempt update of login bash profile on OSX...
Added sdkman init snippet to /Users/tleoncio/.bash_profile
Attempt update of zsh profile...
Updated existing /Users/tleoncio/.zshrc



All done!


Please open a new terminal, or run the following in the existing one:

    source "/Users/tleoncio/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!
ThiagoLeoncio:GradleHelloWorld tleoncio$ source "$HOME/.sdkman/bin/sdkman-init.sh"
ThiagoLeoncio:GradleHelloWorld tleoncio$ sdk version
==== BROADCAST =================================================================
* 01/02/18: Grails 3.2.12 released on SDKMAN! #grailsfw
* 24/01/18: Gradle 4.5 released on SDKMAN! #gradle
* 23/01/18: Kotlin 1.2.21 released on SDKMAN! #kotlin
================================================================================

SDKMAN 5.6.1+290
ThiagoLeoncio:GradleHelloWorld tleoncio$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/sbin
==> The following existing directories will have their owner set to tleoncio:
/usr/local/sbin
==> The following existing directories will have their group set to admin:
/usr/local/sbin
==> The following new directories will be created:
/usr/local/Homebrew
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/sbin
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/sbin
==> /usr/bin/sudo /usr/sbin/chown tleoncio /usr/local/sbin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/sbin
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown tleoncio /usr/local/Homebrew /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/mkdir -p /Users/tleoncio/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/tleoncio/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown tleoncio /Users/tleoncio/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (OS X 10.10) for Xcode-7.2
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (OS\ X\ 10.10)\ for\ Xcode-7.2
Software Update Tool
Copyright 2002-2012 Apple Inc.

Finding available software

Downloading Command Line Tools (OS X 10.10) for Xcode
Downloaded Command Line Tools (OS X 10.10) for Xcode
Installing Command Line Tools (OS X 10.10) for Xcode
Done with Command Line Tools (OS X 10.10) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Counting objects: 96965, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 96965 (delta 3), reused 4 (delta 0), pack-reused 96948
Receiving objects: 100% (96965/96965), 22.05 MiB | 15.86 MiB/s, done.
Resolving deltas: 100% (70389/70389), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]         0.1        -> 0.1
 * [new tag]         0.2        -> 0.2
 * [new tag]         0.3        -> 0.3
 * [new tag]         0.4        -> 0.4
 * [new tag]         0.5        -> 0.5
 * [new tag]         0.6        -> 0.6
 * [new tag]         0.7        -> 0.7
 * [new tag]         0.7.1      -> 0.7.1
 * [new tag]         0.8        -> 0.8
 * [new tag]         0.8.1      -> 0.8.1
 * [new tag]         0.9        -> 0.9
 * [new tag]         0.9.1      -> 0.9.1
 * [new tag]         0.9.2      -> 0.9.2
 * [new tag]         0.9.3      -> 0.9.3
 * [new tag]         0.9.4      -> 0.9.4
 * [new tag]         0.9.5      -> 0.9.5
 * [new tag]         0.9.8      -> 0.9.8
 * [new tag]         0.9.9      -> 0.9.9
 * [new tag]         1.0.0      -> 1.0.0
 * [new tag]         1.0.1      -> 1.0.1
 * [new tag]         1.0.2      -> 1.0.2
 * [new tag]         1.0.3      -> 1.0.3
 * [new tag]         1.0.4      -> 1.0.4
 * [new tag]         1.0.5      -> 1.0.5
 * [new tag]         1.0.6      -> 1.0.6
 * [new tag]         1.0.7      -> 1.0.7
 * [new tag]         1.0.8      -> 1.0.8
 * [new tag]         1.0.9      -> 1.0.9
 * [new tag]         1.1.0      -> 1.1.0
 * [new tag]         1.1.1      -> 1.1.1
 * [new tag]         1.1.10     -> 1.1.10
 * [new tag]         1.1.11     -> 1.1.11
 * [new tag]         1.1.12     -> 1.1.12
 * [new tag]         1.1.13     -> 1.1.13
 * [new tag]         1.1.2      -> 1.1.2
 * [new tag]         1.1.3      -> 1.1.3
 * [new tag]         1.1.4      -> 1.1.4
 * [new tag]         1.1.5      -> 1.1.5
 * [new tag]         1.1.6      -> 1.1.6
 * [new tag]         1.1.7      -> 1.1.7
 * [new tag]         1.1.8      -> 1.1.8
 * [new tag]         1.1.9      -> 1.1.9
 * [new tag]         1.2.0      -> 1.2.0
 * [new tag]         1.2.1      -> 1.2.1
 * [new tag]         1.2.2      -> 1.2.2
 * [new tag]         1.2.3      -> 1.2.3
 * [new tag]         1.2.4      -> 1.2.4
 * [new tag]         1.2.5      -> 1.2.5
 * [new tag]         1.2.6      -> 1.2.6
 * [new tag]         1.3.0      -> 1.3.0
 * [new tag]         1.3.1      -> 1.3.1
 * [new tag]         1.3.2      -> 1.3.2
 * [new tag]         1.3.3      -> 1.3.3
 * [new tag]         1.3.4      -> 1.3.4
 * [new tag]         1.3.5      -> 1.3.5
 * [new tag]         1.3.6      -> 1.3.6
 * [new tag]         1.3.7      -> 1.3.7
 * [new tag]         1.3.8      -> 1.3.8
 * [new tag]         1.3.9      -> 1.3.9
 * [new tag]         1.4.0      -> 1.4.0
 * [new tag]         1.4.1      -> 1.4.1
 * [new tag]         1.4.2      -> 1.4.2
 * [new tag]         1.4.3      -> 1.4.3
 * [new tag]         1.5.0      -> 1.5.0
 * [new tag]         1.5.1      -> 1.5.1
 * [new tag]         1.5.2      -> 1.5.2
HEAD is now at a44b21b Merge pull request #3751 from xiehuc/master
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4645, done.
remote: Compressing objects: 100% (4435/4435), done.
remote: Total 4645 (delta 48), reused 768 (delta 24), pack-reused 0
Receiving objects: 100% (4645/4645), 3.79 MiB | 0 bytes/s, done.
Resolving deltas: 100% (48/48), done.
Checking connectivity... done.
Tapped 4442 formulae (4,686 files, 11.9MB)
==> Cleaning up /Library/Caches/Homebrew...
==> Tapping caskroom/cask
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 4011, done.
remote: Compressing objects: 100% (3982/3982), done.
remote: Total 4011 (delta 35), reused 721 (delta 25), pack-reused 0
Receiving objects: 100% (4011/4011), 1.37 MiB | 0 bytes/s, done.
Resolving deltas: 100% (35/35), done.
Checking connectivity... done.
Tapped 0 formulae (4,019 files, 4.3MB)
Removing: /Library/Caches/Homebrew/gdbm-1.11.yosemite.bottle.2.tar.gz... (163.3KB)
Removing: /Library/Caches/Homebrew/ideviceinstaller-1.1.0_2.yosemite.bottle.tar.gz... (22KB)
Removing: /Library/Caches/Homebrew/ios-webkit-debug-proxy-1.6.yosemite.bottle.tar.gz... (138.5KB)
Removing: /Library/Caches/Homebrew/libimobiledevice-1.2.0.yosemite.bottle.tar.gz... (254.7KB)
Removing: /Library/Caches/Homebrew/libplist-1.12.yosemite.bottle.tar.gz... (92.3KB)
Removing: /Library/Caches/Homebrew/libtasn1-4.7.yosemite.bottle.tar.gz... (131.6KB)
Removing: /Library/Caches/Homebrew/libusb-1.0.20.yosemite.bottle.tar.gz... (106.0KB)
Removing: /Library/Caches/Homebrew/libxml2-2.9.3.yosemite.bottle.tar.gz... (2.3MB)
Removing: /Library/Caches/Homebrew/libzip-1.1.yosemite.bottle.tar.gz... (132.9KB)
Removing: /Library/Caches/Homebrew/openssl-1.0.2g.yosemite.bottle.tar.gz... (3.6MB)
Removing: /Library/Caches/Homebrew/pkg-config-0.29.1.yosemite.bottle.tar.gz... (235.8KB)
Removing: /Library/Caches/Homebrew/python3-3.5.1.tar.xz... (14.1MB)
Removing: /Library/Caches/Homebrew/readline-6.3.8.yosemite.bottle.tar.gz... (741.5KB)
Removing: /Library/Caches/Homebrew/sqlite-3.11.0_1.yosemite.bottle.tar.gz... (1.3MB)
Removing: /Library/Caches/Homebrew/usbmuxd-1.0.10.yosemite.bottle.1.tar.gz... (39.4KB)
Removing: /Library/Caches/Homebrew/xz-5.2.2.yosemite.bottle.tar.gz... (450.3KB)
==> Migrating /Library/Caches/Homebrew to /Users/tleoncio/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
ThiagoLeoncio:GradleHelloWorld tleoncio$ gradle
-bash: gradle: command not found
ThiagoLeoncio:GradleHelloWorld tleoncio$ brew install wget
==> Installing dependencies for wget: pkg-config, gettext, libunistring, libidn2, makedepend, openssl
==> Installing wget dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.yosemite.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/pkg-config
Target /usr/local/bin/pkg-config
is a symlink belonging to pkg-config. You can unlink it:
  brew unlink pkg-config

To force the link and overwrite all conflicting files:
  brew link --overwrite pkg-config

To list all files that would be deleted:
  brew link --overwrite --dry-run pkg-config

Possible conflicting files are:
/usr/local/bin/pkg-config -> /usr/local/Cellar/pkg-config/0.29.1/bin/pkg-config
/usr/local/share/aclocal/pkg.m4 -> /usr/local/Cellar/pkg-config/0.29.1/share/aclocal/pkg.m4
/usr/local/share/doc/pkg-config/pkg-config-guide.html
/usr/local/share/doc/pkg-config/pkg-config-guide.html
/usr/local/share/man/man1/pkg-config.1 -> /usr/local/Cellar/pkg-config/0.29.1/share/man/man1/pkg-config.1
==> Summary
🍺  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 631KB
==> Installing wget dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gettext-0.19.8.1.yosemite.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD gettext library & some software gets confused if both are in the library path.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/gettext/lib
    CPPFLAGS: -I/usr/local/opt/gettext/include

==> Summary
🍺  /usr/local/Cellar/gettext/0.19.8.1: 1,934 files, 17.0MB
==> Installing wget dependency: libunistring
==> Downloading https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.8.tar.xz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libunistring/0.9.8
==> make
==> make check
==> make install
🍺  /usr/local/Cellar/libunistring/0.9.8: 53 files, 4.4MB, built in 3 minutes 55 seconds
==> Installing wget dependency: libidn2
==> Downloading https://ftp.gnu.org/gnu/libidn/libidn2-2.0.4.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libidn2/2.0.4 --with-packager=Homebrew
==> make install
🍺  /usr/local/Cellar/libidn2/2.0.4: 46 files, 585.3KB, built in 57 seconds
==> Installing wget dependency: makedepend
==> Downloading https://homebrew.bintray.com/bottles/makedepend-1.0.5.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring makedepend-1.0.5.yosemite.bottle.1.tar.gz
🍺  /usr/local/Cellar/makedepend/1.0.5: 7 files, 72.8KB
==> Installing wget dependency: openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2n.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2n --openssldir=/usr/local/etc/openssl no-ssl2 zlib-dynamic shared enable-cms darwin64-x86_64-cc enable-ec_nistp
==> make depend
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.2n/share/man MANSUFFIX=ssl
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2n: 1,784 files, 12.1MB, built in 5 minutes 3 seconds
==> Installing wget
==> Downloading https://ftp.gnu.org/gnu/wget/wget-1.19.4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/wget/1.19.4_1 --sysconfdir=/usr/local/etc --with-ssl=openssl --with-libssl-prefix=/usr/local/opt/openssl --disable-pcre
==> make install
🍺  /usr/local/Cellar/wget/1.19.4_1: 49 files, 3.7MB, built in 1 minute 32 seconds
ThiagoLeoncio:GradleHelloWorld tleoncio$ brew install gradle
==> Downloading https://services.gradle.org/distributions/gradle-4.5-all.zip
==> Downloading from https://downloads.gradle.org/distributions/gradle-4.5-all.zip
######################################################################## 100.0%
🍺  /usr/local/Cellar/gradle/4.5: 190 files, 77.4MB, built in 11 seconds


ThiagoLeoncio:GradleHelloWorld tleoncio$ sudo su
Password:
sh-3.2# gradle
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :help 

Welcome to Gradle 4.5.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>


BUILD SUCCESSFUL in 3s
1 actionable task: 1 executed


sh-3.2# gradle test

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
sh-3.2# gradle test deploy



Have fun and happy coding!

Thiago Leoncio.

Saturday, November 25, 2017

How to define a PATH for Oracle Reports Server 11G

Hello guys,

Today I am going to help you to define the Reports PATH for Oracle Reports Server 10G and 11G. Sometimes you can set up a report, but then you can get the message:

REP-52005: The specified key for the report does not exist in the keymap file



That means that the cgicmd.dat file does not have the mapping for your report. So, you need to add it like this:

E.g.:

Online Report (Thiago) Reports
THIAGO_REPORT: report=THIAGO_REPORT.rdf userid=tleoncio/***@thg destype=cache desformat=pdf %P

; Online Overtime
OP_REP: report=OP.rdf userid=tleoncio/***@thg destype=cache desformat=pdf %P

Then if you do the mapping properly, you can probably start getting these other errors:


REP-110: Unable to open file 'THIAGO_REPORT.RDF' 
REP-1070: Error while opening or saving a document. 
REP-0110: Unable to open file 'THIAGO_REPORT.RDF'



This is because now you need to define the reports path that is mapped into your cgicmd.dat file. So, you have to options:

1-It is going to your reports.sh file and add the path that your Oracle report is and save it.
2- The second option is more elegant, where you define it based on the reports server EM below.

Go to EM:
1-Open the following URL for Enterprise Manager console of 11G Forms and Reports.
HTTP://<ip-address:7002>/em

2-From the left panel, click on Report server name, e.g., rep_ag1.

3-Expand the Reports from the top and expand Administration and click on Advanced configuration.

4-Edit the value of the Report Source Directory and Reports Temp Directory.
Report Source Directory= Path to the directory where the reports are placed.
Report Temp Directory=Path to the directory where you want to create the temporary files of reports at runtime.

5-Expand the Reports from the top expand Administration and click on Basic configuration.

6-On the next window, there is an Environment Configuration Box. Give Environment name in the Add a new Environment Field, & click on Add Environment button.
Give the REPORTS_PATH variable in the name field and give the path in the value And then click on the apply button.


7- Note: If you choose this option, don't give the path in reports.sh file, as the path is defined during this process.

8-After make changes restart the report server.






9- Test the reports, please. It now should work just fine.

Have fun and happy coding.

Thiago Leoncio.

OIM-Sandbox Errors and Fixes

Hello everyone, today I am going to share some errors in OIM I have had, and how I was able to fix them:

===================
OIM ERROR #1:----
===================
[ART][ERROR]: Importing a sandbox I got this issue.
oracle.mds.exception.MDSRuntimeException: MDS-01161: Reference "/__MACOSX/sandbox_thiago/._oracle" has an invalid character ".".

FIX: Inside of my structure there is a .DS_Store file created that needs to be deleted.

drwxr-xr-x@ 3 tleoncio  staff    96 Aug 26 11:04 site
drwxr-xr-x@ 3 tleoncio  staff    96 Aug 26 11:04 ..
-rw-r--r--@ 1 tleoncio  staff  6148 Aug 26 11:07 .DS_Store
drwxr-xr-x@ 4 tleoncio  staff   128 Aug 26 11:07 .



===================
OIM ERROR #2:----
===================
the sandbox was failling with the import I made.

[2016-08-26T18:54:47.185-04:00] [oim_server1] [ERROR] [] [oracle.adfinternal.view.faces.renderkit.rich.GridCellRenderer] [tid: [ACTIVE].ExecuteThread:
'12' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: da406a06cc043240:521ad640:1742c4fbcc3:-8000-0000000000004ae6,0]
 [APP: oracle.iam.console.identity.self-service.ear#V2.0] [DSID: 0000NGgpOZtDoYILUqs1yc1VHflP00000I] Error: gridCell required panelGridLayout and/or
 gridRow ancestors not found for gridCell clientId="pt1:_d_reg:region0:1:e9118813506".


FIX: 
1-Removed the grid cell from the page self-service-compliance.jsff  this: 

<af:gridCell xmlns:af="http://xmlns.oracle.com/adf/faces/rich" id="e9118813506" halign="center">

2-then it is now this:
  
<?xml version='1.0' encoding='UTF-8'?>
<mds:customization version="11.1.1.66.73" xmlns:mds="http://xmlns.oracle.com/mds" motype_local_name="root" motype_nsuri="http://java.sun.com/JSP/Page">
  <mds:insert parent="gc4" position="last">
      <oim:DashboardBox xmlns:oim="/componentLib1" instructionText="Reports per Organization - Opera" titleText="Test Page" image="/images/Dashboard/myAccess.png" hoverImage="/images/Dashboard/identityAudit_s2.png" iconClickable="true" id="e726836058"
     iconClickAction="#{backingBeanScope.dashboardNavigationBean.launchTaskFlow}">

        <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" name="taskFlowId" value="/WEB-INF/oracle/iam/ui/custom/test-flow.xml"/>
        <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" name="title" value="Test Page"/>

     </oim:DashboardBox>
   </mds:insert>
   <mds:replace node="gc3"/>
   <mds:replace node="gc1"/>
</mds:customization>
  

===================
OIM ERROR #3:----
===================
 Reason for this error: 
  THIS WAS BECAUSE THE LIB FILE THAT HAS TO BE ADDED ON WEB-INF\LIB ON THE WAR FILE WAS NOT PROPERLY ADDED 
  
  [oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar]
[2016-08-26T19:11:31.523-04:00] [oim_server1] [ERROR] [] [oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider] [tid: [ACTIVE].ExecuteThread: '8' for queue:
'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: da406a06cc043240:521ad640:1742c4fbcc3:-8000-0000000000004e60,0] [APP: oracle.iam.console.identity.self-service.ear#V2.0]
[DSID: 0000NGgpOZtDoYILUqs1yc1VHflP00000I] [[
oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/oracle/iam/ui/custom/test-flow.xml'.
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getMetadataObjects(MdsMetadataResourceProvider.java:512)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.loadUnmutableMetadataResources(MdsMetadataResourceProvider.java:402)
  ....
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/oracle/iam/ui/custom/test-flow.xml'.
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getMetadataObjects(MdsMetadataResourceProvider.java:512)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.loadUnmutableMetadataResources(MdsMetadataResourceProvider.java:402)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getResources(MdsMetadataResourceProvider.java:202)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getResources(MdsMetadataResourceProvider.java:180)
at oracle.adfinternal.controller.metadata.MetadataServiceImpl.getTaskFlowDefinition(MetadataServiceImpl.java:203)
at oracle.adfinternal.controller.activity.TaskFlowCallActivityLogic.findTaskFlowDefinition(TaskFlowCallActivityLogic.java:1084)
at oracle.adfinternal.controller.activity.TaskFlowCallActivityLogic.invokeTaskFlow(TaskFlowCallActivityLogic.java:240)
at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:221)
... 79 more
Caused by: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/WEB-INF/oracle/iam/ui/custom/test-flow.xml"
MDS-00201: PDocument not found in MetadataStore : [store-type=DefaultMetadataStore app-name=oracle.iam.console.identity.self-service.ear(V2.0) lookup-order=ServletContext,Classpath]
at oracle.mds.core.MetadataObject.getBaseMO(MetadataObject.java:1598)


FIX: 
  
1-Added the jar file in the war using zip command below
  
zip -r oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar

tleoncio@tleoncio-mac sandbox % zip -r oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar
  adding: WEB-INF/lib/adflibOIMTF1.jar (deflated 73%)

2-then copy the war file to the OIM server :
  
  scp oracle.iam.ui.custom-dev-starter-pack.war oracle@tleoncio-server:/u01/app/oracle/middleware/Oracle_OIM1/server/apps/oracle.iam.ui.custom-dev-starter-pack.war

3-Then I bounce OIM.

  
I hope this helps,
Thiago Leoncio.

Saturday, November 4, 2017

Insufficient access rights to perform the operation error in Azure AD Connect

Hello team,

If you're getting Insufficient access rights to operate your Azure AD Connect synchronization logs, do the following:


STEP 1 - Make sure you have the latest version of Azure AD Connect installed: https://www.microsoft.com/en-us/download/details.aspx?id=47594

STEP 2 - If you're syncing passwords, make sure that your sync service account has Replicate Directory Changes and Replicate Directory Changes All permissions in your on-premises Active Directory

STEP 3 - Make sure that your sync service account has to write permissions on your sourceAnchor attribute (which is most likely set to ms-ds-consistencyGuid). You can do that either using the user interface, or PowerShell, which is easier:

$accountName = "DOMAINNAME\USERNAME" #[this is the account that will be used by Azure AD Connect Sync to manage objects in the directory.



$ForestDN = "DC=DOMAINNAME,DC=SOMETHING"



$cmd = "dsacls '$ForestDN' /I:S /G '`"$accountName`":WP;ms-ds-consistencyGuid;user'"



Invoke-Expression $cmd

STEP 4 - Make sure that inheritance is turned on for the AD objects that get errors in the synchronization logs. To do that

4.1-Open Active Directory Users and Computers

4.2-Enable the Advanced features in the View settings and,

4.3-Open up the user object that can't sync.

4.4-Go to the security tab and then into advanced.

4.5-Check to make sure the box is checked to inherit permissions. But before you do that make sure that the enabling inheritance will not bring down some grants that you do not want to be there.

Have fun,
Thiago Leoncio

How to Create and use Snapshots in Kubernetes

Objective


Today I am going to show how to create snapshots in Kubernetes. This is really helpful in case you want to manage or mitigate the risk of losing your PODs.



From UI:





From the command line: 

  

Creating periodic snapshots 

When you create a StorageClass, you can specify a snapshot schedule on the volume as specified below. This allows snapshotting the persistent data of the running pod using the volume. 




Above spec will take snapshots of the portworx-repl-1-snap-internal PVC every 190 minutes.

Creating a snapshot on demand 


You can also trigger a new snapshot on a running POD by creating a PersistentVolumeClaim as specified in the following spec:








Note the format of the “name” field. The format is name.<new_snap_name>-source.<old_volume_name>. Above example references the parent (source) persistent volume claim pvc013 and creates a snapshot by the name snap013. 

Listing snapshots


To list snapshots taken by Portworx, use the /opt/pwx/bin/pxctl volume snapshot list command.

 For example: 

# /opt/pwx/bin/pxctl volume snapshot list 

ID                                   NAME   SIZE  HA   SHARED   IO_PRIORITY SCALE    STATUS 
1056733319296008813 snap013 1 GiB  2      no               LOW                 1               up - detached  

You can use the ID or NAME of the snapshots when using them to restore a volume. 


Restoring a pod from a snapshot 


To restore a pod to use the created snapshot, use the pvc name.snap013-source.pvc013 in the pod spec. 

Managing snapshots through pxctl 

You can provide the SAN capabilities, using portworx and then create a snapshot of a volume, let's say using an MYSQL DB.

First, create a database and a demo table in your MYSQL container. 


# mysql --user=tleoncio --password=password
MySQL [(none)]> create database pxThiagoLeoncio;
Query OK, 1 row affected (0.00 sec)
MySQL [(none)]> use pxThiagoLeoncio;
Database changed
MySQL [pxdemo]> create table  K8SThiagoLeoncioSample (counter int unsigned);
Query OK, 0 rows affected (0.04 sec)
MySQL [pxdemo]> quit;
Bye

Now create a snapshot of this database using pxctl. 


First, use pxctl volume list to see what volume you want to snapshot 
# /opt/pwx/bin/pxctl v l
ID     NAME          SIZE HA SHARED ENCRYPTED IO_PRIORITY SCALE STATUS
381983511213673988 pvc-e7e66f98-0915-11e7-94ca-7cd30ac1a138 20 GiB 2 no  no   LOW   0  up - attached on 147.75.105.196

Then use pxctl to snapshot your volume 

opt/pwx/bin/pxctl snap create 381983511213673988 --name snap-013
Volume successfully snapped: 835956864616765999
Also, you can use pxctl to see your snapshot created
# /opt/pwx/bin/pxctl snap list
ID     NAME SIZE HA SHARED ENCRYPTED IO_PRIORITY SCALE STATUS
835956864616765999 snap-01 20 GiB 2 no  no   LOW   0  up - detached

Then we create a mysql Pod to mount the snapshot discussed in this article:
kubectl create -f portworx-mysql-snap-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: test-portworx-snapped-volume-pod
spec:
  containers:
  - image: mysql:5.6
    name: mysql-snap13
    env:
      # Use secret in real usage
    - name: MYSQL_ROOT_PASSWORD
      value: password
    ports:
    - containerPort: 3306
      name: mysql
    volumeMounts:
    - name: snap-013
      mountPath: /var/lib/mysql
  volumes:
  - name: snap-013
    # This Portworx volume must already exist.
    portworxVolume:
      volumeID: "vol1"


Inspect that the database shows the cloned tables in the new MYSQL instance. 

# mysql --user=tleoncio --password=password
mysql> show databases;
+--------------------+
| Database           |
+--------------------+ 
| mysql              |
| performance_schema |
| pxThiagoLeoncio    |
+--------------------+
3 rows in set (0.00 sec)

mysql> use pxThiagoLeoncio;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------------+
| Tables_in_pxdemo      |
+-----------------------+
| K8SThiagoLeoncioSample|
+-----------------------+
1 row in set (0.00 sec)

I hope this helps and happy coding,
Thiago Leoncio.