Skip to main content

Posts

Logging Actual Client IP Address on the Apache Server

  To extract and log the actual client IP address from the X-Forwarded-For header of a request using an Apache server, make the following changes to the server: Log into the Apache server. Go to  /etc/httpd/conf  or  /usr/local/apache2/conf path  and open the file  httpd.conf . Search for the string: “ LogFormat “%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined ” Change the  %h  to  %{X-Forwarded-For}i . The string now appears as “ LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" "  combined ” Save the file and restart apache or httpd.
Recent posts

Command Line for Making EAR/WAR/JAR Changes on the Fly

Extracting the Contents of the EAR To extract the contents of the EAR: Navigate to the directory containing the EAR,  ear-file . On the command line, enter the following to view the contents of the EAR: jar tf ear-file On the command line, enter the following to extract the contents of the EAR: jar xf ear-file Updating and Repackaging an EAR File To update a file and repackage the contents into an EAR file: Navigate to the base directory of all the files and folders that are to be part of the EAR. On the command line, enter the following to extract the contents of the EAR: jar cf ear-file input-files For example, jar cf myear.ear *

Implementation of ADF XML Menu Model

This post will cover the coding details of implementing an ADF XML menu model. Do you need to manage all your navigation menus in a centralized file including its label, URL, title and other custom attributes you may have? If so, the solution is to use ADF XML menu model. ADF XML menu  model is the same concept as the built in WebCenter Navigation Model in Oracle WebCenter Portal. It uses a XML file to hold the navigation metadata - id, label, title, destination/url and other custom attributes you may need. The XML file is the data model layer. Using XML menu, you can generate various kinds of navigation user interface components, such as navigation links, bars, tabs, breadcrumbs, etc. You can also apply business logic to conditionally control the rendering of the navigation menu. The business logic including security can be applied at either the XML model layer or the UI presentation layer depending on where it fits your purpose. You can create multiple navigation hierarchy...

Setup Okta Custom URL Domain

TL:DR In this post, I will walk through the information and steps required to setup Okta custom domain. It also reveals the issues that may get in the way and how to address them. Okta is a leading cloud IAM solution and offers a free developer account. Anyone can register and use its service as long as the active monthly user count doesn't go over 1000 in the developer's account. After registration, Okta will assign an URL domain in a format of "https://dev-xxxxxx.okta.com" (xxxxxx is a random number assigned), where you can login and manage your own Okta services. If you are a paid customer, then you would be able to choose a custom naming in such way as "https://custom.okta.com". It's essential to setup a custom URL domain so that your Okta domain would look like a subdomain of your own such as "https://login.mydomain.com". Setting up a custom domain would provide you: Use custom domain as the issuer for the Okta default or custom a...

About adfc_diagram files in ADF

In short, files that end with "adfc_diagram" file type are metadata files to keep track of element position in an ADF task flow. ADF task flow offers a process-flow like visual panel for developers to re-position the elements (page/fragment, router, Java bean methods, etc). The file ending with "adfc_diagram" is the one tracking the positions of all elements so that next time the task flow is open the saved visual positions are presented. Another blog spot on the same matter: http://javalopez.blogspot.com/2015/03/should-i-commit-adfcdiagram-files.html

Full Screen Youtube Video on Play - React

Youtube video is ubiquitous. Embedding Youtube videos into a web page is as straightforward as it sounds. What also seems natural is to full-screen the video on touching the play icon of the video on mobile devices. This feature is important for mobile user experience as the full screen control is quite small to "aim". Google results on this topic showed many people had been looking for a solution on this and couldn't get a simple way to work out, as Youtube doesn't provide an API to full screen videos. In this post, I am showing a relatively simply way to achieve this user experience with fairly few lines of code. Code example is shown below. In the example, I use React as there are many nice plugins ready to start. Here is a list of them: screenfull: a simple wrapper of cross browser JavaScript implementation of full screen API.  https://www.npmjs.com/package/screenfull device-detector-js: a way of detecting user device with a wide range of device coverage...

X11 doesn't work after sudo to another user

This is kind of old trick but after years of not using X11 at all, I will need to refresh. Most of the times at my client, linux access is given with my own user name with ability to sudo to a regular service user. On a need of X11 GUI, it's mandatory to add the authorization info of my own user name into the sudo user name so X11 window can be started on top of the sudo user. But first of all, make sure the X11 forwarding is enabled by adding the following to /etc/ssh/sshd_config X11Forwarding yes Before the authorization info is added, the following error may show up in the terminal when trying to bring up X11 window. X11 proxy: Authorisation not recognised Here is how to add the authorization. 1. go back to the user who has access to the linux box and get the following info - >> echo $DISPLAY this will print out the display variable of the current user >>xauth list this will print out the authorization info to connect to the X server of the curre...